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