{-# 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.Lexicon where
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 Lexicon = Lexicon'
{
Lexicon -> Maybe (Sensitive Text)
content :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Lexicon -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (Lexicon -> Lexicon -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Lexicon -> Lexicon -> Bool
$c/= :: Lexicon -> Lexicon -> Bool
== :: Lexicon -> Lexicon -> Bool
$c== :: Lexicon -> Lexicon -> Bool
Prelude.Eq, Int -> Lexicon -> ShowS
[Lexicon] -> ShowS
Lexicon -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Lexicon] -> ShowS
$cshowList :: [Lexicon] -> ShowS
show :: Lexicon -> String
$cshow :: Lexicon -> String
showsPrec :: Int -> Lexicon -> ShowS
$cshowsPrec :: Int -> Lexicon -> ShowS
Prelude.Show, forall x. Rep Lexicon x -> Lexicon
forall x. Lexicon -> Rep Lexicon x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Lexicon x -> Lexicon
$cfrom :: forall x. Lexicon -> Rep Lexicon x
Prelude.Generic)
newLexicon ::
Lexicon
newLexicon :: Lexicon
newLexicon =
Lexicon'
{ $sel:content:Lexicon' :: Maybe (Sensitive Text)
content = forall a. Maybe a
Prelude.Nothing,
$sel:name:Lexicon' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
}
lexicon_content :: Lens.Lens' Lexicon (Prelude.Maybe Prelude.Text)
lexicon_content :: Lens' Lexicon (Maybe Text)
lexicon_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lexicon' {Maybe (Sensitive Text)
content :: Maybe (Sensitive Text)
$sel:content:Lexicon' :: Lexicon -> Maybe (Sensitive Text)
content} -> Maybe (Sensitive Text)
content) (\s :: Lexicon
s@Lexicon' {} Maybe (Sensitive Text)
a -> Lexicon
s {$sel:content:Lexicon' :: Maybe (Sensitive Text)
content = Maybe (Sensitive Text)
a} :: Lexicon) 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 a. Iso' (Sensitive a) a
Data._Sensitive
lexicon_name :: Lens.Lens' Lexicon (Prelude.Maybe Prelude.Text)
lexicon_name :: Lens' Lexicon (Maybe Text)
lexicon_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lexicon' {Maybe Text
name :: Maybe Text
$sel:name:Lexicon' :: Lexicon -> Maybe Text
name} -> Maybe Text
name) (\s :: Lexicon
s@Lexicon' {} Maybe Text
a -> Lexicon
s {$sel:name:Lexicon' :: Maybe Text
name = Maybe Text
a} :: Lexicon)
instance Data.FromJSON Lexicon where
parseJSON :: Value -> Parser Lexicon
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Lexicon"
( \Object
x ->
Maybe (Sensitive Text) -> Maybe Text -> Lexicon
Lexicon'
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
"Name")
)
instance Prelude.Hashable Lexicon where
hashWithSalt :: Int -> Lexicon -> Int
hashWithSalt Int
_salt Lexicon' {Maybe Text
Maybe (Sensitive Text)
name :: Maybe Text
content :: Maybe (Sensitive Text)
$sel:name:Lexicon' :: Lexicon -> Maybe Text
$sel:content:Lexicon' :: Lexicon -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
content
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
instance Prelude.NFData Lexicon where
rnf :: Lexicon -> ()
rnf Lexicon' {Maybe Text
Maybe (Sensitive Text)
name :: Maybe Text
content :: Maybe (Sensitive Text)
$sel:name:Lexicon' :: Lexicon -> Maybe Text
$sel:content:Lexicon' :: Lexicon -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
content seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name