{-# 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.Account.Types.ContactInformation
-- 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.Account.Types.ContactInformation 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

-- | Contains the details of the primary contact information associated with
-- an Amazon Web Services account.
--
-- /See:/ 'newContactInformation' smart constructor.
data ContactInformation = ContactInformation'
  { -- | The second line of the primary contact address, if any.
    ContactInformation -> Maybe (Sensitive Text)
addressLine2 :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The third line of the primary contact address, if any.
    ContactInformation -> Maybe (Sensitive Text)
addressLine3 :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The name of the company associated with the primary contact information,
    -- if any.
    ContactInformation -> Maybe (Sensitive Text)
companyName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The district or county of the primary contact address, if any.
    ContactInformation -> Maybe (Sensitive Text)
districtOrCounty :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The state or region of the primary contact address. This field is
    -- required in selected countries.
    ContactInformation -> Maybe (Sensitive Text)
stateOrRegion :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The URL of the website associated with the primary contact information,
    -- if any.
    ContactInformation -> Maybe (Sensitive Text)
websiteUrl :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The first line of the primary contact address.
    ContactInformation -> Sensitive Text
addressLine1 :: Data.Sensitive Prelude.Text,
    -- | The city of the primary contact address.
    ContactInformation -> Sensitive Text
city :: Data.Sensitive Prelude.Text,
    -- | The ISO-3166 two-letter country code for the primary contact address.
    ContactInformation -> Sensitive Text
countryCode :: Data.Sensitive Prelude.Text,
    -- | The full name of the primary contact address.
    ContactInformation -> Sensitive Text
fullName :: Data.Sensitive Prelude.Text,
    -- | The phone number of the primary contact information. The number will be
    -- validated and, in some countries, checked for activation.
    ContactInformation -> Sensitive Text
phoneNumber :: Data.Sensitive Prelude.Text,
    -- | The postal code of the primary contact address.
    ContactInformation -> Sensitive Text
postalCode :: Data.Sensitive Prelude.Text
  }
  deriving (ContactInformation -> ContactInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactInformation -> ContactInformation -> Bool
$c/= :: ContactInformation -> ContactInformation -> Bool
== :: ContactInformation -> ContactInformation -> Bool
$c== :: ContactInformation -> ContactInformation -> Bool
Prelude.Eq, Int -> ContactInformation -> ShowS
[ContactInformation] -> ShowS
ContactInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactInformation] -> ShowS
$cshowList :: [ContactInformation] -> ShowS
show :: ContactInformation -> String
$cshow :: ContactInformation -> String
showsPrec :: Int -> ContactInformation -> ShowS
$cshowsPrec :: Int -> ContactInformation -> ShowS
Prelude.Show, forall x. Rep ContactInformation x -> ContactInformation
forall x. ContactInformation -> Rep ContactInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContactInformation x -> ContactInformation
$cfrom :: forall x. ContactInformation -> Rep ContactInformation x
Prelude.Generic)

-- |
-- Create a value of 'ContactInformation' 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:
--
-- 'addressLine2', 'contactInformation_addressLine2' - The second line of the primary contact address, if any.
--
-- 'addressLine3', 'contactInformation_addressLine3' - The third line of the primary contact address, if any.
--
-- 'companyName', 'contactInformation_companyName' - The name of the company associated with the primary contact information,
-- if any.
--
-- 'districtOrCounty', 'contactInformation_districtOrCounty' - The district or county of the primary contact address, if any.
--
-- 'stateOrRegion', 'contactInformation_stateOrRegion' - The state or region of the primary contact address. This field is
-- required in selected countries.
--
-- 'websiteUrl', 'contactInformation_websiteUrl' - The URL of the website associated with the primary contact information,
-- if any.
--
-- 'addressLine1', 'contactInformation_addressLine1' - The first line of the primary contact address.
--
-- 'city', 'contactInformation_city' - The city of the primary contact address.
--
-- 'countryCode', 'contactInformation_countryCode' - The ISO-3166 two-letter country code for the primary contact address.
--
-- 'fullName', 'contactInformation_fullName' - The full name of the primary contact address.
--
-- 'phoneNumber', 'contactInformation_phoneNumber' - The phone number of the primary contact information. The number will be
-- validated and, in some countries, checked for activation.
--
-- 'postalCode', 'contactInformation_postalCode' - The postal code of the primary contact address.
newContactInformation ::
  -- | 'addressLine1'
  Prelude.Text ->
  -- | 'city'
  Prelude.Text ->
  -- | 'countryCode'
  Prelude.Text ->
  -- | 'fullName'
  Prelude.Text ->
  -- | 'phoneNumber'
  Prelude.Text ->
  -- | 'postalCode'
  Prelude.Text ->
  ContactInformation
