{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53Domains.Types.ContactDetail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53Domains.Types.ContactDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Domains.Types.ContactType
import Amazonka.Route53Domains.Types.CountryCode
import Amazonka.Route53Domains.Types.ExtraParam

-- | ContactDetail includes the following elements.
--
-- /See:/ 'newContactDetail' smart constructor.
data ContactDetail = ContactDetail'
  { -- | First line of the contact\'s address.
    ContactDetail -> Maybe Text
addressLine1 :: Prelude.Maybe Prelude.Text,
    -- | Second line of contact\'s address, if any.
    ContactDetail -> Maybe Text
addressLine2 :: Prelude.Maybe Prelude.Text,
    -- | The city of the contact\'s address.
    ContactDetail -> Maybe Text
city :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the contact is a person, company, association, or
    -- public organization. Note the following:
    --
    -- -   If you specify a value other than @PERSON@, you must also specify a
    --     value for @OrganizationName@.
    --
    -- -   For some TLDs, the privacy protection available depends on the value
    --     that you specify for @Contact Type@. For the privacy protection
    --     settings for your TLD, see
    --     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html Domains that You Can Register with Amazon Route 53>
    --     in the /Amazon Route 53 Developer Guide/
    --
    -- -   For .es domains, the value of @ContactType@ must be @PERSON@ for all
    --     three contacts.
    ContactDetail -> Maybe ContactType
contactType :: Prelude.Maybe ContactType,
    -- | Code for the country of the contact\'s address.
    ContactDetail -> Maybe CountryCode
countryCode :: Prelude.Maybe CountryCode,
    -- | Email address of the contact.
    ContactDetail -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | A list of name-value pairs for parameters required by certain top-level
    -- domains.
    ContactDetail -> Maybe [ExtraParam]
extraParams :: Prelude.Maybe [ExtraParam],
    -- | Fax number of the contact.
    --
    -- Constraints: Phone number must be specified in the format \"+[country
    -- dialing code].[number including any area code]\". For example, a US
    -- phone number might appear as @\"+1.1234567890\"@.
    ContactDetail -> Maybe Text
fax :: Prelude.Maybe Prelude.Text,
    -- | First name of contact.
    ContactDetail -> Maybe Text
firstName :: Prelude.Maybe Prelude.Text,
    -- | Last name of contact.
    ContactDetail -> Maybe Text
lastName :: Prelude.Maybe Prelude.Text,
    -- | Name of the organization for contact types other than @PERSON@.
    ContactDetail -> Maybe Text
organizationName :: Prelude.Maybe Prelude.Text,
    -- | The phone number of the contact.
    --
    -- Constraints: Phone number must be specified in the format \"+[country
    -- dialing code].[number including any area code>]\". For example, a US
    -- phone number might appear as @\"+1.1234567890\"@.
    ContactDetail -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text,
    -- | The state or province of the contact\'s city.
    ContactDetail -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | The zip or postal code of the contact\'s address.
    ContactDetail -> Maybe Text
zipCode :: Prelude.Maybe Prelude.Text
  }
  deriving (ContactDetail -> ContactDetail -> Bool
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
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. 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)

-- |
-- Create a value of 'ContactDetail' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'addressLine1', 'contactDetail_addressLine1' - First line of the contact\'s address.
--
-- 'addressLine2', 'contactDetail_addressLine2' - Second line of contact\'s address, if any.
--
-- 'city', 'contactDetail_city' - The city of the contact\'s address.
--
-- 'contactType', 'contactDetail_contactType' - Indicates whether the contact is a person, company, association, or
-- public organization. Note the following:
--
-- -   If you specify a value other than @PERSON@, you must also specify a
--     value for @OrganizationName@.
--
-- -   For some TLDs, the privacy protection available depends on the value
--     that you specify for @Contact Type@. For the privacy protection
--     settings for your TLD, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html Domains that You Can Register with Amazon Route 53>
--     in the /Amazon Route 53 Developer Guide/
--
-- -   For .es domains, the value of @ContactType@ must be @PERSON@ for all
--     three contacts.
--
-- 'countryCode', 'contactDetail_countryCode' - Code for the country of the contact\'s address.
--
-- 'email', 'contactDetail_email' - Email address of the contact.
--
-- 'extraParams', 'contactDetail_extraParams' - A list of name-value pairs for parameters required by certain top-level
-- domains.
--
-- 'fax', 'contactDetail_fax' - Fax number of the contact.
--
-- Constraints: Phone number must be specified in the format \"+[country
-- dialing code].[number including any area code]\". For example, a US
-- phone number might appear as @\"+1.1234567890\"@.
--
-- 'firstName', 'contactDetail_firstName' - First name of contact.
--
-- 'lastName', 'contactDetail_lastName' - Last name of contact.
--
-- 'organizationName', 'contactDetail_organizationName' - Name of the organization for contact types other than @PERSON@.
--
-- 'phoneNumber', 'contactDetail_phoneNumber' - The phone number of the contact.
--
-- Constraints: Phone number must be specified in the format \"+[country
-- dialing code].[number including any area code>]\". For example, a US
-- phone number might appear as @\"+1.1234567890\"@.
--
-- 'state', 'contactDetail_state' - The state or province of the contact\'s city.
--
-- 'zipCode', 'contactDetail_zipCode' - The zip or postal code of the contact\'s address.
newContactDetail ::
  ContactDetail
newContactDetail :: ContactDetail
newContactDetail =
  ContactDetail'
    { $sel:addressLine1:ContactDetail' :: Maybe Text
addressLine1 = forall a. Maybe a
Prelude.Nothing,
      $sel:addressLine2:ContactDetail' :: Maybe Text
addressLine2 = forall a. Maybe a
Prelude.Nothing,
      $sel:city:ContactDetail' :: Maybe Text
city = forall a. Maybe a
Prelude.Nothing,
      $sel:contactType:ContactDetail' :: Maybe ContactType
contactType = forall a. Maybe a
Prelude.Nothing,
      $sel:countryCode:ContactDetail' :: Maybe CountryCode
countryCode = forall a. Maybe a
Prelude.Nothing,
      $sel:email:ContactDetail' :: Maybe Text
email = forall a. Maybe a
Prelude.Nothing,
      $sel:extraParams:ContactDetail' :: Maybe [ExtraParam]
extraParams = forall a. Maybe a
Prelude.Nothing,
      $sel:fax:ContactDetail' :: Maybe Text
fax = forall a. Maybe a
Prelude.Nothing,
      $sel:firstName:ContactDetail' :: Maybe Text
firstName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastName:ContactDetail' :: Maybe Text
lastName = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationName:ContactDetail' :: Maybe Text
organizationName = forall a. Maybe a
Prelude.Nothing,
      $sel:phoneNumber:ContactDetail' :: Maybe Text
phoneNumber = forall a. Maybe a
Prelude.Nothing,
      $sel:state:ContactDetail' :: Maybe Text
state = forall a. Maybe a
Prelude.Nothing,
      $sel:zipCode:ContactDetail' :: Maybe Text
zipCode = forall a. Maybe a
Prelude.Nothing
    }

-- | First line of the contact\'s address.
contactDetail_addressLine1 :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_addressLine1 :: Lens' ContactDetail (Maybe Text)
contactDetail_addressLine1 = 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)

-- | Second line of contact\'s address, if any.
contactDetail_addressLine2 :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_addressLine2 :: Lens' ContactDetail (Maybe Text)
contactDetail_addressLine2 = 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)

-- | The city of the contact\'s address.
contactDetail_city :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_city :: Lens' ContactDetail (Maybe Text)
contactDetail_city = 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)

-- | Indicates whether the contact is a person, company, association, or
-- public organization. Note the following:
--
-- -   If you specify a value other than @PERSON@, you must also specify a
--     value for @OrganizationName@.
--
-- -   For some TLDs, the privacy protection available depends on the value
--     that you specify for @Contact Type@. For the privacy protection
--     settings for your TLD, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html Domains that You Can Register with Amazon Route 53>
--     in the /Amazon Route 53 Developer Guide/
--
-- -   For .es domains, the value of @ContactType@ must be @PERSON@ for all
--     three contacts.
contactDetail_contactType :: Lens.Lens' ContactDetail (Prelude.Maybe ContactType)
contactDetail_contactType :: Lens' ContactDetail (Maybe ContactType)
contactDetail_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)

-- | Code for the country of the contact\'s address.
contactDetail_countryCode :: Lens.Lens' ContactDetail (Prelude.Maybe CountryCode)
contactDetail_countryCode :: Lens' ContactDetail (Maybe CountryCode)
contactDetail_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)

-- | Email address of the contact.
contactDetail_email :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_email :: Lens' ContactDetail (Maybe Text)
contactDetail_email = 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)

-- | A list of name-value pairs for parameters required by certain top-level
-- domains.
contactDetail_extraParams :: Lens.Lens' ContactDetail (Prelude.Maybe [ExtraParam])
contactDetail_extraParams :: Lens' ContactDetail (Maybe [ExtraParam])
contactDetail_extraParams = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Fax number of the contact.
--
-- Constraints: Phone number must be specified in the format \"+[country
-- dialing code].[number including any area code]\". For example, a US
-- phone number might appear as @\"+1.1234567890\"@.
contactDetail_fax :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_fax :: Lens' ContactDetail (Maybe Text)
contactDetail_fax = 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)

-- | First name of contact.
contactDetail_firstName :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_firstName :: Lens' ContactDetail (Maybe Text)
contactDetail_firstName = 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)

-- | Last name of contact.
contactDetail_lastName :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_lastName :: Lens' ContactDetail (Maybe Text)
contactDetail_lastName = 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)

-- | Name of the organization for contact types other than @PERSON@.
contactDetail_organizationName :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_organizationName :: Lens' ContactDetail (Maybe Text)
contactDetail_organizationName = 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)

-- | The phone number of the contact.
--
-- Constraints: Phone number must be specified in the format \"+[country
-- dialing code].[number including any area code>]\". For example, a US
-- phone number might appear as @\"+1.1234567890\"@.
contactDetail_phoneNumber :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_phoneNumber :: Lens' ContactDetail (Maybe Text)
contactDetail_phoneNumber = 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)

-- | The state or province of the contact\'s city.
contactDetail_state :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_state :: Lens' ContactDetail (Maybe Text)
contactDetail_state = 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)

-- | The zip or postal code of the contact\'s address.
contactDetail_zipCode :: Lens.Lens' ContactDetail (Prelude.Maybe Prelude.Text)
contactDetail_zipCode :: Lens' ContactDetail (Maybe Text)
contactDetail_zipCode = 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)

instance Data.FromJSON ContactDetail where
  parseJSON :: Value -> Parser ContactDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContactDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ContactType
-> Maybe CountryCode
-> Maybe Text
-> Maybe [ExtraParam]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactDetail
ContactDetail'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AddressLine1")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AddressLine2")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"City")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ContactType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CountryCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Email")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExtraParams" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Fax")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FirstName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OrganizationName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PhoneNumber")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"State")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ZipCode")
      )

instance Prelude.Hashable ContactDetail where
  hashWithSalt :: Int -> ContactDetail -> Int
hashWithSalt Int
_salt ContactDetail' {Maybe [ExtraParam]
Maybe Text
Maybe ContactType
Maybe CountryCode
zipCode :: Maybe Text
state :: Maybe Text
phoneNumber :: Maybe Text
organizationName :: Maybe Text
lastName :: Maybe Text
firstName :: Maybe Text
fax :: Maybe Text
extraParams :: Maybe [ExtraParam]
email :: Maybe Text
countryCode :: Maybe CountryCode
contactType :: Maybe ContactType
city :: Maybe Text
addressLine2 :: Maybe Text
addressLine1 :: Maybe Text
$sel:zipCode:ContactDetail' :: ContactDetail -> Maybe Text
$sel:state:ContactDetail' :: ContactDetail -> Maybe Text
$sel:phoneNumber:ContactDetail' :: ContactDetail -> Maybe Text
$sel:organizationName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:lastName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:firstName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:fax:ContactDetail' :: ContactDetail -> Maybe Text
$sel:extraParams:ContactDetail' :: ContactDetail -> Maybe [ExtraParam]
$sel:email:ContactDetail' :: ContactDetail -> Maybe Text
$sel:countryCode:ContactDetail' :: ContactDetail -> Maybe CountryCode
$sel:contactType:ContactDetail' :: ContactDetail -> Maybe ContactType
$sel:city:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine2:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine1:ContactDetail' :: ContactDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addressLine1
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
addressLine2
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
city
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactType
contactType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CountryCode
countryCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
email
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ExtraParam]
extraParams
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fax
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firstName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
organizationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
phoneNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
zipCode

instance Prelude.NFData ContactDetail where
  rnf :: ContactDetail -> ()
rnf ContactDetail' {Maybe [ExtraParam]
Maybe Text
Maybe ContactType
Maybe CountryCode
zipCode :: Maybe Text
state :: Maybe Text
phoneNumber :: Maybe Text
organizationName :: Maybe Text
lastName :: Maybe Text
firstName :: Maybe Text
fax :: Maybe Text
extraParams :: Maybe [ExtraParam]
email :: Maybe Text
countryCode :: Maybe CountryCode
contactType :: Maybe ContactType
city :: Maybe Text
addressLine2 :: Maybe Text
addressLine1 :: Maybe Text
$sel:zipCode:ContactDetail' :: ContactDetail -> Maybe Text
$sel:state:ContactDetail' :: ContactDetail -> Maybe Text
$sel:phoneNumber:ContactDetail' :: ContactDetail -> Maybe Text
$sel:organizationName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:lastName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:firstName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:fax:ContactDetail' :: ContactDetail -> Maybe Text
$sel:extraParams:ContactDetail' :: ContactDetail -> Maybe [ExtraParam]
$sel:email:ContactDetail' :: ContactDetail -> Maybe Text
$sel:countryCode:ContactDetail' :: ContactDetail -> Maybe CountryCode
$sel:contactType:ContactDetail' :: ContactDetail -> Maybe ContactType
$sel:city:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine2:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine1:ContactDetail' :: ContactDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addressLine1
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
addressLine2
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
city
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactType
contactType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CountryCode
countryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
email
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ExtraParam]
extraParams
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fax
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firstName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
phoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
zipCode

instance Data.ToJSON ContactDetail where
  toJSON :: ContactDetail -> Value
toJSON ContactDetail' {Maybe [ExtraParam]
Maybe Text
Maybe ContactType
Maybe CountryCode
zipCode :: Maybe Text
state :: Maybe Text
phoneNumber :: Maybe Text
organizationName :: Maybe Text
lastName :: Maybe Text
firstName :: Maybe Text
fax :: Maybe Text
extraParams :: Maybe [ExtraParam]
email :: Maybe Text
countryCode :: Maybe CountryCode
contactType :: Maybe ContactType
city :: Maybe Text
addressLine2 :: Maybe Text
addressLine1 :: Maybe Text
$sel:zipCode:ContactDetail' :: ContactDetail -> Maybe Text
$sel:state:ContactDetail' :: ContactDetail -> Maybe Text
$sel:phoneNumber:ContactDetail' :: ContactDetail -> Maybe Text
$sel:organizationName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:lastName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:firstName:ContactDetail' :: ContactDetail -> Maybe Text
$sel:fax:ContactDetail' :: ContactDetail -> Maybe Text
$sel:extraParams:ContactDetail' :: ContactDetail -> Maybe [ExtraParam]
$sel:email:ContactDetail' :: ContactDetail -> Maybe Text
$sel:countryCode:ContactDetail' :: ContactDetail -> Maybe CountryCode
$sel:contactType:ContactDetail' :: ContactDetail -> Maybe ContactType
$sel:city:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine2:ContactDetail' :: ContactDetail -> Maybe Text
$sel:addressLine1:ContactDetail' :: ContactDetail -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AddressLine1" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
addressLine1,
            (Key
"AddressLine2" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
addressLine2,
            (Key
"City" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
city,
            (Key
"ContactType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContactType
contactType,
            (Key
"CountryCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CountryCode
countryCode,
            (Key
"Email" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
email,
            (Key
"ExtraParams" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExtraParam]
extraParams,
            (Key
"Fax" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fax,
            (Key
"FirstName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
firstName,
            (Key
"LastName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
lastName,
            (Key
"OrganizationName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
organizationName,
            (Key
"PhoneNumber" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
phoneNumber,
            (Key
"State" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
state,
            (Key
"ZipCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
zipCode
          ]
      )