{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}

-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.

-- | Contains the different functions to run the operation postAccountPersonsPerson
module StripeAPI.Operations.PostAccountPersonsPerson where

import qualified Control.Monad.Trans.Reader
import qualified Data.Aeson
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.ToJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
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.Generics
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/account/persons/{person}
--
-- \<p>Updates an existing person.\<\/p>
postAccountPersonsPerson ::
  forall m s.
  (StripeAPI.Common.MonadHTTP m, StripeAPI.Common.SecurityScheme s) =>
  -- | The configuration to use in the request
  StripeAPI.Common.Configuration s ->
  -- | person | Constraints: Maximum length of 5000
  Data.Text.Internal.Text ->
  -- | The request body to send
  GHC.Maybe.Maybe PostAccountPersonsPersonRequestBody ->
  -- | Monad containing the result of the operation
  m (Data.Either.Either Network.HTTP.Client.Types.HttpException (Network.HTTP.Client.Types.Response PostAccountPersonsPersonResponse))
postAccountPersonsPerson
  config
  person
  body =
    GHC.Base.fmap
      ( GHC.Base.fmap
          ( \response_0 ->
              GHC.Base.fmap
                ( Data.Either.either PostAccountPersonsPersonResponseError GHC.Base.id
                    GHC.Base.. ( \response body ->
                                   if  | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) ->
                                         PostAccountPersonsPersonResponse200
                                           Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
                                                                Data.Either.Either GHC.Base.String
                                                                  Person
                                                            )
                                       | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) ->
                                         PostAccountPersonsPersonResponseDefault
                                           Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
                                                                Data.Either.Either GHC.Base.String
                                                                  Error
                                                            )
                                       | GHC.Base.otherwise -> Data.Either.Left "Missing default response type"
                               )
                      response_0
                )
                response_0
          )
      )
      (StripeAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/account/persons/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel person)) GHC.Base.++ ""))) [] body StripeAPI.Common.RequestBodyEncodingFormData)

-- | > POST /v1/account/persons/{person}
--
-- The same as 'postAccountPersonsPerson' but returns the raw 'Data.ByteString.Char8.ByteString'
postAccountPersonsPersonRaw ::
  forall m s.
  ( StripeAPI.Common.MonadHTTP m,
    StripeAPI.Common.SecurityScheme s
  ) =>
  StripeAPI.Common.Configuration s ->
  Data.Text.Internal.Text ->
  GHC.Maybe.Maybe PostAccountPersonsPersonRequestBody ->
  m
    ( Data.Either.Either Network.HTTP.Client.Types.HttpException
        (Network.HTTP.Client.Types.Response Data.ByteString.Internal.ByteString)
    )
postAccountPersonsPersonRaw
  config
  person
  body = GHC.Base.id (StripeAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/account/persons/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel person)) GHC.Base.++ ""))) [] body StripeAPI.Common.RequestBodyEncodingFormData)

-- | > POST /v1/account/persons/{person}
--
-- Monadic version of 'postAccountPersonsPerson' (use with 'StripeAPI.Common.runWithConfiguration')
postAccountPersonsPersonM ::
  forall m s.
  ( StripeAPI.Common.MonadHTTP m,
    StripeAPI.Common.SecurityScheme s
  ) =>
  Data.Text.Internal.Text ->
  GHC.Maybe.Maybe PostAccountPersonsPersonRequestBody ->
  Control.Monad.Trans.Reader.ReaderT (StripeAPI.Common.Configuration s)
    m
    ( Data.Either.Either Network.HTTP.Client.Types.HttpException
        (Network.HTTP.Client.Types.Response PostAccountPersonsPersonResponse)
    )
postAccountPersonsPersonM
  person
  body =
    GHC.Base.fmap
      ( GHC.Base.fmap
          ( \response_2 ->
              GHC.Base.fmap
                ( Data.Either.either PostAccountPersonsPersonResponseError GHC.Base.id
                    GHC.Base.. ( \response body ->
                                   if  | (\status_3 -> Network.HTTP.Types.Status.statusCode status_3 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) ->
                                         PostAccountPersonsPersonResponse200
                                           Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
                                                                Data.Either.Either GHC.Base.String
                                                                  Person
                                                            )
                                       | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) ->
                                         PostAccountPersonsPersonResponseDefault
                                           Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
                                                                Data.Either.Either GHC.Base.String
                                                                  Error
                                                            )
                                       | GHC.Base.otherwise -> Data.Either.Left "Missing default response type"
                               )
                      response_2
                )
                response_2
          )
      )
      (StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/account/persons/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel person)) GHC.Base.++ ""))) [] body StripeAPI.Common.RequestBodyEncodingFormData)

-- | > POST /v1/account/persons/{person}
--
-- Monadic version of 'postAccountPersonsPersonRaw' (use with 'StripeAPI.Common.runWithConfiguration')
postAccountPersonsPersonRawM ::
  forall m s.
  ( StripeAPI.Common.MonadHTTP m,
    StripeAPI.Common.SecurityScheme s
  ) =>
  Data.Text.Internal.Text ->
  GHC.Maybe.Maybe PostAccountPersonsPersonRequestBody ->
  Control.Monad.Trans.Reader.ReaderT (StripeAPI.Common.Configuration s)
    m
    ( Data.Either.Either Network.HTTP.Client.Types.HttpException
        (Network.HTTP.Client.Types.Response Data.ByteString.Internal.ByteString)
    )
postAccountPersonsPersonRawM
  person
  body = GHC.Base.id (StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/account/persons/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel person)) GHC.Base.++ ""))) [] body StripeAPI.Common.RequestBodyEncodingFormData)

-- | Defines the data type for the schema postAccountPersonsPersonRequestBody
data PostAccountPersonsPersonRequestBody
  = PostAccountPersonsPersonRequestBody
      { -- | account
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAccount :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | address: The person\'s address.
        postAccountPersonsPersonRequestBodyAddress :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyAddress'),
        -- | address_kana: The Kana variation of the person\'s address (Japan only).
        postAccountPersonsPersonRequestBodyAddressKana :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyAddressKana'),
        -- | address_kanji: The Kanji variation of the person\'s address (Japan only).
        postAccountPersonsPersonRequestBodyAddressKanji :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyAddressKanji'),
        -- | dob: The person\'s date of birth.
        postAccountPersonsPersonRequestBodyDob :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyDob'Variants),
        -- | email: The person\'s email address.
        postAccountPersonsPersonRequestBodyEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | expand: Specifies which fields in the response should be expanded.
        postAccountPersonsPersonRequestBodyExpand :: (GHC.Maybe.Maybe ([] Data.Text.Internal.Text)),
        -- | first_name: The person\'s first name.
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyFirstName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | first_name_kana: The Kana variation of the person\'s first name (Japan only).
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyFirstNameKana :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | first_name_kanji: The Kanji variation of the person\'s first name (Japan only).
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyFirstNameKanji :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | gender: The person\'s gender (International regulations require either \"male\" or \"female\").
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyGender :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | id_number: The person\'s ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https:\/\/stripe.com\/docs\/stripe.js\#collecting-pii-data).
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyIdNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | last_name: The person\'s last name.
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyLastName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | last_name_kana: The Kana variation of the person\'s last name (Japan only).
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyLastNameKana :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | last_name_kanji: The Kanji variation of the person\'s last name (Japan only).
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyLastNameKanji :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | maiden_name: The person\'s maiden name.
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyMaidenName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | metadata: Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`.
        postAccountPersonsPersonRequestBodyMetadata :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyMetadata'),
        -- | person_token: A [person token](https:\/\/stripe.com\/docs\/connect\/account-tokens), used to securely provide details to the person.
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyPersonToken :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | phone: The person\'s phone number.
        postAccountPersonsPersonRequestBodyPhone :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | relationship: The relationship that this person has with the account\'s legal entity.
        postAccountPersonsPersonRequestBodyRelationship :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyRelationship'),
        -- | ssn_last_4: The last 4 digits of the person\'s social security number.
        postAccountPersonsPersonRequestBodySsnLast_4 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | verification: The person\'s verification status.
        postAccountPersonsPersonRequestBodyVerification :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyVerification')
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBody where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "account" (postAccountPersonsPersonRequestBodyAccount obj) : (Data.Aeson..=) "address" (postAccountPersonsPersonRequestBodyAddress obj) : (Data.Aeson..=) "address_kana" (postAccountPersonsPersonRequestBodyAddressKana obj) : (Data.Aeson..=) "address_kanji" (postAccountPersonsPersonRequestBodyAddressKanji obj) : (Data.Aeson..=) "dob" (postAccountPersonsPersonRequestBodyDob obj) : (Data.Aeson..=) "email" (postAccountPersonsPersonRequestBodyEmail obj) : (Data.Aeson..=) "expand" (postAccountPersonsPersonRequestBodyExpand obj) : (Data.Aeson..=) "first_name" (postAccountPersonsPersonRequestBodyFirstName obj) : (Data.Aeson..=) "first_name_kana" (postAccountPersonsPersonRequestBodyFirstNameKana obj) : (Data.Aeson..=) "first_name_kanji" (postAccountPersonsPersonRequestBodyFirstNameKanji obj) : (Data.Aeson..=) "gender" (postAccountPersonsPersonRequestBodyGender obj) : (Data.Aeson..=) "id_number" (postAccountPersonsPersonRequestBodyIdNumber obj) : (Data.Aeson..=) "last_name" (postAccountPersonsPersonRequestBodyLastName obj) : (Data.Aeson..=) "last_name_kana" (postAccountPersonsPersonRequestBodyLastNameKana obj) : (Data.Aeson..=) "last_name_kanji" (postAccountPersonsPersonRequestBodyLastNameKanji obj) : (Data.Aeson..=) "maiden_name" (postAccountPersonsPersonRequestBodyMaidenName obj) : (Data.Aeson..=) "metadata" (postAccountPersonsPersonRequestBodyMetadata obj) : (Data.Aeson..=) "person_token" (postAccountPersonsPersonRequestBodyPersonToken obj) : (Data.Aeson..=) "phone" (postAccountPersonsPersonRequestBodyPhone obj) : (Data.Aeson..=) "relationship" (postAccountPersonsPersonRequestBodyRelationship obj) : (Data.Aeson..=) "ssn_last_4" (postAccountPersonsPersonRequestBodySsnLast_4 obj) : (Data.Aeson..=) "verification" (postAccountPersonsPersonRequestBodyVerification obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "account" (postAccountPersonsPersonRequestBodyAccount obj) GHC.Base.<> ((Data.Aeson..=) "address" (postAccountPersonsPersonRequestBodyAddress obj) GHC.Base.<> ((Data.Aeson..=) "address_kana" (postAccountPersonsPersonRequestBodyAddressKana obj) GHC.Base.<> ((Data.Aeson..=) "address_kanji" (postAccountPersonsPersonRequestBodyAddressKanji obj) GHC.Base.<> ((Data.Aeson..=) "dob" (postAccountPersonsPersonRequestBodyDob obj) GHC.Base.<> ((Data.Aeson..=) "email" (postAccountPersonsPersonRequestBodyEmail obj) GHC.Base.<> ((Data.Aeson..=) "expand" (postAccountPersonsPersonRequestBodyExpand obj) GHC.Base.<> ((Data.Aeson..=) "first_name" (postAccountPersonsPersonRequestBodyFirstName obj) GHC.Base.<> ((Data.Aeson..=) "first_name_kana" (postAccountPersonsPersonRequestBodyFirstNameKana obj) GHC.Base.<> ((Data.Aeson..=) "first_name_kanji" (postAccountPersonsPersonRequestBodyFirstNameKanji obj) GHC.Base.<> ((Data.Aeson..=) "gender" (postAccountPersonsPersonRequestBodyGender obj) GHC.Base.<> ((Data.Aeson..=) "id_number" (postAccountPersonsPersonRequestBodyIdNumber obj) GHC.Base.<> ((Data.Aeson..=) "last_name" (postAccountPersonsPersonRequestBodyLastName obj) GHC.Base.<> ((Data.Aeson..=) "last_name_kana" (postAccountPersonsPersonRequestBodyLastNameKana obj) GHC.Base.<> ((Data.Aeson..=) "last_name_kanji" (postAccountPersonsPersonRequestBodyLastNameKanji obj) GHC.Base.<> ((Data.Aeson..=) "maiden_name" (postAccountPersonsPersonRequestBodyMaidenName obj) GHC.Base.<> ((Data.Aeson..=) "metadata" (postAccountPersonsPersonRequestBodyMetadata obj) GHC.Base.<> ((Data.Aeson..=) "person_token" (postAccountPersonsPersonRequestBodyPersonToken obj) GHC.Base.<> ((Data.Aeson..=) "phone" (postAccountPersonsPersonRequestBodyPhone obj) GHC.Base.<> ((Data.Aeson..=) "relationship" (postAccountPersonsPersonRequestBodyRelationship obj) GHC.Base.<> ((Data.Aeson..=) "ssn_last_4" (postAccountPersonsPersonRequestBodySsnLast_4 obj) GHC.Base.<> (Data.Aeson..=) "verification" (postAccountPersonsPersonRequestBodyVerification obj))))))))))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBody where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBody" (\obj -> (((((((((((((((((((((GHC.Base.pure PostAccountPersonsPersonRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_kana")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_kanji")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "dob")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "email")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "first_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "first_name_kana")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "first_name_kanji")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "gender")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "id_number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "last_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "last_name_kana")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "last_name_kanji")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "maiden_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "person_token")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "phone")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "relationship")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "ssn_last_4")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "verification"))

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyAddress\'
--
-- The person\'s address.
data PostAccountPersonsPersonRequestBodyAddress'
  = PostAccountPersonsPersonRequestBodyAddress'
      { -- | city
        --
        -- Constraints:
        --
        -- * Maximum length of 100
        postAccountPersonsPersonRequestBodyAddress'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | country
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddress'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | line1
        --
        -- Constraints:
        --
        -- * Maximum length of 200
        postAccountPersonsPersonRequestBodyAddress'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | line2
        --
        -- Constraints:
        --
        -- * Maximum length of 200
        postAccountPersonsPersonRequestBodyAddress'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | postal_code
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddress'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | state
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddress'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyAddress' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "city" (postAccountPersonsPersonRequestBodyAddress'City obj) : (Data.Aeson..=) "country" (postAccountPersonsPersonRequestBodyAddress'Country obj) : (Data.Aeson..=) "line1" (postAccountPersonsPersonRequestBodyAddress'Line1 obj) : (Data.Aeson..=) "line2" (postAccountPersonsPersonRequestBodyAddress'Line2 obj) : (Data.Aeson..=) "postal_code" (postAccountPersonsPersonRequestBodyAddress'PostalCode obj) : (Data.Aeson..=) "state" (postAccountPersonsPersonRequestBodyAddress'State obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "city" (postAccountPersonsPersonRequestBodyAddress'City obj) GHC.Base.<> ((Data.Aeson..=) "country" (postAccountPersonsPersonRequestBodyAddress'Country obj) GHC.Base.<> ((Data.Aeson..=) "line1" (postAccountPersonsPersonRequestBodyAddress'Line1 obj) GHC.Base.<> ((Data.Aeson..=) "line2" (postAccountPersonsPersonRequestBodyAddress'Line2 obj) GHC.Base.<> ((Data.Aeson..=) "postal_code" (postAccountPersonsPersonRequestBodyAddress'PostalCode obj) GHC.Base.<> (Data.Aeson..=) "state" (postAccountPersonsPersonRequestBodyAddress'State obj))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyAddress' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyAddress'" (\obj -> (((((GHC.Base.pure PostAccountPersonsPersonRequestBodyAddress' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "city")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "line1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "line2")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "postal_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "state"))

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyAddress_kana\'
--
-- The Kana variation of the person\'s address (Japan only).
data PostAccountPersonsPersonRequestBodyAddressKana'
  = PostAccountPersonsPersonRequestBodyAddressKana'
      { -- | city
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | country
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | line1
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | line2
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | postal_code
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | state
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | town
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKana'Town :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyAddressKana' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "city" (postAccountPersonsPersonRequestBodyAddressKana'City obj) : (Data.Aeson..=) "country" (postAccountPersonsPersonRequestBodyAddressKana'Country obj) : (Data.Aeson..=) "line1" (postAccountPersonsPersonRequestBodyAddressKana'Line1 obj) : (Data.Aeson..=) "line2" (postAccountPersonsPersonRequestBodyAddressKana'Line2 obj) : (Data.Aeson..=) "postal_code" (postAccountPersonsPersonRequestBodyAddressKana'PostalCode obj) : (Data.Aeson..=) "state" (postAccountPersonsPersonRequestBodyAddressKana'State obj) : (Data.Aeson..=) "town" (postAccountPersonsPersonRequestBodyAddressKana'Town obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "city" (postAccountPersonsPersonRequestBodyAddressKana'City obj) GHC.Base.<> ((Data.Aeson..=) "country" (postAccountPersonsPersonRequestBodyAddressKana'Country obj) GHC.Base.<> ((Data.Aeson..=) "line1" (postAccountPersonsPersonRequestBodyAddressKana'Line1 obj) GHC.Base.<> ((Data.Aeson..=) "line2" (postAccountPersonsPersonRequestBodyAddressKana'Line2 obj) GHC.Base.<> ((Data.Aeson..=) "postal_code" (postAccountPersonsPersonRequestBodyAddressKana'PostalCode obj) GHC.Base.<> ((Data.Aeson..=) "state" (postAccountPersonsPersonRequestBodyAddressKana'State obj) GHC.Base.<> (Data.Aeson..=) "town" (postAccountPersonsPersonRequestBodyAddressKana'Town obj)))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyAddressKana' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyAddressKana'" (\obj -> ((((((GHC.Base.pure PostAccountPersonsPersonRequestBodyAddressKana' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "city")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "line1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "line2")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "postal_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "state")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "town"))

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyAddress_kanji\'
--
-- The Kanji variation of the person\'s address (Japan only).
data PostAccountPersonsPersonRequestBodyAddressKanji'
  = PostAccountPersonsPersonRequestBodyAddressKanji'
      { -- | city
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | country
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | line1
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | line2
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | postal_code
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | state
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | town
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyAddressKanji'Town :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyAddressKanji' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "city" (postAccountPersonsPersonRequestBodyAddressKanji'City obj) : (Data.Aeson..=) "country" (postAccountPersonsPersonRequestBodyAddressKanji'Country obj) : (Data.Aeson..=) "line1" (postAccountPersonsPersonRequestBodyAddressKanji'Line1 obj) : (Data.Aeson..=) "line2" (postAccountPersonsPersonRequestBodyAddressKanji'Line2 obj) : (Data.Aeson..=) "postal_code" (postAccountPersonsPersonRequestBodyAddressKanji'PostalCode obj) : (Data.Aeson..=) "state" (postAccountPersonsPersonRequestBodyAddressKanji'State obj) : (Data.Aeson..=) "town" (postAccountPersonsPersonRequestBodyAddressKanji'Town obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "city" (postAccountPersonsPersonRequestBodyAddressKanji'City obj) GHC.Base.<> ((Data.Aeson..=) "country" (postAccountPersonsPersonRequestBodyAddressKanji'Country obj) GHC.Base.<> ((Data.Aeson..=) "line1" (postAccountPersonsPersonRequestBodyAddressKanji'Line1 obj) GHC.Base.<> ((Data.Aeson..=) "line2" (postAccountPersonsPersonRequestBodyAddressKanji'Line2 obj) GHC.Base.<> ((Data.Aeson..=) "postal_code" (postAccountPersonsPersonRequestBodyAddressKanji'PostalCode obj) GHC.Base.<> ((Data.Aeson..=) "state" (postAccountPersonsPersonRequestBodyAddressKanji'State obj) GHC.Base.<> (Data.Aeson..=) "town" (postAccountPersonsPersonRequestBodyAddressKanji'Town obj)))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyAddressKanji' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyAddressKanji'" (\obj -> ((((((GHC.Base.pure PostAccountPersonsPersonRequestBodyAddressKanji' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "city")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "line1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "line2")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "postal_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "state")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "town"))

-- | Defines the enum schema postAccountPersonsPersonRequestBodyDob\'OneOf1
data PostAccountPersonsPersonRequestBodyDob'OneOf1
  = PostAccountPersonsPersonRequestBodyDob'OneOf1EnumOther Data.Aeson.Types.Internal.Value
  | PostAccountPersonsPersonRequestBodyDob'OneOf1EnumTyped Data.Text.Internal.Text
  | PostAccountPersonsPersonRequestBodyDob'OneOf1EnumString_
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyDob'OneOf1 where
  toJSON (PostAccountPersonsPersonRequestBodyDob'OneOf1EnumOther patternName) = Data.Aeson.Types.ToJSON.toJSON patternName
  toJSON (PostAccountPersonsPersonRequestBodyDob'OneOf1EnumTyped patternName) = Data.Aeson.Types.ToJSON.toJSON patternName
  toJSON (PostAccountPersonsPersonRequestBodyDob'OneOf1EnumString_) = Data.Aeson.Types.Internal.String GHC.Base.$ Data.Text.pack ""

instance Data.Aeson.FromJSON PostAccountPersonsPersonRequestBodyDob'OneOf1 where
  parseJSON val =
    GHC.Base.pure
      ( if val GHC.Classes.== (Data.Aeson.Types.Internal.String GHC.Base.$ Data.Text.pack "")
          then PostAccountPersonsPersonRequestBodyDob'OneOf1EnumString_
          else PostAccountPersonsPersonRequestBodyDob'OneOf1EnumOther val
      )

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyDob\'OneOf2
data PostAccountPersonsPersonRequestBodyDob'OneOf2
  = PostAccountPersonsPersonRequestBodyDob'OneOf2
      { -- | day
        postAccountPersonsPersonRequestBodyDob'OneOf2Day :: GHC.Integer.Type.Integer,
        -- | month
        postAccountPersonsPersonRequestBodyDob'OneOf2Month :: GHC.Integer.Type.Integer,
        -- | year
        postAccountPersonsPersonRequestBodyDob'OneOf2Year :: GHC.Integer.Type.Integer
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyDob'OneOf2 where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "day" (postAccountPersonsPersonRequestBodyDob'OneOf2Day obj) : (Data.Aeson..=) "month" (postAccountPersonsPersonRequestBodyDob'OneOf2Month obj) : (Data.Aeson..=) "year" (postAccountPersonsPersonRequestBodyDob'OneOf2Year obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "day" (postAccountPersonsPersonRequestBodyDob'OneOf2Day obj) GHC.Base.<> ((Data.Aeson..=) "month" (postAccountPersonsPersonRequestBodyDob'OneOf2Month obj) GHC.Base.<> (Data.Aeson..=) "year" (postAccountPersonsPersonRequestBodyDob'OneOf2Year obj)))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyDob'OneOf2 where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyDob'OneOf2" (\obj -> ((GHC.Base.pure PostAccountPersonsPersonRequestBodyDob'OneOf2 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "day")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "month")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "year"))

-- | Define the one-of schema postAccountPersonsPersonRequestBodyDob\'
--
-- The person\'s date of birth.
data PostAccountPersonsPersonRequestBodyDob'Variants
  = PostAccountPersonsPersonRequestBodyDob'PostAccountPersonsPersonRequestBodyDob'OneOf1 PostAccountPersonsPersonRequestBodyDob'OneOf1
  | PostAccountPersonsPersonRequestBodyDob'PostAccountPersonsPersonRequestBodyDob'OneOf2 PostAccountPersonsPersonRequestBodyDob'OneOf2
  deriving (GHC.Show.Show, GHC.Classes.Eq, GHC.Generics.Generic)

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyDob'Variants where
  toJSON = Data.Aeson.Types.ToJSON.genericToJSON Data.Aeson.Types.Internal.defaultOptions {Data.Aeson.Types.Internal.sumEncoding = Data.Aeson.Types.Internal.UntaggedValue}

instance Data.Aeson.FromJSON PostAccountPersonsPersonRequestBodyDob'Variants where
  parseJSON = Data.Aeson.Types.FromJSON.genericParseJSON Data.Aeson.Types.Internal.defaultOptions {Data.Aeson.Types.Internal.sumEncoding = Data.Aeson.Types.Internal.UntaggedValue}

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyMetadata\'
--
-- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 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 PostAccountPersonsPersonRequestBodyMetadata'
  = PostAccountPersonsPersonRequestBodyMetadata'
      {
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyMetadata' where
  toJSON obj = Data.Aeson.object []
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "string" ("string" :: GHC.Base.String))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyMetadata' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyMetadata'" (\obj -> GHC.Base.pure PostAccountPersonsPersonRequestBodyMetadata')

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyRelationship\'
--
-- The relationship that this person has with the account\'s legal entity.
data PostAccountPersonsPersonRequestBodyRelationship'
  = PostAccountPersonsPersonRequestBodyRelationship'
      { -- | director
        postAccountPersonsPersonRequestBodyRelationship'Director :: (GHC.Maybe.Maybe GHC.Types.Bool),
        -- | executive
        postAccountPersonsPersonRequestBodyRelationship'Executive :: (GHC.Maybe.Maybe GHC.Types.Bool),
        -- | owner
        postAccountPersonsPersonRequestBodyRelationship'Owner :: (GHC.Maybe.Maybe GHC.Types.Bool),
        -- | percent_ownership
        postAccountPersonsPersonRequestBodyRelationship'PercentOwnership :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'Variants),
        -- | representative
        postAccountPersonsPersonRequestBodyRelationship'Representative :: (GHC.Maybe.Maybe GHC.Types.Bool),
        -- | title
        --
        -- Constraints:
        --
        -- * Maximum length of 5000
        postAccountPersonsPersonRequestBodyRelationship'Title :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyRelationship' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "director" (postAccountPersonsPersonRequestBodyRelationship'Director obj) : (Data.Aeson..=) "executive" (postAccountPersonsPersonRequestBodyRelationship'Executive obj) : (Data.Aeson..=) "owner" (postAccountPersonsPersonRequestBodyRelationship'Owner obj) : (Data.Aeson..=) "percent_ownership" (postAccountPersonsPersonRequestBodyRelationship'PercentOwnership obj) : (Data.Aeson..=) "representative" (postAccountPersonsPersonRequestBodyRelationship'Representative obj) : (Data.Aeson..=) "title" (postAccountPersonsPersonRequestBodyRelationship'Title obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "director" (postAccountPersonsPersonRequestBodyRelationship'Director obj) GHC.Base.<> ((Data.Aeson..=) "executive" (postAccountPersonsPersonRequestBodyRelationship'Executive obj) GHC.Base.<> ((Data.Aeson..=) "owner" (postAccountPersonsPersonRequestBodyRelationship'Owner obj) GHC.Base.<> ((Data.Aeson..=) "percent_ownership" (postAccountPersonsPersonRequestBodyRelationship'PercentOwnership obj) GHC.Base.<> ((Data.Aeson..=) "representative" (postAccountPersonsPersonRequestBodyRelationship'Representative obj) GHC.Base.<> (Data.Aeson..=) "title" (postAccountPersonsPersonRequestBodyRelationship'Title obj))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyRelationship' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyRelationship'" (\obj -> (((((GHC.Base.pure PostAccountPersonsPersonRequestBodyRelationship' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "director")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "executive")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "owner")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "percent_ownership")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "representative")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "title"))

-- | Defines the enum schema postAccountPersonsPersonRequestBodyRelationship\'Percent_ownership\'OneOf1
data PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1
  = PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumOther Data.Aeson.Types.Internal.Value
  | PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumTyped Data.Text.Internal.Text
  | PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumString_
  deriving (GHC.Show.Show, GHC.Classes.Eq)

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1 where
  toJSON (PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumOther patternName) = Data.Aeson.Types.ToJSON.toJSON patternName
  toJSON (PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumTyped patternName) = Data.Aeson.Types.ToJSON.toJSON patternName
  toJSON (PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumString_) = Data.Aeson.Types.Internal.String GHC.Base.$ Data.Text.pack ""

instance Data.Aeson.FromJSON PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1 where
  parseJSON val =
    GHC.Base.pure
      ( if val GHC.Classes.== (Data.Aeson.Types.Internal.String GHC.Base.$ Data.Text.pack "")
          then PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumString_
          else PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1EnumOther val
      )

-- | Define the one-of schema postAccountPersonsPersonRequestBodyRelationship\'Percent_ownership\'
data PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'Variants
  = PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1 PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'OneOf1
  | PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'Double GHC.Types.Double
  deriving (GHC.Show.Show, GHC.Classes.Eq, GHC.Generics.Generic)

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'Variants where
  toJSON = Data.Aeson.Types.ToJSON.genericToJSON Data.Aeson.Types.Internal.defaultOptions {Data.Aeson.Types.Internal.sumEncoding = Data.Aeson.Types.Internal.UntaggedValue}

instance Data.Aeson.FromJSON PostAccountPersonsPersonRequestBodyRelationship'PercentOwnership'Variants where
  parseJSON = Data.Aeson.Types.FromJSON.genericParseJSON Data.Aeson.Types.Internal.defaultOptions {Data.Aeson.Types.Internal.sumEncoding = Data.Aeson.Types.Internal.UntaggedValue}

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyVerification\'
--
-- The person\'s verification status.
data PostAccountPersonsPersonRequestBodyVerification'
  = PostAccountPersonsPersonRequestBodyVerification'
      { -- | additional_document
        postAccountPersonsPersonRequestBodyVerification'AdditionalDocument :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument'),
        -- | document
        postAccountPersonsPersonRequestBodyVerification'Document :: (GHC.Maybe.Maybe PostAccountPersonsPersonRequestBodyVerification'Document')
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyVerification' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "additional_document" (postAccountPersonsPersonRequestBodyVerification'AdditionalDocument obj) : (Data.Aeson..=) "document" (postAccountPersonsPersonRequestBodyVerification'Document obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "additional_document" (postAccountPersonsPersonRequestBodyVerification'AdditionalDocument obj) GHC.Base.<> (Data.Aeson..=) "document" (postAccountPersonsPersonRequestBodyVerification'Document obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyVerification' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyVerification'" (\obj -> (GHC.Base.pure PostAccountPersonsPersonRequestBodyVerification' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "additional_document")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "document"))

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyVerification\'Additional_document\'
data PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument'
  = PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument'
      { -- | back
        --
        -- Constraints:
        --
        -- * Maximum length of 500
        postAccountPersonsPersonRequestBodyVerification'AdditionalDocument'Back :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | front
        --
        -- Constraints:
        --
        -- * Maximum length of 500
        postAccountPersonsPersonRequestBodyVerification'AdditionalDocument'Front :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "back" (postAccountPersonsPersonRequestBodyVerification'AdditionalDocument'Back obj) : (Data.Aeson..=) "front" (postAccountPersonsPersonRequestBodyVerification'AdditionalDocument'Front obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "back" (postAccountPersonsPersonRequestBodyVerification'AdditionalDocument'Back obj) GHC.Base.<> (Data.Aeson..=) "front" (postAccountPersonsPersonRequestBodyVerification'AdditionalDocument'Front obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument'" (\obj -> (GHC.Base.pure PostAccountPersonsPersonRequestBodyVerification'AdditionalDocument' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "back")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "front"))

-- | Defines the data type for the schema postAccountPersonsPersonRequestBodyVerification\'Document\'
data PostAccountPersonsPersonRequestBodyVerification'Document'
  = PostAccountPersonsPersonRequestBodyVerification'Document'
      { -- | back
        --
        -- Constraints:
        --
        -- * Maximum length of 500
        postAccountPersonsPersonRequestBodyVerification'Document'Back :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
        -- | front
        --
        -- Constraints:
        --
        -- * Maximum length of 500
        postAccountPersonsPersonRequestBodyVerification'Document'Front :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
      }
  deriving
    ( GHC.Show.Show,
      GHC.Classes.Eq
    )

instance Data.Aeson.ToJSON PostAccountPersonsPersonRequestBodyVerification'Document' where
  toJSON obj = Data.Aeson.object ((Data.Aeson..=) "back" (postAccountPersonsPersonRequestBodyVerification'Document'Back obj) : (Data.Aeson..=) "front" (postAccountPersonsPersonRequestBodyVerification'Document'Front obj) : [])
  toEncoding obj = Data.Aeson.pairs ((Data.Aeson..=) "back" (postAccountPersonsPersonRequestBodyVerification'Document'Back obj) GHC.Base.<> (Data.Aeson..=) "front" (postAccountPersonsPersonRequestBodyVerification'Document'Front obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountPersonsPersonRequestBodyVerification'Document' where
  parseJSON = Data.Aeson.Types.FromJSON.withObject "PostAccountPersonsPersonRequestBodyVerification'Document'" (\obj -> (GHC.Base.pure PostAccountPersonsPersonRequestBodyVerification'Document' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "back")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "front"))

-- | Represents a response of the operation 'postAccountPersonsPerson'.
--
-- 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), 'PostAccountPersonsPersonResponseError' is used.
data PostAccountPersonsPersonResponse
  = -- | Means either no matching case available or a parse error
    PostAccountPersonsPersonResponseError GHC.Base.String
  | -- | Successful response.
    PostAccountPersonsPersonResponse200 Person
  | -- | Error response.
    PostAccountPersonsPersonResponseDefault Error
  deriving (GHC.Show.Show, GHC.Classes.Eq)