{-# 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.Polly.Types.LexiconAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Polly.Types.LanguageCode
import qualified Amazonka.Prelude as Prelude
data LexiconAttributes = LexiconAttributes'
{
LexiconAttributes -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
LexiconAttributes -> Maybe Int
size :: Prelude.Maybe Prelude.Int,
LexiconAttributes -> Maybe Int
lexemesCount :: Prelude.Maybe Prelude.Int,
LexiconAttributes -> Maybe Text
lexiconArn :: Prelude.Maybe Prelude.Text,
LexiconAttributes -> Maybe Text
alphabet :: Prelude.Maybe Prelude.Text,
LexiconAttributes -> Maybe POSIX
lastModified :: Prelude.Maybe Core.POSIX
}
deriving (LexiconAttributes -> LexiconAttributes -> Bool
(LexiconAttributes -> LexiconAttributes -> Bool)
-> (LexiconAttributes -> LexiconAttributes -> Bool)
-> Eq LexiconAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LexiconAttributes -> LexiconAttributes -> Bool
$c/= :: LexiconAttributes -> LexiconAttributes -> Bool
== :: LexiconAttributes -> LexiconAttributes -> Bool
$c== :: LexiconAttributes -> LexiconAttributes -> Bool
Prelude.Eq, ReadPrec [LexiconAttributes]
ReadPrec LexiconAttributes
Int -> ReadS LexiconAttributes
ReadS [LexiconAttributes]
(Int -> ReadS LexiconAttributes)
-> ReadS [LexiconAttributes]
-> ReadPrec LexiconAttributes
-> ReadPrec [LexiconAttributes]
-> Read LexiconAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LexiconAttributes]
$creadListPrec :: ReadPrec [LexiconAttributes]
readPrec :: ReadPrec LexiconAttributes
$creadPrec :: ReadPrec LexiconAttributes
readList :: ReadS [LexiconAttributes]
$creadList :: ReadS [LexiconAttributes]
readsPrec :: Int -> ReadS LexiconAttributes
$creadsPrec :: Int -> ReadS LexiconAttributes
Prelude.Read, Int -> LexiconAttributes -> ShowS
[LexiconAttributes] -> ShowS
LexiconAttributes -> String
(Int -> LexiconAttributes -> ShowS)
-> (LexiconAttributes -> String)
-> ([LexiconAttributes] -> ShowS)
-> Show LexiconAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LexiconAttributes] -> ShowS
$cshowList :: [LexiconAttributes] -> ShowS
show :: LexiconAttributes -> String
$cshow :: LexiconAttributes -> String
showsPrec :: Int -> LexiconAttributes -> ShowS
$cshowsPrec :: Int -> LexiconAttributes -> ShowS
Prelude.Show, (forall x. LexiconAttributes -> Rep LexiconAttributes x)
-> (forall x. Rep LexiconAttributes x -> LexiconAttributes)
-> Generic LexiconAttributes
forall x. Rep LexiconAttributes x -> LexiconAttributes
forall x. LexiconAttributes -> Rep LexiconAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LexiconAttributes x -> LexiconAttributes
$cfrom :: forall x. LexiconAttributes -> Rep LexiconAttributes x
Prelude.Generic)
newLexiconAttributes ::
LexiconAttributes
newLexiconAttributes :: LexiconAttributes
newLexiconAttributes =
LexiconAttributes' :: Maybe LanguageCode
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> LexiconAttributes
LexiconAttributes'
{ $sel:languageCode:LexiconAttributes' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
forall a. Maybe a
Prelude.Nothing,
$sel:size:LexiconAttributes' :: Maybe Int
size = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:lexemesCount:LexiconAttributes' :: Maybe Int
lexemesCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:lexiconArn:LexiconAttributes' :: Maybe Text
lexiconArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alphabet:LexiconAttributes' :: Maybe Text
alphabet = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastModified:LexiconAttributes' :: Maybe POSIX
lastModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
lexiconAttributes_languageCode :: Lens.Lens' LexiconAttributes (Prelude.Maybe LanguageCode)
lexiconAttributes_languageCode :: (Maybe LanguageCode -> f (Maybe LanguageCode))
-> LexiconAttributes -> f LexiconAttributes
lexiconAttributes_languageCode = (LexiconAttributes -> Maybe LanguageCode)
-> (LexiconAttributes -> Maybe LanguageCode -> LexiconAttributes)
-> Lens
LexiconAttributes
LexiconAttributes
(Maybe LanguageCode)
(Maybe LanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexiconAttributes' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:LexiconAttributes' :: LexiconAttributes -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: LexiconAttributes
s@LexiconAttributes' {} Maybe LanguageCode
a -> LexiconAttributes
s {$sel:languageCode:LexiconAttributes' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: LexiconAttributes)
lexiconAttributes_size :: Lens.Lens' LexiconAttributes (Prelude.Maybe Prelude.Int)
lexiconAttributes_size :: (Maybe Int -> f (Maybe Int))
-> LexiconAttributes -> f LexiconAttributes
lexiconAttributes_size = (LexiconAttributes -> Maybe Int)
-> (LexiconAttributes -> Maybe Int -> LexiconAttributes)
-> Lens LexiconAttributes LexiconAttributes (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexiconAttributes' {Maybe Int
size :: Maybe Int
$sel:size:LexiconAttributes' :: LexiconAttributes -> Maybe Int
size} -> Maybe Int
size) (\s :: LexiconAttributes
s@LexiconAttributes' {} Maybe Int
a -> LexiconAttributes
s {$sel:size:LexiconAttributes' :: Maybe Int
size = Maybe Int
a} :: LexiconAttributes)
lexiconAttributes_lexemesCount :: Lens.Lens' LexiconAttributes (Prelude.Maybe Prelude.Int)
lexiconAttributes_lexemesCount :: (Maybe Int -> f (Maybe Int))
-> LexiconAttributes -> f LexiconAttributes
lexiconAttributes_lexemesCount = (LexiconAttributes -> Maybe Int)
-> (LexiconAttributes -> Maybe Int -> LexiconAttributes)
-> Lens LexiconAttributes LexiconAttributes (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexiconAttributes' {Maybe Int
lexemesCount :: Maybe Int
$sel:lexemesCount:LexiconAttributes' :: LexiconAttributes -> Maybe Int
lexemesCount} -> Maybe Int
lexemesCount) (\s :: LexiconAttributes
s@LexiconAttributes' {} Maybe Int
a -> LexiconAttributes
s {$sel:lexemesCount:LexiconAttributes' :: Maybe Int
lexemesCount = Maybe Int
a} :: LexiconAttributes)
lexiconAttributes_lexiconArn :: Lens.Lens' LexiconAttributes (Prelude.Maybe Prelude.Text)
lexiconAttributes_lexiconArn :: (Maybe Text -> f (Maybe Text))
-> LexiconAttributes -> f LexiconAttributes
lexiconAttributes_lexiconArn = (LexiconAttributes -> Maybe Text)
-> (LexiconAttributes -> Maybe Text -> LexiconAttributes)
-> Lens
LexiconAttributes LexiconAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexiconAttributes' {Maybe Text
lexiconArn :: Maybe Text
$sel:lexiconArn:LexiconAttributes' :: LexiconAttributes -> Maybe Text
lexiconArn} -> Maybe Text
lexiconArn) (\s :: LexiconAttributes
s@LexiconAttributes' {} Maybe Text
a -> LexiconAttributes
s {$sel:lexiconArn:LexiconAttributes' :: Maybe Text
lexiconArn = Maybe Text
a} :: LexiconAttributes)
lexiconAttributes_alphabet :: Lens.Lens' LexiconAttributes (Prelude.Maybe Prelude.Text)
lexiconAttributes_alphabet :: (Maybe Text -> f (Maybe Text))
-> LexiconAttributes -> f LexiconAttributes
lexiconAttributes_alphabet = (LexiconAttributes -> Maybe Text)
-> (LexiconAttributes -> Maybe Text -> LexiconAttributes)
-> Lens
LexiconAttributes LexiconAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexiconAttributes' {Maybe Text
alphabet :: Maybe Text
$sel:alphabet:LexiconAttributes' :: LexiconAttributes -> Maybe Text
alphabet} -> Maybe Text
alphabet) (\s :: LexiconAttributes
s@LexiconAttributes' {} Maybe Text
a -> LexiconAttributes
s {$sel:alphabet:LexiconAttributes' :: Maybe Text
alphabet = Maybe Text
a} :: LexiconAttributes)
lexiconAttributes_lastModified :: Lens.Lens' LexiconAttributes (Prelude.Maybe Prelude.UTCTime)
lexiconAttributes_lastModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LexiconAttributes -> f LexiconAttributes
lexiconAttributes_lastModified = (LexiconAttributes -> Maybe POSIX)
-> (LexiconAttributes -> Maybe POSIX -> LexiconAttributes)
-> Lens
LexiconAttributes LexiconAttributes (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexiconAttributes' {Maybe POSIX
lastModified :: Maybe POSIX
$sel:lastModified:LexiconAttributes' :: LexiconAttributes -> Maybe POSIX
lastModified} -> Maybe POSIX
lastModified) (\s :: LexiconAttributes
s@LexiconAttributes' {} Maybe POSIX
a -> LexiconAttributes
s {$sel:lastModified:LexiconAttributes' :: Maybe POSIX
lastModified = Maybe POSIX
a} :: LexiconAttributes) ((Maybe POSIX -> f (Maybe POSIX))
-> LexiconAttributes -> f LexiconAttributes)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LexiconAttributes
-> f LexiconAttributes
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
instance Core.FromJSON LexiconAttributes where
parseJSON :: Value -> Parser LexiconAttributes
parseJSON =
String
-> (Object -> Parser LexiconAttributes)
-> Value
-> Parser LexiconAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LexiconAttributes"
( \Object
x ->
Maybe LanguageCode
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> LexiconAttributes
LexiconAttributes'
(Maybe LanguageCode
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> LexiconAttributes)
-> Parser (Maybe LanguageCode)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> LexiconAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LanguageCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LanguageCode")
Parser
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> LexiconAttributes)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Text -> Maybe Text -> Maybe POSIX -> LexiconAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Size")
Parser
(Maybe Int
-> Maybe Text -> Maybe Text -> Maybe POSIX -> LexiconAttributes)
-> Parser (Maybe Int)
-> Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> LexiconAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LexemesCount")
Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> LexiconAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> LexiconAttributes)
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
"LexiconArn")
Parser (Maybe Text -> Maybe POSIX -> LexiconAttributes)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> LexiconAttributes)
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
"Alphabet")
Parser (Maybe POSIX -> LexiconAttributes)
-> Parser (Maybe POSIX) -> Parser LexiconAttributes
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
"LastModified")
)
instance Prelude.Hashable LexiconAttributes
instance Prelude.NFData LexiconAttributes