{-# 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.Vocabulary where
import Amazonka.Connect.Types.VocabularyLanguageCode
import Amazonka.Connect.Types.VocabularyState
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Vocabulary = Vocabulary'
{
Vocabulary -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
Vocabulary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
Vocabulary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Vocabulary -> Text
name :: Prelude.Text,
Vocabulary -> Text
id :: Prelude.Text,
Vocabulary -> Text
arn :: Prelude.Text,
Vocabulary -> VocabularyLanguageCode
languageCode :: VocabularyLanguageCode,
Vocabulary -> VocabularyState
state :: VocabularyState,
Vocabulary -> POSIX
lastModifiedTime :: Data.POSIX
}
deriving (Vocabulary -> Vocabulary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Vocabulary -> Vocabulary -> Bool
$c/= :: Vocabulary -> Vocabulary -> Bool
== :: Vocabulary -> Vocabulary -> Bool
$c== :: Vocabulary -> Vocabulary -> Bool
Prelude.Eq, ReadPrec [Vocabulary]
ReadPrec Vocabulary
Int -> ReadS Vocabulary
ReadS [Vocabulary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Vocabulary]
$creadListPrec :: ReadPrec [Vocabulary]
readPrec :: ReadPrec Vocabulary
$creadPrec :: ReadPrec Vocabulary
readList :: ReadS [Vocabulary]
$creadList :: ReadS [Vocabulary]
readsPrec :: Int -> ReadS Vocabulary
$creadsPrec :: Int -> ReadS Vocabulary
Prelude.Read, Int -> Vocabulary -> ShowS
[Vocabulary] -> ShowS
Vocabulary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Vocabulary] -> ShowS
$cshowList :: [Vocabulary] -> ShowS
show :: Vocabulary -> String
$cshow :: Vocabulary -> String
showsPrec :: Int -> Vocabulary -> ShowS
$cshowsPrec :: Int -> Vocabulary -> ShowS
Prelude.Show, forall x. Rep Vocabulary x -> Vocabulary
forall x. Vocabulary -> Rep Vocabulary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Vocabulary x -> Vocabulary
$cfrom :: forall x. Vocabulary -> Rep Vocabulary x
Prelude.Generic)
newVocabulary ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VocabularyLanguageCode ->
VocabularyState ->
Prelude.UTCTime ->
Vocabulary
newVocabulary :: Text
-> Text
-> Text
-> VocabularyLanguageCode
-> VocabularyState
-> UTCTime
-> Vocabulary
newVocabulary
Text
pName_
Text
pId_
Text
pArn_
VocabularyLanguageCode
pLanguageCode_
VocabularyState
pState_
UTCTime
pLastModifiedTime_ =
Vocabulary'
{ $sel:content:Vocabulary' :: Maybe Text
content = forall a. Maybe a
Prelude.Nothing,
$sel:failureReason:Vocabulary' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
$sel:tags:Vocabulary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:name:Vocabulary' :: Text
name = Text
pName_,
$sel:id:Vocabulary' :: Text
id = Text
pId_,
$sel:arn:Vocabulary' :: Text
arn = Text
pArn_,
$sel:languageCode:Vocabulary' :: VocabularyLanguageCode
languageCode = VocabularyLanguageCode
pLanguageCode_,
$sel:state:Vocabulary' :: VocabularyState
state = VocabularyState
pState_,
$sel:lastModifiedTime:Vocabulary' :: POSIX
lastModifiedTime =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
}
vocabulary_content :: Lens.Lens' Vocabulary (Prelude.Maybe Prelude.Text)
vocabulary_content :: Lens' Vocabulary (Maybe Text)
vocabulary_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {Maybe Text
content :: Maybe Text
$sel:content:Vocabulary' :: Vocabulary -> Maybe Text
content} -> Maybe Text
content) (\s :: Vocabulary
s@Vocabulary' {} Maybe Text
a -> Vocabulary
s {$sel:content:Vocabulary' :: Maybe Text
content = Maybe Text
a} :: Vocabulary)
vocabulary_failureReason :: Lens.Lens' Vocabulary (Prelude.Maybe Prelude.Text)
vocabulary_failureReason :: Lens' Vocabulary (Maybe Text)
vocabulary_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:Vocabulary' :: Vocabulary -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: Vocabulary
s@Vocabulary' {} Maybe Text
a -> Vocabulary
s {$sel:failureReason:Vocabulary' :: Maybe Text
failureReason = Maybe Text
a} :: Vocabulary)
vocabulary_tags :: Lens.Lens' Vocabulary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
vocabulary_tags :: Lens' Vocabulary (Maybe (HashMap Text Text))
vocabulary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Vocabulary' :: Vocabulary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Vocabulary
s@Vocabulary' {} Maybe (HashMap Text Text)
a -> Vocabulary
s {$sel:tags:Vocabulary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Vocabulary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
vocabulary_name :: Lens.Lens' Vocabulary Prelude.Text
vocabulary_name :: Lens' Vocabulary Text
vocabulary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {Text
name :: Text
$sel:name:Vocabulary' :: Vocabulary -> Text
name} -> Text
name) (\s :: Vocabulary
s@Vocabulary' {} Text
a -> Vocabulary
s {$sel:name:Vocabulary' :: Text
name = Text
a} :: Vocabulary)
vocabulary_id :: Lens.Lens' Vocabulary Prelude.Text
vocabulary_id :: Lens' Vocabulary Text
vocabulary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {Text
id :: Text
$sel:id:Vocabulary' :: Vocabulary -> Text
id} -> Text
id) (\s :: Vocabulary
s@Vocabulary' {} Text
a -> Vocabulary
s {$sel:id:Vocabulary' :: Text
id = Text
a} :: Vocabulary)
vocabulary_arn :: Lens.Lens' Vocabulary Prelude.Text
vocabulary_arn :: Lens' Vocabulary Text
vocabulary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {Text
arn :: Text
$sel:arn:Vocabulary' :: Vocabulary -> Text
arn} -> Text
arn) (\s :: Vocabulary
s@Vocabulary' {} Text
a -> Vocabulary
s {$sel:arn:Vocabulary' :: Text
arn = Text
a} :: Vocabulary)
vocabulary_languageCode :: Lens.Lens' Vocabulary VocabularyLanguageCode
vocabulary_languageCode :: Lens' Vocabulary VocabularyLanguageCode
vocabulary_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {VocabularyLanguageCode
languageCode :: VocabularyLanguageCode
$sel:languageCode:Vocabulary' :: Vocabulary -> VocabularyLanguageCode
languageCode} -> VocabularyLanguageCode
languageCode) (\s :: Vocabulary
s@Vocabulary' {} VocabularyLanguageCode
a -> Vocabulary
s {$sel:languageCode:Vocabulary' :: VocabularyLanguageCode
languageCode = VocabularyLanguageCode
a} :: Vocabulary)
vocabulary_state :: Lens.Lens' Vocabulary VocabularyState
vocabulary_state :: Lens' Vocabulary VocabularyState
vocabulary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {VocabularyState
state :: VocabularyState
$sel:state:Vocabulary' :: Vocabulary -> VocabularyState
state} -> VocabularyState
state) (\s :: Vocabulary
s@Vocabulary' {} VocabularyState
a -> Vocabulary
s {$sel:state:Vocabulary' :: VocabularyState
state = VocabularyState
a} :: Vocabulary)
vocabulary_lastModifiedTime :: Lens.Lens' Vocabulary Prelude.UTCTime
vocabulary_lastModifiedTime :: Lens' Vocabulary UTCTime
vocabulary_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vocabulary' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:Vocabulary' :: Vocabulary -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: Vocabulary
s@Vocabulary' {} POSIX
a -> Vocabulary
s {$sel:lastModifiedTime:Vocabulary' :: POSIX
lastModifiedTime = POSIX
a} :: Vocabulary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON Vocabulary where
parseJSON :: Value -> Parser Vocabulary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Vocabulary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> VocabularyLanguageCode
-> VocabularyState
-> POSIX
-> Vocabulary
Vocabulary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Content")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FailureReason")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LanguageCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"State")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastModifiedTime")
)
instance Prelude.Hashable Vocabulary where
hashWithSalt :: Int -> Vocabulary -> Int
hashWithSalt Int
_salt Vocabulary' {Maybe Text
Maybe (HashMap Text Text)
Text
POSIX
VocabularyLanguageCode
VocabularyState
lastModifiedTime :: POSIX
state :: VocabularyState
languageCode :: VocabularyLanguageCode
arn :: Text
id :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
failureReason :: Maybe Text
content :: Maybe Text
$sel:lastModifiedTime:Vocabulary' :: Vocabulary -> POSIX
$sel:state:Vocabulary' :: Vocabulary -> VocabularyState
$sel:languageCode:Vocabulary' :: Vocabulary -> VocabularyLanguageCode
$sel:arn:Vocabulary' :: Vocabulary -> Text
$sel:id:Vocabulary' :: Vocabulary -> Text
$sel:name:Vocabulary' :: Vocabulary -> Text
$sel:tags:Vocabulary' :: Vocabulary -> Maybe (HashMap Text Text)
$sel:failureReason:Vocabulary' :: Vocabulary -> Maybe Text
$sel:content:Vocabulary' :: Vocabulary -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
content
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VocabularyLanguageCode
languageCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VocabularyState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModifiedTime
instance Prelude.NFData Vocabulary where
rnf :: Vocabulary -> ()
rnf Vocabulary' {Maybe Text
Maybe (HashMap Text Text)
Text
POSIX
VocabularyLanguageCode
VocabularyState
lastModifiedTime :: POSIX
state :: VocabularyState
languageCode :: VocabularyLanguageCode
arn :: Text
id :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
failureReason :: Maybe Text
content :: Maybe Text
$sel:lastModifiedTime:Vocabulary' :: Vocabulary -> POSIX
$sel:state:Vocabulary' :: Vocabulary -> VocabularyState
$sel:languageCode:Vocabulary' :: Vocabulary -> VocabularyLanguageCode
$sel:arn:Vocabulary' :: Vocabulary -> Text
$sel:id:Vocabulary' :: Vocabulary -> Text
$sel:name:Vocabulary' :: Vocabulary -> Text
$sel:tags:Vocabulary' :: Vocabulary -> Maybe (HashMap Text Text)
$sel:failureReason:Vocabulary' :: Vocabulary -> Maybe Text
$sel:content:Vocabulary' :: Vocabulary -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
content
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VocabularyLanguageCode
languageCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VocabularyState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModifiedTime