{-# 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 postTaxRatesTaxRate
module StripeAPI.Operations.PostTaxRatesTaxRate 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/tax_rates/{tax_rate}
--
-- \<p>Updates an existing tax rate.\<\/p>
postTaxRatesTaxRate ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | tax_rate | Constraints: Maximum length of 5000
  Data.Text.Internal.Text ->
  -- | The request body to send
  GHC.Maybe.Maybe PostTaxRatesTaxRateRequestBody ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response PostTaxRatesTaxRateResponse)
postTaxRatesTaxRate :: Text
-> Maybe PostTaxRatesTaxRateRequestBody
-> StripeT m (Response PostTaxRatesTaxRateResponse)
postTaxRatesTaxRate
  Text
taxRate
  Maybe PostTaxRatesTaxRateRequestBody
body =
    (Response ByteString -> Response PostTaxRatesTaxRateResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response PostTaxRatesTaxRateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
      ( \Response ByteString
response_0 ->
          (ByteString -> PostTaxRatesTaxRateResponse)
-> Response ByteString -> Response PostTaxRatesTaxRateResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
            ( (String -> PostTaxRatesTaxRateResponse)
-> (PostTaxRatesTaxRateResponse -> PostTaxRatesTaxRateResponse)
-> Either String PostTaxRatesTaxRateResponse
-> PostTaxRatesTaxRateResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostTaxRatesTaxRateResponse
PostTaxRatesTaxRateResponseError PostTaxRatesTaxRateResponse -> PostTaxRatesTaxRateResponse
forall a. a -> a
GHC.Base.id
                (Either String PostTaxRatesTaxRateResponse
 -> PostTaxRatesTaxRateResponse)
-> (ByteString -> Either String PostTaxRatesTaxRateResponse)
-> ByteString
-> PostTaxRatesTaxRateResponse
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) ->
                                     TaxRate -> PostTaxRatesTaxRateResponse
PostTaxRatesTaxRateResponse200
                                       (TaxRate -> PostTaxRatesTaxRateResponse)
-> Either String TaxRate
-> Either String PostTaxRatesTaxRateResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String TaxRate
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                            Data.Either.Either
                                                              GHC.Base.String
                                                              TaxRate
                                                        )
                                   | 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 -> PostTaxRatesTaxRateResponse
PostTaxRatesTaxRateResponseDefault
                                       (Error -> PostTaxRatesTaxRateResponse)
-> Either String Error -> Either String PostTaxRatesTaxRateResponse
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 PostTaxRatesTaxRateResponse
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]
-> Maybe PostTaxRatesTaxRateRequestBody
-> RequestBodyEncoding
-> StripeT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> StripeT m (Response ByteString)
StripeAPI.Common.doBodyCallWithConfigurationM (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"POST") (String -> Text
Data.Text.pack (String
"/v1/tax_rates/" 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 Text
taxRate)) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostTaxRatesTaxRateRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)

