{-# 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 getSkusId
module StripeAPI.Operations.GetSkusId 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

-- | > GET /v1/skus/{id}
--
-- \<p>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.\<\/p>
getSkusId ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  GetSkusIdParameters ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response GetSkusIdResponse)
getSkusId :: GetSkusIdParameters -> StripeT m (Response GetSkusIdResponse)
getSkusId GetSkusIdParameters
parameters =
  (Response ByteString -> Response GetSkusIdResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response GetSkusIdResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
    ( \Response ByteString
response_0 ->
        (ByteString -> GetSkusIdResponse)
-> Response ByteString -> Response GetSkusIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
          ( (String -> GetSkusIdResponse)
-> (GetSkusIdResponse -> GetSkusIdResponse)
-> Either String GetSkusIdResponse
-> GetSkusIdResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetSkusIdResponse
GetSkusIdResponseError GetSkusIdResponse -> GetSkusIdResponse
forall a. a -> a
GHC.Base.id
              (Either String GetSkusIdResponse -> GetSkusIdResponse)
-> (ByteString -> Either String GetSkusIdResponse)
-> ByteString
-> GetSkusIdResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. ( \Response ByteString
response ByteString
body ->
                             if
                                 | (\Status
status_1 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_1 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
200) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                   GetSkusIdResponseBody200 -> GetSkusIdResponse
GetSkusIdResponse200
                                     (GetSkusIdResponseBody200 -> GetSkusIdResponse)
-> Either String GetSkusIdResponseBody200
-> Either String GetSkusIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetSkusIdResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            GetSkusIdResponseBody200
                                                      )
                                 | Bool -> Status -> Bool
forall a b. a -> b -> a
GHC.Base.const Bool
GHC.Types.True (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                   Error -> GetSkusIdResponse
GetSkusIdResponseDefault
                                     (Error -> GetSkusIdResponse)
-> Either String Error -> Either String GetSkusIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Error
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            Error
                                                      )
                                 | Bool
GHC.Base.otherwise -> String -> Either String GetSkusIdResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
                         )
                Response ByteString
response_0
          )
          Response ByteString
response_0
    )
    (Text -> Text -> [QueryParameter] -> StripeT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> StripeT m (Response ByteString)
StripeAPI.Common.doCallWithConfigurationM (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"GET") (String -> Text
Data.Text.pack (String
"/v1/skus/" String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (ByteString -> String
Data.ByteString.Char8.unpack (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (String -> ByteString
Data.ByteString.Char8.pack (String -> ByteString) -> String -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> String
forall a. StringifyModel a => a -> String
StripeAPI.Common.stringifyModel (GetSkusIdParameters -> Text
getSkusIdParametersPathId GetSkusIdParameters
parameters))) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))) [Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"expand") ([Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON ([Text] -> Value) -> Maybe [Text] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetSkusIdParameters -> Maybe [Text]
getSkusIdParametersQueryExpand GetSkusIdParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True])

-- | Defines the object schema located at @paths.\/v1\/skus\/{id}.GET.parameters@ in the specification.
data GetSkusIdParameters = GetSkusIdParameters
  { -- | pathId: Represents the parameter named \'id\'
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetSkusIdParameters -> Text
getSkusIdParametersPathId :: Data.Text.Internal.Text,
    -- | queryExpand: Represents the parameter named \'expand\'
    --
    -- Specifies which fields in the response should be expanded.
    GetSkusIdParameters -> Maybe [Text]
getSkusIdParametersQueryExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text]))
  }
  deriving
    ( Int -> GetSkusIdParameters -> String -> String
[GetSkusIdParameters] -> String -> String
GetSkusIdParameters -> String
(Int -> GetSkusIdParameters -> String -> String)
-> (GetSkusIdParameters -> String)
-> ([GetSkusIdParameters] -> String -> String)
-> Show GetSkusIdParameters
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetSkusIdParameters] -> String -> String
$cshowList :: [GetSkusIdParameters] -> String -> String
show :: GetSkusIdParameters -> String
$cshow :: GetSkusIdParameters -> String
showsPrec :: Int -> GetSkusIdParameters -> String -> String
$cshowsPrec :: Int -> GetSkusIdParameters -> String -> String
GHC.Show.Show,
      GetSkusIdParameters -> GetSkusIdParameters -> Bool
