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