{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.PortalBusinessProfile 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 qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data PortalBusinessProfile = PortalBusinessProfile
{
PortalBusinessProfile -> Maybe Text
portalBusinessProfileHeadline :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PortalBusinessProfile -> Text
portalBusinessProfilePrivacyPolicyUrl :: Data.Text.Internal.Text,
PortalBusinessProfile -> Text
portalBusinessProfileTermsOfServiceUrl :: Data.Text.Internal.Text
}
deriving
( Int -> PortalBusinessProfile -> ShowS
[PortalBusinessProfile] -> ShowS
PortalBusinessProfile -> String
(Int -> PortalBusinessProfile -> ShowS)
-> (PortalBusinessProfile -> String)
-> ([PortalBusinessProfile] -> ShowS)
-> Show PortalBusinessProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PortalBusinessProfile] -> ShowS
$cshowList :: [PortalBusinessProfile] -> ShowS
show :: PortalBusinessProfile -> String
$cshow :: PortalBusinessProfile -> String
showsPrec :: Int -> PortalBusinessProfile -> ShowS
$cshowsPrec :: Int -> PortalBusinessProfile -> ShowS
GHC.Show.Show,
PortalBusinessProfile -> PortalBusinessProfile -> Bool
(PortalBusinessProfile -> PortalBusinessProfile -> Bool)
-> (PortalBusinessProfile -> PortalBusinessProfile -> Bool)
-> Eq PortalBusinessProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PortalBusinessProfile -> PortalBusinessProfile -> Bool
$c/= :: PortalBusinessProfile -> PortalBusinessProfile -> Bool
== :: PortalBusinessProfile -> PortalBusinessProfile -> Bool
$c== :: PortalBusinessProfile -> PortalBusinessProfile -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PortalBusinessProfile where
toJSON :: PortalBusinessProfile -> Value
toJSON PortalBusinessProfile
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"headline" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PortalBusinessProfile -> Maybe Text
portalBusinessProfileHeadline PortalBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"privacy_policy_url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PortalBusinessProfile -> Text
portalBusinessProfilePrivacyPolicyUrl PortalBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"terms_of_service_url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PortalBusinessProfile -> Text
portalBusinessProfileTermsOfServiceUrl PortalBusinessProfile
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PortalBusinessProfile -> Encoding
toEncoding PortalBusinessProfile
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"headline" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PortalBusinessProfile -> Maybe Text
portalBusinessProfileHeadline PortalBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"privacy_policy_url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PortalBusinessProfile -> Text
portalBusinessProfilePrivacyPolicyUrl PortalBusinessProfile
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"terms_of_service_url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PortalBusinessProfile -> Text
portalBusinessProfileTermsOfServiceUrl PortalBusinessProfile
obj)))
instance Data.Aeson.Types.FromJSON.FromJSON PortalBusinessProfile where
parseJSON :: Value -> Parser PortalBusinessProfile
parseJSON = String
-> (Object -> Parser PortalBusinessProfile)
-> Value
-> Parser PortalBusinessProfile
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PortalBusinessProfile" (\Object
obj -> (((Maybe Text -> Text -> Text -> PortalBusinessProfile)
-> Parser (Maybe Text -> Text -> Text -> PortalBusinessProfile)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text -> Text -> Text -> PortalBusinessProfile
PortalBusinessProfile Parser (Maybe Text -> Text -> Text -> PortalBusinessProfile)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> PortalBusinessProfile)
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
"headline")) Parser (Text -> Text -> PortalBusinessProfile)
-> Parser Text -> Parser (Text -> PortalBusinessProfile)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"privacy_policy_url")) Parser (Text -> PortalBusinessProfile)
-> Parser Text -> Parser PortalBusinessProfile
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"terms_of_service_url"))
mkPortalBusinessProfile ::
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
PortalBusinessProfile
mkPortalBusinessProfile :: Text -> Text -> PortalBusinessProfile
mkPortalBusinessProfile Text
portalBusinessProfilePrivacyPolicyUrl Text
portalBusinessProfileTermsOfServiceUrl =
PortalBusinessProfile :: Maybe Text -> Text -> Text -> PortalBusinessProfile
PortalBusinessProfile
{ portalBusinessProfileHeadline :: Maybe Text
portalBusinessProfileHeadline = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
portalBusinessProfilePrivacyPolicyUrl :: Text
portalBusinessProfilePrivacyPolicyUrl = Text
portalBusinessProfilePrivacyPolicyUrl,
portalBusinessProfileTermsOfServiceUrl :: Text
portalBusinessProfileTermsOfServiceUrl = Text
portalBusinessProfileTermsOfServiceUrl
}