{-# 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.Chime.Types.PhoneNumberAssociation where
import Amazonka.Chime.Types.PhoneNumberAssociationName
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PhoneNumberAssociation = PhoneNumberAssociation'
{
PhoneNumberAssociation -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
PhoneNumberAssociation -> Maybe POSIX
associatedTimestamp :: Prelude.Maybe Core.POSIX,
PhoneNumberAssociation -> Maybe PhoneNumberAssociationName
name :: Prelude.Maybe PhoneNumberAssociationName
}
deriving (PhoneNumberAssociation -> PhoneNumberAssociation -> Bool
(PhoneNumberAssociation -> PhoneNumberAssociation -> Bool)
-> (PhoneNumberAssociation -> PhoneNumberAssociation -> Bool)
-> Eq PhoneNumberAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhoneNumberAssociation -> PhoneNumberAssociation -> Bool
$c/= :: PhoneNumberAssociation -> PhoneNumberAssociation -> Bool
== :: PhoneNumberAssociation -> PhoneNumberAssociation -> Bool
$c== :: PhoneNumberAssociation -> PhoneNumberAssociation -> Bool
Prelude.Eq, ReadPrec [PhoneNumberAssociation]
ReadPrec PhoneNumberAssociation
Int -> ReadS PhoneNumberAssociation
ReadS [PhoneNumberAssociation]
(Int -> ReadS PhoneNumberAssociation)
-> ReadS [PhoneNumberAssociation]
-> ReadPrec PhoneNumberAssociation
-> ReadPrec [PhoneNumberAssociation]
-> Read PhoneNumberAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhoneNumberAssociation]
$creadListPrec :: ReadPrec [PhoneNumberAssociation]
readPrec :: ReadPrec PhoneNumberAssociation
$creadPrec :: ReadPrec PhoneNumberAssociation
readList :: ReadS [PhoneNumberAssociation]
$creadList :: ReadS [PhoneNumberAssociation]
readsPrec :: Int -> ReadS PhoneNumberAssociation
$creadsPrec :: Int -> ReadS PhoneNumberAssociation
Prelude.Read, Int -> PhoneNumberAssociation -> ShowS
[PhoneNumberAssociation] -> ShowS
PhoneNumberAssociation -> String
(Int -> PhoneNumberAssociation -> ShowS)
-> (PhoneNumberAssociation -> String)
-> ([PhoneNumberAssociation] -> ShowS)
-> Show PhoneNumberAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhoneNumberAssociation] -> ShowS
$cshowList :: [PhoneNumberAssociation] -> ShowS
show :: PhoneNumberAssociation -> String
$cshow :: PhoneNumberAssociation -> String
showsPrec :: Int -> PhoneNumberAssociation -> ShowS
$cshowsPrec :: Int -> PhoneNumberAssociation -> ShowS
Prelude.Show, (forall x. PhoneNumberAssociation -> Rep PhoneNumberAssociation x)
-> (forall x.
Rep PhoneNumberAssociation x -> PhoneNumberAssociation)
-> Generic PhoneNumberAssociation
forall x. Rep PhoneNumberAssociation x -> PhoneNumberAssociation
forall x. PhoneNumberAssociation -> Rep PhoneNumberAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhoneNumberAssociation x -> PhoneNumberAssociation
$cfrom :: forall x. PhoneNumberAssociation -> Rep PhoneNumberAssociation x
Prelude.Generic)
newPhoneNumberAssociation ::
PhoneNumberAssociation
newPhoneNumberAssociation :: PhoneNumberAssociation
newPhoneNumberAssociation =
PhoneNumberAssociation' :: Maybe Text
-> Maybe POSIX
-> Maybe PhoneNumberAssociationName
-> PhoneNumberAssociation
PhoneNumberAssociation'
{ $sel:value:PhoneNumberAssociation' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:associatedTimestamp:PhoneNumberAssociation' :: Maybe POSIX
associatedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:PhoneNumberAssociation' :: Maybe PhoneNumberAssociationName
name = Maybe PhoneNumberAssociationName
forall a. Maybe a
Prelude.Nothing
}
phoneNumberAssociation_value :: Lens.Lens' PhoneNumberAssociation (Prelude.Maybe Prelude.Text)
phoneNumberAssociation_value :: (Maybe Text -> f (Maybe Text))
-> PhoneNumberAssociation -> f PhoneNumberAssociation
phoneNumberAssociation_value = (PhoneNumberAssociation -> Maybe Text)
-> (PhoneNumberAssociation -> Maybe Text -> PhoneNumberAssociation)
-> Lens
PhoneNumberAssociation
PhoneNumberAssociation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberAssociation' {Maybe Text
value :: Maybe Text
$sel:value:PhoneNumberAssociation' :: PhoneNumberAssociation -> Maybe Text
value} -> Maybe Text
value) (\s :: PhoneNumberAssociation
s@PhoneNumberAssociation' {} Maybe Text
a -> PhoneNumberAssociation
s {$sel:value:PhoneNumberAssociation' :: Maybe Text
value = Maybe Text
a} :: PhoneNumberAssociation)
phoneNumberAssociation_associatedTimestamp :: Lens.Lens' PhoneNumberAssociation (Prelude.Maybe Prelude.UTCTime)
phoneNumberAssociation_associatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PhoneNumberAssociation -> f PhoneNumberAssociation
phoneNumberAssociation_associatedTimestamp = (PhoneNumberAssociation -> Maybe POSIX)
-> (PhoneNumberAssociation
-> Maybe POSIX -> PhoneNumberAssociation)
-> Lens
PhoneNumberAssociation
PhoneNumberAssociation
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberAssociation' {Maybe POSIX
associatedTimestamp :: Maybe POSIX
$sel:associatedTimestamp:PhoneNumberAssociation' :: PhoneNumberAssociation -> Maybe POSIX
associatedTimestamp} -> Maybe POSIX
associatedTimestamp) (\s :: PhoneNumberAssociation
s@PhoneNumberAssociation' {} Maybe POSIX
a -> PhoneNumberAssociation
s {$sel:associatedTimestamp:PhoneNumberAssociation' :: Maybe POSIX
associatedTimestamp = Maybe POSIX
a} :: PhoneNumberAssociation) ((Maybe POSIX -> f (Maybe POSIX))
-> PhoneNumberAssociation -> f PhoneNumberAssociation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PhoneNumberAssociation
-> f PhoneNumberAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
phoneNumberAssociation_name :: Lens.Lens' PhoneNumberAssociation (Prelude.Maybe PhoneNumberAssociationName)
phoneNumberAssociation_name :: (Maybe PhoneNumberAssociationName
-> f (Maybe PhoneNumberAssociationName))
-> PhoneNumberAssociation -> f PhoneNumberAssociation
phoneNumberAssociation_name = (PhoneNumberAssociation -> Maybe PhoneNumberAssociationName)
-> (PhoneNumberAssociation
-> Maybe PhoneNumberAssociationName -> PhoneNumberAssociation)
-> Lens
PhoneNumberAssociation
PhoneNumberAssociation
(Maybe PhoneNumberAssociationName)
(Maybe PhoneNumberAssociationName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberAssociation' {Maybe PhoneNumberAssociationName
name :: Maybe PhoneNumberAssociationName
$sel:name:PhoneNumberAssociation' :: PhoneNumberAssociation -> Maybe PhoneNumberAssociationName
name} -> Maybe PhoneNumberAssociationName
name) (\s :: PhoneNumberAssociation
s@PhoneNumberAssociation' {} Maybe PhoneNumberAssociationName
a -> PhoneNumberAssociation
s {$sel:name:PhoneNumberAssociation' :: Maybe PhoneNumberAssociationName
name = Maybe PhoneNumberAssociationName
a} :: PhoneNumberAssociation)
instance Core.FromJSON PhoneNumberAssociation where
parseJSON :: Value -> Parser PhoneNumberAssociation
parseJSON =
String
-> (Object -> Parser PhoneNumberAssociation)
-> Value
-> Parser PhoneNumberAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PhoneNumberAssociation"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe PhoneNumberAssociationName
-> PhoneNumberAssociation
PhoneNumberAssociation'
(Maybe Text
-> Maybe POSIX
-> Maybe PhoneNumberAssociationName
-> PhoneNumberAssociation)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe PhoneNumberAssociationName -> PhoneNumberAssociation)
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
"Value")
Parser
(Maybe POSIX
-> Maybe PhoneNumberAssociationName -> PhoneNumberAssociation)
-> Parser (Maybe POSIX)
-> Parser
(Maybe PhoneNumberAssociationName -> PhoneNumberAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssociatedTimestamp")
Parser (Maybe PhoneNumberAssociationName -> PhoneNumberAssociation)
-> Parser (Maybe PhoneNumberAssociationName)
-> Parser PhoneNumberAssociation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PhoneNumberAssociationName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
)
instance Prelude.Hashable PhoneNumberAssociation
instance Prelude.NFData PhoneNumberAssociation