-- | Defines the object schema located at @paths.\/v1\/tax_rates\/{tax_rate}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostTaxRatesTaxRateRequestBody = PostTaxRatesTaxRateRequestBody
  { -- | active: Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.
    PostTaxRatesTaxRateRequestBody -> Maybe Bool
postTaxRatesTaxRateRequestBodyActive :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | country: Two-letter country code ([ISO 3166-1 alpha-2](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1_alpha-2)).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyCountry :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | description: An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | display_name: The display name of the tax rate, which will be shown to users.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyDisplayName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | expand: Specifies which fields in the response should be expanded.
    PostTaxRatesTaxRateRequestBody -> Maybe [Text]
postTaxRatesTaxRateRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
    -- | jurisdiction: The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyJurisdiction :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | 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\`.
    PostTaxRatesTaxRateRequestBody
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
postTaxRatesTaxRateRequestBodyMetadata :: (GHC.Maybe.Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants),
    -- | state: [ISO 3166-2 subdivision code](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-2:US), without country prefix. For example, \"NY\" for New York, United States.
    --
    -- Constraints:
    --
    -- * Maximum length of 2
    PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyState :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | tax_type: The high-level tax type, such as \`vat\` or \`sales_tax\`.
    PostTaxRatesTaxRateRequestBody
-> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
postTaxRatesTaxRateRequestBodyTaxType :: (GHC.Maybe.Maybe PostTaxRatesTaxRateRequestBodyTaxType')
  }
  deriving
    ( Int -> PostTaxRatesTaxRateRequestBody -> String -> String
[PostTaxRatesTaxRateRequestBody] -> String -> String
PostTaxRatesTaxRateRequestBody -> String
(Int -> PostTaxRatesTaxRateRequestBody -> String -> String)
-> (PostTaxRatesTaxRateRequestBody -> String)
-> ([PostTaxRatesTaxRateRequestBody] -> String -> String)
-> Show PostTaxRatesTaxRateRequestBody
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostTaxRatesTaxRateRequestBody] -> String -> String
$cshowList :: [PostTaxRatesTaxRateRequestBody] -> String -> String
show :: PostTaxRatesTaxRateRequestBody -> String
$cshow :: PostTaxRatesTaxRateRequestBody -> String
showsPrec :: Int -> PostTaxRatesTaxRateRequestBody -> String -> String
$cshowsPrec :: Int -> PostTaxRatesTaxRateRequestBody -> String -> String
GHC.Show.Show,
      PostTaxRatesTaxRateRequestBody
-> PostTaxRatesTaxRateRequestBody -> Bool
(PostTaxRatesTaxRateRequestBody
 -> PostTaxRatesTaxRateRequestBody -> Bool)
-> (PostTaxRatesTaxRateRequestBody
    -> PostTaxRatesTaxRateRequestBody -> Bool)
-> Eq PostTaxRatesTaxRateRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostTaxRatesTaxRateRequestBody
-> PostTaxRatesTaxRateRequestBody -> Bool
$c/= :: PostTaxRatesTaxRateRequestBody
-> PostTaxRatesTaxRateRequestBody -> Bool
== :: PostTaxRatesTaxRateRequestBody
-> PostTaxRatesTaxRateRequestBody -> Bool
$c== :: PostTaxRatesTaxRateRequestBody
-> PostTaxRatesTaxRateRequestBody -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostTaxRatesTaxRateRequestBody where
  toJSON :: PostTaxRatesTaxRateRequestBody -> Value
toJSON PostTaxRatesTaxRateRequestBody
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..= PostTaxRatesTaxRateRequestBody -> Maybe Bool
postTaxRatesTaxRateRequestBodyActive PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyCountry PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyDescription PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"display_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyDisplayName PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe [Text]
postTaxRatesTaxRateRequestBodyExpand PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"jurisdiction" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyJurisdiction PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
postTaxRatesTaxRateRequestBodyMetadata PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"state" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyState PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_type" Text -> Maybe PostTaxRatesTaxRateRequestBodyTaxType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody
-> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
postTaxRatesTaxRateRequestBodyTaxType PostTaxRatesTaxRateRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostTaxRatesTaxRateRequestBody -> Encoding
toEncoding PostTaxRatesTaxRateRequestBody
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..= PostTaxRatesTaxRateRequestBody -> Maybe Bool
postTaxRatesTaxRateRequestBodyActive PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyCountry PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyDescription PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"display_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyDisplayName PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe [Text]
postTaxRatesTaxRateRequestBodyExpand PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"jurisdiction" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyJurisdiction PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
postTaxRatesTaxRateRequestBodyMetadata PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"state" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody -> Maybe Text
postTaxRatesTaxRateRequestBodyState PostTaxRatesTaxRateRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"tax_type" Text -> Maybe PostTaxRatesTaxRateRequestBodyTaxType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostTaxRatesTaxRateRequestBody
-> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
postTaxRatesTaxRateRequestBodyTaxType PostTaxRatesTaxRateRequestBody
obj)))))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostTaxRatesTaxRateRequestBody where
  parseJSON :: Value -> Parser PostTaxRatesTaxRateRequestBody
parseJSON = String
-> (Object -> Parser PostTaxRatesTaxRateRequestBody)
-> Value
-> Parser PostTaxRatesTaxRateRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostTaxRatesTaxRateRequestBody" (\Object
obj -> (((((((((Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
 -> Maybe Text
 -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
 -> PostTaxRatesTaxRateRequestBody)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBody
PostTaxRatesTaxRateRequestBody Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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
"country")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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
"description")) Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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
"display_name")) Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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
"expand")) Parser
  (Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
      -> Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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
"jurisdiction")) Parser
  (Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
   -> Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants)
-> Parser
     (Maybe Text
      -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser
  (Maybe Text
   -> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe PostTaxRatesTaxRateRequestBodyTaxType'
      -> PostTaxRatesTaxRateRequestBody)
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
"state")) Parser
  (Maybe PostTaxRatesTaxRateRequestBodyTaxType'
   -> PostTaxRatesTaxRateRequestBody)
-> Parser (Maybe PostTaxRatesTaxRateRequestBodyTaxType')
-> Parser PostTaxRatesTaxRateRequestBody
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe PostTaxRatesTaxRateRequestBodyTaxType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_type"))

-- | Create a new 'PostTaxRatesTaxRateRequestBody' with all required fields.
mkPostTaxRatesTaxRateRequestBody :: PostTaxRatesTaxRateRequestBody
mkPostTaxRatesTaxRateRequestBody :: PostTaxRatesTaxRateRequestBody
mkPostTaxRatesTaxRateRequestBody =
  PostTaxRatesTaxRateRequestBody :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBody
PostTaxRatesTaxRateRequestBody
    { postTaxRatesTaxRateRequestBodyActive :: Maybe Bool
postTaxRatesTaxRateRequestBodyActive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyCountry :: Maybe Text
postTaxRatesTaxRateRequestBodyCountry = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyDescription :: Maybe Text
postTaxRatesTaxRateRequestBodyDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyDisplayName :: Maybe Text
postTaxRatesTaxRateRequestBodyDisplayName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyExpand :: Maybe [Text]
postTaxRatesTaxRateRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyJurisdiction :: Maybe Text
postTaxRatesTaxRateRequestBodyJurisdiction = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyMetadata :: Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
postTaxRatesTaxRateRequestBodyMetadata = Maybe PostTaxRatesTaxRateRequestBodyMetadata'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyState :: Maybe Text
postTaxRatesTaxRateRequestBodyState = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postTaxRatesTaxRateRequestBodyTaxType :: Maybe PostTaxRatesTaxRateRequestBodyTaxType'
postTaxRatesTaxRateRequestBodyTaxType = Maybe PostTaxRatesTaxRateRequestBodyTaxType'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @paths.\/v1\/tax_rates\/{tax_rate}.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 PostTaxRatesTaxRateRequestBodyMetadata'Variants
  = -- | Represents the JSON value @""@
    PostTaxRatesTaxRateRequestBodyMetadata'EmptyString
  | PostTaxRatesTaxRateRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object
  deriving (Int
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> String
-> String
[PostTaxRatesTaxRateRequestBodyMetadata'Variants]
-> String -> String
PostTaxRatesTaxRateRequestBodyMetadata'Variants -> String
(Int
 -> PostTaxRatesTaxRateRequestBodyMetadata'Variants
 -> String
 -> String)
-> (PostTaxRatesTaxRateRequestBodyMetadata'Variants -> String)
-> ([PostTaxRatesTaxRateRequestBodyMetadata'Variants]
    -> String -> String)
-> Show PostTaxRatesTaxRateRequestBodyMetadata'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostTaxRatesTaxRateRequestBodyMetadata'Variants]
-> String -> String
$cshowList :: [PostTaxRatesTaxRateRequestBodyMetadata'Variants]
-> String -> String
show :: PostTaxRatesTaxRateRequestBodyMetadata'Variants -> String
$cshow :: PostTaxRatesTaxRateRequestBodyMetadata'Variants -> String
showsPrec :: Int
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> String
-> String
$cshowsPrec :: Int
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> String
-> String
GHC.Show.Show, PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool
(PostTaxRatesTaxRateRequestBodyMetadata'Variants
 -> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool)
-> (PostTaxRatesTaxRateRequestBodyMetadata'Variants
    -> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool)
-> Eq PostTaxRatesTaxRateRequestBodyMetadata'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool
$c/= :: PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool
== :: PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool
$c== :: PostTaxRatesTaxRateRequestBodyMetadata'Variants
-> PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostTaxRatesTaxRateRequestBodyMetadata'Variants where
  toJSON :: PostTaxRatesTaxRateRequestBodyMetadata'Variants -> Value
toJSON (PostTaxRatesTaxRateRequestBodyMetadata'Object Object
a) = Object -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Object
a
  toJSON (PostTaxRatesTaxRateRequestBodyMetadata'Variants
PostTaxRatesTaxRateRequestBodyMetadata'EmptyString) = Value
""

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

-- | Defines the enum schema located at @paths.\/v1\/tax_rates\/{tax_rate}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax_type@ in the specification.
--
-- The high-level tax type, such as \`vat\` or \`sales_tax\`.
data PostTaxRatesTaxRateRequestBodyTaxType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PostTaxRatesTaxRateRequestBodyTaxType'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.
    PostTaxRatesTaxRateRequestBodyTaxType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"gst"@
    PostTaxRatesTaxRateRequestBodyTaxType'EnumGst
  | -- | Represents the JSON value @"hst"@
    PostTaxRatesTaxRateRequestBodyTaxType'EnumHst
  | -- | Represents the JSON value @"pst"@
    PostTaxRatesTaxRateRequestBodyTaxType'EnumPst
  | -- | Represents the JSON value @"qst"@
    PostTaxRatesTaxRateRequestBodyTaxType'EnumQst
  | -- | Represents the JSON value @"sales_tax"@
    PostTaxRatesTaxRateRequestBodyTaxType'EnumSalesTax
  | -- | Represents the JSON value @"vat"@
    PostTaxRatesTaxRateRequestBodyTaxType'EnumVat
  deriving (Int -> PostTaxRatesTaxRateRequestBodyTaxType' -> String -> String
[PostTaxRatesTaxRateRequestBodyTaxType'] -> String -> String
PostTaxRatesTaxRateRequestBodyTaxType' -> String
(Int -> PostTaxRatesTaxRateRequestBodyTaxType' -> String -> String)
-> (PostTaxRatesTaxRateRequestBodyTaxType' -> String)
-> ([PostTaxRatesTaxRateRequestBodyTaxType'] -> String -> String)
-> Show PostTaxRatesTaxRateRequestBodyTaxType'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostTaxRatesTaxRateRequestBodyTaxType'] -> String -> String
$cshowList :: [PostTaxRatesTaxRateRequestBodyTaxType'] -> String -> String
show :: PostTaxRatesTaxRateRequestBodyTaxType' -> String
$cshow :: PostTaxRatesTaxRateRequestBodyTaxType' -> String
showsPrec :: Int -> PostTaxRatesTaxRateRequestBodyTaxType' -> String -> String
$cshowsPrec :: Int -> PostTaxRatesTaxRateRequestBodyTaxType' -> String -> String
GHC.Show.Show, PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool
(PostTaxRatesTaxRateRequestBodyTaxType'
 -> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool)
-> (PostTaxRatesTaxRateRequestBodyTaxType'
    -> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool)
-> Eq PostTaxRatesTaxRateRequestBodyTaxType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool
$c/= :: PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool
== :: PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool
$c== :: PostTaxRatesTaxRateRequestBodyTaxType'
-> PostTaxRatesTaxRateRequestBodyTaxType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostTaxRatesTaxRateRequestBodyTaxType' where
  toJSON :: PostTaxRatesTaxRateRequestBodyTaxType' -> Value
toJSON (PostTaxRatesTaxRateRequestBodyTaxType'Other Value
val) = Value
val
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumGst) = Value
"gst"
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumHst) = Value
"hst"
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumPst) = Value
"pst"
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumQst) = Value
"qst"
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumSalesTax) = Value
"sales_tax"
  toJSON (PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumVat) = Value
"vat"

instance Data.Aeson.Types.FromJSON.FromJSON PostTaxRatesTaxRateRequestBodyTaxType' where
  parseJSON :: Value -> Parser PostTaxRatesTaxRateRequestBodyTaxType'
parseJSON Value
val =
    PostTaxRatesTaxRateRequestBodyTaxType'
-> Parser PostTaxRatesTaxRateRequestBodyTaxType'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"gst" -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumGst
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"hst" -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumHst
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pst" -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumPst
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"qst" -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumQst
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sales_tax" -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumSalesTax
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"vat" -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'EnumVat
            | Bool
GHC.Base.otherwise -> Value -> PostTaxRatesTaxRateRequestBodyTaxType'
PostTaxRatesTaxRateRequestBodyTaxType'Other Value
val
      )

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