{-# 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.TypedLinkFacet where
import Amazonka.CloudDirectory.Types.TypedLinkAttributeDefinition
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TypedLinkFacet = TypedLinkFacet'
{
TypedLinkFacet -> Text
name :: Prelude.Text,
TypedLinkFacet -> [TypedLinkAttributeDefinition]
attributes :: [TypedLinkAttributeDefinition],
TypedLinkFacet -> [Text]
identityAttributeOrder :: [Prelude.Text]
}
deriving (TypedLinkFacet -> TypedLinkFacet -> Bool
(TypedLinkFacet -> TypedLinkFacet -> Bool)
-> (TypedLinkFacet -> TypedLinkFacet -> Bool) -> Eq TypedLinkFacet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypedLinkFacet -> TypedLinkFacet -> Bool
$c/= :: TypedLinkFacet -> TypedLinkFacet -> Bool
== :: TypedLinkFacet -> TypedLinkFacet -> Bool
$c== :: TypedLinkFacet -> TypedLinkFacet -> Bool
Prelude.Eq, ReadPrec [TypedLinkFacet]
ReadPrec TypedLinkFacet
Int -> ReadS TypedLinkFacet
ReadS [TypedLinkFacet]
(Int -> ReadS TypedLinkFacet)
-> ReadS [TypedLinkFacet]
-> ReadPrec TypedLinkFacet
-> ReadPrec [TypedLinkFacet]
-> Read TypedLinkFacet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TypedLinkFacet]
$creadListPrec :: ReadPrec [TypedLinkFacet]
readPrec :: ReadPrec TypedLinkFacet
$creadPrec :: ReadPrec TypedLinkFacet
readList :: ReadS [TypedLinkFacet]
$creadList :: ReadS [TypedLinkFacet]
readsPrec :: Int -> ReadS TypedLinkFacet
$creadsPrec :: Int -> ReadS TypedLinkFacet
Prelude.Read, Int -> TypedLinkFacet -> ShowS
[TypedLinkFacet] -> ShowS
TypedLinkFacet -> String
(Int -> TypedLinkFacet -> ShowS)
-> (TypedLinkFacet -> String)
-> ([TypedLinkFacet] -> ShowS)
-> Show TypedLinkFacet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypedLinkFacet] -> ShowS
$cshowList :: [TypedLinkFacet] -> ShowS
show :: TypedLinkFacet -> String
$cshow :: TypedLinkFacet -> String
showsPrec :: Int -> TypedLinkFacet -> ShowS
$cshowsPrec :: Int -> TypedLinkFacet -> ShowS
Prelude.Show, (forall x. TypedLinkFacet -> Rep TypedLinkFacet x)
-> (forall x. Rep TypedLinkFacet x -> TypedLinkFacet)
-> Generic TypedLinkFacet
forall x. Rep TypedLinkFacet x -> TypedLinkFacet
forall x. TypedLinkFacet -> Rep TypedLinkFacet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypedLinkFacet x -> TypedLinkFacet
$cfrom :: forall x. TypedLinkFacet -> Rep TypedLinkFacet x
Prelude.Generic)
newTypedLinkFacet ::
Prelude.Text ->
TypedLinkFacet
newTypedLinkFacet :: Text -> TypedLinkFacet
newTypedLinkFacet Text
pName_ =
TypedLinkFacet' :: Text -> [TypedLinkAttributeDefinition] -> [Text] -> TypedLinkFacet
TypedLinkFacet'
{ $sel:name:TypedLinkFacet' :: Text
name = Text
pName_,
$sel:attributes:TypedLinkFacet' :: [TypedLinkAttributeDefinition]
attributes = [TypedLinkAttributeDefinition]
forall a. Monoid a => a
Prelude.mempty,
$sel:identityAttributeOrder:TypedLinkFacet' :: [Text]
identityAttributeOrder = [Text]
forall a. Monoid a => a
Prelude.mempty
}
typedLinkFacet_name :: Lens.Lens' TypedLinkFacet Prelude.Text
typedLinkFacet_name :: (Text -> f Text) -> TypedLinkFacet -> f TypedLinkFacet
typedLinkFacet_name = (TypedLinkFacet -> Text)
-> (TypedLinkFacet -> Text -> TypedLinkFacet)
-> Lens TypedLinkFacet TypedLinkFacet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkFacet' {Text
name :: Text
$sel:name:TypedLinkFacet' :: TypedLinkFacet -> Text
name} -> Text
name) (\s :: TypedLinkFacet
s@TypedLinkFacet' {} Text
a -> TypedLinkFacet
s {$sel:name:TypedLinkFacet' :: Text
name = Text
a} :: TypedLinkFacet)
typedLinkFacet_attributes :: Lens.Lens' TypedLinkFacet [TypedLinkAttributeDefinition]
typedLinkFacet_attributes :: ([TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition])
-> TypedLinkFacet -> f TypedLinkFacet
typedLinkFacet_attributes = (TypedLinkFacet -> [TypedLinkAttributeDefinition])
-> (TypedLinkFacet
-> [TypedLinkAttributeDefinition] -> TypedLinkFacet)
-> Lens
TypedLinkFacet
TypedLinkFacet
[TypedLinkAttributeDefinition]
[TypedLinkAttributeDefinition]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkFacet' {[TypedLinkAttributeDefinition]
attributes :: [TypedLinkAttributeDefinition]
$sel:attributes:TypedLinkFacet' :: TypedLinkFacet -> [TypedLinkAttributeDefinition]
attributes} -> [TypedLinkAttributeDefinition]
attributes) (\s :: TypedLinkFacet
s@TypedLinkFacet' {} [TypedLinkAttributeDefinition]
a -> TypedLinkFacet
s {$sel:attributes:TypedLinkFacet' :: [TypedLinkAttributeDefinition]
attributes = [TypedLinkAttributeDefinition]
a} :: TypedLinkFacet) (([TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition])
-> TypedLinkFacet -> f TypedLinkFacet)
-> (([TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition])
-> [TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition])
-> ([TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition])
-> TypedLinkFacet
-> f TypedLinkFacet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition])
-> [TypedLinkAttributeDefinition]
-> f [TypedLinkAttributeDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
typedLinkFacet_identityAttributeOrder :: Lens.Lens' TypedLinkFacet [Prelude.Text]
typedLinkFacet_identityAttributeOrder :: ([Text] -> f [Text]) -> TypedLinkFacet -> f TypedLinkFacet
typedLinkFacet_identityAttributeOrder = (TypedLinkFacet -> [Text])
-> (TypedLinkFacet -> [Text] -> TypedLinkFacet)
-> Lens TypedLinkFacet TypedLinkFacet [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkFacet' {[Text]
identityAttributeOrder :: [Text]
$sel:identityAttributeOrder:TypedLinkFacet' :: TypedLinkFacet -> [Text]
identityAttributeOrder} -> [Text]
identityAttributeOrder) (\s :: TypedLinkFacet
s@TypedLinkFacet' {} [Text]
a -> TypedLinkFacet
s {$sel:identityAttributeOrder:TypedLinkFacet' :: [Text]
identityAttributeOrder = [Text]
a} :: TypedLinkFacet) (([Text] -> f [Text]) -> TypedLinkFacet -> f TypedLinkFacet)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> TypedLinkFacet
-> f TypedLinkFacet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable TypedLinkFacet
instance Prelude.NFData TypedLinkFacet
instance Core.ToJSON TypedLinkFacet where
toJSON :: TypedLinkFacet -> Value
toJSON TypedLinkFacet' {[Text]
[TypedLinkAttributeDefinition]
Text
identityAttributeOrder :: [Text]
attributes :: [TypedLinkAttributeDefinition]
name :: Text
$sel:identityAttributeOrder:TypedLinkFacet' :: TypedLinkFacet -> [Text]
$sel:attributes:TypedLinkFacet' :: TypedLinkFacet -> [TypedLinkAttributeDefinition]
$sel:name:TypedLinkFacet' :: TypedLinkFacet -> Text
..} =
[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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Attributes" Text -> [TypedLinkAttributeDefinition] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [TypedLinkAttributeDefinition]
attributes),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"IdentityAttributeOrder"
Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
identityAttributeOrder
)
]
)