{-# 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 AccountBusinessProfile
module StripeAPI.Types.AccountBusinessProfile 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 qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.account_business_profile@ in the specification.
data AccountBusinessProfile = AccountBusinessProfile
  { -- | mcc: [The merchant category code for the account](https:\/\/stripe.com\/docs\/connect\/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileMcc :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | name: The customer-facing business name.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | product_description: Internal-only description of the product sold or service provided by the business. It\'s used by Stripe for risk and underwriting purposes.
    --
    -- Constraints:
    --
    -- * Maximum length of 40000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileProductDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | support_address: A publicly available mailing address for sending support issues to.
    AccountBusinessProfile
-> Maybe AccountBusinessProfileSupportAddress'
accountBusinessProfileSupportAddress :: (GHC.Maybe.Maybe AccountBusinessProfileSupportAddress'),
    -- | support_email: A publicly available email address for sending support issues to.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | support_phone: A publicly available phone number to call with support issues.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportPhone :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | support_url: A publicly available website for handling support issues.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportUrl :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | url: The business\'s publicly available website.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfile -> Maybe Text
accountBusinessProfileUrl :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> AccountBusinessProfile -> ShowS
[AccountBusinessProfile] -> ShowS
AccountBusinessProfile -> String
(Int -> AccountBusinessProfile -> ShowS)
-> (AccountBusinessProfile -> String)
-> ([AccountBusinessProfile] -> ShowS)
-> Show AccountBusinessProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountBusinessProfile] -> ShowS
$cshowList :: [AccountBusinessProfile] -> ShowS
show :: AccountBusinessProfile -> String
$cshow :: AccountBusinessProfile -> String
showsPrec :: Int -> AccountBusinessProfile -> ShowS
$cshowsPrec :: Int -> AccountBusinessProfile -> ShowS
GHC.Show.Show,
      AccountBusinessProfile -> AccountBusinessProfile -> Bool
(AccountBusinessProfile -> AccountBusinessProfile -> Bool)
-> (AccountBusinessProfile -> AccountBusinessProfile -> Bool)
-> Eq AccountBusinessProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountBusinessProfile -> AccountBusinessProfile -> Bool
$c/= :: AccountBusinessProfile -> AccountBusinessProfile -> Bool
== :: AccountBusinessProfile -> AccountBusinessProfile -> Bool
$c== :: AccountBusinessProfile -> AccountBusinessProfile -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON AccountBusinessProfile where
  toJSON :: AccountBusinessProfile -> Value
toJSON AccountBusinessProfile
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"mcc" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileMcc AccountBusinessProfile
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..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileName AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"product_description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileProductDescription AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"support_address" Text -> Maybe AccountBusinessProfileSupportAddress' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile
-> Maybe AccountBusinessProfileSupportAddress'
accountBusinessProfileSupportAddress AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"support_email" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportEmail AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"support_phone" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportPhone AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"support_url" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportUrl AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"url" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileUrl AccountBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: AccountBusinessProfile -> Encoding
toEncoding AccountBusinessProfile
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"mcc" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileMcc AccountBusinessProfile
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..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileName AccountBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"product_description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileProductDescription AccountBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"support_address" Text -> Maybe AccountBusinessProfileSupportAddress' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile
-> Maybe AccountBusinessProfileSupportAddress'
accountBusinessProfileSupportAddress AccountBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"support_email" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportEmail AccountBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"support_phone" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportPhone AccountBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"support_url" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileSupportUrl AccountBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"url" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountBusinessProfile -> Maybe Text
accountBusinessProfileUrl AccountBusinessProfile
obj))))))))

instance Data.Aeson.Types.FromJSON.FromJSON AccountBusinessProfile where
  parseJSON :: Value -> Parser AccountBusinessProfile
parseJSON = String
-> (Object -> Parser AccountBusinessProfile)
-> Value
-> Parser AccountBusinessProfile
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AccountBusinessProfile" (\Object
obj -> ((((((((Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AccountBusinessProfileSupportAddress'
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AccountBusinessProfile)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountBusinessProfileSupportAddress'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AccountBusinessProfile)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AccountBusinessProfileSupportAddress'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AccountBusinessProfile
AccountBusinessProfile Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountBusinessProfileSupportAddress'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AccountBusinessProfile)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AccountBusinessProfileSupportAddress'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AccountBusinessProfile)
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
"mcc")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AccountBusinessProfileSupportAddress'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AccountBusinessProfile)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AccountBusinessProfileSupportAddress'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AccountBusinessProfile)
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 AccountBusinessProfileSupportAddress'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AccountBusinessProfile)
-> Parser (Maybe Text)
-> Parser
     (Maybe AccountBusinessProfileSupportAddress'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AccountBusinessProfile)
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
"product_description")) Parser
  (Maybe AccountBusinessProfileSupportAddress'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AccountBusinessProfile)
-> Parser (Maybe AccountBusinessProfileSupportAddress')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AccountBusinessProfile)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe AccountBusinessProfileSupportAddress')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"support_address")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AccountBusinessProfile)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> AccountBusinessProfile)
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
"support_email")) Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> AccountBusinessProfile)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AccountBusinessProfile)
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
"support_phone")) Parser (Maybe Text -> Maybe Text -> AccountBusinessProfile)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AccountBusinessProfile)
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
"support_url")) Parser (Maybe Text -> AccountBusinessProfile)
-> Parser (Maybe Text) -> Parser AccountBusinessProfile
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
"url"))

