{-# 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 types generated from the schema LegalEntityCompany
module StripeAPI.Types.LegalEntityCompany where

import qualified Control.Monad.Fail
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.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 GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import {-# SOURCE #-} StripeAPI.Types.Address
import {-# SOURCE #-} StripeAPI.Types.LegalEntityCompanyVerification
import {-# SOURCE #-} StripeAPI.Types.LegalEntityCompanyVerificationDocument
import {-# SOURCE #-} StripeAPI.Types.LegalEntityJapanAddress
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.legal_entity_company@ in the specification.
data LegalEntityCompany = LegalEntityCompany
  { -- | address:
    LegalEntityCompany -> Maybe Address
legalEntityCompanyAddress :: (GHC.Maybe.Maybe Address),
    -- | address_kana: The Kana variation of the company\'s primary address (Japan only).
    LegalEntityCompany -> Maybe LegalEntityCompanyAddressKana'
legalEntityCompanyAddressKana :: (GHC.Maybe.Maybe LegalEntityCompanyAddressKana'),
    -- | address_kanji: The Kanji variation of the company\'s primary address (Japan only).
    LegalEntityCompany -> Maybe LegalEntityCompanyAddressKanji'
legalEntityCompanyAddressKanji :: (GHC.Maybe.Maybe LegalEntityCompanyAddressKanji'),
    -- | directors_provided: Whether the company\'s directors have been provided. This Boolean will be \`true\` if you\'ve manually indicated that all directors are provided via [the \`directors_provided\` parameter](https:\/\/stripe.com\/docs\/api\/accounts\/update\#update_account-company-directors_provided).
    LegalEntityCompany -> Maybe Bool
legalEntityCompanyDirectorsProvided :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | executives_provided: Whether the company\'s executives have been provided. This Boolean will be \`true\` if you\'ve manually indicated that all executives are provided via [the \`executives_provided\` parameter](https:\/\/stripe.com\/docs\/api\/accounts\/update\#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided.
    LegalEntityCompany -> Maybe Bool
legalEntityCompanyExecutivesProvided :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | name: The company\'s legal name.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompany -> Maybe Text
legalEntityCompanyName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | name_kana: The Kana variation of the company\'s legal name (Japan only).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompany -> Maybe Text
legalEntityCompanyNameKana :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | name_kanji: The Kanji variation of the company\'s legal name (Japan only).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompany -> Maybe Text
legalEntityCompanyNameKanji :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | owners_provided: Whether the company\'s owners have been provided. This Boolean will be \`true\` if you\'ve manually indicated that all owners are provided via [the \`owners_provided\` parameter](https:\/\/stripe.com\/docs\/api\/accounts\/update\#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the \`percent_ownership\` of each owner together).
    LegalEntityCompany -> Maybe Bool
legalEntityCompanyOwnersProvided :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | phone: The company\'s phone number (used for verification).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompany -> Maybe Text
legalEntityCompanyPhone :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | structure: The category identifying the legal structure of the company or legal entity. See [Business structure](https:\/\/stripe.com\/docs\/connect\/identity-verification\#business-structure) for more details.
    LegalEntityCompany -> Maybe LegalEntityCompanyStructure'
legalEntityCompanyStructure :: (GHC.Maybe.Maybe LegalEntityCompanyStructure'),
    -- | tax_id_provided: Whether the company\'s business ID number was provided.
    LegalEntityCompany -> Maybe Bool
legalEntityCompanyTaxIdProvided :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | tax_id_registrar: The jurisdiction in which the \`tax_id\` is registered (Germany-based companies only).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompany -> Maybe Text
legalEntityCompanyTaxIdRegistrar :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | vat_id_provided: Whether the company\'s business VAT number was provided.
    LegalEntityCompany -> Maybe Bool
legalEntityCompanyVatIdProvided :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | verification: Information on the verification state of the company.
    LegalEntityCompany -> Maybe LegalEntityCompanyVerification'
legalEntityCompanyVerification :: (GHC.Maybe.Maybe LegalEntityCompanyVerification')
  }
  deriving
    ( Int -> LegalEntityCompany -> ShowS
[LegalEntityCompany] -> ShowS
LegalEntityCompany -> String
(Int -> LegalEntityCompany -> ShowS)
-> (LegalEntityCompany -> String)
-> ([LegalEntityCompany] -> ShowS)
-> Show LegalEntityCompany
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LegalEntityCompany] -> ShowS
$cshowList :: [LegalEntityCompany] -> ShowS
show :: LegalEntityCompany -> String
$cshow :: LegalEntityCompany -> String
showsPrec :: Int -> LegalEntityCompany -> ShowS
$cshowsPrec :: Int -> LegalEntityCompany -> ShowS
GHC.Show.Show,
      LegalEntityCompany -> LegalEntityCompany -> Bool
(LegalEntityCompany -> LegalEntityCompany -> Bool)
-> (LegalEntityCompany -> LegalEntityCompany -> Bool)
-> Eq LegalEntityCompany
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LegalEntityCompany -> LegalEntityCompany -> Bool
$c/= :: LegalEntityCompany -> LegalEntityCompany -> Bool
== :: LegalEntityCompany -> LegalEntityCompany -> Bool
$c== :: LegalEntityCompany -> LegalEntityCompany -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON LegalEntityCompany where
  toJSON :: LegalEntityCompany -> Value
toJSON LegalEntityCompany
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"address" Text -> Maybe Address -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Address
legalEntityCompanyAddress LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_kana" Text -> Maybe LegalEntityCompanyAddressKana' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyAddressKana'
legalEntityCompanyAddressKana LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_kanji" Text -> Maybe LegalEntityCompanyAddressKanji' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyAddressKanji'
legalEntityCompanyAddressKanji LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"directors_provided" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyDirectorsProvided LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"executives_provided" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyExecutivesProvided LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyName LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name_kana" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyNameKana LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name_kanji" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyNameKanji LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"owners_provided" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyOwnersProvided LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"phone" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyPhone LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"structure" Text -> Maybe LegalEntityCompanyStructure' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyStructure'
legalEntityCompanyStructure LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_id_provided" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyTaxIdProvided LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_id_registrar" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyTaxIdRegistrar LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"vat_id_provided" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyVatIdProvided LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"verification" Text -> Maybe LegalEntityCompanyVerification' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyVerification'
legalEntityCompanyVerification LegalEntityCompany
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: LegalEntityCompany -> Encoding
toEncoding LegalEntityCompany
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"address" Text -> Maybe Address -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Address
legalEntityCompanyAddress LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_kana" Text -> Maybe LegalEntityCompanyAddressKana' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyAddressKana'
legalEntityCompanyAddressKana LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_kanji" Text -> Maybe LegalEntityCompanyAddressKanji' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyAddressKanji'
legalEntityCompanyAddressKanji LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"directors_provided" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyDirectorsProvided LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"executives_provided" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyExecutivesProvided LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyName LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"name_kana" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyNameKana LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"name_kanji" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyNameKanji LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"owners_provided" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyOwnersProvided LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"phone" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyPhone LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"structure" Text -> Maybe LegalEntityCompanyStructure' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyStructure'
legalEntityCompanyStructure LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tax_id_provided" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyTaxIdProvided LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tax_id_registrar" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Text
legalEntityCompanyTaxIdRegistrar LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"vat_id_provided" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe Bool
legalEntityCompanyVatIdProvided LegalEntityCompany
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"verification" Text -> Maybe LegalEntityCompanyVerification' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompany -> Maybe LegalEntityCompanyVerification'
legalEntityCompanyVerification LegalEntityCompany
obj)))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON LegalEntityCompany where
  parseJSON :: Value -> Parser LegalEntityCompany
parseJSON = String
-> (Object -> Parser LegalEntityCompany)
-> Value
-> Parser LegalEntityCompany
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"LegalEntityCompany" (\Object
obj -> (((((((((((((((Maybe Address
 -> Maybe LegalEntityCompanyAddressKana'
 -> Maybe LegalEntityCompanyAddressKanji'
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe LegalEntityCompanyStructure'
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe LegalEntityCompanyVerification'
 -> LegalEntityCompany)
-> Parser
     (Maybe Address
      -> Maybe LegalEntityCompanyAddressKana'
      -> Maybe LegalEntityCompanyAddressKanji'
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Address
-> Maybe LegalEntityCompanyAddressKana'
-> Maybe LegalEntityCompanyAddressKanji'
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe LegalEntityCompanyStructure'
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe LegalEntityCompanyVerification'
-> LegalEntityCompany
LegalEntityCompany Parser
  (Maybe Address
   -> Maybe LegalEntityCompanyAddressKana'
   -> Maybe LegalEntityCompanyAddressKanji'
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Address)
-> Parser
     (Maybe LegalEntityCompanyAddressKana'
      -> Maybe LegalEntityCompanyAddressKanji'
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Address)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address")) Parser
  (Maybe LegalEntityCompanyAddressKana'
   -> Maybe LegalEntityCompanyAddressKanji'
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe LegalEntityCompanyAddressKana')
-> Parser
     (Maybe LegalEntityCompanyAddressKanji'
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe LegalEntityCompanyAddressKana')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_kana")) Parser
  (Maybe LegalEntityCompanyAddressKanji'
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe LegalEntityCompanyAddressKanji')
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe LegalEntityCompanyAddressKanji')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_kanji")) Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"directors_provided")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"executives_provided")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"name")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"name_kana")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"name_kanji")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"owners_provided")) Parser
  (Maybe Text
   -> Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Text)
-> Parser
     (Maybe LegalEntityCompanyStructure'
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"phone")) Parser
  (Maybe LegalEntityCompanyStructure'
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe LegalEntityCompanyStructure')
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe LegalEntityCompanyStructure')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"structure")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe LegalEntityCompanyVerification'
      -> LegalEntityCompany)
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
"tax_id_provided")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe LegalEntityCompanyVerification'
   -> LegalEntityCompany)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe LegalEntityCompanyVerification' -> LegalEntityCompany)
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
"tax_id_registrar")) Parser
  (Maybe Bool
   -> Maybe LegalEntityCompanyVerification' -> LegalEntityCompany)
-> Parser (Maybe Bool)
-> Parser
     (Maybe LegalEntityCompanyVerification' -> LegalEntityCompany)
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
"vat_id_provided")) Parser
  (Maybe LegalEntityCompanyVerification' -> LegalEntityCompany)
-> Parser (Maybe LegalEntityCompanyVerification')
-> Parser LegalEntityCompany
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe LegalEntityCompanyVerification')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"verification"))

-- | Create a new 'LegalEntityCompany' with all required fields.
mkLegalEntityCompany :: LegalEntityCompany
mkLegalEntityCompany :: LegalEntityCompany
mkLegalEntityCompany =
  LegalEntityCompany :: Maybe Address
-> Maybe LegalEntityCompanyAddressKana'
-> Maybe LegalEntityCompanyAddressKanji'
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe LegalEntityCompanyStructure'
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe LegalEntityCompanyVerification'
-> LegalEntityCompany
LegalEntityCompany
    { legalEntityCompanyAddress :: Maybe Address
legalEntityCompanyAddress = Maybe Address
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana :: Maybe LegalEntityCompanyAddressKana'
legalEntityCompanyAddressKana = Maybe LegalEntityCompanyAddressKana'
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji :: Maybe LegalEntityCompanyAddressKanji'
legalEntityCompanyAddressKanji = Maybe LegalEntityCompanyAddressKanji'
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyDirectorsProvided :: Maybe Bool
legalEntityCompanyDirectorsProvided = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyExecutivesProvided :: Maybe Bool
legalEntityCompanyExecutivesProvided = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyName :: Maybe Text
legalEntityCompanyName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyNameKana :: Maybe Text
legalEntityCompanyNameKana = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyNameKanji :: Maybe Text
legalEntityCompanyNameKanji = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyOwnersProvided :: Maybe Bool
legalEntityCompanyOwnersProvided = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyPhone :: Maybe Text
legalEntityCompanyPhone = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyStructure :: Maybe LegalEntityCompanyStructure'
legalEntityCompanyStructure = Maybe LegalEntityCompanyStructure'
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyTaxIdProvided :: Maybe Bool
legalEntityCompanyTaxIdProvided = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyTaxIdRegistrar :: Maybe Text
legalEntityCompanyTaxIdRegistrar = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyVatIdProvided :: Maybe Bool
legalEntityCompanyVatIdProvided = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyVerification :: Maybe LegalEntityCompanyVerification'
legalEntityCompanyVerification = Maybe LegalEntityCompanyVerification'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.legal_entity_company.properties.address_kana.anyOf@ in the specification.
--
-- The Kana variation of the company\\\'s primary address (Japan only).
data LegalEntityCompanyAddressKana' = LegalEntityCompanyAddressKana'
  { -- | city: City\/Ward.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | 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
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line1: Block\/Building number.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line2: Building details.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | postal_code: ZIP or postal code.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | state: Prefecture.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | town: Town\/cho-me.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Town :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> LegalEntityCompanyAddressKana' -> ShowS
[LegalEntityCompanyAddressKana'] -> ShowS
LegalEntityCompanyAddressKana' -> String
(Int -> LegalEntityCompanyAddressKana' -> ShowS)
-> (LegalEntityCompanyAddressKana' -> String)
-> ([LegalEntityCompanyAddressKana'] -> ShowS)
-> Show LegalEntityCompanyAddressKana'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LegalEntityCompanyAddressKana'] -> ShowS
$cshowList :: [LegalEntityCompanyAddressKana'] -> ShowS
show :: LegalEntityCompanyAddressKana' -> String
$cshow :: LegalEntityCompanyAddressKana' -> String
showsPrec :: Int -> LegalEntityCompanyAddressKana' -> ShowS
$cshowsPrec :: Int -> LegalEntityCompanyAddressKana' -> ShowS
GHC.Show.Show,
      LegalEntityCompanyAddressKana'
-> LegalEntityCompanyAddressKana' -> Bool
(LegalEntityCompanyAddressKana'
 -> LegalEntityCompanyAddressKana' -> Bool)
-> (LegalEntityCompanyAddressKana'
    -> LegalEntityCompanyAddressKana' -> Bool)
-> Eq LegalEntityCompanyAddressKana'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LegalEntityCompanyAddressKana'
-> LegalEntityCompanyAddressKana' -> Bool
$c/= :: LegalEntityCompanyAddressKana'
-> LegalEntityCompanyAddressKana' -> Bool
== :: LegalEntityCompanyAddressKana'
-> LegalEntityCompanyAddressKana' -> Bool
$c== :: LegalEntityCompanyAddressKana'
-> LegalEntityCompanyAddressKana' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON LegalEntityCompanyAddressKana' where
  toJSON :: LegalEntityCompanyAddressKana' -> Value
toJSON LegalEntityCompanyAddressKana'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"city" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'City LegalEntityCompanyAddressKana'
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..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Country LegalEntityCompanyAddressKana'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"line1" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Line1 LegalEntityCompanyAddressKana'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"line2" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Line2 LegalEntityCompanyAddressKana'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"postal_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'PostalCode LegalEntityCompanyAddressKana'
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..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'State LegalEntityCompanyAddressKana'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"town" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Town LegalEntityCompanyAddressKana'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: LegalEntityCompanyAddressKana' -> Encoding
toEncoding LegalEntityCompanyAddressKana'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"city" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'City LegalEntityCompanyAddressKana'
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..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Country LegalEntityCompanyAddressKana'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"line1" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Line1 LegalEntityCompanyAddressKana'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"line2" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Line2 LegalEntityCompanyAddressKana'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"postal_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'PostalCode LegalEntityCompanyAddressKana'
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..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'State LegalEntityCompanyAddressKana'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"town" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKana' -> Maybe Text
legalEntityCompanyAddressKana'Town LegalEntityCompanyAddressKana'
obj)))))))

instance Data.Aeson.Types.FromJSON.FromJSON LegalEntityCompanyAddressKana' where
  parseJSON :: Value -> Parser LegalEntityCompanyAddressKana'
parseJSON = String
-> (Object -> Parser LegalEntityCompanyAddressKana')
-> Value
-> Parser LegalEntityCompanyAddressKana'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"LegalEntityCompanyAddressKana'" (\Object
obj -> (((((((Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> LegalEntityCompanyAddressKana')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKana')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LegalEntityCompanyAddressKana'
LegalEntityCompanyAddressKana' Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKana')
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
"city")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKana')
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 Text
   -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKana')
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
"line1")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKana')
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
"line2")) Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKana')
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
"postal_code")) Parser (Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LegalEntityCompanyAddressKana')
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 Text -> LegalEntityCompanyAddressKana')
-> Parser (Maybe Text) -> Parser LegalEntityCompanyAddressKana'
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
"town"))

-- | Create a new 'LegalEntityCompanyAddressKana'' with all required fields.
mkLegalEntityCompanyAddressKana' :: LegalEntityCompanyAddressKana'
mkLegalEntityCompanyAddressKana' :: LegalEntityCompanyAddressKana'
mkLegalEntityCompanyAddressKana' =
  LegalEntityCompanyAddressKana' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LegalEntityCompanyAddressKana'
LegalEntityCompanyAddressKana'
    { legalEntityCompanyAddressKana'City :: Maybe Text
legalEntityCompanyAddressKana'City = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana'Country :: Maybe Text
legalEntityCompanyAddressKana'Country = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana'Line1 :: Maybe Text
legalEntityCompanyAddressKana'Line1 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana'Line2 :: Maybe Text
legalEntityCompanyAddressKana'Line2 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana'PostalCode :: Maybe Text
legalEntityCompanyAddressKana'PostalCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana'State :: Maybe Text
legalEntityCompanyAddressKana'State = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKana'Town :: Maybe Text
legalEntityCompanyAddressKana'Town = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.legal_entity_company.properties.address_kanji.anyOf@ in the specification.
--
-- The Kanji variation of the company\\\'s primary address (Japan only).
data LegalEntityCompanyAddressKanji' = LegalEntityCompanyAddressKanji'
  { -- | city: City\/Ward.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | 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
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line1: Block\/Building number.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line2: Building details.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | postal_code: ZIP or postal code.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | state: Prefecture.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | town: Town\/cho-me.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Town :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> LegalEntityCompanyAddressKanji' -> ShowS
[LegalEntityCompanyAddressKanji'] -> ShowS
LegalEntityCompanyAddressKanji' -> String
(Int -> LegalEntityCompanyAddressKanji' -> ShowS)
-> (LegalEntityCompanyAddressKanji' -> String)
-> ([LegalEntityCompanyAddressKanji'] -> ShowS)
-> Show LegalEntityCompanyAddressKanji'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LegalEntityCompanyAddressKanji'] -> ShowS
$cshowList :: [LegalEntityCompanyAddressKanji'] -> ShowS
show :: LegalEntityCompanyAddressKanji' -> String
$cshow :: LegalEntityCompanyAddressKanji' -> String
showsPrec :: Int -> LegalEntityCompanyAddressKanji' -> ShowS
$cshowsPrec :: Int -> LegalEntityCompanyAddressKanji' -> ShowS
GHC.Show.Show,
      LegalEntityCompanyAddressKanji'
-> LegalEntityCompanyAddressKanji' -> Bool
(LegalEntityCompanyAddressKanji'
 -> LegalEntityCompanyAddressKanji' -> Bool)
-> (LegalEntityCompanyAddressKanji'
    -> LegalEntityCompanyAddressKanji' -> Bool)
-> Eq LegalEntityCompanyAddressKanji'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LegalEntityCompanyAddressKanji'
-> LegalEntityCompanyAddressKanji' -> Bool
$c/= :: LegalEntityCompanyAddressKanji'
-> LegalEntityCompanyAddressKanji' -> Bool
== :: LegalEntityCompanyAddressKanji'
-> LegalEntityCompanyAddressKanji' -> Bool
$c== :: LegalEntityCompanyAddressKanji'
-> LegalEntityCompanyAddressKanji' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON LegalEntityCompanyAddressKanji' where
  toJSON :: LegalEntityCompanyAddressKanji' -> Value
toJSON LegalEntityCompanyAddressKanji'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"city" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'City LegalEntityCompanyAddressKanji'
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..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Country LegalEntityCompanyAddressKanji'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"line1" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Line1 LegalEntityCompanyAddressKanji'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"line2" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Line2 LegalEntityCompanyAddressKanji'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"postal_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'PostalCode LegalEntityCompanyAddressKanji'
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..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'State LegalEntityCompanyAddressKanji'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"town" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Town LegalEntityCompanyAddressKanji'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: LegalEntityCompanyAddressKanji' -> Encoding
toEncoding LegalEntityCompanyAddressKanji'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"city" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'City LegalEntityCompanyAddressKanji'
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..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Country LegalEntityCompanyAddressKanji'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"line1" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Line1 LegalEntityCompanyAddressKanji'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"line2" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Line2 LegalEntityCompanyAddressKanji'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"postal_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'PostalCode LegalEntityCompanyAddressKanji'
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..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'State LegalEntityCompanyAddressKanji'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"town" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyAddressKanji' -> Maybe Text
legalEntityCompanyAddressKanji'Town LegalEntityCompanyAddressKanji'
obj)))))))

instance Data.Aeson.Types.FromJSON.FromJSON LegalEntityCompanyAddressKanji' where
  parseJSON :: Value -> Parser LegalEntityCompanyAddressKanji'
parseJSON = String
-> (Object -> Parser LegalEntityCompanyAddressKanji')
-> Value
-> Parser LegalEntityCompanyAddressKanji'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"LegalEntityCompanyAddressKanji'" (\Object
obj -> (((((((Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> LegalEntityCompanyAddressKanji')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKanji')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LegalEntityCompanyAddressKanji'
LegalEntityCompanyAddressKanji' Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKanji')
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
"city")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKanji')
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 Text
   -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> LegalEntityCompanyAddressKanji')
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
"line1")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKanji')
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
"line2")) Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKanji')
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
"postal_code")) Parser
  (Maybe Text -> Maybe Text -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LegalEntityCompanyAddressKanji')
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 Text -> LegalEntityCompanyAddressKanji')
-> Parser (Maybe Text) -> Parser LegalEntityCompanyAddressKanji'
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
"town"))

-- | Create a new 'LegalEntityCompanyAddressKanji'' with all required fields.
mkLegalEntityCompanyAddressKanji' :: LegalEntityCompanyAddressKanji'
mkLegalEntityCompanyAddressKanji' :: LegalEntityCompanyAddressKanji'
mkLegalEntityCompanyAddressKanji' =
  LegalEntityCompanyAddressKanji' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> LegalEntityCompanyAddressKanji'
LegalEntityCompanyAddressKanji'
    { legalEntityCompanyAddressKanji'City :: Maybe Text
legalEntityCompanyAddressKanji'City = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji'Country :: Maybe Text
legalEntityCompanyAddressKanji'Country = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji'Line1 :: Maybe Text
legalEntityCompanyAddressKanji'Line1 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji'Line2 :: Maybe Text
legalEntityCompanyAddressKanji'Line2 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji'PostalCode :: Maybe Text
legalEntityCompanyAddressKanji'PostalCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji'State :: Maybe Text
legalEntityCompanyAddressKanji'State = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      legalEntityCompanyAddressKanji'Town :: Maybe Text
legalEntityCompanyAddressKanji'Town = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.legal_entity_company.properties.structure@ in the specification.
--
-- The category identifying the legal structure of the company or legal entity. See [Business structure](https:\/\/stripe.com\/docs\/connect\/identity-verification\#business-structure) for more details.
data LegalEntityCompanyStructure'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    LegalEntityCompanyStructure'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.
    LegalEntityCompanyStructure'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"free_zone_establishment"@
    LegalEntityCompanyStructure'EnumFreeZoneEstablishment
  | -- | Represents the JSON value @"free_zone_llc"@
    LegalEntityCompanyStructure'EnumFreeZoneLlc
  | -- | Represents the JSON value @"government_instrumentality"@
    LegalEntityCompanyStructure'EnumGovernmentInstrumentality
  | -- | Represents the JSON value @"governmental_unit"@
    LegalEntityCompanyStructure'EnumGovernmentalUnit
  | -- | Represents the JSON value @"incorporated_non_profit"@
    LegalEntityCompanyStructure'EnumIncorporatedNonProfit
  | -- | Represents the JSON value @"limited_liability_partnership"@
    LegalEntityCompanyStructure'EnumLimitedLiabilityPartnership
  | -- | Represents the JSON value @"llc"@
    LegalEntityCompanyStructure'EnumLlc
  | -- | Represents the JSON value @"multi_member_llc"@
    LegalEntityCompanyStructure'EnumMultiMemberLlc
  | -- | Represents the JSON value @"private_company"@
    LegalEntityCompanyStructure'EnumPrivateCompany
  | -- | Represents the JSON value @"private_corporation"@
    LegalEntityCompanyStructure'EnumPrivateCorporation
  | -- | Represents the JSON value @"private_partnership"@
    LegalEntityCompanyStructure'EnumPrivatePartnership
  | -- | Represents the JSON value @"public_company"@
    LegalEntityCompanyStructure'EnumPublicCompany
  | -- | Represents the JSON value @"public_corporation"@
    LegalEntityCompanyStructure'EnumPublicCorporation
  | -- | Represents the JSON value @"public_partnership"@
    LegalEntityCompanyStructure'EnumPublicPartnership
  | -- | Represents the JSON value @"single_member_llc"@
    LegalEntityCompanyStructure'EnumSingleMemberLlc
  | -- | Represents the JSON value @"sole_establishment"@
    LegalEntityCompanyStructure'EnumSoleEstablishment
  | -- | Represents the JSON value @"sole_proprietorship"@
    LegalEntityCompanyStructure'EnumSoleProprietorship
  | -- | Represents the JSON value @"tax_exempt_government_instrumentality"@
    LegalEntityCompanyStructure'EnumTaxExemptGovernmentInstrumentality
  | -- | Represents the JSON value @"unincorporated_association"@
    LegalEntityCompanyStructure'EnumUnincorporatedAssociation
  | -- | Represents the JSON value @"unincorporated_non_profit"@
    LegalEntityCompanyStructure'EnumUnincorporatedNonProfit
  deriving (Int -> LegalEntityCompanyStructure' -> ShowS
[LegalEntityCompanyStructure'] -> ShowS
LegalEntityCompanyStructure' -> String
(Int -> LegalEntityCompanyStructure' -> ShowS)
-> (LegalEntityCompanyStructure' -> String)
-> ([LegalEntityCompanyStructure'] -> ShowS)
-> Show LegalEntityCompanyStructure'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LegalEntityCompanyStructure'] -> ShowS
$cshowList :: [LegalEntityCompanyStructure'] -> ShowS
show :: LegalEntityCompanyStructure' -> String
$cshow :: LegalEntityCompanyStructure' -> String
showsPrec :: Int -> LegalEntityCompanyStructure' -> ShowS
$cshowsPrec :: Int -> LegalEntityCompanyStructure' -> ShowS
GHC.Show.Show, LegalEntityCompanyStructure'
-> LegalEntityCompanyStructure' -> Bool
(LegalEntityCompanyStructure'
 -> LegalEntityCompanyStructure' -> Bool)
-> (LegalEntityCompanyStructure'
    -> LegalEntityCompanyStructure' -> Bool)
-> Eq LegalEntityCompanyStructure'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LegalEntityCompanyStructure'
-> LegalEntityCompanyStructure' -> Bool
$c/= :: LegalEntityCompanyStructure'
-> LegalEntityCompanyStructure' -> Bool
== :: LegalEntityCompanyStructure'
-> LegalEntityCompanyStructure' -> Bool
$c== :: LegalEntityCompanyStructure'
-> LegalEntityCompanyStructure' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON LegalEntityCompanyStructure' where
  toJSON :: LegalEntityCompanyStructure' -> Value
toJSON (LegalEntityCompanyStructure'Other Value
val) = Value
val
  toJSON (LegalEntityCompanyStructure'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumFreeZoneEstablishment) = Value
"free_zone_establishment"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumFreeZoneLlc) = Value
"free_zone_llc"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumGovernmentInstrumentality) = Value
"government_instrumentality"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumGovernmentalUnit) = Value
"governmental_unit"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumIncorporatedNonProfit) = Value
"incorporated_non_profit"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumLimitedLiabilityPartnership) = Value
"limited_liability_partnership"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumLlc) = Value
"llc"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumMultiMemberLlc) = Value
"multi_member_llc"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPrivateCompany) = Value
"private_company"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPrivateCorporation) = Value
"private_corporation"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPrivatePartnership) = Value
"private_partnership"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPublicCompany) = Value
"public_company"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPublicCorporation) = Value
"public_corporation"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPublicPartnership) = Value
"public_partnership"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumSingleMemberLlc) = Value
"single_member_llc"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumSoleEstablishment) = Value
"sole_establishment"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumSoleProprietorship) = Value
"sole_proprietorship"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumTaxExemptGovernmentInstrumentality) = Value
"tax_exempt_government_instrumentality"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumUnincorporatedAssociation) = Value
"unincorporated_association"
  toJSON (LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumUnincorporatedNonProfit) = Value
"unincorporated_non_profit"

instance Data.Aeson.Types.FromJSON.FromJSON LegalEntityCompanyStructure' where
  parseJSON :: Value -> Parser LegalEntityCompanyStructure'
parseJSON Value
val =
    LegalEntityCompanyStructure' -> Parser LegalEntityCompanyStructure'
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
"free_zone_establishment" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumFreeZoneEstablishment
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"free_zone_llc" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumFreeZoneLlc
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"government_instrumentality" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumGovernmentInstrumentality
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"governmental_unit" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumGovernmentalUnit
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"incorporated_non_profit" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumIncorporatedNonProfit
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"limited_liability_partnership" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumLimitedLiabilityPartnership
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"llc" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumLlc
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"multi_member_llc" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumMultiMemberLlc
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"private_company" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPrivateCompany
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"private_corporation" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPrivateCorporation
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"private_partnership" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPrivatePartnership
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"public_company" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPublicCompany
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"public_corporation" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPublicCorporation
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"public_partnership" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumPublicPartnership
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"single_member_llc" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumSingleMemberLlc
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sole_establishment" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumSoleEstablishment
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sole_proprietorship" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumSoleProprietorship
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"tax_exempt_government_instrumentality" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumTaxExemptGovernmentInstrumentality
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unincorporated_association" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumUnincorporatedAssociation
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unincorporated_non_profit" -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'EnumUnincorporatedNonProfit
            | Bool
GHC.Base.otherwise -> Value -> LegalEntityCompanyStructure'
LegalEntityCompanyStructure'Other Value
val
      )

-- | Defines the object schema located at @components.schemas.legal_entity_company.properties.verification.anyOf@ in the specification.
--
-- Information on the verification state of the company.
data LegalEntityCompanyVerification' = LegalEntityCompanyVerification'
  { -- | document:
    LegalEntityCompanyVerification'
-> Maybe LegalEntityCompanyVerificationDocument
legalEntityCompanyVerification'Document :: (GHC.Maybe.Maybe LegalEntityCompanyVerificationDocument)
  }
  deriving
    ( Int -> LegalEntityCompanyVerification' -> ShowS
[LegalEntityCompanyVerification'] -> ShowS
LegalEntityCompanyVerification' -> String
(Int -> LegalEntityCompanyVerification' -> ShowS)
-> (LegalEntityCompanyVerification' -> String)
-> ([LegalEntityCompanyVerification'] -> ShowS)
-> Show LegalEntityCompanyVerification'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LegalEntityCompanyVerification'] -> ShowS
$cshowList :: [LegalEntityCompanyVerification'] -> ShowS
show :: LegalEntityCompanyVerification' -> String
$cshow :: LegalEntityCompanyVerification' -> String
showsPrec :: Int -> LegalEntityCompanyVerification' -> ShowS
$cshowsPrec :: Int -> LegalEntityCompanyVerification' -> ShowS
GHC.Show.Show,
      LegalEntityCompanyVerification'
-> LegalEntityCompanyVerification' -> Bool
(LegalEntityCompanyVerification'
 -> LegalEntityCompanyVerification' -> Bool)
-> (LegalEntityCompanyVerification'
    -> LegalEntityCompanyVerification' -> Bool)
-> Eq LegalEntityCompanyVerification'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LegalEntityCompanyVerification'
-> LegalEntityCompanyVerification' -> Bool
$c/= :: LegalEntityCompanyVerification'
-> LegalEntityCompanyVerification' -> Bool
== :: LegalEntityCompanyVerification'
-> LegalEntityCompanyVerification' -> Bool
$c== :: LegalEntityCompanyVerification'
-> LegalEntityCompanyVerification' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON LegalEntityCompanyVerification' where
  toJSON :: LegalEntityCompanyVerification' -> Value
toJSON LegalEntityCompanyVerification'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"document" Text -> Maybe LegalEntityCompanyVerificationDocument -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyVerification'
-> Maybe LegalEntityCompanyVerificationDocument
legalEntityCompanyVerification'Document LegalEntityCompanyVerification'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: LegalEntityCompanyVerification' -> Encoding
toEncoding LegalEntityCompanyVerification'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs (Text
"document" Text -> Maybe LegalEntityCompanyVerificationDocument -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= LegalEntityCompanyVerification'
-> Maybe LegalEntityCompanyVerificationDocument
legalEntityCompanyVerification'Document LegalEntityCompanyVerification'
obj)

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

-- | Create a new 'LegalEntityCompanyVerification'' with all required fields.
mkLegalEntityCompanyVerification' :: LegalEntityCompanyVerification'
mkLegalEntityCompanyVerification' :: LegalEntityCompanyVerification'
mkLegalEntityCompanyVerification' = LegalEntityCompanyVerification' :: Maybe LegalEntityCompanyVerificationDocument
-> LegalEntityCompanyVerification'
LegalEntityCompanyVerification' {legalEntityCompanyVerification'Document :: Maybe LegalEntityCompanyVerificationDocument
legalEntityCompanyVerification'Document = Maybe LegalEntityCompanyVerificationDocument
forall a. Maybe a
GHC.Maybe.Nothing}