newContactInformation :: Text -> Text -> Text -> Text -> Text -> Text -> ContactInformation
newContactInformation
  Text
pAddressLine1_
  Text
pCity_
  Text
pCountryCode_
  Text
pFullName_
  Text
pPhoneNumber_
  Text
pPostalCode_ =
    ContactInformation'
      { $sel:addressLine2:ContactInformation' :: Maybe (Sensitive Text)
addressLine2 = forall a. Maybe a
Prelude.Nothing,
        $sel:addressLine3:ContactInformation' :: Maybe (Sensitive Text)
addressLine3 = forall a. Maybe a
Prelude.Nothing,
        $sel:companyName:ContactInformation' :: Maybe (Sensitive Text)
companyName = forall a. Maybe a
Prelude.Nothing,
        $sel:districtOrCounty:ContactInformation' :: Maybe (Sensitive Text)
districtOrCounty = forall a. Maybe a
Prelude.Nothing,
        $sel:stateOrRegion:ContactInformation' :: Maybe (Sensitive Text)
stateOrRegion = forall a. Maybe a
Prelude.Nothing,
        $sel:websiteUrl:ContactInformation' :: Maybe (Sensitive Text)
websiteUrl = forall a. Maybe a
Prelude.Nothing,
        $sel:addressLine1:ContactInformation' :: Sensitive Text
addressLine1 = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pAddressLine1_,
        $sel:city:ContactInformation' :: Sensitive Text
city = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pCity_,
        $sel:countryCode:ContactInformation' :: Sensitive Text
countryCode = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pCountryCode_,
        $sel:fullName:ContactInformation' :: Sensitive Text
fullName = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pFullName_,
        $sel:phoneNumber:ContactInformation' :: Sensitive Text
phoneNumber = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPhoneNumber_,
        $sel:postalCode:ContactInformation' :: Sensitive Text
postalCode = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPostalCode_
      }

