{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module RecurlyClient.Types.BusinessEntity 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
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as 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 RecurlyClient.Common
import RecurlyClient.TypeAlias
import {-# SOURCE #-} RecurlyClient.Types.Address
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data BusinessEntity = BusinessEntity
{ BusinessEntity -> Maybe Text
businessEntityCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe JsonDateTime
businessEntityCreated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
, BusinessEntity -> Maybe Text
businessEntityDefault_liability_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe Text
businessEntityDefault_registration_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe Text
businessEntityDefault_revenue_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe Text
businessEntityDefault_vat_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity
-> Maybe BusinessEntityDestination_tax_address_source
businessEntityDestination_tax_address_source :: (GHC.Maybe.Maybe BusinessEntityDestination_tax_address_source)
, BusinessEntity -> Maybe Text
businessEntityId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe Address
businessEntityInvoice_display_address :: (GHC.Maybe.Maybe Address)
, BusinessEntity -> Maybe Text
businessEntityName :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe Text
businessEntityObject :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, BusinessEntity -> Maybe BusinessEntityOrigin_tax_address_source
businessEntityOrigin_tax_address_source :: (GHC.Maybe.Maybe BusinessEntityOrigin_tax_address_source)
, BusinessEntity -> Maybe [Text]
businessEntitySubscriber_location_countries :: (GHC.Maybe.Maybe [Data.Text.Internal.Text])
, BusinessEntity -> Maybe Address
businessEntityTax_address :: (GHC.Maybe.Maybe Address)
, BusinessEntity -> Maybe JsonDateTime
businessEntityUpdated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
}
deriving
( Int -> BusinessEntity -> ShowS
[BusinessEntity] -> ShowS
BusinessEntity -> String
(Int -> BusinessEntity -> ShowS)
-> (BusinessEntity -> String)
-> ([BusinessEntity] -> ShowS)
-> Show BusinessEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BusinessEntity -> ShowS
showsPrec :: Int -> BusinessEntity -> ShowS
$cshow :: BusinessEntity -> String
show :: BusinessEntity -> String
$cshowList :: [BusinessEntity] -> ShowS
showList :: [BusinessEntity] -> ShowS
GHC.Show.Show
, BusinessEntity -> BusinessEntity -> Bool
(BusinessEntity -> BusinessEntity -> Bool)
-> (BusinessEntity -> BusinessEntity -> Bool) -> Eq BusinessEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BusinessEntity -> BusinessEntity -> Bool
== :: BusinessEntity -> BusinessEntity -> Bool
$c/= :: BusinessEntity -> BusinessEntity -> Bool
/= :: BusinessEntity -> BusinessEntity -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON BusinessEntity where
toJSON :: BusinessEntity -> Value
toJSON BusinessEntity
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityCode BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"created_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe JsonDateTime
businessEntityCreated_at BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_liability_gl_account_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_liability_gl_account_id BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_registration_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_registration_number BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_revenue_gl_account_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_revenue_gl_account_id BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_vat_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_vat_number BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (BusinessEntityDestination_tax_address_source -> [Pair])
-> Maybe BusinessEntityDestination_tax_address_source
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (BusinessEntityDestination_tax_address_source -> Pair)
-> BusinessEntityDestination_tax_address_source
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"destination_tax_address_source" Key -> BusinessEntityDestination_tax_address_source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity
-> Maybe BusinessEntityDestination_tax_address_source
businessEntityDestination_tax_address_source BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityId BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Address -> [Pair]) -> Maybe Address -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Address -> Pair) -> Address -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"invoice_display_address" Key -> Address -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Address
businessEntityInvoice_display_address BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"name" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityName BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityObject BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (BusinessEntityOrigin_tax_address_source -> [Pair])
-> Maybe BusinessEntityOrigin_tax_address_source
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (BusinessEntityOrigin_tax_address_source -> Pair)
-> BusinessEntityOrigin_tax_address_source
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin_tax_address_source" Key -> BusinessEntityOrigin_tax_address_source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe BusinessEntityOrigin_tax_address_source
businessEntityOrigin_tax_address_source BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> ([Text] -> [Pair]) -> Maybe [Text] -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> ([Text] -> Pair) -> [Text] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"subscriber_location_countries" Key -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe [Text]
businessEntitySubscriber_location_countries BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Address -> [Pair]) -> Maybe Address -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Address -> Pair) -> Address -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_address" Key -> Address -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Address
businessEntityTax_address BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"updated_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe JsonDateTime
businessEntityUpdated_at BusinessEntity
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
toEncoding :: BusinessEntity -> Encoding
toEncoding BusinessEntity
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityCode BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"created_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe JsonDateTime
businessEntityCreated_at BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_liability_gl_account_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_liability_gl_account_id BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_registration_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_registration_number BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_revenue_gl_account_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_revenue_gl_account_id BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"default_vat_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityDefault_vat_number BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (BusinessEntityDestination_tax_address_source -> [Series])
-> Maybe BusinessEntityDestination_tax_address_source
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (BusinessEntityDestination_tax_address_source -> Series)
-> BusinessEntityDestination_tax_address_source
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"destination_tax_address_source" Key -> BusinessEntityDestination_tax_address_source -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity
-> Maybe BusinessEntityDestination_tax_address_source
businessEntityDestination_tax_address_source BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityId BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Address -> [Series]) -> Maybe Address -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Address -> Series) -> Address -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"invoice_display_address" Key -> Address -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Address
businessEntityInvoice_display_address BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"name" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityName BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Text
businessEntityObject BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (BusinessEntityOrigin_tax_address_source -> [Series])
-> Maybe BusinessEntityOrigin_tax_address_source
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (BusinessEntityOrigin_tax_address_source -> Series)
-> BusinessEntityOrigin_tax_address_source
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin_tax_address_source" Key -> BusinessEntityOrigin_tax_address_source -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe BusinessEntityOrigin_tax_address_source
businessEntityOrigin_tax_address_source BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> ([Text] -> [Series]) -> Maybe [Text] -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> ([Text] -> Series) -> [Text] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"subscriber_location_countries" Key -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe [Text]
businessEntitySubscriber_location_countries BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Address -> [Series]) -> Maybe Address -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Address -> Series) -> Address -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_address" Key -> Address -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe Address
businessEntityTax_address BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"updated_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (BusinessEntity -> Maybe JsonDateTime
businessEntityUpdated_at BusinessEntity
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON BusinessEntity where
parseJSON :: Value -> Parser BusinessEntity
parseJSON = String
-> (Object -> Parser BusinessEntity)
-> Value
-> Parser BusinessEntity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"BusinessEntity" (\Object
obj -> (((((((((((((((Maybe Text
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser
(Maybe Text
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity
BusinessEntity Parser
(Maybe Text
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"code")) Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe JsonDateTime)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"created_at")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"default_liability_gl_account_id")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"default_registration_number")) Parser
(Maybe Text
-> Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"default_revenue_gl_account_id")) Parser
(Maybe Text
-> Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"default_vat_number")) Parser
(Maybe BusinessEntityDestination_tax_address_source
-> Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe BusinessEntityDestination_tax_address_source)
-> Parser
(Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key
-> Parser (Maybe BusinessEntityDestination_tax_address_source)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"destination_tax_address_source")) Parser
(Maybe Text
-> Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"id")) Parser
(Maybe Address
-> Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Address)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Address)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"invoice_display_address")) Parser
(Maybe Text
-> Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"name")) Parser
(Maybe Text
-> Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe Text)
-> Parser
(Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"object")) Parser
(Maybe BusinessEntityOrigin_tax_address_source
-> Maybe [Text]
-> Maybe Address
-> Maybe JsonDateTime
-> BusinessEntity)
-> Parser (Maybe BusinessEntityOrigin_tax_address_source)
-> Parser
(Maybe [Text]
-> Maybe Address -> Maybe JsonDateTime -> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe BusinessEntityOrigin_tax_address_source)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"origin_tax_address_source")) Parser
(Maybe [Text]
-> Maybe Address -> Maybe JsonDateTime -> BusinessEntity)
-> Parser (Maybe [Text])
-> Parser (Maybe Address -> Maybe JsonDateTime -> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"subscriber_location_countries")) Parser (Maybe Address -> Maybe JsonDateTime -> BusinessEntity)
-> Parser (Maybe Address)
-> Parser (Maybe JsonDateTime -> BusinessEntity)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Address)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_address")) Parser (Maybe JsonDateTime -> BusinessEntity)
-> Parser (Maybe JsonDateTime) -> Parser BusinessEntity
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"updated_at"))
mkBusinessEntity :: BusinessEntity
mkBusinessEntity :: BusinessEntity
mkBusinessEntity =
BusinessEntity
{ businessEntityCode :: Maybe Text
businessEntityCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityCreated_at :: Maybe JsonDateTime
businessEntityCreated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityDefault_liability_gl_account_id :: Maybe Text
businessEntityDefault_liability_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityDefault_registration_number :: Maybe Text
businessEntityDefault_registration_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityDefault_revenue_gl_account_id :: Maybe Text
businessEntityDefault_revenue_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityDefault_vat_number :: Maybe Text
businessEntityDefault_vat_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityDestination_tax_address_source :: Maybe BusinessEntityDestination_tax_address_source
businessEntityDestination_tax_address_source = Maybe BusinessEntityDestination_tax_address_source
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityId :: Maybe Text
businessEntityId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityInvoice_display_address :: Maybe Address
businessEntityInvoice_display_address = Maybe Address
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityName :: Maybe Text
businessEntityName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityObject :: Maybe Text
businessEntityObject = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityOrigin_tax_address_source :: Maybe BusinessEntityOrigin_tax_address_source
businessEntityOrigin_tax_address_source = Maybe BusinessEntityOrigin_tax_address_source
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntitySubscriber_location_countries :: Maybe [Text]
businessEntitySubscriber_location_countries = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityTax_address :: Maybe Address
businessEntityTax_address = Maybe Address
forall a. Maybe a
GHC.Maybe.Nothing
, businessEntityUpdated_at :: Maybe JsonDateTime
businessEntityUpdated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
}
data BusinessEntityDestination_tax_address_source
=
BusinessEntityDestination_tax_address_sourceOther Data.Aeson.Types.Internal.Value
|
BusinessEntityDestination_tax_address_sourceTyped Data.Text.Internal.Text
|
BusinessEntityDestination_tax_address_sourceEnumDestination
|
BusinessEntityDestination_tax_address_sourceEnumOrigin
deriving (Int -> BusinessEntityDestination_tax_address_source -> ShowS
[BusinessEntityDestination_tax_address_source] -> ShowS
BusinessEntityDestination_tax_address_source -> String
(Int -> BusinessEntityDestination_tax_address_source -> ShowS)
-> (BusinessEntityDestination_tax_address_source -> String)
-> ([BusinessEntityDestination_tax_address_source] -> ShowS)
-> Show BusinessEntityDestination_tax_address_source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BusinessEntityDestination_tax_address_source -> ShowS
showsPrec :: Int -> BusinessEntityDestination_tax_address_source -> ShowS
$cshow :: BusinessEntityDestination_tax_address_source -> String
show :: BusinessEntityDestination_tax_address_source -> String
$cshowList :: [BusinessEntityDestination_tax_address_source] -> ShowS
showList :: [BusinessEntityDestination_tax_address_source] -> ShowS
GHC.Show.Show, BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool
(BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool)
-> (BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool)
-> Eq BusinessEntityDestination_tax_address_source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool
== :: BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool
$c/= :: BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool
/= :: BusinessEntityDestination_tax_address_source
-> BusinessEntityDestination_tax_address_source -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON BusinessEntityDestination_tax_address_source where
toJSON :: BusinessEntityDestination_tax_address_source -> Value
toJSON (BusinessEntityDestination_tax_address_sourceOther Value
val) = Value
val
toJSON (BusinessEntityDestination_tax_address_sourceTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (BusinessEntityDestination_tax_address_source
BusinessEntityDestination_tax_address_sourceEnumDestination) = Value
"destination"
toJSON (BusinessEntityDestination_tax_address_source
BusinessEntityDestination_tax_address_sourceEnumOrigin) = Value
"origin"
instance Data.Aeson.Types.FromJSON.FromJSON BusinessEntityDestination_tax_address_source where
parseJSON :: Value -> Parser BusinessEntityDestination_tax_address_source
parseJSON Value
val =
BusinessEntityDestination_tax_address_source
-> Parser BusinessEntityDestination_tax_address_source
forall a. a -> Parser a
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
"destination" -> BusinessEntityDestination_tax_address_source
BusinessEntityDestination_tax_address_sourceEnumDestination
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"origin" -> BusinessEntityDestination_tax_address_source
BusinessEntityDestination_tax_address_sourceEnumOrigin
| Bool
GHC.Base.otherwise -> Value -> BusinessEntityDestination_tax_address_source
BusinessEntityDestination_tax_address_sourceOther Value
val
)
data BusinessEntityOrigin_tax_address_source
=
BusinessEntityOrigin_tax_address_sourceOther Data.Aeson.Types.Internal.Value
|
BusinessEntityOrigin_tax_address_sourceTyped Data.Text.Internal.Text
|
BusinessEntityOrigin_tax_address_sourceEnumOrigin
|
BusinessEntityOrigin_tax_address_sourceEnumDestination
deriving (Int -> BusinessEntityOrigin_tax_address_source -> ShowS
[BusinessEntityOrigin_tax_address_source] -> ShowS
BusinessEntityOrigin_tax_address_source -> String
(Int -> BusinessEntityOrigin_tax_address_source -> ShowS)
-> (BusinessEntityOrigin_tax_address_source -> String)
-> ([BusinessEntityOrigin_tax_address_source] -> ShowS)
-> Show BusinessEntityOrigin_tax_address_source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BusinessEntityOrigin_tax_address_source -> ShowS
showsPrec :: Int -> BusinessEntityOrigin_tax_address_source -> ShowS
$cshow :: BusinessEntityOrigin_tax_address_source -> String
show :: BusinessEntityOrigin_tax_address_source -> String
$cshowList :: [BusinessEntityOrigin_tax_address_source] -> ShowS
showList :: [BusinessEntityOrigin_tax_address_source] -> ShowS
GHC.Show.Show, BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool
(BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool)
-> (BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool)
-> Eq BusinessEntityOrigin_tax_address_source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool
== :: BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool
$c/= :: BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool
/= :: BusinessEntityOrigin_tax_address_source
-> BusinessEntityOrigin_tax_address_source -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON BusinessEntityOrigin_tax_address_source where
toJSON :: BusinessEntityOrigin_tax_address_source -> Value
toJSON (BusinessEntityOrigin_tax_address_sourceOther Value
val) = Value
val
toJSON (BusinessEntityOrigin_tax_address_sourceTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (BusinessEntityOrigin_tax_address_source
BusinessEntityOrigin_tax_address_sourceEnumOrigin) = Value
"origin"
toJSON (BusinessEntityOrigin_tax_address_source
BusinessEntityOrigin_tax_address_sourceEnumDestination) = Value
"destination"
instance Data.Aeson.Types.FromJSON.FromJSON BusinessEntityOrigin_tax_address_source where
parseJSON :: Value -> Parser BusinessEntityOrigin_tax_address_source
parseJSON Value
val =
BusinessEntityOrigin_tax_address_source
-> Parser BusinessEntityOrigin_tax_address_source
forall a. a -> Parser a
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
"origin" -> BusinessEntityOrigin_tax_address_source
BusinessEntityOrigin_tax_address_sourceEnumOrigin
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"destination" -> BusinessEntityOrigin_tax_address_source
BusinessEntityOrigin_tax_address_sourceEnumDestination
| Bool
GHC.Base.otherwise -> Value -> BusinessEntityOrigin_tax_address_source
BusinessEntityOrigin_tax_address_sourceOther Value
val
)