{-# 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.BatchAddFacetToObject where
import Amazonka.CloudDirectory.Types.AttributeKeyAndValue
import Amazonka.CloudDirectory.Types.ObjectReference
import Amazonka.CloudDirectory.Types.SchemaFacet
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 BatchAddFacetToObject = BatchAddFacetToObject'
{
BatchAddFacetToObject -> SchemaFacet
schemaFacet :: SchemaFacet,
BatchAddFacetToObject -> [AttributeKeyAndValue]
objectAttributeList :: [AttributeKeyAndValue],
BatchAddFacetToObject -> ObjectReference
objectReference :: ObjectReference
}
deriving (BatchAddFacetToObject -> BatchAddFacetToObject -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAddFacetToObject -> BatchAddFacetToObject -> Bool
$c/= :: BatchAddFacetToObject -> BatchAddFacetToObject -> Bool
== :: BatchAddFacetToObject -> BatchAddFacetToObject -> Bool
$c== :: BatchAddFacetToObject -> BatchAddFacetToObject -> Bool
Prelude.Eq, ReadPrec [BatchAddFacetToObject]
ReadPrec BatchAddFacetToObject
Int -> ReadS BatchAddFacetToObject
ReadS [BatchAddFacetToObject]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAddFacetToObject]
$creadListPrec :: ReadPrec [BatchAddFacetToObject]
readPrec :: ReadPrec BatchAddFacetToObject
$creadPrec :: ReadPrec BatchAddFacetToObject
readList :: ReadS [BatchAddFacetToObject]
$creadList :: ReadS [BatchAddFacetToObject]
readsPrec :: Int -> ReadS BatchAddFacetToObject
$creadsPrec :: Int -> ReadS BatchAddFacetToObject
Prelude.Read, Int -> BatchAddFacetToObject -> ShowS
[BatchAddFacetToObject] -> ShowS
BatchAddFacetToObject -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAddFacetToObject] -> ShowS
$cshowList :: [BatchAddFacetToObject] -> ShowS
show :: BatchAddFacetToObject -> String
$cshow :: BatchAddFacetToObject -> String
showsPrec :: Int -> BatchAddFacetToObject -> ShowS
$cshowsPrec :: Int -> BatchAddFacetToObject -> ShowS
Prelude.Show, forall x. Rep BatchAddFacetToObject x -> BatchAddFacetToObject
forall x. BatchAddFacetToObject -> Rep BatchAddFacetToObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchAddFacetToObject x -> BatchAddFacetToObject
$cfrom :: forall x. BatchAddFacetToObject -> Rep BatchAddFacetToObject x
Prelude.Generic)
newBatchAddFacetToObject ::
SchemaFacet ->
ObjectReference ->
BatchAddFacetToObject
newBatchAddFacetToObject :: SchemaFacet -> ObjectReference -> BatchAddFacetToObject
newBatchAddFacetToObject
SchemaFacet
pSchemaFacet_
ObjectReference
pObjectReference_ =
BatchAddFacetToObject'
{ $sel:schemaFacet:BatchAddFacetToObject' :: SchemaFacet
schemaFacet = SchemaFacet
pSchemaFacet_,
$sel:objectAttributeList:BatchAddFacetToObject' :: [AttributeKeyAndValue]
objectAttributeList = forall a. Monoid a => a
Prelude.mempty,
$sel:objectReference:BatchAddFacetToObject' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
}
batchAddFacetToObject_schemaFacet :: Lens.Lens' BatchAddFacetToObject SchemaFacet
batchAddFacetToObject_schemaFacet :: Lens' BatchAddFacetToObject SchemaFacet
batchAddFacetToObject_schemaFacet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAddFacetToObject' {SchemaFacet
schemaFacet :: SchemaFacet
$sel:schemaFacet:BatchAddFacetToObject' :: BatchAddFacetToObject -> SchemaFacet
schemaFacet} -> SchemaFacet
schemaFacet) (\s :: BatchAddFacetToObject
s@BatchAddFacetToObject' {} SchemaFacet
a -> BatchAddFacetToObject
s {$sel:schemaFacet:BatchAddFacetToObject' :: SchemaFacet
schemaFacet = SchemaFacet
a} :: BatchAddFacetToObject)
batchAddFacetToObject_objectAttributeList :: Lens.Lens' BatchAddFacetToObject [AttributeKeyAndValue]
batchAddFacetToObject_objectAttributeList :: Lens' BatchAddFacetToObject [AttributeKeyAndValue]
batchAddFacetToObject_objectAttributeList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAddFacetToObject' {[AttributeKeyAndValue]
objectAttributeList :: [AttributeKeyAndValue]
$sel:objectAttributeList:BatchAddFacetToObject' :: BatchAddFacetToObject -> [AttributeKeyAndValue]
objectAttributeList} -> [AttributeKeyAndValue]
objectAttributeList) (\s :: BatchAddFacetToObject
s@BatchAddFacetToObject' {} [AttributeKeyAndValue]
a -> BatchAddFacetToObject
s {$sel:objectAttributeList:BatchAddFacetToObject' :: [AttributeKeyAndValue]
objectAttributeList = [AttributeKeyAndValue]
a} :: BatchAddFacetToObject) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchAddFacetToObject_objectReference :: Lens.Lens' BatchAddFacetToObject ObjectReference
batchAddFacetToObject_objectReference :: Lens' BatchAddFacetToObject ObjectReference
batchAddFacetToObject_objectReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAddFacetToObject' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchAddFacetToObject' :: BatchAddFacetToObject -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchAddFacetToObject
s@BatchAddFacetToObject' {} ObjectReference
a -> BatchAddFacetToObject
s {$sel:objectReference:BatchAddFacetToObject' :: ObjectReference
objectReference = ObjectReference
a} :: BatchAddFacetToObject)
instance Prelude.Hashable BatchAddFacetToObject where
hashWithSalt :: Int -> BatchAddFacetToObject -> Int
hashWithSalt Int
_salt BatchAddFacetToObject' {[AttributeKeyAndValue]
ObjectReference
SchemaFacet
objectReference :: ObjectReference
objectAttributeList :: [AttributeKeyAndValue]
schemaFacet :: SchemaFacet
$sel:objectReference:BatchAddFacetToObject' :: BatchAddFacetToObject -> ObjectReference
$sel:objectAttributeList:BatchAddFacetToObject' :: BatchAddFacetToObject -> [AttributeKeyAndValue]
$sel:schemaFacet:BatchAddFacetToObject' :: BatchAddFacetToObject -> SchemaFacet
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SchemaFacet
schemaFacet
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [AttributeKeyAndValue]
objectAttributeList
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
objectReference
instance Prelude.NFData BatchAddFacetToObject where
rnf :: BatchAddFacetToObject -> ()
rnf BatchAddFacetToObject' {[AttributeKeyAndValue]
ObjectReference
SchemaFacet
objectReference :: ObjectReference
objectAttributeList :: [AttributeKeyAndValue]
schemaFacet :: SchemaFacet
$sel:objectReference:BatchAddFacetToObject' :: BatchAddFacetToObject -> ObjectReference
$sel:objectAttributeList:BatchAddFacetToObject' :: BatchAddFacetToObject -> [AttributeKeyAndValue]
$sel:schemaFacet:BatchAddFacetToObject' :: BatchAddFacetToObject -> SchemaFacet
..} =
forall a. NFData a => a -> ()
Prelude.rnf SchemaFacet
schemaFacet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [AttributeKeyAndValue]
objectAttributeList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
objectReference
instance Data.ToJSON BatchAddFacetToObject where
toJSON :: BatchAddFacetToObject -> Value
toJSON BatchAddFacetToObject' {[AttributeKeyAndValue]
ObjectReference
SchemaFacet
objectReference :: ObjectReference
objectAttributeList :: [AttributeKeyAndValue]
schemaFacet :: SchemaFacet
$sel:objectReference:BatchAddFacetToObject' :: BatchAddFacetToObject -> ObjectReference
$sel:objectAttributeList:BatchAddFacetToObject' :: BatchAddFacetToObject -> [AttributeKeyAndValue]
$sel:schemaFacet:BatchAddFacetToObject' :: BatchAddFacetToObject -> SchemaFacet
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"SchemaFacet" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SchemaFacet
schemaFacet),
forall a. a -> Maybe a
Prelude.Just
(Key
"ObjectAttributeList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [AttributeKeyAndValue]
objectAttributeList),
forall a. a -> Maybe a
Prelude.Just
(Key
"ObjectReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
objectReference)
]
)