-- | Create a new 'AccountBusinessProfile' with all required fields.
mkAccountBusinessProfile :: AccountBusinessProfile
mkAccountBusinessProfile :: AccountBusinessProfile
mkAccountBusinessProfile =
  AccountBusinessProfile :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AccountBusinessProfileSupportAddress'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AccountBusinessProfile
AccountBusinessProfile
    { accountBusinessProfileMcc :: Maybe Text
accountBusinessProfileMcc = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileName :: Maybe Text
accountBusinessProfileName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileProductDescription :: Maybe Text
accountBusinessProfileProductDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileSupportAddress :: Maybe AccountBusinessProfileSupportAddress'
accountBusinessProfileSupportAddress = Maybe AccountBusinessProfileSupportAddress'
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileSupportEmail :: Maybe Text
accountBusinessProfileSupportEmail = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileSupportPhone :: Maybe Text
accountBusinessProfileSupportPhone = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileSupportUrl :: Maybe Text
accountBusinessProfileSupportUrl = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      accountBusinessProfileUrl :: Maybe Text
accountBusinessProfileUrl = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.account_business_profile.properties.support_address.anyOf@ in the specification.
--
-- A publicly available mailing address for sending support issues to.
data AccountBusinessProfileSupportAddress' = AccountBusinessProfileSupportAddress'
  { -- | city: City, district, suburb, town, or village.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'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
    AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line1: Address line 1 (e.g., street, PO Box, or company name).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line2: Address line 2 (e.g., apartment, suite, unit, or building).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | postal_code: ZIP or postal code.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | state: State, county, province, or region.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> AccountBusinessProfileSupportAddress' -> ShowS
[AccountBusinessProfileSupportAddress'] -> ShowS
AccountBusinessProfileSupportAddress' -> String
(Int -> AccountBusinessProfileSupportAddress' -> ShowS)
-> (AccountBusinessProfileSupportAddress' -> String)
-> ([AccountBusinessProfileSupportAddress'] -> ShowS)
-> Show AccountBusinessProfileSupportAddress'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountBusinessProfileSupportAddress'] -> ShowS
$cshowList :: [AccountBusinessProfileSupportAddress'] -> ShowS
show :: AccountBusinessProfileSupportAddress' -> String
$cshow :: AccountBusinessProfileSupportAddress' -> String
showsPrec :: Int -> AccountBusinessProfileSupportAddress' -> ShowS
$cshowsPrec :: Int -> AccountBusinessProfileSupportAddress' -> ShowS
GHC.Show.Show,
      AccountBusinessProfileSupportAddress'
-> AccountBusinessProfileSupportAddress' -> Bool
(AccountBusinessProfileSupportAddress'
 -> AccountBusinessProfileSupportAddress' -> Bool)
-> (AccountBusinessProfileSupportAddress'
    -> AccountBusinessProfileSupportAddress' -> Bool)
-> Eq AccountBusinessProfileSupportAddress'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountBusinessProfileSupportAddress'
-> AccountBusinessProfileSupportAddress' -> Bool
$c/= :: AccountBusinessProfileSupportAddress'
-> AccountBusinessProfileSupportAddress' -> Bool
== :: AccountBusinessProfileSupportAddress'
-> AccountBusinessProfileSupportAddress' -> Bool
$c== :: AccountBusinessProfileSupportAddress'
-> AccountBusinessProfileSupportAddress' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON AccountBusinessProfileSupportAddress' where
  toJSON :: AccountBusinessProfileSupportAddress' -> Value
toJSON AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'City AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Country AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Line1 AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Line2 AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'PostalCode AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'State AccountBusinessProfileSupportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: AccountBusinessProfileSupportAddress' -> Encoding
toEncoding AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'City AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Country AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Line1 AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'Line2 AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'PostalCode AccountBusinessProfileSupportAddress'
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..= AccountBusinessProfileSupportAddress' -> Maybe Text
accountBusinessProfileSupportAddress'State AccountBusinessProfileSupportAddress'
obj))))))

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

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