{-# 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.Connect.Types.PhoneNumberSummary where
import Amazonka.Connect.Types.PhoneNumberCountryCode
import Amazonka.Connect.Types.PhoneNumberType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PhoneNumberSummary = PhoneNumberSummary'
{
PhoneNumberSummary -> Maybe PhoneNumberType
phoneNumberType :: Prelude.Maybe PhoneNumberType,
PhoneNumberSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
PhoneNumberSummary -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text,
PhoneNumberSummary -> Maybe PhoneNumberCountryCode
phoneNumberCountryCode :: Prelude.Maybe PhoneNumberCountryCode,
PhoneNumberSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (PhoneNumberSummary -> PhoneNumberSummary -> Bool
(PhoneNumberSummary -> PhoneNumberSummary -> Bool)
-> (PhoneNumberSummary -> PhoneNumberSummary -> Bool)
-> Eq PhoneNumberSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhoneNumberSummary -> PhoneNumberSummary -> Bool
$c/= :: PhoneNumberSummary -> PhoneNumberSummary -> Bool
== :: PhoneNumberSummary -> PhoneNumberSummary -> Bool
$c== :: PhoneNumberSummary -> PhoneNumberSummary -> Bool
Prelude.Eq, ReadPrec [PhoneNumberSummary]
ReadPrec PhoneNumberSummary
Int -> ReadS PhoneNumberSummary
ReadS [PhoneNumberSummary]
(Int -> ReadS PhoneNumberSummary)
-> ReadS [PhoneNumberSummary]
-> ReadPrec PhoneNumberSummary
-> ReadPrec [PhoneNumberSummary]
-> Read PhoneNumberSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhoneNumberSummary]
$creadListPrec :: ReadPrec [PhoneNumberSummary]
readPrec :: ReadPrec PhoneNumberSummary
$creadPrec :: ReadPrec PhoneNumberSummary
readList :: ReadS [PhoneNumberSummary]
$creadList :: ReadS [PhoneNumberSummary]
readsPrec :: Int -> ReadS PhoneNumberSummary
$creadsPrec :: Int -> ReadS PhoneNumberSummary
Prelude.Read, Int -> PhoneNumberSummary -> ShowS
[PhoneNumberSummary] -> ShowS
PhoneNumberSummary -> String
(Int -> PhoneNumberSummary -> ShowS)
-> (PhoneNumberSummary -> String)
-> ([PhoneNumberSummary] -> ShowS)
-> Show PhoneNumberSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhoneNumberSummary] -> ShowS
$cshowList :: [PhoneNumberSummary] -> ShowS
show :: PhoneNumberSummary -> String
$cshow :: PhoneNumberSummary -> String
showsPrec :: Int -> PhoneNumberSummary -> ShowS
$cshowsPrec :: Int -> PhoneNumberSummary -> ShowS
Prelude.Show, (forall x. PhoneNumberSummary -> Rep PhoneNumberSummary x)
-> (forall x. Rep PhoneNumberSummary x -> PhoneNumberSummary)
-> Generic PhoneNumberSummary
forall x. Rep PhoneNumberSummary x -> PhoneNumberSummary
forall x. PhoneNumberSummary -> Rep PhoneNumberSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhoneNumberSummary x -> PhoneNumberSummary
$cfrom :: forall x. PhoneNumberSummary -> Rep PhoneNumberSummary x
Prelude.Generic)
newPhoneNumberSummary ::
PhoneNumberSummary
newPhoneNumberSummary :: PhoneNumberSummary
newPhoneNumberSummary =
PhoneNumberSummary' :: Maybe PhoneNumberType
-> Maybe Text
-> Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary
PhoneNumberSummary'
{ $sel:phoneNumberType:PhoneNumberSummary' :: Maybe PhoneNumberType
phoneNumberType =
Maybe PhoneNumberType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:PhoneNumberSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:PhoneNumberSummary' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumberCountryCode:PhoneNumberSummary' :: Maybe PhoneNumberCountryCode
phoneNumberCountryCode = Maybe PhoneNumberCountryCode
forall a. Maybe a
Prelude.Nothing,
$sel:id:PhoneNumberSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
phoneNumberSummary_phoneNumberType :: Lens.Lens' PhoneNumberSummary (Prelude.Maybe PhoneNumberType)
phoneNumberSummary_phoneNumberType :: (Maybe PhoneNumberType -> f (Maybe PhoneNumberType))
-> PhoneNumberSummary -> f PhoneNumberSummary
phoneNumberSummary_phoneNumberType = (PhoneNumberSummary -> Maybe PhoneNumberType)
-> (PhoneNumberSummary
-> Maybe PhoneNumberType -> PhoneNumberSummary)
-> Lens
PhoneNumberSummary
PhoneNumberSummary
(Maybe PhoneNumberType)
(Maybe PhoneNumberType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberSummary' {Maybe PhoneNumberType
phoneNumberType :: Maybe PhoneNumberType
$sel:phoneNumberType:PhoneNumberSummary' :: PhoneNumberSummary -> Maybe PhoneNumberType
phoneNumberType} -> Maybe PhoneNumberType
phoneNumberType) (\s :: PhoneNumberSummary
s@PhoneNumberSummary' {} Maybe PhoneNumberType
a -> PhoneNumberSummary
s {$sel:phoneNumberType:PhoneNumberSummary' :: Maybe PhoneNumberType
phoneNumberType = Maybe PhoneNumberType
a} :: PhoneNumberSummary)
phoneNumberSummary_arn :: Lens.Lens' PhoneNumberSummary (Prelude.Maybe Prelude.Text)
phoneNumberSummary_arn :: (Maybe Text -> f (Maybe Text))
-> PhoneNumberSummary -> f PhoneNumberSummary
phoneNumberSummary_arn = (PhoneNumberSummary -> Maybe Text)
-> (PhoneNumberSummary -> Maybe Text -> PhoneNumberSummary)
-> Lens
PhoneNumberSummary PhoneNumberSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:PhoneNumberSummary' :: PhoneNumberSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PhoneNumberSummary
s@PhoneNumberSummary' {} Maybe Text
a -> PhoneNumberSummary
s {$sel:arn:PhoneNumberSummary' :: Maybe Text
arn = Maybe Text
a} :: PhoneNumberSummary)
phoneNumberSummary_phoneNumber :: Lens.Lens' PhoneNumberSummary (Prelude.Maybe Prelude.Text)
phoneNumberSummary_phoneNumber :: (Maybe Text -> f (Maybe Text))
-> PhoneNumberSummary -> f PhoneNumberSummary
phoneNumberSummary_phoneNumber = (PhoneNumberSummary -> Maybe Text)
-> (PhoneNumberSummary -> Maybe Text -> PhoneNumberSummary)
-> Lens
PhoneNumberSummary PhoneNumberSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberSummary' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:PhoneNumberSummary' :: PhoneNumberSummary -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: PhoneNumberSummary
s@PhoneNumberSummary' {} Maybe Text
a -> PhoneNumberSummary
s {$sel:phoneNumber:PhoneNumberSummary' :: Maybe Text
phoneNumber = Maybe Text
a} :: PhoneNumberSummary)
phoneNumberSummary_phoneNumberCountryCode :: Lens.Lens' PhoneNumberSummary (Prelude.Maybe PhoneNumberCountryCode)
phoneNumberSummary_phoneNumberCountryCode :: (Maybe PhoneNumberCountryCode -> f (Maybe PhoneNumberCountryCode))
-> PhoneNumberSummary -> f PhoneNumberSummary
phoneNumberSummary_phoneNumberCountryCode = (PhoneNumberSummary -> Maybe PhoneNumberCountryCode)
-> (PhoneNumberSummary
-> Maybe PhoneNumberCountryCode -> PhoneNumberSummary)
-> Lens
PhoneNumberSummary
PhoneNumberSummary
(Maybe PhoneNumberCountryCode)
(Maybe PhoneNumberCountryCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberSummary' {Maybe PhoneNumberCountryCode
phoneNumberCountryCode :: Maybe PhoneNumberCountryCode
$sel:phoneNumberCountryCode:PhoneNumberSummary' :: PhoneNumberSummary -> Maybe PhoneNumberCountryCode
phoneNumberCountryCode} -> Maybe PhoneNumberCountryCode
phoneNumberCountryCode) (\s :: PhoneNumberSummary
s@PhoneNumberSummary' {} Maybe PhoneNumberCountryCode
a -> PhoneNumberSummary
s {$sel:phoneNumberCountryCode:PhoneNumberSummary' :: Maybe PhoneNumberCountryCode
phoneNumberCountryCode = Maybe PhoneNumberCountryCode
a} :: PhoneNumberSummary)
phoneNumberSummary_id :: Lens.Lens' PhoneNumberSummary (Prelude.Maybe Prelude.Text)
phoneNumberSummary_id :: (Maybe Text -> f (Maybe Text))
-> PhoneNumberSummary -> f PhoneNumberSummary
phoneNumberSummary_id = (PhoneNumberSummary -> Maybe Text)
-> (PhoneNumberSummary -> Maybe Text -> PhoneNumberSummary)
-> Lens
PhoneNumberSummary PhoneNumberSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberSummary' {Maybe Text
id :: Maybe Text
$sel:id:PhoneNumberSummary' :: PhoneNumberSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: PhoneNumberSummary
s@PhoneNumberSummary' {} Maybe Text
a -> PhoneNumberSummary
s {$sel:id:PhoneNumberSummary' :: Maybe Text
id = Maybe Text
a} :: PhoneNumberSummary)
instance Core.FromJSON PhoneNumberSummary where
parseJSON :: Value -> Parser PhoneNumberSummary
parseJSON =
String
-> (Object -> Parser PhoneNumberSummary)
-> Value
-> Parser PhoneNumberSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PhoneNumberSummary"
( \Object
x ->
Maybe PhoneNumberType
-> Maybe Text
-> Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary
PhoneNumberSummary'
(Maybe PhoneNumberType
-> Maybe Text
-> Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary)
-> Parser (Maybe PhoneNumberType)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PhoneNumberType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhoneNumberType")
Parser
(Maybe Text
-> Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary)
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
"Arn")
Parser
(Maybe Text
-> Maybe PhoneNumberCountryCode
-> Maybe Text
-> PhoneNumberSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe PhoneNumberCountryCode -> Maybe Text -> PhoneNumberSummary)
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 PhoneNumberCountryCode -> Maybe Text -> PhoneNumberSummary)
-> Parser (Maybe PhoneNumberCountryCode)
-> Parser (Maybe Text -> PhoneNumberSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PhoneNumberCountryCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhoneNumberCountryCode")
Parser (Maybe Text -> PhoneNumberSummary)
-> Parser (Maybe Text) -> Parser PhoneNumberSummary
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
"Id")
)
instance Prelude.Hashable PhoneNumberSummary
instance Prelude.NFData PhoneNumberSummary