{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudDirectory.UpdateTypedLinkFacet
(
UpdateTypedLinkFacet (..),
newUpdateTypedLinkFacet,
updateTypedLinkFacet_schemaArn,
updateTypedLinkFacet_name,
updateTypedLinkFacet_attributeUpdates,
updateTypedLinkFacet_identityAttributeOrder,
UpdateTypedLinkFacetResponse (..),
newUpdateTypedLinkFacetResponse,
updateTypedLinkFacetResponse_httpStatus,
)
where
import Amazonka.CloudDirectory.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateTypedLinkFacet = UpdateTypedLinkFacet'
{
UpdateTypedLinkFacet -> Text
schemaArn :: Prelude.Text,
UpdateTypedLinkFacet -> Text
name :: Prelude.Text,
UpdateTypedLinkFacet -> [TypedLinkFacetAttributeUpdate]
attributeUpdates :: [TypedLinkFacetAttributeUpdate],
UpdateTypedLinkFacet -> [Text]
identityAttributeOrder :: [Prelude.Text]
}
deriving (UpdateTypedLinkFacet -> UpdateTypedLinkFacet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTypedLinkFacet -> UpdateTypedLinkFacet -> Bool
$c/= :: UpdateTypedLinkFacet -> UpdateTypedLinkFacet -> Bool
== :: UpdateTypedLinkFacet -> UpdateTypedLinkFacet -> Bool
$c== :: UpdateTypedLinkFacet -> UpdateTypedLinkFacet -> Bool
Prelude.Eq, ReadPrec [UpdateTypedLinkFacet]
ReadPrec UpdateTypedLinkFacet
Int -> ReadS UpdateTypedLinkFacet
ReadS [UpdateTypedLinkFacet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTypedLinkFacet]
$creadListPrec :: ReadPrec [UpdateTypedLinkFacet]
readPrec :: ReadPrec UpdateTypedLinkFacet
$creadPrec :: ReadPrec UpdateTypedLinkFacet
readList :: ReadS [UpdateTypedLinkFacet]
$creadList :: ReadS [UpdateTypedLinkFacet]
readsPrec :: Int -> ReadS UpdateTypedLinkFacet
$creadsPrec :: Int -> ReadS UpdateTypedLinkFacet
Prelude.Read, Int -> UpdateTypedLinkFacet -> ShowS
[UpdateTypedLinkFacet] -> ShowS
UpdateTypedLinkFacet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTypedLinkFacet] -> ShowS
$cshowList :: [UpdateTypedLinkFacet] -> ShowS
show :: UpdateTypedLinkFacet -> String
$cshow :: UpdateTypedLinkFacet -> String
showsPrec :: Int -> UpdateTypedLinkFacet -> ShowS
$cshowsPrec :: Int -> UpdateTypedLinkFacet -> ShowS
Prelude.Show, forall x. Rep UpdateTypedLinkFacet x -> UpdateTypedLinkFacet
forall x. UpdateTypedLinkFacet -> Rep UpdateTypedLinkFacet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTypedLinkFacet x -> UpdateTypedLinkFacet
$cfrom :: forall x. UpdateTypedLinkFacet -> Rep UpdateTypedLinkFacet x
Prelude.Generic)
newUpdateTypedLinkFacet ::
Prelude.Text ->
Prelude.Text ->
UpdateTypedLinkFacet
newUpdateTypedLinkFacet :: Text -> Text -> UpdateTypedLinkFacet
newUpdateTypedLinkFacet Text
pSchemaArn_ Text
pName_ =
UpdateTypedLinkFacet'
{ $sel:schemaArn:UpdateTypedLinkFacet' :: Text
schemaArn = Text
pSchemaArn_,
$sel:name:UpdateTypedLinkFacet' :: Text
name = Text
pName_,
$sel:attributeUpdates:UpdateTypedLinkFacet' :: [TypedLinkFacetAttributeUpdate]
attributeUpdates = forall a. Monoid a => a
Prelude.mempty,
$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: [Text]
identityAttributeOrder = forall a. Monoid a => a
Prelude.mempty
}
updateTypedLinkFacet_schemaArn :: Lens.Lens' UpdateTypedLinkFacet Prelude.Text
updateTypedLinkFacet_schemaArn :: Lens' UpdateTypedLinkFacet Text
updateTypedLinkFacet_schemaArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTypedLinkFacet' {Text
schemaArn :: Text
$sel:schemaArn:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
schemaArn} -> Text
schemaArn) (\s :: UpdateTypedLinkFacet
s@UpdateTypedLinkFacet' {} Text
a -> UpdateTypedLinkFacet
s {$sel:schemaArn:UpdateTypedLinkFacet' :: Text
schemaArn = Text
a} :: UpdateTypedLinkFacet)
updateTypedLinkFacet_name :: Lens.Lens' UpdateTypedLinkFacet Prelude.Text
updateTypedLinkFacet_name :: Lens' UpdateTypedLinkFacet Text
updateTypedLinkFacet_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTypedLinkFacet' {Text
name :: Text
$sel:name:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
name} -> Text
name) (\s :: UpdateTypedLinkFacet
s@UpdateTypedLinkFacet' {} Text
a -> UpdateTypedLinkFacet
s {$sel:name:UpdateTypedLinkFacet' :: Text
name = Text
a} :: UpdateTypedLinkFacet)
updateTypedLinkFacet_attributeUpdates :: Lens.Lens' UpdateTypedLinkFacet [TypedLinkFacetAttributeUpdate]
updateTypedLinkFacet_attributeUpdates :: Lens' UpdateTypedLinkFacet [TypedLinkFacetAttributeUpdate]
updateTypedLinkFacet_attributeUpdates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTypedLinkFacet' {[TypedLinkFacetAttributeUpdate]
attributeUpdates :: [TypedLinkFacetAttributeUpdate]
$sel:attributeUpdates:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [TypedLinkFacetAttributeUpdate]
attributeUpdates} -> [TypedLinkFacetAttributeUpdate]
attributeUpdates) (\s :: UpdateTypedLinkFacet
s@UpdateTypedLinkFacet' {} [TypedLinkFacetAttributeUpdate]
a -> UpdateTypedLinkFacet
s {$sel:attributeUpdates:UpdateTypedLinkFacet' :: [TypedLinkFacetAttributeUpdate]
attributeUpdates = [TypedLinkFacetAttributeUpdate]
a} :: UpdateTypedLinkFacet) 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
updateTypedLinkFacet_identityAttributeOrder :: Lens.Lens' UpdateTypedLinkFacet [Prelude.Text]
updateTypedLinkFacet_identityAttributeOrder :: Lens' UpdateTypedLinkFacet [Text]
updateTypedLinkFacet_identityAttributeOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTypedLinkFacet' {[Text]
identityAttributeOrder :: [Text]
$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [Text]
identityAttributeOrder} -> [Text]
identityAttributeOrder) (\s :: UpdateTypedLinkFacet
s@UpdateTypedLinkFacet' {} [Text]
a -> UpdateTypedLinkFacet
s {$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: [Text]
identityAttributeOrder = [Text]
a} :: UpdateTypedLinkFacet) 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 Core.AWSRequest UpdateTypedLinkFacet where
type
AWSResponse UpdateTypedLinkFacet =
UpdateTypedLinkFacetResponse
request :: (Service -> Service)
-> UpdateTypedLinkFacet -> Request UpdateTypedLinkFacet
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateTypedLinkFacet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTypedLinkFacet)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateTypedLinkFacetResponse
UpdateTypedLinkFacetResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateTypedLinkFacet where
hashWithSalt :: Int -> UpdateTypedLinkFacet -> Int
hashWithSalt Int
_salt UpdateTypedLinkFacet' {[Text]
[TypedLinkFacetAttributeUpdate]
Text
identityAttributeOrder :: [Text]
attributeUpdates :: [TypedLinkFacetAttributeUpdate]
name :: Text
schemaArn :: Text
$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [Text]
$sel:attributeUpdates:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [TypedLinkFacetAttributeUpdate]
$sel:name:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
$sel:schemaArn:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
schemaArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [TypedLinkFacetAttributeUpdate]
attributeUpdates
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
identityAttributeOrder
instance Prelude.NFData UpdateTypedLinkFacet where
rnf :: UpdateTypedLinkFacet -> ()
rnf UpdateTypedLinkFacet' {[Text]
[TypedLinkFacetAttributeUpdate]
Text
identityAttributeOrder :: [Text]
attributeUpdates :: [TypedLinkFacetAttributeUpdate]
name :: Text
schemaArn :: Text
$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [Text]
$sel:attributeUpdates:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [TypedLinkFacetAttributeUpdate]
$sel:name:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
$sel:schemaArn:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
schemaArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [TypedLinkFacetAttributeUpdate]
attributeUpdates
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
identityAttributeOrder
instance Data.ToHeaders UpdateTypedLinkFacet where
toHeaders :: UpdateTypedLinkFacet -> ResponseHeaders
toHeaders UpdateTypedLinkFacet' {[Text]
[TypedLinkFacetAttributeUpdate]
Text
identityAttributeOrder :: [Text]
attributeUpdates :: [TypedLinkFacetAttributeUpdate]
name :: Text
schemaArn :: Text
$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [Text]
$sel:attributeUpdates:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [TypedLinkFacetAttributeUpdate]
$sel:name:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
$sel:schemaArn:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-data-partition" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Text
schemaArn]
instance Data.ToJSON UpdateTypedLinkFacet where
toJSON :: UpdateTypedLinkFacet -> Value
toJSON UpdateTypedLinkFacet' {[Text]
[TypedLinkFacetAttributeUpdate]
Text
identityAttributeOrder :: [Text]
attributeUpdates :: [TypedLinkFacetAttributeUpdate]
name :: Text
schemaArn :: Text
$sel:identityAttributeOrder:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [Text]
$sel:attributeUpdates:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> [TypedLinkFacetAttributeUpdate]
$sel:name:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
$sel:schemaArn:UpdateTypedLinkFacet' :: UpdateTypedLinkFacet -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just
(Key
"AttributeUpdates" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [TypedLinkFacetAttributeUpdate]
attributeUpdates),
forall a. a -> Maybe a
Prelude.Just
( Key
"IdentityAttributeOrder"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
identityAttributeOrder
)
]
)
instance Data.ToPath UpdateTypedLinkFacet where
toPath :: UpdateTypedLinkFacet -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const
ByteString
"/amazonclouddirectory/2017-01-11/typedlink/facet"
instance Data.ToQuery UpdateTypedLinkFacet where
toQuery :: UpdateTypedLinkFacet -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateTypedLinkFacetResponse = UpdateTypedLinkFacetResponse'
{
UpdateTypedLinkFacetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateTypedLinkFacetResponse
-> UpdateTypedLinkFacetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTypedLinkFacetResponse
-> UpdateTypedLinkFacetResponse -> Bool
$c/= :: UpdateTypedLinkFacetResponse
-> UpdateTypedLinkFacetResponse -> Bool
== :: UpdateTypedLinkFacetResponse
-> UpdateTypedLinkFacetResponse -> Bool
$c== :: UpdateTypedLinkFacetResponse
-> UpdateTypedLinkFacetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTypedLinkFacetResponse]
ReadPrec UpdateTypedLinkFacetResponse
Int -> ReadS UpdateTypedLinkFacetResponse
ReadS [UpdateTypedLinkFacetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTypedLinkFacetResponse]
$creadListPrec :: ReadPrec [UpdateTypedLinkFacetResponse]
readPrec :: ReadPrec UpdateTypedLinkFacetResponse
$creadPrec :: ReadPrec UpdateTypedLinkFacetResponse
readList :: ReadS [UpdateTypedLinkFacetResponse]
$creadList :: ReadS [UpdateTypedLinkFacetResponse]
readsPrec :: Int -> ReadS UpdateTypedLinkFacetResponse
$creadsPrec :: Int -> ReadS UpdateTypedLinkFacetResponse
Prelude.Read, Int -> UpdateTypedLinkFacetResponse -> ShowS
[UpdateTypedLinkFacetResponse] -> ShowS
UpdateTypedLinkFacetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTypedLinkFacetResponse] -> ShowS
$cshowList :: [UpdateTypedLinkFacetResponse] -> ShowS
show :: UpdateTypedLinkFacetResponse -> String
$cshow :: UpdateTypedLinkFacetResponse -> String
showsPrec :: Int -> UpdateTypedLinkFacetResponse -> ShowS
$cshowsPrec :: Int -> UpdateTypedLinkFacetResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateTypedLinkFacetResponse x -> UpdateTypedLinkFacetResponse
forall x.
UpdateTypedLinkFacetResponse -> Rep UpdateTypedLinkFacetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTypedLinkFacetResponse x -> UpdateTypedLinkFacetResponse
$cfrom :: forall x.
UpdateTypedLinkFacetResponse -> Rep UpdateTypedLinkFacetResponse x
Prelude.Generic)
newUpdateTypedLinkFacetResponse ::
Prelude.Int ->
UpdateTypedLinkFacetResponse
newUpdateTypedLinkFacetResponse :: Int -> UpdateTypedLinkFacetResponse
newUpdateTypedLinkFacetResponse Int
pHttpStatus_ =
UpdateTypedLinkFacetResponse'
{ $sel:httpStatus:UpdateTypedLinkFacetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateTypedLinkFacetResponse_httpStatus :: Lens.Lens' UpdateTypedLinkFacetResponse Prelude.Int
updateTypedLinkFacetResponse_httpStatus :: Lens' UpdateTypedLinkFacetResponse Int
updateTypedLinkFacetResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTypedLinkFacetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTypedLinkFacetResponse' :: UpdateTypedLinkFacetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateTypedLinkFacetResponse
s@UpdateTypedLinkFacetResponse' {} Int
a -> UpdateTypedLinkFacetResponse
s {$sel:httpStatus:UpdateTypedLinkFacetResponse' :: Int
httpStatus = Int
a} :: UpdateTypedLinkFacetResponse)
instance Prelude.NFData UpdateTypedLinkFacetResponse where
rnf :: UpdateTypedLinkFacetResponse -> ()
rnf UpdateTypedLinkFacetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTypedLinkFacetResponse' :: UpdateTypedLinkFacetResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus