{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | ContactDetail includes the following elements.
--
-- /See:/ 'newContactDetail' smart constructor.
data ContactDetail = ContactDetail'
  { -- | Name of the organization for contact types other than @PERSON@.
    ContactDetail -> Maybe Text
organizationName :: Prelude.Maybe Prelude.Text,
    -- | Email address of the contact.
    ContactDetail -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | The state or province of the contact\'s city.
    ContactDetail -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | Last name of contact.
    ContactDetail -> Maybe Text
lastName :: 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],
    -- | The zip or postal code of the contact\'s address.
    ContactDetail -> Maybe Text
zipCode :: Prelude.Maybe Prelude.Text,
    -- | First line of the contact\'s address.
    ContactDetail -> Maybe Text
addressLine1 :: Prelude.Maybe Prelude.Text,
    -- | The city of the contact\'s address.
    ContactDetail -> Maybe Text
city :: 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,
    -- | Second line of contact\'s address, if any.
    ContactDetail -> Maybe Text
addressLine2 :: Prelude.Maybe Prelude.Text,
    -- | First name of contact.
    ContactDetail -> Maybe Text
firstName :: Prelude.Maybe Prelude.Text,
    -- | Code for the country of the contact\'s address.
    ContactDetail -> Maybe CountryCode
countryCode :: Prelude.Maybe CountryCode,
    -- | 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, if you specify @PERSON@, you must specify
    --     @INDIVIDUAL@ for the value of @ES_LEGAL_FORM@.
    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)

-- |
-- 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:
--
-- 'organizationName', 'contactDetail_organizationName' - Name of the organization for contact types other than @PERSON@.
--
-- 'email', 'contactDetail_email' - Email address of the contact.
--
-- 'state', 'contactDetail_state' - The state or province of the contact\'s city.
--
-- '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\"@.
--
-- 'lastName', 'contactDetail_lastName' - Last name of contact.
--
-- 'extraParams', 'contactDetail_extraParams' - A list of name-value pairs for parameters required by certain top-level
-- domains.
--
-- 'zipCode', 'contactDetail_zipCode' - The zip or postal code of the contact\'s address.
--
-- 'addressLine1', 'contactDetail_addressLine1' - First line of the contact\'s address.
--
-- 'city', 'contactDetail_city' - The city of the contact\'s address.
--
-- '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\"@.
--
-- 'addressLine2', 'contactDetail_addressLine2' - Second line of contact\'s address, if any.
--
-- 'firstName', 'contactDetail_firstName' - First name of contact.
--
-- 'countryCode', 'contactDetail_countryCode' - Code for the country 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, if you specify @PERSON@, you must specify
--     @INDIVIDUAL@ for the value of @ES_LEGAL_FORM@.
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
    }

-- | Name of the organization for contact types other than @PERSON@.
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)

-- | Email address of the contact.
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)

-- | The state or province of the contact\'s city.
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)

-- | 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 :: (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)

-- | Last name of contact.
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)

-- | A list of name-value pairs for parameters required by certain top-level
-- domains.
contactDetail_extraParams :: Lens.Lens' ContactDetail (Prelude.Maybe [ExtraParam])
contactDetail_extraParams :: (Maybe [ExtraParam] -> f (Maybe [ExtraParam]))
-> ContactDetail -> f ContactDetail
contactDetail_extraParams = (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

-- | The zip or postal code of the contact\'s address.
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)

-- | First line of the contact\'s address.
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)

-- | The city of the contact\'s address.
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)

-- | 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 :: (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)

-- | Second line of contact\'s address, if any.
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)

-- | First name of contact.
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)

-- | Code for the country of the contact\'s address.
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)

-- | 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, if you specify @PERSON@, you must specify
--     @INDIVIDUAL@ for the value of @ES_LEGAL_FORM@.
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
          ]
      )