(GetSkusIdParameters -> GetSkusIdParameters -> Bool)
-> (GetSkusIdParameters -> GetSkusIdParameters -> Bool)
-> Eq GetSkusIdParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSkusIdParameters -> GetSkusIdParameters -> Bool
$c/= :: GetSkusIdParameters -> GetSkusIdParameters -> Bool
== :: GetSkusIdParameters -> GetSkusIdParameters -> Bool
$c== :: GetSkusIdParameters -> GetSkusIdParameters -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetSkusIdParameters where
  toJSON :: GetSkusIdParameters -> Value
toJSON GetSkusIdParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"pathId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdParameters -> Text
getSkusIdParametersPathId GetSkusIdParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryExpand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdParameters -> Maybe [Text]
getSkusIdParametersQueryExpand GetSkusIdParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetSkusIdParameters -> Encoding
toEncoding GetSkusIdParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"pathId" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdParameters -> Text
getSkusIdParametersPathId GetSkusIdParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"queryExpand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdParameters -> Maybe [Text]
getSkusIdParametersQueryExpand GetSkusIdParameters
obj))

instance Data.Aeson.Types.FromJSON.FromJSON GetSkusIdParameters where
  parseJSON :: Value -> Parser GetSkusIdParameters
parseJSON = String
-> (Object -> Parser GetSkusIdParameters)
-> Value
-> Parser GetSkusIdParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetSkusIdParameters" (\Object
obj -> ((Text -> Maybe [Text] -> GetSkusIdParameters)
-> Parser (Text -> Maybe [Text] -> GetSkusIdParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text -> Maybe [Text] -> GetSkusIdParameters
GetSkusIdParameters Parser (Text -> Maybe [Text] -> GetSkusIdParameters)
-> Parser Text -> Parser (Maybe [Text] -> GetSkusIdParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"pathId")) Parser (Maybe [Text] -> GetSkusIdParameters)
-> Parser (Maybe [Text]) -> Parser GetSkusIdParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryExpand"))

-- | Create a new 'GetSkusIdParameters' with all required fields.
mkGetSkusIdParameters ::
  -- | 'getSkusIdParametersPathId'
  Data.Text.Internal.Text ->
  GetSkusIdParameters
mkGetSkusIdParameters :: Text -> GetSkusIdParameters
mkGetSkusIdParameters Text
getSkusIdParametersPathId =
  GetSkusIdParameters :: Text -> Maybe [Text] -> GetSkusIdParameters
GetSkusIdParameters
    { getSkusIdParametersPathId :: Text
getSkusIdParametersPathId = Text
getSkusIdParametersPathId,
      getSkusIdParametersQueryExpand :: Maybe [Text]
getSkusIdParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Represents a response of the operation 'getSkusId'.
--
-- 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), 'GetSkusIdResponseError' is used.
data GetSkusIdResponse
  = -- | Means either no matching case available or a parse error
    GetSkusIdResponseError GHC.Base.String
  | -- | Successful response.
    GetSkusIdResponse200 GetSkusIdResponseBody200
  | -- | Error response.
    GetSkusIdResponseDefault Error
  deriving (Int -> GetSkusIdResponse -> String -> String
[GetSkusIdResponse] -> String -> String
GetSkusIdResponse -> String
(Int -> GetSkusIdResponse -> String -> String)
-> (GetSkusIdResponse -> String)
-> ([GetSkusIdResponse] -> String -> String)
-> Show GetSkusIdResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetSkusIdResponse] -> String -> String
$cshowList :: [GetSkusIdResponse] -> String -> String
show :: GetSkusIdResponse -> String
$cshow :: GetSkusIdResponse -> String
showsPrec :: Int -> GetSkusIdResponse -> String -> String
$cshowsPrec :: Int -> GetSkusIdResponse -> String -> String
GHC.Show.Show, GetSkusIdResponse -> GetSkusIdResponse -> Bool
(GetSkusIdResponse -> GetSkusIdResponse -> Bool)
-> (GetSkusIdResponse -> GetSkusIdResponse -> Bool)
-> Eq GetSkusIdResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSkusIdResponse -> GetSkusIdResponse -> Bool
$c/= :: GetSkusIdResponse -> GetSkusIdResponse -> Bool
== :: GetSkusIdResponse -> GetSkusIdResponse -> Bool
$c== :: GetSkusIdResponse -> GetSkusIdResponse -> Bool
GHC.Classes.Eq)

