{-# 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.IVS.PutMetadata
(
PutMetadata (..),
newPutMetadata,
putMetadata_channelArn,
putMetadata_metadata,
PutMetadataResponse (..),
newPutMetadataResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IVS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutMetadata = PutMetadata'
{
PutMetadata -> Text
channelArn :: Prelude.Text,
PutMetadata -> Sensitive Text
metadata :: Core.Sensitive Prelude.Text
}
deriving (PutMetadata -> PutMetadata -> Bool
(PutMetadata -> PutMetadata -> Bool)
-> (PutMetadata -> PutMetadata -> Bool) -> Eq PutMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutMetadata -> PutMetadata -> Bool
$c/= :: PutMetadata -> PutMetadata -> Bool
== :: PutMetadata -> PutMetadata -> Bool
$c== :: PutMetadata -> PutMetadata -> Bool
Prelude.Eq, Int -> PutMetadata -> ShowS
[PutMetadata] -> ShowS
PutMetadata -> String
(Int -> PutMetadata -> ShowS)
-> (PutMetadata -> String)
-> ([PutMetadata] -> ShowS)
-> Show PutMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutMetadata] -> ShowS
$cshowList :: [PutMetadata] -> ShowS
show :: PutMetadata -> String
$cshow :: PutMetadata -> String
showsPrec :: Int -> PutMetadata -> ShowS
$cshowsPrec :: Int -> PutMetadata -> ShowS
Prelude.Show, (forall x. PutMetadata -> Rep PutMetadata x)
-> (forall x. Rep PutMetadata x -> PutMetadata)
-> Generic PutMetadata
forall x. Rep PutMetadata x -> PutMetadata
forall x. PutMetadata -> Rep PutMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutMetadata x -> PutMetadata
$cfrom :: forall x. PutMetadata -> Rep PutMetadata x
Prelude.Generic)
newPutMetadata ::
Prelude.Text ->
Prelude.Text ->
PutMetadata
newPutMetadata :: Text -> Text -> PutMetadata
newPutMetadata Text
pChannelArn_ Text
pMetadata_ =
PutMetadata' :: Text -> Sensitive Text -> PutMetadata
PutMetadata'
{ $sel:channelArn:PutMetadata' :: Text
channelArn = Text
pChannelArn_,
$sel:metadata:PutMetadata' :: Sensitive Text
metadata = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pMetadata_
}
putMetadata_channelArn :: Lens.Lens' PutMetadata Prelude.Text
putMetadata_channelArn :: (Text -> f Text) -> PutMetadata -> f PutMetadata
putMetadata_channelArn = (PutMetadata -> Text)
-> (PutMetadata -> Text -> PutMetadata)
-> Lens PutMetadata PutMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMetadata' {Text
channelArn :: Text
$sel:channelArn:PutMetadata' :: PutMetadata -> Text
channelArn} -> Text
channelArn) (\s :: PutMetadata
s@PutMetadata' {} Text
a -> PutMetadata
s {$sel:channelArn:PutMetadata' :: Text
channelArn = Text
a} :: PutMetadata)
putMetadata_metadata :: Lens.Lens' PutMetadata Prelude.Text
putMetadata_metadata :: (Text -> f Text) -> PutMetadata -> f PutMetadata
putMetadata_metadata = (PutMetadata -> Sensitive Text)
-> (PutMetadata -> Sensitive Text -> PutMetadata)
-> Lens PutMetadata PutMetadata (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMetadata' {Sensitive Text
metadata :: Sensitive Text
$sel:metadata:PutMetadata' :: PutMetadata -> Sensitive Text
metadata} -> Sensitive Text
metadata) (\s :: PutMetadata
s@PutMetadata' {} Sensitive Text
a -> PutMetadata
s {$sel:metadata:PutMetadata' :: Sensitive Text
metadata = Sensitive Text
a} :: PutMetadata) ((Sensitive Text -> f (Sensitive Text))
-> PutMetadata -> f PutMetadata)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> PutMetadata
-> f PutMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.AWSRequest PutMetadata where
type AWSResponse PutMetadata = PutMetadataResponse
request :: PutMetadata -> Request PutMetadata
request = Service -> PutMetadata -> Request PutMetadata
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutMetadata
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutMetadata)))
response = AWSResponse PutMetadata
-> Logger
-> Service
-> Proxy PutMetadata
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutMetadata)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutMetadata
PutMetadataResponse
PutMetadataResponse'
instance Prelude.Hashable PutMetadata
instance Prelude.NFData PutMetadata
instance Core.ToHeaders PutMetadata where
toHeaders :: PutMetadata -> [Header]
toHeaders =
[Header] -> PutMetadata -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutMetadata where
toJSON :: PutMetadata -> Value
toJSON PutMetadata' {Text
Sensitive Text
metadata :: Sensitive Text
channelArn :: Text
$sel:metadata:PutMetadata' :: PutMetadata -> Sensitive Text
$sel:channelArn:PutMetadata' :: PutMetadata -> 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
"channelArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
channelArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"metadata" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
metadata)
]
)
instance Core.ToPath PutMetadata where
toPath :: PutMetadata -> ByteString
toPath = ByteString -> PutMetadata -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/PutMetadata"
instance Core.ToQuery PutMetadata where
toQuery :: PutMetadata -> QueryString
toQuery = QueryString -> PutMetadata -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutMetadataResponse = PutMetadataResponse'
{
}
deriving (PutMetadataResponse -> PutMetadataResponse -> Bool
(PutMetadataResponse -> PutMetadataResponse -> Bool)
-> (PutMetadataResponse -> PutMetadataResponse -> Bool)
-> Eq PutMetadataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutMetadataResponse -> PutMetadataResponse -> Bool
$c/= :: PutMetadataResponse -> PutMetadataResponse -> Bool
== :: PutMetadataResponse -> PutMetadataResponse -> Bool
$c== :: PutMetadataResponse -> PutMetadataResponse -> Bool
Prelude.Eq, ReadPrec [PutMetadataResponse]
ReadPrec PutMetadataResponse
Int -> ReadS PutMetadataResponse
ReadS [PutMetadataResponse]
(Int -> ReadS PutMetadataResponse)
-> ReadS [PutMetadataResponse]
-> ReadPrec PutMetadataResponse
-> ReadPrec [PutMetadataResponse]
-> Read PutMetadataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutMetadataResponse]
$creadListPrec :: ReadPrec [PutMetadataResponse]
readPrec :: ReadPrec PutMetadataResponse
$creadPrec :: ReadPrec PutMetadataResponse
readList :: ReadS [PutMetadataResponse]
$creadList :: ReadS [PutMetadataResponse]
readsPrec :: Int -> ReadS PutMetadataResponse
$creadsPrec :: Int -> ReadS PutMetadataResponse
Prelude.Read, Int -> PutMetadataResponse -> ShowS
[PutMetadataResponse] -> ShowS
PutMetadataResponse -> String
(Int -> PutMetadataResponse -> ShowS)
-> (PutMetadataResponse -> String)
-> ([PutMetadataResponse] -> ShowS)
-> Show PutMetadataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutMetadataResponse] -> ShowS
$cshowList :: [PutMetadataResponse] -> ShowS
show :: PutMetadataResponse -> String
$cshow :: PutMetadataResponse -> String
showsPrec :: Int -> PutMetadataResponse -> ShowS
$cshowsPrec :: Int -> PutMetadataResponse -> ShowS
Prelude.Show, (forall x. PutMetadataResponse -> Rep PutMetadataResponse x)
-> (forall x. Rep PutMetadataResponse x -> PutMetadataResponse)
-> Generic PutMetadataResponse
forall x. Rep PutMetadataResponse x -> PutMetadataResponse
forall x. PutMetadataResponse -> Rep PutMetadataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutMetadataResponse x -> PutMetadataResponse
$cfrom :: forall x. PutMetadataResponse -> Rep PutMetadataResponse x
Prelude.Generic)
newPutMetadataResponse ::
PutMetadataResponse
newPutMetadataResponse :: PutMetadataResponse
newPutMetadataResponse = PutMetadataResponse
PutMetadataResponse'
instance Prelude.NFData PutMetadataResponse