Package com.stripe.model
Class Sku
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Sku
-
- All Implemented Interfaces:
HasId,MetadataStore<Sku>,StripeObjectInterface
public class Sku extends ApiResource implements HasId, MetadataStore<Sku>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSku.Inventory-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description Sku()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static Skucreate(SkuCreateParams params)Creates a new SKU associated with a product.static Skucreate(SkuCreateParams params, RequestOptions options)Creates a new SKU associated with a product.static Skucreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a new SKU associated with a product.static Skucreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a new SKU associated with a product.Skudelete()Delete a SKU.Skudelete(RequestOptions options)Delete a SKU.Skudelete(java.util.Map<java.lang.String,java.lang.Object> params)Delete a SKU.Skudelete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Delete a SKU.booleanequals(java.lang.Object o)java.lang.BooleangetActive()Whether the SKU is available for purchase.java.util.Map<java.lang.String,java.lang.String>getAttributes()A dictionary of attributes and values for the attributes defined by the product.java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.BooleangetDeleted()Always true for a deleted object.java.lang.StringgetId()Unique identifier for the object.java.lang.StringgetImage()The URL of an image for this SKU, meant to be displayable to the customer.Sku.InventorygetInventory()java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetObject()String representing the object's type.PackageDimensionsgetPackageDimensions()The dimensions of this SKU for shipping purposes.java.lang.LonggetPrice()The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).java.lang.StringgetProduct()Get ID of expandableproductobject.ProductgetProductObject()Get expandedproduct.java.lang.LonggetUpdated()Time at which the object was last updated.inthashCode()static SkuCollectionlist(SkuListParams params)Returns a list of your SKUs.static SkuCollectionlist(SkuListParams params, RequestOptions options)Returns a list of your SKUs.static SkuCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your SKUs.static SkuCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your SKUs.static Skuretrieve(java.lang.String id)Retrieves the details of an existing SKU.static Skuretrieve(java.lang.String id, RequestOptions options)Retrieves the details of an existing SKU.static Skuretrieve(java.lang.String id, SkuRetrieveParams params, RequestOptions options)Retrieves the details of an existing SKU.static Skuretrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the details of an existing SKU.voidsetActive(java.lang.Boolean active)Whether the SKU is available for purchase.voidsetAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)A dictionary of attributes and values for the attributes defined by the product.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetDeleted(java.lang.Boolean deleted)Always true for a deleted object.voidsetId(java.lang.String id)Unique identifier for the object.voidsetImage(java.lang.String image)The URL of an image for this SKU, meant to be displayable to the customer.voidsetInventory(Sku.Inventory inventory)voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetObject(java.lang.String object)String representing the object's type.voidsetPackageDimensions(PackageDimensions packageDimensions)The dimensions of this SKU for shipping purposes.voidsetPrice(java.lang.Long price)The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).voidsetProduct(java.lang.String id)voidsetProductObject(Product expandableObject)voidsetUpdated(java.lang.Long updated)Time at which the object was last updated.Skuupdate(SkuUpdateParams params)Updates the specific SKU by setting the values of the parameters passed.Skuupdate(SkuUpdateParams params, RequestOptions options)Updates the specific SKU by setting the values of the parameters passed.Skuupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the specific SKU by setting the values of the parameters passed.Skuupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates the specific SKU by setting the values of the parameters passed.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getProduct
public java.lang.String getProduct()
Get ID of expandableproductobject.
-
setProduct
public void setProduct(java.lang.String id)
-
getProductObject
public Product getProductObject()
Get expandedproduct.
-
setProductObject
public void setProductObject(Product expandableObject)
-
retrieve
public static Sku retrieve(java.lang.String id) throws StripeException
Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
retrieve
public static Sku retrieve(java.lang.String id, RequestOptions options) throws StripeException
Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
retrieve
public static Sku retrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
retrieve
public static Sku retrieve(java.lang.String id, SkuRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
list
public static SkuCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
list
public static SkuCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
list
public static SkuCollection list(SkuListParams params) throws StripeException
Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
list
public static SkuCollection list(SkuListParams params, RequestOptions options) throws StripeException
Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
update
public Sku update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributesare not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Specified by:
updatein interfaceMetadataStore<Sku>- Throws:
StripeException
-
update
public Sku update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributesare not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Specified by:
updatein interfaceMetadataStore<Sku>- Throws:
StripeException
-
update
public Sku update(SkuUpdateParams params) throws StripeException
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributesare not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Throws:
StripeException
-
update
public Sku update(SkuUpdateParams params, RequestOptions options) throws StripeException
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributesare not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Throws:
StripeException
-
create
public static Sku create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new SKU associated with a product.- Throws:
StripeException
-
create
public static Sku create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new SKU associated with a product.- Throws:
StripeException
-
create
public static Sku create(SkuCreateParams params) throws StripeException
Creates a new SKU associated with a product.- Throws:
StripeException
-
create
public static Sku create(SkuCreateParams params, RequestOptions options) throws StripeException
Creates a new SKU associated with a product.- Throws:
StripeException
-
delete
public Sku delete() throws StripeException
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
delete
public Sku delete(RequestOptions options) throws StripeException
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
delete
public Sku delete(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
delete
public Sku delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
getActive
public java.lang.Boolean getActive()
Whether the SKU is available for purchase.
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are["size", "gender"], a valid SKU has the following dictionary of attributes:{"size": "Medium", "gender": "Unisex"}.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
getDeleted
public java.lang.Boolean getDeleted()
Always true for a deleted object.
-
getImage
public java.lang.String getImage()
The URL of an image for this SKU, meant to be displayable to the customer.
-
getInventory
public Sku.Inventory getInventory()
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
sku.
-
getPackageDimensions
public PackageDimensions getPackageDimensions()
The dimensions of this SKU for shipping purposes.
-
getPrice
public java.lang.Long getPrice()
The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).
-
getUpdated
public java.lang.Long getUpdated()
Time at which the object was last updated. Measured in seconds since the Unix epoch.
-
setActive
public void setActive(java.lang.Boolean active)
Whether the SKU is available for purchase.
-
setAttributes
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are["size", "gender"], a valid SKU has the following dictionary of attributes:{"size": "Medium", "gender": "Unisex"}.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setDeleted
public void setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setImage
public void setImage(java.lang.String image)
The URL of an image for this SKU, meant to be displayable to the customer.
-
setInventory
public void setInventory(Sku.Inventory inventory)
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
-
setObject
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
sku.
-
setPackageDimensions
public void setPackageDimensions(PackageDimensions packageDimensions)
The dimensions of this SKU for shipping purposes.
-
setPrice
public void setPrice(java.lang.Long price)
The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).
-
setUpdated
public void setUpdated(java.lang.Long updated)
Time at which the object was last updated. Measured in seconds since the Unix epoch.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.- Specified by:
getMetadatain interfaceMetadataStore<Sku>
-
-