{-# 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.AlexaBusiness.Types.AddressBookData where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AddressBookData = AddressBookData'
{
AddressBookData -> Maybe Text
addressBookArn :: Prelude.Maybe Prelude.Text,
AddressBookData -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AddressBookData -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (AddressBookData -> AddressBookData -> Bool
(AddressBookData -> AddressBookData -> Bool)
-> (AddressBookData -> AddressBookData -> Bool)
-> Eq AddressBookData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressBookData -> AddressBookData -> Bool
$c/= :: AddressBookData -> AddressBookData -> Bool
== :: AddressBookData -> AddressBookData -> Bool
$c== :: AddressBookData -> AddressBookData -> Bool
Prelude.Eq, ReadPrec [AddressBookData]
ReadPrec AddressBookData
Int -> ReadS AddressBookData
ReadS [AddressBookData]
(Int -> ReadS AddressBookData)
-> ReadS [AddressBookData]
-> ReadPrec AddressBookData
-> ReadPrec [AddressBookData]
-> Read AddressBookData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddressBookData]
$creadListPrec :: ReadPrec [AddressBookData]
readPrec :: ReadPrec AddressBookData
$creadPrec :: ReadPrec AddressBookData
readList :: ReadS [AddressBookData]
$creadList :: ReadS [AddressBookData]
readsPrec :: Int -> ReadS AddressBookData
$creadsPrec :: Int -> ReadS AddressBookData
Prelude.Read, Int -> AddressBookData -> ShowS
[AddressBookData] -> ShowS
AddressBookData -> String
(Int -> AddressBookData -> ShowS)
-> (AddressBookData -> String)
-> ([AddressBookData] -> ShowS)
-> Show AddressBookData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressBookData] -> ShowS
$cshowList :: [AddressBookData] -> ShowS
show :: AddressBookData -> String
$cshow :: AddressBookData -> String
showsPrec :: Int -> AddressBookData -> ShowS
$cshowsPrec :: Int -> AddressBookData -> ShowS
Prelude.Show, (forall x. AddressBookData -> Rep AddressBookData x)
-> (forall x. Rep AddressBookData x -> AddressBookData)
-> Generic AddressBookData
forall x. Rep AddressBookData x -> AddressBookData
forall x. AddressBookData -> Rep AddressBookData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressBookData x -> AddressBookData
$cfrom :: forall x. AddressBookData -> Rep AddressBookData x
Prelude.Generic)
newAddressBookData ::
AddressBookData
newAddressBookData :: AddressBookData
newAddressBookData =
AddressBookData' :: Maybe Text -> Maybe Text -> Maybe Text -> AddressBookData
AddressBookData'
{ $sel:addressBookArn:AddressBookData' :: Maybe Text
addressBookArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:AddressBookData' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:AddressBookData' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
addressBookData_addressBookArn :: Lens.Lens' AddressBookData (Prelude.Maybe Prelude.Text)
addressBookData_addressBookArn :: (Maybe Text -> f (Maybe Text))
-> AddressBookData -> f AddressBookData
addressBookData_addressBookArn = (AddressBookData -> Maybe Text)
-> (AddressBookData -> Maybe Text -> AddressBookData)
-> Lens AddressBookData AddressBookData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressBookData' {Maybe Text
addressBookArn :: Maybe Text
$sel:addressBookArn:AddressBookData' :: AddressBookData -> Maybe Text
addressBookArn} -> Maybe Text
addressBookArn) (\s :: AddressBookData
s@AddressBookData' {} Maybe Text
a -> AddressBookData
s {$sel:addressBookArn:AddressBookData' :: Maybe Text
addressBookArn = Maybe Text
a} :: AddressBookData)
addressBookData_name :: Lens.Lens' AddressBookData (Prelude.Maybe Prelude.Text)
addressBookData_name :: (Maybe Text -> f (Maybe Text))
-> AddressBookData -> f AddressBookData
addressBookData_name = (AddressBookData -> Maybe Text)
-> (AddressBookData -> Maybe Text -> AddressBookData)
-> Lens AddressBookData AddressBookData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressBookData' {Maybe Text
name :: Maybe Text
$sel:name:AddressBookData' :: AddressBookData -> Maybe Text
name} -> Maybe Text
name) (\s :: AddressBookData
s@AddressBookData' {} Maybe Text
a -> AddressBookData
s {$sel:name:AddressBookData' :: Maybe Text
name = Maybe Text
a} :: AddressBookData)
addressBookData_description :: Lens.Lens' AddressBookData (Prelude.Maybe Prelude.Text)
addressBookData_description :: (Maybe Text -> f (Maybe Text))
-> AddressBookData -> f AddressBookData
addressBookData_description = (AddressBookData -> Maybe Text)
-> (AddressBookData -> Maybe Text -> AddressBookData)
-> Lens AddressBookData AddressBookData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressBookData' {Maybe Text
description :: Maybe Text
$sel:description:AddressBookData' :: AddressBookData -> Maybe Text
description} -> Maybe Text
description) (\s :: AddressBookData
s@AddressBookData' {} Maybe Text
a -> AddressBookData
s {$sel:description:AddressBookData' :: Maybe Text
description = Maybe Text
a} :: AddressBookData)
instance Core.FromJSON AddressBookData where
parseJSON :: Value -> Parser AddressBookData
parseJSON =
String
-> (Object -> Parser AddressBookData)
-> Value
-> Parser AddressBookData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AddressBookData"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> AddressBookData
AddressBookData'
(Maybe Text -> Maybe Text -> Maybe Text -> AddressBookData)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AddressBookData)
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
"AddressBookArn")
Parser (Maybe Text -> Maybe Text -> AddressBookData)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AddressBookData)
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
"Name")
Parser (Maybe Text -> AddressBookData)
-> Parser (Maybe Text) -> Parser AddressBookData
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
"Description")
)
instance Prelude.Hashable AddressBookData
instance Prelude.NFData AddressBookData