{-# 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.TypedLinkSpecifier 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 TypedLinkSpecifier = TypedLinkSpecifier'
{
TypedLinkSpecifier -> TypedLinkSchemaAndFacetName
typedLinkFacet :: TypedLinkSchemaAndFacetName,
TypedLinkSpecifier -> ObjectReference
sourceObjectReference :: ObjectReference,
TypedLinkSpecifier -> ObjectReference
targetObjectReference :: ObjectReference,
TypedLinkSpecifier -> [AttributeNameAndValue]
identityAttributeValues :: [AttributeNameAndValue]
}
deriving (TypedLinkSpecifier -> TypedLinkSpecifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypedLinkSpecifier -> TypedLinkSpecifier -> Bool
$c/= :: TypedLinkSpecifier -> TypedLinkSpecifier -> Bool
== :: TypedLinkSpecifier -> TypedLinkSpecifier -> Bool
$c== :: TypedLinkSpecifier -> TypedLinkSpecifier -> Bool
Prelude.Eq, ReadPrec [TypedLinkSpecifier]
ReadPrec TypedLinkSpecifier
Int -> ReadS TypedLinkSpecifier
ReadS [TypedLinkSpecifier]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TypedLinkSpecifier]
$creadListPrec :: ReadPrec [TypedLinkSpecifier]
readPrec :: ReadPrec TypedLinkSpecifier
$creadPrec :: ReadPrec TypedLinkSpecifier
readList :: ReadS [TypedLinkSpecifier]
$creadList :: ReadS [TypedLinkSpecifier]
readsPrec :: Int -> ReadS TypedLinkSpecifier
$creadsPrec :: Int -> ReadS TypedLinkSpecifier
Prelude.Read, Int -> TypedLinkSpecifier -> ShowS
[TypedLinkSpecifier] -> ShowS
TypedLinkSpecifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypedLinkSpecifier] -> ShowS
$cshowList :: [TypedLinkSpecifier] -> ShowS
show :: TypedLinkSpecifier -> String
$cshow :: TypedLinkSpecifier -> String
showsPrec :: Int -> TypedLinkSpecifier -> ShowS
$cshowsPrec :: Int -> TypedLinkSpecifier -> ShowS
Prelude.Show, forall x. Rep TypedLinkSpecifier x -> TypedLinkSpecifier
forall x. TypedLinkSpecifier -> Rep TypedLinkSpecifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypedLinkSpecifier x -> TypedLinkSpecifier
$cfrom :: forall x. TypedLinkSpecifier -> Rep TypedLinkSpecifier x
Prelude.Generic)
newTypedLinkSpecifier ::
TypedLinkSchemaAndFacetName ->
ObjectReference ->
ObjectReference ->
TypedLinkSpecifier
newTypedLinkSpecifier :: TypedLinkSchemaAndFacetName
-> ObjectReference -> ObjectReference -> TypedLinkSpecifier
newTypedLinkSpecifier
TypedLinkSchemaAndFacetName
pTypedLinkFacet_
ObjectReference
pSourceObjectReference_
ObjectReference
pTargetObjectReference_ =
TypedLinkSpecifier'
{ $sel:typedLinkFacet:TypedLinkSpecifier' :: TypedLinkSchemaAndFacetName
typedLinkFacet =
TypedLinkSchemaAndFacetName
pTypedLinkFacet_,
$sel:sourceObjectReference:TypedLinkSpecifier' :: ObjectReference
sourceObjectReference = ObjectReference
pSourceObjectReference_,
$sel:targetObjectReference:TypedLinkSpecifier' :: ObjectReference
targetObjectReference = ObjectReference
pTargetObjectReference_,
$sel:identityAttributeValues:TypedLinkSpecifier' :: [AttributeNameAndValue]
identityAttributeValues = forall a. Monoid a => a
Prelude.mempty
}
typedLinkSpecifier_typedLinkFacet :: Lens.Lens' TypedLinkSpecifier TypedLinkSchemaAndFacetName
typedLinkSpecifier_typedLinkFacet :: Lens' TypedLinkSpecifier TypedLinkSchemaAndFacetName
typedLinkSpecifier_typedLinkFacet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkSpecifier' {TypedLinkSchemaAndFacetName
typedLinkFacet :: TypedLinkSchemaAndFacetName
$sel:typedLinkFacet:TypedLinkSpecifier' :: TypedLinkSpecifier -> TypedLinkSchemaAndFacetName
typedLinkFacet} -> TypedLinkSchemaAndFacetName
typedLinkFacet) (\s :: TypedLinkSpecifier
s@TypedLinkSpecifier' {} TypedLinkSchemaAndFacetName
a -> TypedLinkSpecifier
s {$sel:typedLinkFacet:TypedLinkSpecifier' :: TypedLinkSchemaAndFacetName
typedLinkFacet = TypedLinkSchemaAndFacetName
a} :: TypedLinkSpecifier)
typedLinkSpecifier_sourceObjectReference :: Lens.Lens' TypedLinkSpecifier ObjectReference
typedLinkSpecifier_sourceObjectReference :: Lens' TypedLinkSpecifier ObjectReference
typedLinkSpecifier_sourceObjectReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkSpecifier' {ObjectReference
sourceObjectReference :: ObjectReference
$sel:sourceObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
sourceObjectReference} -> ObjectReference
sourceObjectReference) (\s :: TypedLinkSpecifier
s@TypedLinkSpecifier' {} ObjectReference
a -> TypedLinkSpecifier
s {$sel:sourceObjectReference:TypedLinkSpecifier' :: ObjectReference
sourceObjectReference = ObjectReference
a} :: TypedLinkSpecifier)
typedLinkSpecifier_targetObjectReference :: Lens.Lens' TypedLinkSpecifier ObjectReference
typedLinkSpecifier_targetObjectReference :: Lens' TypedLinkSpecifier ObjectReference
typedLinkSpecifier_targetObjectReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkSpecifier' {ObjectReference
targetObjectReference :: ObjectReference
$sel:targetObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
targetObjectReference} -> ObjectReference
targetObjectReference) (\s :: TypedLinkSpecifier
s@TypedLinkSpecifier' {} ObjectReference
a -> TypedLinkSpecifier
s {$sel:targetObjectReference:TypedLinkSpecifier' :: ObjectReference
targetObjectReference = ObjectReference
a} :: TypedLinkSpecifier)
typedLinkSpecifier_identityAttributeValues :: Lens.Lens' TypedLinkSpecifier [AttributeNameAndValue]
typedLinkSpecifier_identityAttributeValues :: Lens' TypedLinkSpecifier [AttributeNameAndValue]
typedLinkSpecifier_identityAttributeValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkSpecifier' {[AttributeNameAndValue]
identityAttributeValues :: [AttributeNameAndValue]
$sel:identityAttributeValues:TypedLinkSpecifier' :: TypedLinkSpecifier -> [AttributeNameAndValue]
identityAttributeValues} -> [AttributeNameAndValue]
identityAttributeValues) (\s :: TypedLinkSpecifier
s@TypedLinkSpecifier' {} [AttributeNameAndValue]
a -> TypedLinkSpecifier
s {$sel:identityAttributeValues:TypedLinkSpecifier' :: [AttributeNameAndValue]
identityAttributeValues = [AttributeNameAndValue]
a} :: TypedLinkSpecifier) 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 Data.FromJSON TypedLinkSpecifier where
parseJSON :: Value -> Parser TypedLinkSpecifier
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TypedLinkSpecifier"
( \Object
x ->
TypedLinkSchemaAndFacetName
-> ObjectReference
-> ObjectReference
-> [AttributeNameAndValue]
-> TypedLinkSpecifier
TypedLinkSpecifier'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TypedLinkFacet")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SourceObjectReference")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TargetObjectReference")
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
"IdentityAttributeValues"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable TypedLinkSpecifier where
hashWithSalt :: Int -> TypedLinkSpecifier -> Int
hashWithSalt Int
_salt TypedLinkSpecifier' {[AttributeNameAndValue]
ObjectReference
TypedLinkSchemaAndFacetName
identityAttributeValues :: [AttributeNameAndValue]
targetObjectReference :: ObjectReference
sourceObjectReference :: ObjectReference
typedLinkFacet :: TypedLinkSchemaAndFacetName
$sel:identityAttributeValues:TypedLinkSpecifier' :: TypedLinkSpecifier -> [AttributeNameAndValue]
$sel:targetObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
$sel:sourceObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
$sel:typedLinkFacet:TypedLinkSpecifier' :: TypedLinkSpecifier -> TypedLinkSchemaAndFacetName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TypedLinkSchemaAndFacetName
typedLinkFacet
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` [AttributeNameAndValue]
identityAttributeValues
instance Prelude.NFData TypedLinkSpecifier where
rnf :: TypedLinkSpecifier -> ()
rnf TypedLinkSpecifier' {[AttributeNameAndValue]
ObjectReference
TypedLinkSchemaAndFacetName
identityAttributeValues :: [AttributeNameAndValue]
targetObjectReference :: ObjectReference
sourceObjectReference :: ObjectReference
typedLinkFacet :: TypedLinkSchemaAndFacetName
$sel:identityAttributeValues:TypedLinkSpecifier' :: TypedLinkSpecifier -> [AttributeNameAndValue]
$sel:targetObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
$sel:sourceObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
$sel:typedLinkFacet:TypedLinkSpecifier' :: TypedLinkSpecifier -> TypedLinkSchemaAndFacetName
..} =
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 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 [AttributeNameAndValue]
identityAttributeValues
instance Data.ToJSON TypedLinkSpecifier where
toJSON :: TypedLinkSpecifier -> Value
toJSON TypedLinkSpecifier' {[AttributeNameAndValue]
ObjectReference
TypedLinkSchemaAndFacetName
identityAttributeValues :: [AttributeNameAndValue]
targetObjectReference :: ObjectReference
sourceObjectReference :: ObjectReference
typedLinkFacet :: TypedLinkSchemaAndFacetName
$sel:identityAttributeValues:TypedLinkSpecifier' :: TypedLinkSpecifier -> [AttributeNameAndValue]
$sel:targetObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
$sel:sourceObjectReference:TypedLinkSpecifier' :: TypedLinkSpecifier -> ObjectReference
$sel:typedLinkFacet:TypedLinkSpecifier' :: TypedLinkSpecifier -> TypedLinkSchemaAndFacetName
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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
"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
"IdentityAttributeValues"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [AttributeNameAndValue]
identityAttributeValues
)
]
)