{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Route53Domains.Types.ContactDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Domains.Types.ContactType
import Amazonka.Route53Domains.Types.CountryCode
import Amazonka.Route53Domains.Types.ExtraParam
data ContactDetail = ContactDetail'
{
ContactDetail -> Maybe Text
organizationName :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
fax :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
lastName :: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe [ExtraParam],
ContactDetail -> Maybe Text
zipCode :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
addressLine1 :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
city :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
addressLine2 :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe Text
firstName :: Prelude.Maybe Prelude.Text,
ContactDetail -> Maybe CountryCode
countryCode :: Prelude.Maybe CountryCode,
ContactDetail -> Maybe ContactType
contactType :: Prelude.Maybe ContactType
}
deriving (ContactDetail -> ContactDetail -> Bool
(ContactDetail -> ContactDetail -> Bool)
-> (ContactDetail -> ContactDetail -> Bool) -> Eq ContactDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactDetail -> ContactDetail -> Bool
$c/= :: ContactDetail -> ContactDetail -> Bool
== :: ContactDetail -> ContactDetail -> Bool
$c== :: ContactDetail -> ContactDetail -> Bool
Prelude.Eq, Int -> ContactDetail -> ShowS
[ContactDetail] -> ShowS
ContactDetail -> String
(Int -> ContactDetail -> ShowS)
-> (ContactDetail -> String)
-> ([ContactDetail] -> ShowS)
-> Show ContactDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactDetail] -> ShowS
$cshowList :: [ContactDetail] -> ShowS
show :: ContactDetail -> String
$cshow :: ContactDetail -> String
showsPrec :: Int -> ContactDetail -> ShowS
$cshowsPrec :: Int -> ContactDetail -> ShowS
Prelude.Show, (forall x. ContactDetail -> Rep ContactDetail x)
-> (forall x. Rep ContactDetail x -> ContactDetail)
-> Generic ContactDetail
forall x. Rep ContactDetail x -> ContactDetail
forall x. ContactDetail -> Rep ContactDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContactDetail x -> ContactDetail
$cfrom :: forall x. ContactDetail -> Rep ContactDetail x
Prelude.Generic)
newContactDetail ::
ContactDetail
newContactDetail :: ContactDetail
newContactDetail =
ContactDetail' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail
ContactDetail'
{ $sel:organizationName:ContactDetail' :: Maybe Text
organizationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:email:ContactDetail' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:state:ContactDetail' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fax:ContactDetail' :: Maybe Text
fax = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastName:ContactDetail' :: Maybe Text
lastName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:extraParams:ContactDetail' :: Maybe [ExtraParam]
extraParams = Maybe [ExtraParam]
forall a. Maybe a
Prelude.Nothing,
$sel:zipCode:ContactDetail' :: Maybe Text
zipCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressLine1:ContactDetail' :: Maybe Text
addressLine1 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:city:ContactDetail' :: Maybe Text
city = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:ContactDetail' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressLine2:ContactDetail' :: Maybe Text
addressLine2 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:firstName:ContactDetail' :: Maybe Text
firstName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:countryCode:ContactDetail' :: Maybe CountryCode
countryCode = Maybe CountryCode
forall a. Maybe a
Prelude.Nothing,
$sel:contactType:ContactDetail' :: Maybe ContactType
contactType = Maybe ContactType
forall a. Maybe a
Prelude.Nothing
}
contactDetail_organizationName :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_organizationName :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_organizationName = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
organizationName :: Maybe Text
$sel:organizationName:ContactDetail' :: ContactDetail -> Maybe Text
organizationName} -> Maybe Text
organizationName) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:organizationName:ContactDetail' :: Maybe Text
organizationName = Maybe Text
a} :: ContactDetail)
contactDetail_email :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_email :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_email = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
email :: Maybe Text
$sel:email:ContactDetail' :: ContactDetail -> Maybe Text
email} -> Maybe Text
email) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:email:ContactDetail' :: Maybe Text
email = Maybe Text
a} :: ContactDetail)
contactDetail_state :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_state :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_state = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
state :: Maybe Text
$sel:state:ContactDetail' :: ContactDetail -> Maybe Text
state} -> Maybe Text
state) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:state:ContactDetail' :: Maybe Text
state = Maybe Text
a} :: ContactDetail)
contactDetail_fax :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_fax :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_fax = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
fax :: Maybe Text
$sel:fax:ContactDetail' :: ContactDetail -> Maybe Text
fax} -> Maybe Text
fax) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:fax:ContactDetail' :: Maybe Text
fax = Maybe Text
a} :: ContactDetail)
contactDetail_lastName :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_lastName :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_lastName = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
lastName :: Maybe Text
$sel:lastName:ContactDetail' :: ContactDetail -> Maybe Text
lastName} -> Maybe Text
lastName) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:lastName:ContactDetail' :: Maybe Text
lastName = Maybe Text
a} :: ContactDetail)
contactDetail_extraParams :: Lens.Lens' ContactDetail (Prelude.Maybe [ExtraParam])
= (ContactDetail -> Maybe [ExtraParam])
-> (ContactDetail -> Maybe [ExtraParam] -> ContactDetail)
-> Lens
ContactDetail
ContactDetail
(Maybe [ExtraParam])
(Maybe [ExtraParam])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe [ExtraParam]
extraParams :: Maybe [ExtraParam]
$sel:extraParams:ContactDetail' :: ContactDetail -> Maybe [ExtraParam]
extraParams} -> Maybe [ExtraParam]
extraParams) (\s :: ContactDetail
s@ContactDetail' {} Maybe [ExtraParam]
a -> ContactDetail
s {$sel:extraParams:ContactDetail' :: Maybe [ExtraParam]
extraParams = Maybe [ExtraParam]
a} :: ContactDetail) ((Maybe [ExtraParam] -> f (Maybe [ExtraParam]))
-> ContactDetail -> f ContactDetail)
-> ((Maybe [ExtraParam] -> f (Maybe [ExtraParam]))
-> Maybe [ExtraParam] -> f (Maybe [ExtraParam]))
-> (Maybe [ExtraParam] -> f (Maybe [ExtraParam]))
-> ContactDetail
-> f ContactDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ExtraParam] [ExtraParam] [ExtraParam] [ExtraParam]
-> Iso
(Maybe [ExtraParam])
(Maybe [ExtraParam])
(Maybe [ExtraParam])
(Maybe [ExtraParam])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ExtraParam] [ExtraParam] [ExtraParam] [ExtraParam]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
contactDetail_zipCode :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_zipCode :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_zipCode = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
zipCode :: Maybe Text
$sel:zipCode:ContactDetail' :: ContactDetail -> Maybe Text
zipCode} -> Maybe Text
zipCode) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:zipCode:ContactDetail' :: Maybe Text
zipCode = Maybe Text
a} :: ContactDetail)
contactDetail_addressLine1 :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_addressLine1 :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_addressLine1 = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
addressLine1 :: Maybe Text
$sel:addressLine1:ContactDetail' :: ContactDetail -> Maybe Text
addressLine1} -> Maybe Text
addressLine1) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:addressLine1:ContactDetail' :: Maybe Text
addressLine1 = Maybe Text
a} :: ContactDetail)
contactDetail_city :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_city :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_city = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
city :: Maybe Text
$sel:city:ContactDetail' :: ContactDetail -> Maybe Text
city} -> Maybe Text
city) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:city:ContactDetail' :: Maybe Text
city = Maybe Text
a} :: ContactDetail)
contactDetail_phoneNumber :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_phoneNumber :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_phoneNumber = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:ContactDetail' :: ContactDetail -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:phoneNumber:ContactDetail' :: Maybe Text
phoneNumber = Maybe Text
a} :: ContactDetail)
contactDetail_addressLine2 :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_addressLine2 :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_addressLine2 = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
addressLine2 :: Maybe Text
$sel:addressLine2:ContactDetail' :: ContactDetail -> Maybe Text
addressLine2} -> Maybe Text
addressLine2) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:addressLine2:ContactDetail' :: Maybe Text
addressLine2 = Maybe Text
a} :: ContactDetail)
contactDetail_firstName :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_firstName :: (Maybe Text -> f (Maybe Text)) -> ContactDetail -> f ContactDetail
contactDetail_firstName = (ContactDetail -> Maybe Text)
-> (ContactDetail -> Maybe Text -> ContactDetail)
-> Lens ContactDetail ContactDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe Text
firstName :: Maybe Text
$sel:firstName:ContactDetail' :: ContactDetail -> Maybe Text
firstName} -> Maybe Text
firstName) (\s :: ContactDetail
s@ContactDetail' {} Maybe Text
a -> ContactDetail
s {$sel:firstName:ContactDetail' :: Maybe Text
firstName = Maybe Text
a} :: ContactDetail)
contactDetail_countryCode :: Lens.Lens' ContactDetail (Prelude.Maybe CountryCode)
contactDetail_countryCode :: (Maybe CountryCode -> f (Maybe CountryCode))
-> ContactDetail -> f ContactDetail
contactDetail_countryCode = (ContactDetail -> Maybe CountryCode)
-> (ContactDetail -> Maybe CountryCode -> ContactDetail)
-> Lens
ContactDetail ContactDetail (Maybe CountryCode) (Maybe CountryCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe CountryCode
countryCode :: Maybe CountryCode
$sel:countryCode:ContactDetail' :: ContactDetail -> Maybe CountryCode
countryCode} -> Maybe CountryCode
countryCode) (\s :: ContactDetail
s@ContactDetail' {} Maybe CountryCode
a -> ContactDetail
s {$sel:countryCode:ContactDetail' :: Maybe CountryCode
countryCode = Maybe CountryCode
a} :: ContactDetail)
contactDetail_contactType :: Lens.Lens' ContactDetail (Prelude.Maybe ContactType)
contactDetail_contactType :: (Maybe ContactType -> f (Maybe ContactType))
-> ContactDetail -> f ContactDetail
contactDetail_contactType = (ContactDetail -> Maybe ContactType)
-> (ContactDetail -> Maybe ContactType -> ContactDetail)
-> Lens
ContactDetail ContactDetail (Maybe ContactType) (Maybe ContactType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactDetail' {Maybe ContactType
contactType :: Maybe ContactType
$sel:contactType:ContactDetail' :: ContactDetail -> Maybe ContactType
contactType} -> Maybe ContactType
contactType) (\s :: ContactDetail
s@ContactDetail' {} Maybe ContactType
a -> ContactDetail
s {$sel:contactType:ContactDetail' :: Maybe ContactType
contactType = Maybe ContactType
a} :: ContactDetail)
instance Core.FromJSON ContactDetail where
parseJSON :: Value -> Parser ContactDetail
parseJSON =
String
-> (Object -> Parser ContactDetail)
-> Value
-> Parser ContactDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContactDetail"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail
ContactDetail'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OrganizationName")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Email")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe Text
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Fax")
Parser
(Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastName")
Parser
(Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe [ExtraParam])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ExtraParam]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExtraParams" Parser (Maybe (Maybe [ExtraParam]))
-> Maybe [ExtraParam] -> Parser (Maybe [ExtraParam])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ExtraParam]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ZipCode")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AddressLine1")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"City")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhoneNumber")
Parser
(Maybe Text
-> Maybe Text
-> Maybe CountryCode
-> Maybe ContactType
-> ContactDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe CountryCode -> Maybe ContactType -> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AddressLine2")
Parser
(Maybe Text
-> Maybe CountryCode -> Maybe ContactType -> ContactDetail)
-> Parser (Maybe Text)
-> Parser (Maybe CountryCode -> Maybe ContactType -> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FirstName")
Parser (Maybe CountryCode -> Maybe ContactType -> ContactDetail)
-> Parser (Maybe CountryCode)
-> Parser (Maybe ContactType -> ContactDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CountryCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CountryCode")
Parser (Maybe ContactType -> ContactDetail)
-> Parser (Maybe ContactType) -> Parser ContactDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContactType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContactType")
)
instance Prelude.Hashable ContactDetail
instance Prelude.NFData ContactDetail
instance Core.ToJSON ContactDetail where
toJSON :: ContactDetail -> Value
toJSON ContactDetail' {Maybe [ExtraParam]
Maybe Text
Maybe ContactType
Maybe CountryCode
contactType :: Maybe ContactType
countryCode :: Maybe CountryCode
firstName :: Maybe Text
addressLine2 :: Maybe Text
phoneNumber :: Maybe Text
city :: Maybe Text
addressLine1 :: Maybe Text
zipCode :: Maybe Text
extraParams :: Maybe [ExtraParam]
lastName :: Maybe Text
fax :: Maybe Text
state :: Maybe Text
email :: Maybe Text
organizationName :: Maybe Text
$sel:contactType:ContactDetail' :: ContactDetail -> Maybe ContactType
$sel:countryCode:ContactDetail' :: ContactDetail -> Maybe CountryCode
$sel:firstName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine2:ContactDetail' :: ContactDetail -> Maybe Text
$sel:phoneNumber:ContactDetail' :: ContactDetail -> Maybe Text
$sel:city:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine1:ContactDetail' :: ContactDetail -> Maybe Text
$sel:zipCode:ContactDetail' :: ContactDetail -> Maybe Text
$sel:extraParams:ContactDetail' :: ContactDetail -> Maybe [ExtraParam]
$sel:lastName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:fax:ContactDetail' :: ContactDetail -> Maybe Text
$sel:state:ContactDetail' :: ContactDetail -> Maybe Text
$sel:email:ContactDetail' :: ContactDetail -> Maybe Text
$sel:organizationName:ContactDetail' :: ContactDetail -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"OrganizationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
organizationName,
(Text
"Email" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
email,
(Text
"State" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
state,
(Text
"Fax" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fax,
(Text
"LastName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lastName,
(Text
"ExtraParams" Text -> [ExtraParam] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ExtraParam] -> Pair) -> Maybe [ExtraParam] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExtraParam]
extraParams,
(Text
"ZipCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
zipCode,
(Text
"AddressLine1" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
addressLine1,
(Text
"City" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
city,
(Text
"PhoneNumber" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
phoneNumber,
(Text
"AddressLine2" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
addressLine2,
(Text
"FirstName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firstName,
(Text
"CountryCode" Text -> CountryCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CountryCode -> Pair) -> Maybe CountryCode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CountryCode
countryCode,
(Text
"ContactType" Text -> ContactType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ContactType -> Pair) -> Maybe ContactType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContactType
contactType
]
)