{-# 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.LexV2Models.Types.SubSlotTypeComposition 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 SubSlotTypeComposition = SubSlotTypeComposition'
{
SubSlotTypeComposition -> Text
name :: Prelude.Text,
SubSlotTypeComposition -> Text
slotTypeId :: Prelude.Text
}
deriving (SubSlotTypeComposition -> SubSlotTypeComposition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubSlotTypeComposition -> SubSlotTypeComposition -> Bool
$c/= :: SubSlotTypeComposition -> SubSlotTypeComposition -> Bool
== :: SubSlotTypeComposition -> SubSlotTypeComposition -> Bool
$c== :: SubSlotTypeComposition -> SubSlotTypeComposition -> Bool
Prelude.Eq, ReadPrec [SubSlotTypeComposition]
ReadPrec SubSlotTypeComposition
Int -> ReadS SubSlotTypeComposition
ReadS [SubSlotTypeComposition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubSlotTypeComposition]
$creadListPrec :: ReadPrec [SubSlotTypeComposition]
readPrec :: ReadPrec SubSlotTypeComposition
$creadPrec :: ReadPrec SubSlotTypeComposition
readList :: ReadS [SubSlotTypeComposition]
$creadList :: ReadS [SubSlotTypeComposition]
readsPrec :: Int -> ReadS SubSlotTypeComposition
$creadsPrec :: Int -> ReadS SubSlotTypeComposition
Prelude.Read, Int -> SubSlotTypeComposition -> ShowS
[SubSlotTypeComposition] -> ShowS
SubSlotTypeComposition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubSlotTypeComposition] -> ShowS
$cshowList :: [SubSlotTypeComposition] -> ShowS
show :: SubSlotTypeComposition -> String
$cshow :: SubSlotTypeComposition -> String
showsPrec :: Int -> SubSlotTypeComposition -> ShowS
$cshowsPrec :: Int -> SubSlotTypeComposition -> ShowS
Prelude.Show, forall x. Rep SubSlotTypeComposition x -> SubSlotTypeComposition
forall x. SubSlotTypeComposition -> Rep SubSlotTypeComposition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubSlotTypeComposition x -> SubSlotTypeComposition
$cfrom :: forall x. SubSlotTypeComposition -> Rep SubSlotTypeComposition x
Prelude.Generic)
newSubSlotTypeComposition ::
Prelude.Text ->
Prelude.Text ->
SubSlotTypeComposition
newSubSlotTypeComposition :: Text -> Text -> SubSlotTypeComposition
newSubSlotTypeComposition Text
pName_ Text
pSlotTypeId_ =
SubSlotTypeComposition'
{ $sel:name:SubSlotTypeComposition' :: Text
name = Text
pName_,
$sel:slotTypeId:SubSlotTypeComposition' :: Text
slotTypeId = Text
pSlotTypeId_
}
subSlotTypeComposition_name :: Lens.Lens' SubSlotTypeComposition Prelude.Text
subSlotTypeComposition_name :: Lens' SubSlotTypeComposition Text
subSlotTypeComposition_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubSlotTypeComposition' {Text
name :: Text
$sel:name:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
name} -> Text
name) (\s :: SubSlotTypeComposition
s@SubSlotTypeComposition' {} Text
a -> SubSlotTypeComposition
s {$sel:name:SubSlotTypeComposition' :: Text
name = Text
a} :: SubSlotTypeComposition)
subSlotTypeComposition_slotTypeId :: Lens.Lens' SubSlotTypeComposition Prelude.Text
subSlotTypeComposition_slotTypeId :: Lens' SubSlotTypeComposition Text
subSlotTypeComposition_slotTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubSlotTypeComposition' {Text
slotTypeId :: Text
$sel:slotTypeId:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
slotTypeId} -> Text
slotTypeId) (\s :: SubSlotTypeComposition
s@SubSlotTypeComposition' {} Text
a -> SubSlotTypeComposition
s {$sel:slotTypeId:SubSlotTypeComposition' :: Text
slotTypeId = Text
a} :: SubSlotTypeComposition)
instance Data.FromJSON SubSlotTypeComposition where
parseJSON :: Value -> Parser SubSlotTypeComposition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SubSlotTypeComposition"
( \Object
x ->
Text -> Text -> SubSlotTypeComposition
SubSlotTypeComposition'
forall (f :: * -> *) a b. Functor 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
"slotTypeId")
)
instance Prelude.Hashable SubSlotTypeComposition where
hashWithSalt :: Int -> SubSlotTypeComposition -> Int
hashWithSalt Int
_salt SubSlotTypeComposition' {Text
slotTypeId :: Text
name :: Text
$sel:slotTypeId:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
$sel:name:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
slotTypeId
instance Prelude.NFData SubSlotTypeComposition where
rnf :: SubSlotTypeComposition -> ()
rnf SubSlotTypeComposition' {Text
slotTypeId :: Text
name :: Text
$sel:slotTypeId:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
$sel:name:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
..} =
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
slotTypeId
instance Data.ToJSON SubSlotTypeComposition where
toJSON :: SubSlotTypeComposition -> Value
toJSON SubSlotTypeComposition' {Text
slotTypeId :: Text
name :: Text
$sel:slotTypeId:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
$sel:name:SubSlotTypeComposition' :: SubSlotTypeComposition -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"slotTypeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
slotTypeId)
]
)