{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Account.Types.AlternateContact where
import Amazonka.Account.Types.AlternateContactType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AlternateContact = AlternateContact'
{
AlternateContact -> Maybe AlternateContactType
alternateContactType :: Prelude.Maybe AlternateContactType,
AlternateContact -> Maybe (Sensitive Text)
phoneNumber :: Prelude.Maybe (Core.Sensitive Prelude.Text),
AlternateContact -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
AlternateContact -> Maybe (Sensitive Text)
emailAddress :: Prelude.Maybe (Core.Sensitive Prelude.Text),
AlternateContact -> Maybe (Sensitive Text)
title :: Prelude.Maybe (Core.Sensitive Prelude.Text)
}
deriving (AlternateContact -> AlternateContact -> Bool
(AlternateContact -> AlternateContact -> Bool)
-> (AlternateContact -> AlternateContact -> Bool)
-> Eq AlternateContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlternateContact -> AlternateContact -> Bool
$c/= :: AlternateContact -> AlternateContact -> Bool
== :: AlternateContact -> AlternateContact -> Bool
$c== :: AlternateContact -> AlternateContact -> Bool
Prelude.Eq, Int -> AlternateContact -> ShowS
[AlternateContact] -> ShowS
AlternateContact -> String
(Int -> AlternateContact -> ShowS)
-> (AlternateContact -> String)
-> ([AlternateContact] -> ShowS)
-> Show AlternateContact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlternateContact] -> ShowS
$cshowList :: [AlternateContact] -> ShowS
show :: AlternateContact -> String
$cshow :: AlternateContact -> String
showsPrec :: Int -> AlternateContact -> ShowS
$cshowsPrec :: Int -> AlternateContact -> ShowS
Prelude.Show, (forall x. AlternateContact -> Rep AlternateContact x)
-> (forall x. Rep AlternateContact x -> AlternateContact)
-> Generic AlternateContact
forall x. Rep AlternateContact x -> AlternateContact
forall x. AlternateContact -> Rep AlternateContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlternateContact x -> AlternateContact
$cfrom :: forall x. AlternateContact -> Rep AlternateContact x
Prelude.Generic)
newAlternateContact ::
AlternateContact
newAlternateContact :: AlternateContact
newAlternateContact =
AlternateContact' :: Maybe AlternateContactType
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact
AlternateContact'
{ $sel:alternateContactType:AlternateContact' :: Maybe AlternateContactType
alternateContactType =
Maybe AlternateContactType
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:AlternateContact' :: Maybe (Sensitive Text)
phoneNumber = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:AlternateContact' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:emailAddress:AlternateContact' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:title:AlternateContact' :: Maybe (Sensitive Text)
title = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
}
alternateContact_alternateContactType :: Lens.Lens' AlternateContact (Prelude.Maybe AlternateContactType)
alternateContact_alternateContactType :: (Maybe AlternateContactType -> f (Maybe AlternateContactType))
-> AlternateContact -> f AlternateContact
alternateContact_alternateContactType = (AlternateContact -> Maybe AlternateContactType)
-> (AlternateContact
-> Maybe AlternateContactType -> AlternateContact)
-> Lens
AlternateContact
AlternateContact
(Maybe AlternateContactType)
(Maybe AlternateContactType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlternateContact' {Maybe AlternateContactType
alternateContactType :: Maybe AlternateContactType
$sel:alternateContactType:AlternateContact' :: AlternateContact -> Maybe AlternateContactType
alternateContactType} -> Maybe AlternateContactType
alternateContactType) (\s :: AlternateContact
s@AlternateContact' {} Maybe AlternateContactType
a -> AlternateContact
s {$sel:alternateContactType:AlternateContact' :: Maybe AlternateContactType
alternateContactType = Maybe AlternateContactType
a} :: AlternateContact)
alternateContact_phoneNumber :: Lens.Lens' AlternateContact (Prelude.Maybe Prelude.Text)
alternateContact_phoneNumber :: (Maybe Text -> f (Maybe Text))
-> AlternateContact -> f AlternateContact
alternateContact_phoneNumber = (AlternateContact -> Maybe (Sensitive Text))
-> (AlternateContact -> Maybe (Sensitive Text) -> AlternateContact)
-> Lens
AlternateContact
AlternateContact
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlternateContact' {Maybe (Sensitive Text)
phoneNumber :: Maybe (Sensitive Text)
$sel:phoneNumber:AlternateContact' :: AlternateContact -> Maybe (Sensitive Text)
phoneNumber} -> Maybe (Sensitive Text)
phoneNumber) (\s :: AlternateContact
s@AlternateContact' {} Maybe (Sensitive Text)
a -> AlternateContact
s {$sel:phoneNumber:AlternateContact' :: Maybe (Sensitive Text)
phoneNumber = Maybe (Sensitive Text)
a} :: AlternateContact) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> AlternateContact -> f AlternateContact)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AlternateContact
-> f AlternateContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
alternateContact_name :: Lens.Lens' AlternateContact (Prelude.Maybe Prelude.Text)
alternateContact_name :: (Maybe Text -> f (Maybe Text))
-> AlternateContact -> f AlternateContact
alternateContact_name = (AlternateContact -> Maybe (Sensitive Text))
-> (AlternateContact -> Maybe (Sensitive Text) -> AlternateContact)
-> Lens
AlternateContact
AlternateContact
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlternateContact' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:AlternateContact' :: AlternateContact -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: AlternateContact
s@AlternateContact' {} Maybe (Sensitive Text)
a -> AlternateContact
s {$sel:name:AlternateContact' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: AlternateContact) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> AlternateContact -> f AlternateContact)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AlternateContact
-> f AlternateContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
alternateContact_emailAddress :: Lens.Lens' AlternateContact (Prelude.Maybe Prelude.Text)
alternateContact_emailAddress :: (Maybe Text -> f (Maybe Text))
-> AlternateContact -> f AlternateContact
alternateContact_emailAddress = (AlternateContact -> Maybe (Sensitive Text))
-> (AlternateContact -> Maybe (Sensitive Text) -> AlternateContact)
-> Lens
AlternateContact
AlternateContact
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlternateContact' {Maybe (Sensitive Text)
emailAddress :: Maybe (Sensitive Text)
$sel:emailAddress:AlternateContact' :: AlternateContact -> Maybe (Sensitive Text)
emailAddress} -> Maybe (Sensitive Text)
emailAddress) (\s :: AlternateContact
s@AlternateContact' {} Maybe (Sensitive Text)
a -> AlternateContact
s {$sel:emailAddress:AlternateContact' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
a} :: AlternateContact) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> AlternateContact -> f AlternateContact)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AlternateContact
-> f AlternateContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
alternateContact_title :: Lens.Lens' AlternateContact (Prelude.Maybe Prelude.Text)
alternateContact_title :: (Maybe Text -> f (Maybe Text))
-> AlternateContact -> f AlternateContact
alternateContact_title = (AlternateContact -> Maybe (Sensitive Text))
-> (AlternateContact -> Maybe (Sensitive Text) -> AlternateContact)
-> Lens
AlternateContact
AlternateContact
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlternateContact' {Maybe (Sensitive Text)
title :: Maybe (Sensitive Text)
$sel:title:AlternateContact' :: AlternateContact -> Maybe (Sensitive Text)
title} -> Maybe (Sensitive Text)
title) (\s :: AlternateContact
s@AlternateContact' {} Maybe (Sensitive Text)
a -> AlternateContact
s {$sel:title:AlternateContact' :: Maybe (Sensitive Text)
title = Maybe (Sensitive Text)
a} :: AlternateContact) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> AlternateContact -> f AlternateContact)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AlternateContact
-> f AlternateContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.FromJSON AlternateContact where
parseJSON :: Value -> Parser AlternateContact
parseJSON =
String
-> (Object -> Parser AlternateContact)
-> Value
-> Parser AlternateContact
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AlternateContact"
( \Object
x ->
Maybe AlternateContactType
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact
AlternateContact'
(Maybe AlternateContactType
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact)
-> Parser (Maybe AlternateContactType)
-> Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AlternateContactType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AlternateContactType")
Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhoneNumber")
Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AlternateContact)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> AlternateContact)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> AlternateContact)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe (Sensitive Text) -> AlternateContact)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EmailAddress")
Parser (Maybe (Sensitive Text) -> AlternateContact)
-> Parser (Maybe (Sensitive Text)) -> Parser AlternateContact
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Title")
)
instance Prelude.Hashable AlternateContact
instance Prelude.NFData AlternateContact