{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Lexicon = Lexicon'
{
Lexicon -> Maybe (Sensitive Text)
content :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Lexicon -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (Lexicon -> Lexicon -> Bool
(Lexicon -> Lexicon -> Bool)
-> (Lexicon -> Lexicon -> Bool) -> Eq Lexicon
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
(Int -> Lexicon -> ShowS)
-> (Lexicon -> String) -> ([Lexicon] -> ShowS) -> Show Lexicon
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. Lexicon -> Rep Lexicon x)
-> (forall x. Rep Lexicon x -> Lexicon) -> Generic Lexicon
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' :: Maybe (Sensitive Text) -> Maybe Text -> Lexicon
Lexicon'
{ $sel:content:Lexicon' :: Maybe (Sensitive Text)
content = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:Lexicon' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
lexicon_content :: Lens.Lens' Lexicon (Prelude.Maybe Prelude.Text)
lexicon_content :: (Maybe Text -> f (Maybe Text)) -> Lexicon -> f Lexicon
lexicon_content = (Lexicon -> Maybe (Sensitive Text))
-> (Lexicon -> Maybe (Sensitive Text) -> Lexicon)
-> Lens
Lexicon Lexicon (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Lexicon -> f Lexicon)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Lexicon
-> f Lexicon
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
lexicon_name :: Lens.Lens' Lexicon (Prelude.Maybe Prelude.Text)
lexicon_name :: (Maybe Text -> f (Maybe Text)) -> Lexicon -> f Lexicon
lexicon_name = (Lexicon -> Maybe Text)
-> (Lexicon -> Maybe Text -> Lexicon)
-> Lens Lexicon Lexicon (Maybe Text) (Maybe Text)
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 Core.FromJSON Lexicon where
parseJSON :: Value -> Parser Lexicon
parseJSON =
String -> (Object -> Parser Lexicon) -> Value -> Parser Lexicon
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Lexicon"
( \Object
x ->
Maybe (Sensitive Text) -> Maybe Text -> Lexicon
Lexicon'
(Maybe (Sensitive Text) -> Maybe Text -> Lexicon)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Lexicon)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Content")
Parser (Maybe Text -> Lexicon)
-> Parser (Maybe Text) -> Parser Lexicon
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")
)
instance Prelude.Hashable Lexicon
instance Prelude.NFData Lexicon