{-# 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 AccountUnificationAccountController module StripeAPI.Types.AccountUnificationAccountController 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.Foldable import qualified Data.Functor import qualified Data.Maybe 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 qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.account_unification_account_controller@ in the specification. data AccountUnificationAccountController = AccountUnificationAccountController { -- | is_controller: \`true\` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https:\/\/stripe.com\/docs\/connect\/platform-controls-for-standard-accounts). Otherwise, this field is null. accountUnificationAccountControllerIsController :: (GHC.Maybe.Maybe GHC.Types.Bool), -- | type: The controller type. Can be \`application\`, if a Connect application controls the account, or \`account\`, if the account controls itself. accountUnificationAccountControllerType :: AccountUnificationAccountControllerType' } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON AccountUnificationAccountController where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("is_controller" Data.Aeson.Types.ToJSON..=)) (accountUnificationAccountControllerIsController obj) : ["type" Data.Aeson.Types.ToJSON..= accountUnificationAccountControllerType obj] : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("is_controller" Data.Aeson.Types.ToJSON..=)) (accountUnificationAccountControllerIsController obj) : ["type" Data.Aeson.Types.ToJSON..= accountUnificationAccountControllerType obj] : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON AccountUnificationAccountController where parseJSON = Data.Aeson.Types.FromJSON.withObject "AccountUnificationAccountController" (\obj -> (GHC.Base.pure AccountUnificationAccountController GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "is_controller")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "type")) -- | Create a new 'AccountUnificationAccountController' with all required fields. mkAccountUnificationAccountController :: -- | 'accountUnificationAccountControllerType' AccountUnificationAccountControllerType' -> AccountUnificationAccountController mkAccountUnificationAccountController accountUnificationAccountControllerType = AccountUnificationAccountController { accountUnificationAccountControllerIsController = GHC.Maybe.Nothing, accountUnificationAccountControllerType = accountUnificationAccountControllerType } -- | Defines the enum schema located at @components.schemas.account_unification_account_controller.properties.type@ in the specification. -- -- The controller type. Can be \`application\`, if a Connect application controls the account, or \`account\`, if the account controls itself. data AccountUnificationAccountControllerType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. AccountUnificationAccountControllerType'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. AccountUnificationAccountControllerType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"account"@ AccountUnificationAccountControllerType'EnumAccount | -- | Represents the JSON value @"application"@ AccountUnificationAccountControllerType'EnumApplication deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON AccountUnificationAccountControllerType' where toJSON (AccountUnificationAccountControllerType'Other val) = val toJSON (AccountUnificationAccountControllerType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (AccountUnificationAccountControllerType'EnumAccount) = "account" toJSON (AccountUnificationAccountControllerType'EnumApplication) = "application" instance Data.Aeson.Types.FromJSON.FromJSON AccountUnificationAccountControllerType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "account" -> AccountUnificationAccountControllerType'EnumAccount | val GHC.Classes.== "application" -> AccountUnificationAccountControllerType'EnumApplication | GHC.Base.otherwise -> AccountUnificationAccountControllerType'Other val )