{-# 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.BatchAttachTypedLink where
import Amazonka.CloudDirectory.Types.AttributeNameAndValue
import Amazonka.CloudDirectory.Types.ObjectReference
import Amazonka.CloudDirectory.Types.TypedLinkSchemaAndFacetName
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchAttachTypedLink = BatchAttachTypedLink'
{
BatchAttachTypedLink -> ObjectReference
sourceObjectReference :: ObjectReference,
BatchAttachTypedLink -> ObjectReference
targetObjectReference :: ObjectReference,
BatchAttachTypedLink -> TypedLinkSchemaAndFacetName
typedLinkFacet :: TypedLinkSchemaAndFacetName,
BatchAttachTypedLink -> [AttributeNameAndValue]
attributes :: [AttributeNameAndValue]
}
deriving (BatchAttachTypedLink -> BatchAttachTypedLink -> Bool
(BatchAttachTypedLink -> BatchAttachTypedLink -> Bool)
-> (BatchAttachTypedLink -> BatchAttachTypedLink -> Bool)
-> Eq BatchAttachTypedLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAttachTypedLink -> BatchAttachTypedLink -> Bool
$c/= :: BatchAttachTypedLink -> BatchAttachTypedLink -> Bool
== :: BatchAttachTypedLink -> BatchAttachTypedLink -> Bool
$c== :: BatchAttachTypedLink -> BatchAttachTypedLink -> Bool
Prelude.Eq, ReadPrec [BatchAttachTypedLink]
ReadPrec BatchAttachTypedLink
Int -> ReadS BatchAttachTypedLink
ReadS [BatchAttachTypedLink]
(Int -> ReadS BatchAttachTypedLink)
-> ReadS [BatchAttachTypedLink]
-> ReadPrec BatchAttachTypedLink
-> ReadPrec [BatchAttachTypedLink]
-> Read BatchAttachTypedLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAttachTypedLink]
$creadListPrec :: ReadPrec [BatchAttachTypedLink]
readPrec :: ReadPrec BatchAttachTypedLink
$creadPrec :: ReadPrec BatchAttachTypedLink
readList :: ReadS [BatchAttachTypedLink]
$creadList :: ReadS [BatchAttachTypedLink]
readsPrec :: Int -> ReadS BatchAttachTypedLink
$creadsPrec :: Int -> ReadS BatchAttachTypedLink
Prelude.Read, Int -> BatchAttachTypedLink -> ShowS
[BatchAttachTypedLink] -> ShowS
BatchAttachTypedLink -> String
(Int -> BatchAttachTypedLink -> ShowS)
-> (BatchAttachTypedLink -> String)
-> ([BatchAttachTypedLink] -> ShowS)
-> Show BatchAttachTypedLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAttachTypedLink] -> ShowS
$cshowList :: [BatchAttachTypedLink] -> ShowS
show :: BatchAttachTypedLink -> String
$cshow :: BatchAttachTypedLink -> String
showsPrec :: Int -> BatchAttachTypedLink -> ShowS
$cshowsPrec :: Int -> BatchAttachTypedLink -> ShowS
Prelude.Show, (forall x. BatchAttachTypedLink -> Rep BatchAttachTypedLink x)
-> (forall x. Rep BatchAttachTypedLink x -> BatchAttachTypedLink)
-> Generic BatchAttachTypedLink
forall x. Rep BatchAttachTypedLink x -> BatchAttachTypedLink
forall x. BatchAttachTypedLink -> Rep BatchAttachTypedLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchAttachTypedLink x -> BatchAttachTypedLink
$cfrom :: forall x. BatchAttachTypedLink -> Rep BatchAttachTypedLink x
Prelude.Generic)
newBatchAttachTypedLink ::
ObjectReference ->
ObjectReference ->
TypedLinkSchemaAndFacetName ->
BatchAttachTypedLink
newBatchAttachTypedLink :: ObjectReference
-> ObjectReference
-> TypedLinkSchemaAndFacetName
-> BatchAttachTypedLink
newBatchAttachTypedLink
ObjectReference
pSourceObjectReference_
ObjectReference
pTargetObjectReference_
TypedLinkSchemaAndFacetName
pTypedLinkFacet_ =
BatchAttachTypedLink' :: ObjectReference
-> ObjectReference
-> TypedLinkSchemaAndFacetName
-> [AttributeNameAndValue]
-> BatchAttachTypedLink
BatchAttachTypedLink'
{ $sel:sourceObjectReference:BatchAttachTypedLink' :: ObjectReference
sourceObjectReference =
ObjectReference
pSourceObjectReference_,
$sel:targetObjectReference:BatchAttachTypedLink' :: ObjectReference
targetObjectReference = ObjectReference
pTargetObjectReference_,
$sel:typedLinkFacet:BatchAttachTypedLink' :: TypedLinkSchemaAndFacetName
typedLinkFacet = TypedLinkSchemaAndFacetName
pTypedLinkFacet_,
$sel:attributes:BatchAttachTypedLink' :: [AttributeNameAndValue]
attributes = [AttributeNameAndValue]
forall a. Monoid a => a
Prelude.mempty
}
batchAttachTypedLink_sourceObjectReference :: Lens.Lens' BatchAttachTypedLink ObjectReference
batchAttachTypedLink_sourceObjectReference :: (ObjectReference -> f ObjectReference)
-> BatchAttachTypedLink -> f BatchAttachTypedLink
batchAttachTypedLink_sourceObjectReference = (BatchAttachTypedLink -> ObjectReference)
-> (BatchAttachTypedLink
-> ObjectReference -> BatchAttachTypedLink)
-> Lens
BatchAttachTypedLink
BatchAttachTypedLink
ObjectReference
ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachTypedLink' {ObjectReference
sourceObjectReference :: ObjectReference
$sel:sourceObjectReference:BatchAttachTypedLink' :: BatchAttachTypedLink -> ObjectReference
sourceObjectReference} -> ObjectReference
sourceObjectReference) (\s :: BatchAttachTypedLink
s@BatchAttachTypedLink' {} ObjectReference
a -> BatchAttachTypedLink
s {$sel:sourceObjectReference:BatchAttachTypedLink' :: ObjectReference
sourceObjectReference = ObjectReference
a} :: BatchAttachTypedLink)
batchAttachTypedLink_targetObjectReference :: Lens.Lens' BatchAttachTypedLink ObjectReference
batchAttachTypedLink_targetObjectReference :: (ObjectReference -> f ObjectReference)
-> BatchAttachTypedLink -> f BatchAttachTypedLink
batchAttachTypedLink_targetObjectReference = (BatchAttachTypedLink -> ObjectReference)
-> (BatchAttachTypedLink
-> ObjectReference -> BatchAttachTypedLink)
-> Lens
BatchAttachTypedLink
BatchAttachTypedLink
ObjectReference
ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachTypedLink' {ObjectReference
targetObjectReference :: ObjectReference
$sel:targetObjectReference:BatchAttachTypedLink' :: BatchAttachTypedLink -> ObjectReference
targetObjectReference} -> ObjectReference
targetObjectReference) (\s :: BatchAttachTypedLink
s@BatchAttachTypedLink' {} ObjectReference
a -> BatchAttachTypedLink
s {$sel:targetObjectReference:BatchAttachTypedLink' :: ObjectReference
targetObjectReference = ObjectReference
a} :: BatchAttachTypedLink)
batchAttachTypedLink_typedLinkFacet :: Lens.Lens' BatchAttachTypedLink TypedLinkSchemaAndFacetName
batchAttachTypedLink_typedLinkFacet :: (TypedLinkSchemaAndFacetName -> f TypedLinkSchemaAndFacetName)
-> BatchAttachTypedLink -> f BatchAttachTypedLink
batchAttachTypedLink_typedLinkFacet = (BatchAttachTypedLink -> TypedLinkSchemaAndFacetName)
-> (BatchAttachTypedLink
-> TypedLinkSchemaAndFacetName -> BatchAttachTypedLink)
-> Lens
BatchAttachTypedLink
BatchAttachTypedLink
TypedLinkSchemaAndFacetName
TypedLinkSchemaAndFacetName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachTypedLink' {TypedLinkSchemaAndFacetName
typedLinkFacet :: TypedLinkSchemaAndFacetName
$sel:typedLinkFacet:BatchAttachTypedLink' :: BatchAttachTypedLink -> TypedLinkSchemaAndFacetName
typedLinkFacet} -> TypedLinkSchemaAndFacetName
typedLinkFacet) (\s :: BatchAttachTypedLink
s@BatchAttachTypedLink' {} TypedLinkSchemaAndFacetName
a -> BatchAttachTypedLink
s {$sel:typedLinkFacet:BatchAttachTypedLink' :: TypedLinkSchemaAndFacetName
typedLinkFacet = TypedLinkSchemaAndFacetName
a} :: BatchAttachTypedLink)
batchAttachTypedLink_attributes :: Lens.Lens' BatchAttachTypedLink [AttributeNameAndValue]
batchAttachTypedLink_attributes :: ([AttributeNameAndValue] -> f [AttributeNameAndValue])
-> BatchAttachTypedLink -> f BatchAttachTypedLink
batchAttachTypedLink_attributes = (BatchAttachTypedLink -> [AttributeNameAndValue])
-> (BatchAttachTypedLink
-> [AttributeNameAndValue] -> BatchAttachTypedLink)
-> Lens
BatchAttachTypedLink
BatchAttachTypedLink
[AttributeNameAndValue]
[AttributeNameAndValue]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachTypedLink' {[AttributeNameAndValue]
attributes :: [AttributeNameAndValue]
$sel:attributes:BatchAttachTypedLink' :: BatchAttachTypedLink -> [AttributeNameAndValue]
attributes} -> [AttributeNameAndValue]
attributes) (\s :: BatchAttachTypedLink
s@BatchAttachTypedLink' {} [AttributeNameAndValue]
a -> BatchAttachTypedLink
s {$sel:attributes:BatchAttachTypedLink' :: [AttributeNameAndValue]
attributes = [AttributeNameAndValue]
a} :: BatchAttachTypedLink) (([AttributeNameAndValue] -> f [AttributeNameAndValue])
-> BatchAttachTypedLink -> f BatchAttachTypedLink)
-> (([AttributeNameAndValue] -> f [AttributeNameAndValue])
-> [AttributeNameAndValue] -> f [AttributeNameAndValue])
-> ([AttributeNameAndValue] -> f [AttributeNameAndValue])
-> BatchAttachTypedLink
-> f BatchAttachTypedLink
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AttributeNameAndValue] -> f [AttributeNameAndValue])
-> [AttributeNameAndValue] -> f [AttributeNameAndValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable BatchAttachTypedLink
instance Prelude.NFData BatchAttachTypedLink
instance Core.ToJSON BatchAttachTypedLink where
toJSON :: BatchAttachTypedLink -> Value
toJSON BatchAttachTypedLink' {[AttributeNameAndValue]
ObjectReference
TypedLinkSchemaAndFacetName
attributes :: [AttributeNameAndValue]
typedLinkFacet :: TypedLinkSchemaAndFacetName
targetObjectReference :: ObjectReference
sourceObjectReference :: ObjectReference
$sel:attributes:BatchAttachTypedLink' :: BatchAttachTypedLink -> [AttributeNameAndValue]
$sel:typedLinkFacet:BatchAttachTypedLink' :: BatchAttachTypedLink -> TypedLinkSchemaAndFacetName
$sel:targetObjectReference:BatchAttachTypedLink' :: BatchAttachTypedLink -> ObjectReference
$sel:sourceObjectReference:BatchAttachTypedLink' :: BatchAttachTypedLink -> ObjectReference
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"SourceObjectReference"
Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
sourceObjectReference
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"TargetObjectReference"
Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
targetObjectReference
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"TypedLinkFacet" Text -> TypedLinkSchemaAndFacetName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TypedLinkSchemaAndFacetName
typedLinkFacet),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Attributes" Text -> [AttributeNameAndValue] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AttributeNameAndValue]
attributes)
]
)