-- | Defines the object schema located at @paths.\/v1\/skus\/{id}.GET.responses.200.content.application\/json.schema.anyOf@ in the specification.
data GetSkusIdResponseBody200 = GetSkusIdResponseBody200
  { -- | active: Whether the SKU is available for purchase.
    GetSkusIdResponseBody200 -> Maybe Bool
getSkusIdResponseBody200Active :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | 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\"}\`.
    GetSkusIdResponseBody200 -> Maybe Object
getSkusIdResponseBody200Attributes :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
    -- | created: Time at which the object was created. Measured in seconds since the Unix epoch.
    GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Created :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | 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).
    GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Currency :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | id: Unique identifier for the object.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Id :: (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 2048
    GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Image :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | inventory:
    GetSkusIdResponseBody200 -> Maybe SkuInventory
getSkusIdResponseBody200Inventory :: (GHC.Maybe.Maybe SkuInventory),
    -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode.
    GetSkusIdResponseBody200 -> Maybe Bool
getSkusIdResponseBody200Livemode :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | 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.
    GetSkusIdResponseBody200 -> Maybe Object
getSkusIdResponseBody200Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
    -- | package_dimensions: The dimensions of this SKU for shipping purposes.
    GetSkusIdResponseBody200
-> Maybe GetSkusIdResponseBody200PackageDimensions'
getSkusIdResponseBody200PackageDimensions :: (GHC.Maybe.Maybe GetSkusIdResponseBody200PackageDimensions'),
    -- | 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).
    GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Price :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | product: The ID of the product this SKU is associated with. The product must be currently active.
    GetSkusIdResponseBody200
-> Maybe GetSkusIdResponseBody200Product'Variants
getSkusIdResponseBody200Product :: (GHC.Maybe.Maybe GetSkusIdResponseBody200Product'Variants),
    -- | updated: Time at which the object was last updated. Measured in seconds since the Unix epoch.
    GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Updated :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GetSkusIdResponseBody200 -> String -> String
[GetSkusIdResponseBody200] -> String -> String
GetSkusIdResponseBody200 -> String
(Int -> GetSkusIdResponseBody200 -> String -> String)
-> (GetSkusIdResponseBody200 -> String)
-> ([GetSkusIdResponseBody200] -> String -> String)
-> Show GetSkusIdResponseBody200
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetSkusIdResponseBody200] -> String -> String
$cshowList :: [GetSkusIdResponseBody200] -> String -> String
show :: GetSkusIdResponseBody200 -> String
$cshow :: GetSkusIdResponseBody200 -> String
showsPrec :: Int -> GetSkusIdResponseBody200 -> String -> String
$cshowsPrec :: Int -> GetSkusIdResponseBody200 -> String -> String
GHC.Show.Show,
      GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool
(GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool)
-> (GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool)
-> Eq GetSkusIdResponseBody200
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool
$c/= :: GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool
== :: GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool
$c== :: GetSkusIdResponseBody200 -> GetSkusIdResponseBody200 -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetSkusIdResponseBody200 where
  toJSON :: GetSkusIdResponseBody200 -> Value
toJSON GetSkusIdResponseBody200
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"active" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Bool
getSkusIdResponseBody200Active GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"attributes" Text -> Maybe Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Object
getSkusIdResponseBody200Attributes GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"created" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Created GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"currency" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Currency GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Id GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"image" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Image GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"inventory" Text -> Maybe SkuInventory -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe SkuInventory
getSkusIdResponseBody200Inventory GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"livemode" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Bool
getSkusIdResponseBody200Livemode GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Maybe Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Object
getSkusIdResponseBody200Metadata GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"package_dimensions" Text -> Maybe GetSkusIdResponseBody200PackageDimensions' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200
-> Maybe GetSkusIdResponseBody200PackageDimensions'
getSkusIdResponseBody200PackageDimensions GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"price" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Price GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"product" Text -> Maybe GetSkusIdResponseBody200Product'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200
-> Maybe GetSkusIdResponseBody200Product'Variants
getSkusIdResponseBody200Product GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"updated" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Updated GetSkusIdResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"deleted" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"sku" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetSkusIdResponseBody200 -> Encoding
toEncoding GetSkusIdResponseBody200
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"active" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Bool
getSkusIdResponseBody200Active GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"attributes" Text -> Maybe Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Object
getSkusIdResponseBody200Attributes GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"created" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Created GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"currency" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Currency GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Id GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"image" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Text
getSkusIdResponseBody200Image GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"inventory" Text -> Maybe SkuInventory -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe SkuInventory
getSkusIdResponseBody200Inventory GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"livemode" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Bool
getSkusIdResponseBody200Livemode GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Maybe Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Object
getSkusIdResponseBody200Metadata GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"package_dimensions" Text -> Maybe GetSkusIdResponseBody200PackageDimensions' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200
-> Maybe GetSkusIdResponseBody200PackageDimensions'
getSkusIdResponseBody200PackageDimensions GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"price" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Price GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"product" Text -> Maybe GetSkusIdResponseBody200Product'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200
-> Maybe GetSkusIdResponseBody200Product'Variants
getSkusIdResponseBody200Product GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"updated" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200 -> Maybe Int
getSkusIdResponseBody200Updated GetSkusIdResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"deleted" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"sku")))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON GetSkusIdResponseBody200 where
  parseJSON :: Value -> Parser GetSkusIdResponseBody200