-- | The second line of the primary contact address, if any.
contactInformation_addressLine2 :: Lens.Lens' ContactInformation (Prelude.Maybe Prelude.Text)
contactInformation_addressLine2 :: Lens' ContactInformation (Maybe Text)
contactInformation_addressLine2 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Maybe (Sensitive Text)
addressLine2 :: Maybe (Sensitive Text)
$sel:addressLine2:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
addressLine2} -> Maybe (Sensitive Text)
addressLine2) (\s :: ContactInformation
s@ContactInformation' {} Maybe (Sensitive Text)
a -> ContactInformation
s {$sel:addressLine2:ContactInformation' :: Maybe (Sensitive Text)
addressLine2 = Maybe (Sensitive Text)
a} :: ContactInformation) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The third line of the primary contact address, if any.
contactInformation_addressLine3 :: Lens.Lens' ContactInformation (Prelude.Maybe Prelude.Text)
contactInformation_addressLine3 :: Lens' ContactInformation (Maybe Text)
contactInformation_addressLine3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Maybe (Sensitive Text)
addressLine3 :: Maybe (Sensitive Text)
$sel:addressLine3:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
addressLine3} -> Maybe (Sensitive Text)
addressLine3) (\s :: ContactInformation
s@ContactInformation' {} Maybe (Sensitive Text)
a -> ContactInformation
s {$sel:addressLine3:ContactInformation' :: Maybe (Sensitive Text)
addressLine3 = Maybe (Sensitive Text)
a} :: ContactInformation) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The name of the company associated with the primary contact information,
-- if any.
contactInformation_companyName :: Lens.Lens' ContactInformation (Prelude.Maybe Prelude.Text)
contactInformation_companyName :: Lens' ContactInformation (Maybe Text)
contactInformation_companyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Maybe (Sensitive Text)
companyName :: Maybe (Sensitive Text)
$sel:companyName:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
companyName} -> Maybe (Sensitive Text)
companyName) (\s :: ContactInformation
s@ContactInformation' {} Maybe (Sensitive Text)
a -> ContactInformation
s {$sel:companyName:ContactInformation' :: Maybe (Sensitive Text)
companyName = Maybe (Sensitive Text)
a} :: ContactInformation) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The district or county of the primary contact address, if any.
contactInformation_districtOrCounty :: Lens.Lens' ContactInformation (Prelude.Maybe Prelude.Text)
contactInformation_districtOrCounty :: Lens' ContactInformation (Maybe Text)
contactInformation_districtOrCounty = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Maybe (Sensitive Text)
districtOrCounty :: Maybe (Sensitive Text)
$sel:districtOrCounty:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
districtOrCounty} -> Maybe (Sensitive Text)
districtOrCounty) (\s :: ContactInformation
s@ContactInformation' {} Maybe (Sensitive Text)
a -> ContactInformation
s {$sel:districtOrCounty:ContactInformation' :: Maybe (Sensitive Text)
districtOrCounty = Maybe (Sensitive Text)
a} :: ContactInformation) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The state or region of the primary contact address. This field is
-- required in selected countries.
contactInformation_stateOrRegion :: Lens.Lens' ContactInformation (Prelude.Maybe Prelude.Text)
contactInformation_stateOrRegion :: Lens' ContactInformation (Maybe Text)
contactInformation_stateOrRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Maybe (Sensitive Text)
stateOrRegion :: Maybe (Sensitive Text)
$sel:stateOrRegion:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
stateOrRegion} -> Maybe (Sensitive Text)
stateOrRegion) (\s :: ContactInformation
s@ContactInformation' {} Maybe (Sensitive Text)
a -> ContactInformation
s {$sel:stateOrRegion:ContactInformation' :: Maybe (Sensitive Text)
stateOrRegion = Maybe (Sensitive Text)
a} :: ContactInformation) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The URL of the website associated with the primary contact information,
-- if any.
contactInformation_websiteUrl :: Lens.Lens' ContactInformation (Prelude.Maybe Prelude.Text)
contactInformation_websiteUrl :: Lens' ContactInformation (Maybe Text)
contactInformation_websiteUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Maybe (Sensitive Text)
websiteUrl :: Maybe (Sensitive Text)
$sel:websiteUrl:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
websiteUrl} -> Maybe (Sensitive Text)
websiteUrl) (\s :: ContactInformation
s@ContactInformation' {} Maybe (Sensitive Text)
a -> ContactInformation
s {$sel:websiteUrl:ContactInformation' :: Maybe (Sensitive Text)
websiteUrl = Maybe (Sensitive Text)
a} :: ContactInformation) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | The first line of the primary contact address.
contactInformation_addressLine1 :: Lens.Lens' ContactInformation Prelude.Text
contactInformation_addressLine1 :: Lens' ContactInformation Text
contactInformation_addressLine1 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Sensitive Text
addressLine1 :: Sensitive Text
$sel:addressLine1:ContactInformation' :: ContactInformation -> Sensitive Text
addressLine1} -> Sensitive Text
addressLine1) (\s :: ContactInformation
s@ContactInformation' {} Sensitive Text
a -> ContactInformation
s {$sel:addressLine1:ContactInformation' :: Sensitive Text
addressLine1 = Sensitive Text
a} :: ContactInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The city of the primary contact address.
contactInformation_city :: Lens.Lens' ContactInformation Prelude.Text
contactInformation_city :: Lens' ContactInformation Text
contactInformation_city = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Sensitive Text
city :: Sensitive Text
$sel:city:ContactInformation' :: ContactInformation -> Sensitive Text
city} -> Sensitive Text
city) (\s :: ContactInformation
s@ContactInformation' {} Sensitive Text
a -> ContactInformation
s {$sel:city:ContactInformation' :: Sensitive Text
city = Sensitive Text
a} :: ContactInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The ISO-3166 two-letter country code for the primary contact address.
contactInformation_countryCode :: Lens.Lens' ContactInformation Prelude.Text
contactInformation_countryCode :: Lens' ContactInformation Text
contactInformation_countryCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Sensitive Text
countryCode :: Sensitive Text
$sel:countryCode:ContactInformation' :: ContactInformation -> Sensitive Text
countryCode} -> Sensitive Text
countryCode) (\s :: ContactInformation
s@ContactInformation' {} Sensitive Text
a -> ContactInformation
s {$sel:countryCode:ContactInformation' :: Sensitive Text
countryCode = Sensitive Text
a} :: ContactInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The full name of the primary contact address.
contactInformation_fullName :: Lens.Lens' ContactInformation Prelude.Text
contactInformation_fullName :: Lens' ContactInformation Text
contactInformation_fullName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Sensitive Text
fullName :: Sensitive Text
$sel:fullName:ContactInformation' :: ContactInformation -> Sensitive Text
fullName} -> Sensitive Text
fullName) (\s :: ContactInformation
s@ContactInformation' {} Sensitive Text
a -> ContactInformation
s {$sel:fullName:ContactInformation' :: Sensitive Text
fullName = Sensitive Text
a} :: ContactInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The phone number of the primary contact information. The number will be
-- validated and, in some countries, checked for activation.
contactInformation_phoneNumber :: Lens.Lens' ContactInformation Prelude.Text
contactInformation_phoneNumber :: Lens' ContactInformation Text
contactInformation_phoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Sensitive Text
phoneNumber :: Sensitive Text
$sel:phoneNumber:ContactInformation' :: ContactInformation -> Sensitive Text
phoneNumber} -> Sensitive Text
phoneNumber) (\s :: ContactInformation
s@ContactInformation' {} Sensitive Text
a -> ContactInformation
s {$sel:phoneNumber:ContactInformation' :: Sensitive Text
phoneNumber = Sensitive Text
a} :: ContactInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The postal code of the primary contact address.
contactInformation_postalCode :: Lens.Lens' ContactInformation Prelude.Text
contactInformation_postalCode :: Lens' ContactInformation Text
contactInformation_postalCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactInformation' {Sensitive Text
postalCode :: Sensitive Text
$sel:postalCode:ContactInformation' :: ContactInformation -> Sensitive Text
postalCode} -> Sensitive Text
postalCode) (\s :: ContactInformation
s@ContactInformation' {} Sensitive Text
a -> ContactInformation
s {$sel:postalCode:ContactInformation' :: Sensitive Text
postalCode = Sensitive Text
a} :: ContactInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

instance Data.FromJSON ContactInformation where
  parseJSON :: Value -> Parser ContactInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContactInformation"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Sensitive Text
-> Sensitive Text
-> Sensitive Text
-> Sensitive Text
-> Sensitive Text
-> Sensitive Text
-> ContactInformation
ContactInformation'
            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
"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
"AddressLine3")
            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
