{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 = forall a. Monoid a => a
Prelude.mempty
}
batchAttachTypedLink_sourceObjectReference :: Lens.Lens' BatchAttachTypedLink ObjectReference
batchAttachTypedLink_sourceObjectReference :: Lens' BatchAttachTypedLink ObjectReference
batchAttachTypedLink_sourceObjectReference = 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 :: Lens' BatchAttachTypedLink ObjectReference
batchAttachTypedLink_targetObjectReference = 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 :: Lens' BatchAttachTypedLink TypedLinkSchemaAndFacetName
batchAttachTypedLink_typedLinkFacet = 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 :: Lens' BatchAttachTypedLink [AttributeNameAndValue]
batchAttachTypedLink_attributes = 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) 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 BatchAttachTypedLink where
hashWithSalt :: Int -> BatchAttachTypedLink -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
sourceObjectReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
targetObjectReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TypedLinkSchemaAndFacetName
typedLinkFacet
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [AttributeNameAndValue]
attributes
instance Prelude.NFData BatchAttachTypedLink where
rnf :: BatchAttachTypedLink -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
sourceObjectReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
targetObjectReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TypedLinkSchemaAndFacetName
typedLinkFacet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [AttributeNameAndValue]
attributes
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"SourceObjectReference"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
sourceObjectReference
),
forall a. a -> Maybe a
Prelude.Just
( Key
"TargetObjectReference"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
targetObjectReference
),
forall a. a -> Maybe a
Prelude.Just
(Key
"TypedLinkFacet" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TypedLinkSchemaAndFacetName
typedLinkFacet),
forall a. a -> Maybe a
Prelude.Just (Key
"Attributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [AttributeNameAndValue]
attributes)
]
)