parseJSON = String
-> (Object -> Parser GetSkusIdResponseBody200)
-> Value
-> Parser GetSkusIdResponseBody200
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetSkusIdResponseBody200" (\Object
obj -> (((((((((((((Maybe Bool
 -> Maybe Object
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe SkuInventory
 -> Maybe Bool
 -> Maybe Object
 -> Maybe GetSkusIdResponseBody200PackageDimensions'
 -> Maybe Int
 -> Maybe GetSkusIdResponseBody200Product'Variants
 -> Maybe Int
 -> GetSkusIdResponseBody200)
-> Parser
     (Maybe Bool
      -> Maybe Object
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SkuInventory
-> Maybe Bool
-> Maybe Object
-> Maybe GetSkusIdResponseBody200PackageDimensions'
-> Maybe Int
-> Maybe GetSkusIdResponseBody200Product'Variants
-> Maybe Int
-> GetSkusIdResponseBody200
GetSkusIdResponseBody200 Parser
  (Maybe Bool
   -> Maybe Object
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Object
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"active")) Parser
  (Maybe Object
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Object)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"attributes")) Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"created")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"currency")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"id")) Parser
  (Maybe Text
   -> Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Text)
-> Parser
     (Maybe SkuInventory
      -> Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"image")) Parser
  (Maybe SkuInventory
   -> Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe SkuInventory)
-> Parser
     (Maybe Bool
      -> Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe SkuInventory)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"inventory")) Parser
  (Maybe Bool
   -> Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Object
      -> Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"livemode")) Parser
  (Maybe Object
   -> Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Object)
-> Parser
     (Maybe GetSkusIdResponseBody200PackageDimensions'
      -> Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser
  (Maybe GetSkusIdResponseBody200PackageDimensions'
   -> Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe GetSkusIdResponseBody200PackageDimensions')
-> Parser
     (Maybe Int
      -> Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int
      -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe GetSkusIdResponseBody200PackageDimensions')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"package_dimensions")) Parser
  (Maybe Int
   -> Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int
   -> GetSkusIdResponseBody200)
-> Parser (Maybe Int)
-> Parser
     (Maybe GetSkusIdResponseBody200Product'Variants
      -> Maybe Int -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"price")) Parser
  (Maybe GetSkusIdResponseBody200Product'Variants
   -> Maybe Int -> GetSkusIdResponseBody200)
-> Parser (Maybe GetSkusIdResponseBody200Product'Variants)
-> Parser (Maybe Int -> GetSkusIdResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe GetSkusIdResponseBody200Product'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"product")) Parser (Maybe Int -> GetSkusIdResponseBody200)
-> Parser (Maybe Int) -> Parser GetSkusIdResponseBody200
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"updated"))

-- | Create a new 'GetSkusIdResponseBody200' with all required fields.
mkGetSkusIdResponseBody200 :: GetSkusIdResponseBody200
mkGetSkusIdResponseBody200 :: GetSkusIdResponseBody200
mkGetSkusIdResponseBody200 =
  GetSkusIdResponseBody200 :: Maybe Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SkuInventory
-> Maybe Bool
-> Maybe Object
-> Maybe GetSkusIdResponseBody200PackageDimensions'
-> Maybe Int
-> Maybe GetSkusIdResponseBody200Product'Variants
-> Maybe Int
-> GetSkusIdResponseBody200
GetSkusIdResponseBody200
    { getSkusIdResponseBody200Active :: Maybe Bool
getSkusIdResponseBody200Active = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Attributes :: Maybe Object
getSkusIdResponseBody200Attributes = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Created :: Maybe Int
getSkusIdResponseBody200Created = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Currency :: Maybe Text
getSkusIdResponseBody200Currency = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Id :: Maybe Text
getSkusIdResponseBody200Id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Image :: Maybe Text
getSkusIdResponseBody200Image = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Inventory :: Maybe SkuInventory
getSkusIdResponseBody200Inventory = Maybe SkuInventory
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Livemode :: Maybe Bool
getSkusIdResponseBody200Livemode = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Metadata :: Maybe Object
getSkusIdResponseBody200Metadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200PackageDimensions :: Maybe GetSkusIdResponseBody200PackageDimensions'
getSkusIdResponseBody200PackageDimensions = Maybe GetSkusIdResponseBody200PackageDimensions'
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Price :: Maybe Int
getSkusIdResponseBody200Price = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Product :: Maybe GetSkusIdResponseBody200Product'Variants
getSkusIdResponseBody200Product = Maybe GetSkusIdResponseBody200Product'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200Updated :: Maybe Int
getSkusIdResponseBody200Updated = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @paths.\/v1\/skus\/{id}.GET.responses.200.content.application\/json.schema.anyOf.properties.package_dimensions.anyOf@ in the specification.
--
-- The dimensions of this SKU for shipping purposes.
data GetSkusIdResponseBody200PackageDimensions' = GetSkusIdResponseBody200PackageDimensions'
  { -- | height: Height, in inches.
    GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Height :: (GHC.Maybe.Maybe GHC.Types.Double),
    -- | length: Length, in inches.
    GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Length :: (GHC.Maybe.Maybe GHC.Types.Double),
    -- | weight: Weight, in ounces.
    GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Weight :: (GHC.Maybe.Maybe GHC.Types.Double),
    -- | width: Width, in inches.
    GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Width :: (GHC.Maybe.Maybe GHC.Types.Double)
  }
  deriving
    ( Int
-> GetSkusIdResponseBody200PackageDimensions' -> String -> String
[GetSkusIdResponseBody200PackageDimensions'] -> String -> String
GetSkusIdResponseBody200PackageDimensions' -> String
(Int
 -> GetSkusIdResponseBody200PackageDimensions' -> String -> String)
-> (GetSkusIdResponseBody200PackageDimensions' -> String)
-> ([GetSkusIdResponseBody200PackageDimensions']
    -> String -> String)
-> Show GetSkusIdResponseBody200PackageDimensions'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetSkusIdResponseBody200PackageDimensions'] -> String -> String
$cshowList :: [GetSkusIdResponseBody200PackageDimensions'] -> String -> String
show :: GetSkusIdResponseBody200PackageDimensions' -> String
$cshow :: GetSkusIdResponseBody200PackageDimensions' -> String
showsPrec :: Int
-> GetSkusIdResponseBody200PackageDimensions' -> String -> String
$cshowsPrec :: Int
-> GetSkusIdResponseBody200PackageDimensions' -> String -> String
GHC.Show.Show,
      GetSkusIdResponseBody200PackageDimensions'
-> GetSkusIdResponseBody200PackageDimensions' -> Bool
(GetSkusIdResponseBody200PackageDimensions'
 -> GetSkusIdResponseBody200PackageDimensions' -> Bool)
-> (GetSkusIdResponseBody200PackageDimensions'
    -> GetSkusIdResponseBody200PackageDimensions' -> Bool)
-> Eq GetSkusIdResponseBody200PackageDimensions'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSkusIdResponseBody200PackageDimensions'
-> GetSkusIdResponseBody200PackageDimensions' -> Bool
$c/= :: GetSkusIdResponseBody200PackageDimensions'
-> GetSkusIdResponseBody200PackageDimensions' -> Bool
== :: GetSkusIdResponseBody200PackageDimensions'
-> GetSkusIdResponseBody200PackageDimensions' -> Bool
$c== :: GetSkusIdResponseBody200PackageDimensions'
-> GetSkusIdResponseBody200PackageDimensions' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetSkusIdResponseBody200PackageDimensions' where
  toJSON :: GetSkusIdResponseBody200PackageDimensions' -> Value
toJSON GetSkusIdResponseBody200PackageDimensions'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"height" Text -> Maybe Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Height GetSkusIdResponseBody200PackageDimensions'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"length" Text -> Maybe Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Length GetSkusIdResponseBody200PackageDimensions'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"weight" Text -> Maybe Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Weight GetSkusIdResponseBody200PackageDimensions'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"width" Text -> Maybe Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Width GetSkusIdResponseBody200PackageDimensions'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetSkusIdResponseBody200PackageDimensions' -> Encoding
toEncoding GetSkusIdResponseBody200PackageDimensions'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"height" Text -> Maybe Double -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Height GetSkusIdResponseBody200PackageDimensions'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"length" Text -> Maybe Double -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Length GetSkusIdResponseBody200PackageDimensions'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"weight" Text -> Maybe Double -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Weight GetSkusIdResponseBody200PackageDimensions'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"width" Text -> Maybe Double -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetSkusIdResponseBody200PackageDimensions' -> Maybe Double
getSkusIdResponseBody200PackageDimensions'Width GetSkusIdResponseBody200PackageDimensions'
obj))))

instance Data.Aeson.Types.FromJSON.FromJSON GetSkusIdResponseBody200PackageDimensions' where
  parseJSON :: Value -> Parser GetSkusIdResponseBody200PackageDimensions'
parseJSON = String
-> (Object -> Parser GetSkusIdResponseBody200PackageDimensions')
-> Value
-> Parser GetSkusIdResponseBody200PackageDimensions'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetSkusIdResponseBody200PackageDimensions'" (\Object
obj -> ((((Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> Maybe Double
 -> GetSkusIdResponseBody200PackageDimensions')
-> Parser
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> GetSkusIdResponseBody200PackageDimensions')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> GetSkusIdResponseBody200PackageDimensions'
GetSkusIdResponseBody200PackageDimensions' Parser
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> GetSkusIdResponseBody200PackageDimensions')
-> Parser (Maybe Double)
-> Parser
     (Maybe Double
      -> Maybe Double
      -> Maybe Double
      -> GetSkusIdResponseBody200PackageDimensions')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"height")) Parser
  (Maybe Double
   -> Maybe Double
   -> Maybe Double
   -> GetSkusIdResponseBody200PackageDimensions')
-> Parser (Maybe Double)
-> Parser
     (Maybe Double
      -> Maybe Double -> GetSkusIdResponseBody200PackageDimensions')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"length")) Parser
  (Maybe Double
   -> Maybe Double -> GetSkusIdResponseBody200PackageDimensions')
-> Parser (Maybe Double)
-> Parser
     (Maybe Double -> GetSkusIdResponseBody200PackageDimensions')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"weight")) Parser (Maybe Double -> GetSkusIdResponseBody200PackageDimensions')
-> Parser (Maybe Double)
-> Parser GetSkusIdResponseBody200PackageDimensions'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"width"))

-- | Create a new 'GetSkusIdResponseBody200PackageDimensions'' with all required fields.
mkGetSkusIdResponseBody200PackageDimensions' :: GetSkusIdResponseBody200PackageDimensions'
mkGetSkusIdResponseBody200PackageDimensions' :: GetSkusIdResponseBody200PackageDimensions'
mkGetSkusIdResponseBody200PackageDimensions' =
  GetSkusIdResponseBody200PackageDimensions' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> GetSkusIdResponseBody200PackageDimensions'
GetSkusIdResponseBody200PackageDimensions'
    { getSkusIdResponseBody200PackageDimensions'Height :: Maybe Double
getSkusIdResponseBody200PackageDimensions'Height = Maybe Double
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200PackageDimensions'Length :: Maybe Double
getSkusIdResponseBody200PackageDimensions'Length = Maybe Double
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200PackageDimensions'Weight :: Maybe Double
getSkusIdResponseBody200PackageDimensions'Weight = Maybe Double
forall a. Maybe a
GHC.Maybe.Nothing,
      getSkusIdResponseBody200PackageDimensions'Width :: Maybe Double
getSkusIdResponseBody200PackageDimensions'Width = Maybe Double
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @paths.\/v1\/skus\/{id}.GET.responses.200.content.application\/json.schema.anyOf.properties.product.anyOf@ in the specification.
--
-- The ID of the product this SKU is associated with. The product must be currently active.
data GetSkusIdResponseBody200Product'Variants
  = GetSkusIdResponseBody200Product'Text Data.Text.Internal.Text
  | GetSkusIdResponseBody200Product'Product Product
  deriving (Int -> GetSkusIdResponseBody200Product'Variants -> String -> String
[GetSkusIdResponseBody200Product'Variants] -> String -> String
GetSkusIdResponseBody200Product'Variants -> String
(Int
 -> GetSkusIdResponseBody200Product'Variants -> String -> String)
-> (GetSkusIdResponseBody200Product'Variants -> String)
-> ([GetSkusIdResponseBody200Product'Variants] -> String -> String)
-> Show GetSkusIdResponseBody200Product'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetSkusIdResponseBody200Product'Variants] -> String -> String
$cshowList :: [GetSkusIdResponseBody200Product'Variants] -> String -> String
show :: GetSkusIdResponseBody200Product'Variants -> String
$cshow :: GetSkusIdResponseBody200Product'Variants -> String
showsPrec :: Int -> GetSkusIdResponseBody200Product'Variants -> String -> String
$cshowsPrec :: Int -> GetSkusIdResponseBody200Product'Variants -> String -> String
GHC.Show.Show, GetSkusIdResponseBody200Product'Variants
-> GetSkusIdResponseBody200Product'Variants -> Bool
(GetSkusIdResponseBody200Product'Variants
 -> GetSkusIdResponseBody200Product'Variants -> Bool)
-> (GetSkusIdResponseBody200Product'Variants
    -> GetSkusIdResponseBody200Product'Variants -> Bool)
-> Eq GetSkusIdResponseBody200Product'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSkusIdResponseBody200Product'Variants
-> GetSkusIdResponseBody200Product'Variants -> Bool
$c/= :: GetSkusIdResponseBody200Product'Variants
-> GetSkusIdResponseBody200Product'Variants -> Bool
== :: GetSkusIdResponseBody200Product'Variants
-> GetSkusIdResponseBody200Product'Variants -> Bool
$c== :: GetSkusIdResponseBody200Product'Variants
-> GetSkusIdResponseBody200Product'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GetSkusIdResponseBody200Product'Variants where
  toJSON :: GetSkusIdResponseBody200Product'Variants -> Value
toJSON (GetSkusIdResponseBody200Product'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (GetSkusIdResponseBody200Product'Product Product
a) = Product -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Product
a

instance Data.Aeson.Types.FromJSON.FromJSON GetSkusIdResponseBody200Product'Variants where
  parseJSON :: Value -> Parser GetSkusIdResponseBody200Product'Variants
parseJSON Value
val = case (Text -> GetSkusIdResponseBody200Product'Variants
GetSkusIdResponseBody200Product'Text (Text -> GetSkusIdResponseBody200Product'Variants)
-> Result Text -> Result GetSkusIdResponseBody200Product'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetSkusIdResponseBody200Product'Variants
-> Result GetSkusIdResponseBody200Product'Variants
-> Result GetSkusIdResponseBody200Product'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Product -> GetSkusIdResponseBody200Product'Variants
GetSkusIdResponseBody200Product'Product (Product -> GetSkusIdResponseBody200Product'Variants)
-> Result Product
-> Result GetSkusIdResponseBody200Product'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Product
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetSkusIdResponseBody200Product'Variants
-> Result GetSkusIdResponseBody200Product'Variants
-> Result GetSkusIdResponseBody200Product'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result GetSkusIdResponseBody200Product'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success GetSkusIdResponseBody200Product'Variants
a -> GetSkusIdResponseBody200Product'Variants
-> Parser GetSkusIdResponseBody200Product'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure GetSkusIdResponseBody200Product'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser GetSkusIdResponseBody200Product'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a