Skip to content

Commit 5e20ce3

Browse files
authored
Merge pull request #469 from stripe/ob-plan-expand-product
Make `product` attribute on Plan objects expandable
2 parents 1ecd116 + e345ac9 commit 5e20ce3

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Diff for: src/main/java/com/stripe/model/Plan.java

+18-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class Plan extends APIResource implements MetadataStore<Plan>, HasId {
2121
Boolean livemode;
2222
Map<String, String> metadata;
2323
String nickname;
24-
String product;
24+
ExpandableField<Product> product;
2525

2626
@Deprecated
2727
String statementDescription;
@@ -113,11 +113,25 @@ public void setNickname(String nickname) {
113113
}
114114

115115
public String getProduct() {
116-
return product;
116+
if (this.product == null) {
117+
return null;
118+
}
119+
return this.product.getId();
117120
}
118121

119-
public void setProduct(String product) {
120-
this.product = product;
122+
public void setProduct(String productID) {
123+
this.product = setExpandableFieldID(productID, this.product);
124+
}
125+
126+
public Product getProductObject() {
127+
if (this.product == null) {
128+
return null;
129+
}
130+
return this.product.getExpanded();
131+
}
132+
133+
public void setProductObject(Product product) {
134+
this.product = new ExpandableField<Product>(product.getId(), product);
121135
}
122136

123137
/**

0 commit comments

Comments
 (0)