{-# 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.BatchCreateObject 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 BatchCreateObject = BatchCreateObject'
{
BatchCreateObject -> Maybe Text
batchReferenceName :: Prelude.Maybe Prelude.Text,
BatchCreateObject -> Maybe Text
linkName :: Prelude.Maybe Prelude.Text,
BatchCreateObject -> Maybe ObjectReference
parentReference :: Prelude.Maybe ObjectReference,
BatchCreateObject -> [SchemaFacet]
schemaFacet :: [SchemaFacet],
BatchCreateObject -> [AttributeKeyAndValue]
objectAttributeList :: [AttributeKeyAndValue]
}
deriving (BatchCreateObject -> BatchCreateObject -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCreateObject -> BatchCreateObject -> Bool
$c/= :: BatchCreateObject -> BatchCreateObject -> Bool
== :: BatchCreateObject -> BatchCreateObject -> Bool
$c== :: BatchCreateObject -> BatchCreateObject -> Bool
Prelude.Eq, ReadPrec [BatchCreateObject]
ReadPrec BatchCreateObject
Int -> ReadS BatchCreateObject
ReadS [BatchCreateObject]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCreateObject]
$creadListPrec :: ReadPrec [BatchCreateObject]
readPrec :: ReadPrec BatchCreateObject
$creadPrec :: ReadPrec BatchCreateObject
readList :: ReadS [BatchCreateObject]
$creadList :: ReadS [BatchCreateObject]
readsPrec :: Int -> ReadS BatchCreateObject
$creadsPrec :: Int -> ReadS BatchCreateObject
Prelude.Read, Int -> BatchCreateObject -> ShowS
[BatchCreateObject] -> ShowS
BatchCreateObject -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCreateObject] -> ShowS
$cshowList :: [BatchCreateObject] -> ShowS
show :: BatchCreateObject -> String
$cshow :: BatchCreateObject -> String
showsPrec :: Int -> BatchCreateObject -> ShowS
$cshowsPrec :: Int -> BatchCreateObject -> ShowS
Prelude.Show, forall x. Rep BatchCreateObject x -> BatchCreateObject
forall x. BatchCreateObject -> Rep BatchCreateObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchCreateObject x -> BatchCreateObject
$cfrom :: forall x. BatchCreateObject -> Rep BatchCreateObject x
Prelude.Generic)
newBatchCreateObject ::
BatchCreateObject
newBatchCreateObject :: BatchCreateObject
newBatchCreateObject =
BatchCreateObject'
{ $sel:batchReferenceName:BatchCreateObject' :: Maybe Text
batchReferenceName =
forall a. Maybe a
Prelude.Nothing,
$sel:linkName:BatchCreateObject' :: Maybe Text
linkName = forall a. Maybe a
Prelude.Nothing,
$sel:parentReference:BatchCreateObject' :: Maybe ObjectReference
parentReference = forall a. Maybe a
Prelude.Nothing,
$sel:schemaFacet:BatchCreateObject' :: [SchemaFacet]
schemaFacet = forall a. Monoid a => a
Prelude.mempty,
$sel:objectAttributeList:BatchCreateObject' :: [AttributeKeyAndValue]
objectAttributeList = forall a. Monoid a => a
Prelude.mempty
}
batchCreateObject_batchReferenceName :: Lens.Lens' BatchCreateObject (Prelude.Maybe Prelude.Text)
batchCreateObject_batchReferenceName :: Lens' BatchCreateObject (Maybe Text)
batchCreateObject_batchReferenceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateObject' {Maybe Text
batchReferenceName :: Maybe Text
$sel:batchReferenceName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
batchReferenceName} -> Maybe Text
batchReferenceName) (\s :: BatchCreateObject
s@BatchCreateObject' {} Maybe Text
a -> BatchCreateObject
s {$sel:batchReferenceName:BatchCreateObject' :: Maybe Text
batchReferenceName = Maybe Text
a} :: BatchCreateObject)
batchCreateObject_linkName :: Lens.Lens' BatchCreateObject (Prelude.Maybe Prelude.Text)
batchCreateObject_linkName :: Lens' BatchCreateObject (Maybe Text)
batchCreateObject_linkName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateObject' {Maybe Text
linkName :: Maybe Text
$sel:linkName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
linkName} -> Maybe Text
linkName) (\s :: BatchCreateObject
s@BatchCreateObject' {} Maybe Text
a -> BatchCreateObject
s {$sel:linkName:BatchCreateObject' :: Maybe Text
linkName = Maybe Text
a} :: BatchCreateObject)
batchCreateObject_parentReference :: Lens.Lens' BatchCreateObject (Prelude.Maybe ObjectReference)
batchCreateObject_parentReference :: Lens' BatchCreateObject (Maybe ObjectReference)
batchCreateObject_parentReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateObject' {Maybe ObjectReference
parentReference :: Maybe ObjectReference
$sel:parentReference:BatchCreateObject' :: BatchCreateObject -> Maybe ObjectReference
parentReference} -> Maybe ObjectReference
parentReference) (\s :: BatchCreateObject
s@BatchCreateObject' {} Maybe ObjectReference
a -> BatchCreateObject
s {$sel:parentReference:BatchCreateObject' :: Maybe ObjectReference
parentReference = Maybe ObjectReference
a} :: BatchCreateObject)
batchCreateObject_schemaFacet :: Lens.Lens' BatchCreateObject [SchemaFacet]
batchCreateObject_schemaFacet :: Lens' BatchCreateObject [SchemaFacet]
batchCreateObject_schemaFacet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateObject' {[SchemaFacet]
schemaFacet :: [SchemaFacet]
$sel:schemaFacet:BatchCreateObject' :: BatchCreateObject -> [SchemaFacet]
schemaFacet} -> [SchemaFacet]
schemaFacet) (\s :: BatchCreateObject
s@BatchCreateObject' {} [SchemaFacet]
a -> BatchCreateObject
s {$sel:schemaFacet:BatchCreateObject' :: [SchemaFacet]
schemaFacet = [SchemaFacet]
a} :: BatchCreateObject) 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
batchCreateObject_objectAttributeList :: Lens.Lens' BatchCreateObject [AttributeKeyAndValue]
batchCreateObject_objectAttributeList :: Lens' BatchCreateObject [AttributeKeyAndValue]
batchCreateObject_objectAttributeList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateObject' {[AttributeKeyAndValue]
objectAttributeList :: [AttributeKeyAndValue]
$sel:objectAttributeList:BatchCreateObject' :: BatchCreateObject -> [AttributeKeyAndValue]
objectAttributeList} -> [AttributeKeyAndValue]
objectAttributeList) (\s :: BatchCreateObject
s@BatchCreateObject' {} [AttributeKeyAndValue]
a -> BatchCreateObject
s {$sel:objectAttributeList:BatchCreateObject' :: [AttributeKeyAndValue]
objectAttributeList = [AttributeKeyAndValue]
a} :: BatchCreateObject) 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
instance Prelude.Hashable BatchCreateObject where
hashWithSalt :: Int -> BatchCreateObject -> Int
hashWithSalt Int
_salt BatchCreateObject' {[SchemaFacet]
[AttributeKeyAndValue]
Maybe Text
Maybe ObjectReference
objectAttributeList :: [AttributeKeyAndValue]
schemaFacet :: [SchemaFacet]
parentReference :: Maybe ObjectReference
linkName :: Maybe Text
batchReferenceName :: Maybe Text
$sel:objectAttributeList:BatchCreateObject' :: BatchCreateObject -> [AttributeKeyAndValue]
$sel:schemaFacet:BatchCreateObject' :: BatchCreateObject -> [SchemaFacet]
$sel:parentReference:BatchCreateObject' :: BatchCreateObject -> Maybe ObjectReference
$sel:linkName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
$sel:batchReferenceName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
batchReferenceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
linkName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObjectReference
parentReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [SchemaFacet]
schemaFacet
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [AttributeKeyAndValue]
objectAttributeList
instance Prelude.NFData BatchCreateObject where
rnf :: BatchCreateObject -> ()
rnf BatchCreateObject' {[SchemaFacet]
[AttributeKeyAndValue]
Maybe Text
Maybe ObjectReference
objectAttributeList :: [AttributeKeyAndValue]
schemaFacet :: [SchemaFacet]
parentReference :: Maybe ObjectReference
linkName :: Maybe Text
batchReferenceName :: Maybe Text
$sel:objectAttributeList:BatchCreateObject' :: BatchCreateObject -> [AttributeKeyAndValue]
$sel:schemaFacet:BatchCreateObject' :: BatchCreateObject -> [SchemaFacet]
$sel:parentReference:BatchCreateObject' :: BatchCreateObject -> Maybe ObjectReference
$sel:linkName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
$sel:batchReferenceName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
batchReferenceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
linkName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ObjectReference
parentReference
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
instance Data.ToJSON BatchCreateObject where
toJSON :: BatchCreateObject -> Value
toJSON BatchCreateObject' {[SchemaFacet]
[AttributeKeyAndValue]
Maybe Text
Maybe ObjectReference
objectAttributeList :: [AttributeKeyAndValue]
schemaFacet :: [SchemaFacet]
parentReference :: Maybe ObjectReference
linkName :: Maybe Text
batchReferenceName :: Maybe Text
$sel:objectAttributeList:BatchCreateObject' :: BatchCreateObject -> [AttributeKeyAndValue]
$sel:schemaFacet:BatchCreateObject' :: BatchCreateObject -> [SchemaFacet]
$sel:parentReference:BatchCreateObject' :: BatchCreateObject -> Maybe ObjectReference
$sel:linkName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
$sel:batchReferenceName:BatchCreateObject' :: BatchCreateObject -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BatchReferenceName" 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
batchReferenceName,
(Key
"LinkName" 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
linkName,
(Key
"ParentReference" 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 ObjectReference
parentReference,
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)
]
)