{-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE MultiWayIf #-} -- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator. {-# LANGUAGE OverloadedStrings #-} -- | Contains the different functions to run the operation postSkusId module StripeAPI.Operations.PostSkusId where import qualified Control.Monad.Fail import qualified Control.Monad.Trans.Reader import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Internal import qualified Data.Aeson as Data.Aeson.Types import qualified Data.Aeson as Data.Aeson.Types.FromJSON import qualified Data.Aeson as Data.Aeson.Types.Internal import qualified Data.Aeson as Data.Aeson.Types.ToJSON import qualified Data.ByteString.Char8 import qualified Data.ByteString.Char8 as Data.ByteString.Internal import qualified Data.Either import qualified Data.Functor import qualified Data.Scientific import qualified Data.Text import qualified Data.Text.Internal import qualified Data.Time.Calendar as Data.Time.Calendar.Days import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime import qualified Data.Vector import qualified GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified Network.HTTP.Client import qualified Network.HTTP.Client as Network.HTTP.Client.Request import qualified Network.HTTP.Client as Network.HTTP.Client.Types import qualified Network.HTTP.Simple import qualified Network.HTTP.Types import qualified Network.HTTP.Types as Network.HTTP.Types.Status import qualified Network.HTTP.Types as Network.HTTP.Types.URI import qualified StripeAPI.Common import StripeAPI.Types import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | > POST /v1/skus/{id} -- -- \

Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.\<\/p> -- -- \

Note that a SKU’s \attributes\<\/code> are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.\<\/p> postSkusId :: forall m. StripeAPI.Common.MonadHTTP m => -- | id | Constraints: Maximum length of 5000 Data.Text.Internal.Text -> -- | The request body to send GHC.Maybe.Maybe PostSkusIdRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostSkusIdResponse) postSkusId id body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostSkusIdResponseError GHC.Base.id GHC.Base.. ( \response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PostSkusIdResponse200 Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String Sku ) | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> PostSkusIdResponseDefault Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String Error ) | GHC.Base.otherwise -> Data.Either.Left "Missing default response type" ) response_0 ) response_0 ) (StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/skus/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel id)) GHC.Base.++ ""))) GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostSkusIdRequestBody = PostSkusIdRequestBody { -- | active: Whether this SKU is available for purchase. postSkusIdRequestBodyActive :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | attributes: A dictionary of attributes and values for the attributes defined by the product. When specified, \`attributes\` will partially update the existing attributes dictionary on the product, with the postcondition that a value must be present for each attribute key on the product. postSkusIdRequestBodyAttributes :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | currency: Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies). postSkusIdRequestBodyCurrency :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | expand: Specifies which fields in the response should be expanded. postSkusIdRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | image: The URL of an image for this SKU, meant to be displayable to the customer. -- -- Constraints: -- -- * Maximum length of 5000 postSkusIdRequestBodyImage :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | inventory: Description of the SKU\'s inventory. postSkusIdRequestBodyInventory :: (GHC.Maybe.Maybe PostSkusIdRequestBodyInventory'), -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. postSkusIdRequestBodyMetadata :: (GHC.Maybe.Maybe PostSkusIdRequestBodyMetadata'Variants), -- | package_dimensions: The dimensions of this SKU for shipping purposes. postSkusIdRequestBodyPackageDimensions :: (GHC.Maybe.Maybe PostSkusIdRequestBodyPackageDimensions'Variants), -- | 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). postSkusIdRequestBodyPrice :: (GHC.Maybe.Maybe GHC.Types.Int), -- | product: The ID of the product that this SKU should belong to. The product must exist, have the same set of attribute names as the SKU\'s current product, and be of type \`good\`. -- -- Constraints: -- -- * Maximum length of 5000 postSkusIdRequestBodyProduct :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBody where toJSON obj = Data.Aeson.Types.Internal.object ("active" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyActive obj : "attributes" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyAttributes obj : "currency" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyCurrency obj : "expand" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyExpand obj : "image" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyImage obj : "inventory" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory obj : "metadata" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyMetadata obj : "package_dimensions" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions obj : "price" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPrice obj : "product" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyProduct obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("active" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyActive obj) GHC.Base.<> (("attributes" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyAttributes obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyCurrency obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyExpand obj) GHC.Base.<> (("image" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyImage obj) GHC.Base.<> (("inventory" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyMetadata obj) GHC.Base.<> (("package_dimensions" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions obj) GHC.Base.<> (("price" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPrice obj) GHC.Base.<> ("product" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyProduct obj)))))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSkusIdRequestBody" (\obj -> (((((((((GHC.Base.pure PostSkusIdRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "active")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "attributes")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "image")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "inventory")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "package_dimensions")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "price")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "product")) -- | Create a new 'PostSkusIdRequestBody' with all required fields. mkPostSkusIdRequestBody :: PostSkusIdRequestBody mkPostSkusIdRequestBody = PostSkusIdRequestBody { postSkusIdRequestBodyActive = GHC.Maybe.Nothing, postSkusIdRequestBodyAttributes = GHC.Maybe.Nothing, postSkusIdRequestBodyCurrency = GHC.Maybe.Nothing, postSkusIdRequestBodyExpand = GHC.Maybe.Nothing, postSkusIdRequestBodyImage = GHC.Maybe.Nothing, postSkusIdRequestBodyInventory = GHC.Maybe.Nothing, postSkusIdRequestBodyMetadata = GHC.Maybe.Nothing, postSkusIdRequestBodyPackageDimensions = GHC.Maybe.Nothing, postSkusIdRequestBodyPrice = GHC.Maybe.Nothing, postSkusIdRequestBodyProduct = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.inventory@ in the specification. -- -- Description of the SKU\'s inventory. data PostSkusIdRequestBodyInventory' = PostSkusIdRequestBodyInventory' { -- | quantity postSkusIdRequestBodyInventory'Quantity :: (GHC.Maybe.Maybe GHC.Types.Int), -- | type postSkusIdRequestBodyInventory'Type :: (GHC.Maybe.Maybe PostSkusIdRequestBodyInventory'Type'), -- | value postSkusIdRequestBodyInventory'Value :: (GHC.Maybe.Maybe PostSkusIdRequestBodyInventory'Value') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBodyInventory' where toJSON obj = Data.Aeson.Types.Internal.object ("quantity" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory'Quantity obj : "type" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory'Type obj : "value" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory'Value obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("quantity" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory'Quantity obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory'Type obj) GHC.Base.<> ("value" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyInventory'Value obj))) instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBodyInventory' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSkusIdRequestBodyInventory'" (\obj -> ((GHC.Base.pure PostSkusIdRequestBodyInventory' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "quantity")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "value")) -- | Create a new 'PostSkusIdRequestBodyInventory'' with all required fields. mkPostSkusIdRequestBodyInventory' :: PostSkusIdRequestBodyInventory' mkPostSkusIdRequestBodyInventory' = PostSkusIdRequestBodyInventory' { postSkusIdRequestBodyInventory'Quantity = GHC.Maybe.Nothing, postSkusIdRequestBodyInventory'Type = GHC.Maybe.Nothing, postSkusIdRequestBodyInventory'Value = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.inventory.properties.type@ in the specification. data PostSkusIdRequestBodyInventory'Type' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSkusIdRequestBodyInventory'Type'Other Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. PostSkusIdRequestBodyInventory'Type'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"bucket"@ PostSkusIdRequestBodyInventory'Type'EnumBucket | -- | Represents the JSON value @"finite"@ PostSkusIdRequestBodyInventory'Type'EnumFinite | -- | Represents the JSON value @"infinite"@ PostSkusIdRequestBodyInventory'Type'EnumInfinite deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBodyInventory'Type' where toJSON (PostSkusIdRequestBodyInventory'Type'Other val) = val toJSON (PostSkusIdRequestBodyInventory'Type'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSkusIdRequestBodyInventory'Type'EnumBucket) = "bucket" toJSON (PostSkusIdRequestBodyInventory'Type'EnumFinite) = "finite" toJSON (PostSkusIdRequestBodyInventory'Type'EnumInfinite) = "infinite" instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBodyInventory'Type' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "bucket" -> PostSkusIdRequestBodyInventory'Type'EnumBucket | val GHC.Classes.== "finite" -> PostSkusIdRequestBodyInventory'Type'EnumFinite | val GHC.Classes.== "infinite" -> PostSkusIdRequestBodyInventory'Type'EnumInfinite | GHC.Base.otherwise -> PostSkusIdRequestBodyInventory'Type'Other val ) -- | Defines the enum schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.inventory.properties.value@ in the specification. data PostSkusIdRequestBodyInventory'Value' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostSkusIdRequestBodyInventory'Value'Other Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. PostSkusIdRequestBodyInventory'Value'Typed Data.Text.Internal.Text | -- | Represents the JSON value @""@ PostSkusIdRequestBodyInventory'Value'EnumEmptyString | -- | Represents the JSON value @"in_stock"@ PostSkusIdRequestBodyInventory'Value'EnumInStock | -- | Represents the JSON value @"limited"@ PostSkusIdRequestBodyInventory'Value'EnumLimited | -- | Represents the JSON value @"out_of_stock"@ PostSkusIdRequestBodyInventory'Value'EnumOutOfStock deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBodyInventory'Value' where toJSON (PostSkusIdRequestBodyInventory'Value'Other val) = val toJSON (PostSkusIdRequestBodyInventory'Value'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostSkusIdRequestBodyInventory'Value'EnumEmptyString) = "" toJSON (PostSkusIdRequestBodyInventory'Value'EnumInStock) = "in_stock" toJSON (PostSkusIdRequestBodyInventory'Value'EnumLimited) = "limited" toJSON (PostSkusIdRequestBodyInventory'Value'EnumOutOfStock) = "out_of_stock" instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBodyInventory'Value' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "" -> PostSkusIdRequestBodyInventory'Value'EnumEmptyString | val GHC.Classes.== "in_stock" -> PostSkusIdRequestBodyInventory'Value'EnumInStock | val GHC.Classes.== "limited" -> PostSkusIdRequestBodyInventory'Value'EnumLimited | val GHC.Classes.== "out_of_stock" -> PostSkusIdRequestBodyInventory'Value'EnumOutOfStock | GHC.Base.otherwise -> PostSkusIdRequestBodyInventory'Value'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.metadata.anyOf@ in the specification. -- -- Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. data PostSkusIdRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostSkusIdRequestBodyMetadata'EmptyString | PostSkusIdRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBodyMetadata'Variants where toJSON (PostSkusIdRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSkusIdRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSkusIdRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostSkusIdRequestBodyMetadata'Object Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.package_dimensions.anyOf@ in the specification. data PostSkusIdRequestBodyPackageDimensions'OneOf1 = PostSkusIdRequestBodyPackageDimensions'OneOf1 { -- | height postSkusIdRequestBodyPackageDimensions'OneOf1Height :: GHC.Types.Double, -- | length postSkusIdRequestBodyPackageDimensions'OneOf1Length :: GHC.Types.Double, -- | weight postSkusIdRequestBodyPackageDimensions'OneOf1Weight :: GHC.Types.Double, -- | width postSkusIdRequestBodyPackageDimensions'OneOf1Width :: GHC.Types.Double } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBodyPackageDimensions'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("height" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Height obj : "length" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Length obj : "weight" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Weight obj : "width" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Width obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("height" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Height obj) GHC.Base.<> (("length" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Length obj) GHC.Base.<> (("weight" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Weight obj) GHC.Base.<> ("width" Data.Aeson.Types.ToJSON..= postSkusIdRequestBodyPackageDimensions'OneOf1Width obj)))) instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBodyPackageDimensions'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostSkusIdRequestBodyPackageDimensions'OneOf1" (\obj -> (((GHC.Base.pure PostSkusIdRequestBodyPackageDimensions'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "height")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "length")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "weight")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "width")) -- | Create a new 'PostSkusIdRequestBodyPackageDimensions'OneOf1' with all required fields. mkPostSkusIdRequestBodyPackageDimensions'OneOf1 :: -- | 'postSkusIdRequestBodyPackageDimensions'OneOf1Height' GHC.Types.Double -> -- | 'postSkusIdRequestBodyPackageDimensions'OneOf1Length' GHC.Types.Double -> -- | 'postSkusIdRequestBodyPackageDimensions'OneOf1Weight' GHC.Types.Double -> -- | 'postSkusIdRequestBodyPackageDimensions'OneOf1Width' GHC.Types.Double -> PostSkusIdRequestBodyPackageDimensions'OneOf1 mkPostSkusIdRequestBodyPackageDimensions'OneOf1 postSkusIdRequestBodyPackageDimensions'OneOf1Height postSkusIdRequestBodyPackageDimensions'OneOf1Length postSkusIdRequestBodyPackageDimensions'OneOf1Weight postSkusIdRequestBodyPackageDimensions'OneOf1Width = PostSkusIdRequestBodyPackageDimensions'OneOf1 { postSkusIdRequestBodyPackageDimensions'OneOf1Height = postSkusIdRequestBodyPackageDimensions'OneOf1Height, postSkusIdRequestBodyPackageDimensions'OneOf1Length = postSkusIdRequestBodyPackageDimensions'OneOf1Length, postSkusIdRequestBodyPackageDimensions'OneOf1Weight = postSkusIdRequestBodyPackageDimensions'OneOf1Weight, postSkusIdRequestBodyPackageDimensions'OneOf1Width = postSkusIdRequestBodyPackageDimensions'OneOf1Width } -- | Defines the oneOf schema located at @paths.\/v1\/skus\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.package_dimensions.anyOf@ in the specification. -- -- The dimensions of this SKU for shipping purposes. data PostSkusIdRequestBodyPackageDimensions'Variants = -- | Represents the JSON value @""@ PostSkusIdRequestBodyPackageDimensions'EmptyString | PostSkusIdRequestBodyPackageDimensions'PostSkusIdRequestBodyPackageDimensions'OneOf1 PostSkusIdRequestBodyPackageDimensions'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostSkusIdRequestBodyPackageDimensions'Variants where toJSON (PostSkusIdRequestBodyPackageDimensions'PostSkusIdRequestBodyPackageDimensions'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostSkusIdRequestBodyPackageDimensions'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostSkusIdRequestBodyPackageDimensions'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostSkusIdRequestBodyPackageDimensions'EmptyString | GHC.Base.otherwise -> case (PostSkusIdRequestBodyPackageDimensions'PostSkusIdRequestBodyPackageDimensions'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Represents a response of the operation 'postSkusId'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PostSkusIdResponseError' is used. data PostSkusIdResponse = -- | Means either no matching case available or a parse error PostSkusIdResponseError GHC.Base.String | -- | Successful response. PostSkusIdResponse200 Sku | -- | Error response. PostSkusIdResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)