"CompanyName")
            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
"DistrictOrCounty")
            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
"StateOrRegion")
            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
"WebsiteUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 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 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 a
Data..: Key
"FullName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"PostalCode")
      )

instance Prelude.Hashable ContactInformation where
  hashWithSalt :: Int -> ContactInformation -> Int
hashWithSalt Int
_salt ContactInformation' {Maybe (Sensitive Text)
Sensitive Text
postalCode :: Sensitive Text
phoneNumber :: Sensitive Text
fullName :: Sensitive Text
countryCode :: Sensitive Text
city :: Sensitive Text
addressLine1 :: Sensitive Text
websiteUrl :: Maybe (Sensitive Text)
stateOrRegion :: Maybe (Sensitive Text)
districtOrCounty :: Maybe (Sensitive Text)
companyName :: Maybe (Sensitive Text)
addressLine3 :: Maybe (Sensitive Text)
addressLine2 :: Maybe (Sensitive Text)
$sel:postalCode:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:phoneNumber:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:fullName:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:countryCode:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:city:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:addressLine1:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:websiteUrl:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:stateOrRegion:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:districtOrCounty:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:companyName:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:addressLine3:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:addressLine2:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
addressLine2
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
addressLine3
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
companyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
districtOrCounty
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
stateOrRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
websiteUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
addressLine1
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
city
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
countryCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
fullName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
phoneNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
postalCode

instance Prelude.NFData ContactInformation where
  rnf :: ContactInformation -> ()
rnf ContactInformation' {Maybe (Sensitive Text)
Sensitive Text
postalCode :: Sensitive Text
phoneNumber :: Sensitive Text
fullName :: Sensitive Text
countryCode :: Sensitive Text
city :: Sensitive Text
addressLine1 :: Sensitive Text
websiteUrl :: Maybe (Sensitive Text)
stateOrRegion :: Maybe (Sensitive Text)
districtOrCounty :: Maybe (Sensitive Text)
companyName :: Maybe (Sensitive Text)
addressLine3 :: Maybe (Sensitive Text)
addressLine2 :: Maybe (Sensitive Text)
$sel:postalCode:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:phoneNumber:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:fullName:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:countryCode:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:city:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:addressLine1:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:websiteUrl:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:stateOrRegion:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:districtOrCounty:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:companyName:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:addressLine3:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:addressLine2:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
addressLine2
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
addressLine3
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
companyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
districtOrCounty
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
stateOrRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
websiteUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
addressLine1
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
city
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
countryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
fullName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
phoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
postalCode

instance Data.ToJSON ContactInformation where
  toJSON :: ContactInformation -> Value
toJSON ContactInformation' {Maybe (Sensitive Text)
Sensitive Text
postalCode :: Sensitive Text
phoneNumber :: Sensitive Text
fullName :: Sensitive Text
countryCode :: Sensitive Text
city :: Sensitive Text
addressLine1 :: Sensitive Text
websiteUrl :: Maybe (Sensitive Text)
stateOrRegion :: Maybe (Sensitive Text)
districtOrCounty :: Maybe (Sensitive Text)
companyName :: Maybe (Sensitive Text)
addressLine3 :: Maybe (Sensitive Text)
addressLine2 :: Maybe (Sensitive Text)
$sel:postalCode:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:phoneNumber:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:fullName:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:countryCode:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:city:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:addressLine1:ContactInformation' :: ContactInformation -> Sensitive Text
$sel:websiteUrl:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:stateOrRegion:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:districtOrCounty:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:companyName:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:addressLine3:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
$sel:addressLine2:ContactInformation' :: ContactInformation -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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 (Sensitive Text)
addressLine2,
            (Key
"AddressLine3" 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 (Sensitive Text)
addressLine3,
            (Key
"CompanyName" 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 (Sensitive Text)
companyName,
            (Key
"DistrictOrCounty" 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 (Sensitive Text)
districtOrCounty,
            (Key
"StateOrRegion" 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 (Sensitive Text)
stateOrRegion,
            (Key
"WebsiteUrl" 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 (Sensitive Text)
websiteUrl,
            forall a. a -> Maybe a
Prelude.Just (Key
"AddressLine1" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
addressLine1),
            forall a. a -> Maybe a
Prelude.Just (Key
"City" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
city),
            forall a. a -> Maybe a
Prelude.Just (Key
"CountryCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
countryCode),
            forall a. a -> Maybe a
Prelude.Just (Key
"FullName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
fullName),
            forall a. a -> Maybe a
Prelude.Just (Key
"PhoneNumber" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
phoneNumber),
            forall a. a -> Maybe a
Prelude.Just (Key
"PostalCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
postalCode)
          ]
      )