{-# 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.ChimeSDKMessaging.CreateChannel
(
CreateChannel (..),
newCreateChannel,
createChannel_mode,
createChannel_privacy,
createChannel_metadata,
createChannel_tags,
createChannel_appInstanceArn,
createChannel_name,
createChannel_clientRequestToken,
createChannel_chimeBearer,
CreateChannelResponse (..),
newCreateChannelResponse,
createChannelResponse_channelArn,
createChannelResponse_httpStatus,
)
where
import Amazonka.ChimeSDKMessaging.Types
import qualified Amazonka.Core as Core
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 CreateChannel = CreateChannel'
{
CreateChannel -> Maybe ChannelMode
mode :: Prelude.Maybe ChannelMode,
CreateChannel -> Maybe ChannelPrivacy
privacy :: Prelude.Maybe ChannelPrivacy,
CreateChannel -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateChannel -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateChannel -> Text
appInstanceArn :: Prelude.Text,
CreateChannel -> Sensitive Text
name :: Core.Sensitive Prelude.Text,
CreateChannel -> Sensitive Text
clientRequestToken :: Core.Sensitive Prelude.Text,
CreateChannel -> Text
chimeBearer :: Prelude.Text
}
deriving (CreateChannel -> CreateChannel -> Bool
(CreateChannel -> CreateChannel -> Bool)
-> (CreateChannel -> CreateChannel -> Bool) -> Eq CreateChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannel -> CreateChannel -> Bool
$c/= :: CreateChannel -> CreateChannel -> Bool
== :: CreateChannel -> CreateChannel -> Bool
$c== :: CreateChannel -> CreateChannel -> Bool
Prelude.Eq, Int -> CreateChannel -> ShowS
[CreateChannel] -> ShowS
CreateChannel -> String
(Int -> CreateChannel -> ShowS)
-> (CreateChannel -> String)
-> ([CreateChannel] -> ShowS)
-> Show CreateChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannel] -> ShowS
$cshowList :: [CreateChannel] -> ShowS
show :: CreateChannel -> String
$cshow :: CreateChannel -> String
showsPrec :: Int -> CreateChannel -> ShowS
$cshowsPrec :: Int -> CreateChannel -> ShowS
Prelude.Show, (forall x. CreateChannel -> Rep CreateChannel x)
-> (forall x. Rep CreateChannel x -> CreateChannel)
-> Generic CreateChannel
forall x. Rep CreateChannel x -> CreateChannel
forall x. CreateChannel -> Rep CreateChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannel x -> CreateChannel
$cfrom :: forall x. CreateChannel -> Rep CreateChannel x
Prelude.Generic)
newCreateChannel ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateChannel
newCreateChannel :: Text -> Text -> Text -> Text -> CreateChannel
newCreateChannel
Text
pAppInstanceArn_
Text
pName_
Text
pClientRequestToken_
Text
pChimeBearer_ =
CreateChannel' :: Maybe ChannelMode
-> Maybe ChannelPrivacy
-> Maybe (Sensitive Text)
-> Maybe (NonEmpty Tag)
-> Text
-> Sensitive Text
-> Sensitive Text
-> Text
-> CreateChannel
CreateChannel'
{ $sel:mode:CreateChannel' :: Maybe ChannelMode
mode = Maybe ChannelMode
forall a. Maybe a
Prelude.Nothing,
$sel:privacy:CreateChannel' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
forall a. Maybe a
Prelude.Nothing,
$sel:metadata:CreateChannel' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateChannel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:appInstanceArn:CreateChannel' :: Text
appInstanceArn = Text
pAppInstanceArn_,
$sel:name:CreateChannel' :: Sensitive Text
name = 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
pName_,
$sel:clientRequestToken:CreateChannel' :: Sensitive Text
clientRequestToken =
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
pClientRequestToken_,
$sel:chimeBearer:CreateChannel' :: Text
chimeBearer = Text
pChimeBearer_
}
createChannel_mode :: Lens.Lens' CreateChannel (Prelude.Maybe ChannelMode)
createChannel_mode :: (Maybe ChannelMode -> f (Maybe ChannelMode))
-> CreateChannel -> f CreateChannel
createChannel_mode = (CreateChannel -> Maybe ChannelMode)
-> (CreateChannel -> Maybe ChannelMode -> CreateChannel)
-> Lens
CreateChannel CreateChannel (Maybe ChannelMode) (Maybe ChannelMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe ChannelMode
mode :: Maybe ChannelMode
$sel:mode:CreateChannel' :: CreateChannel -> Maybe ChannelMode
mode} -> Maybe ChannelMode
mode) (\s :: CreateChannel
s@CreateChannel' {} Maybe ChannelMode
a -> CreateChannel
s {$sel:mode:CreateChannel' :: Maybe ChannelMode
mode = Maybe ChannelMode
a} :: CreateChannel)
createChannel_privacy :: Lens.Lens' CreateChannel (Prelude.Maybe ChannelPrivacy)
createChannel_privacy :: (Maybe ChannelPrivacy -> f (Maybe ChannelPrivacy))
-> CreateChannel -> f CreateChannel
createChannel_privacy = (CreateChannel -> Maybe ChannelPrivacy)
-> (CreateChannel -> Maybe ChannelPrivacy -> CreateChannel)
-> Lens
CreateChannel
CreateChannel
(Maybe ChannelPrivacy)
(Maybe ChannelPrivacy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe ChannelPrivacy
privacy :: Maybe ChannelPrivacy
$sel:privacy:CreateChannel' :: CreateChannel -> Maybe ChannelPrivacy
privacy} -> Maybe ChannelPrivacy
privacy) (\s :: CreateChannel
s@CreateChannel' {} Maybe ChannelPrivacy
a -> CreateChannel
s {$sel:privacy:CreateChannel' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
a} :: CreateChannel)
createChannel_metadata :: Lens.Lens' CreateChannel (Prelude.Maybe Prelude.Text)
createChannel_metadata :: (Maybe Text -> f (Maybe Text)) -> CreateChannel -> f CreateChannel
createChannel_metadata = (CreateChannel -> Maybe (Sensitive Text))
-> (CreateChannel -> Maybe (Sensitive Text) -> CreateChannel)
-> Lens
CreateChannel
CreateChannel
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:CreateChannel' :: CreateChannel -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: CreateChannel
s@CreateChannel' {} Maybe (Sensitive Text)
a -> CreateChannel
s {$sel:metadata:CreateChannel' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: CreateChannel) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateChannel -> f CreateChannel)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateChannel
-> f CreateChannel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
createChannel_tags :: Lens.Lens' CreateChannel (Prelude.Maybe (Prelude.NonEmpty Tag))
createChannel_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannel -> f CreateChannel
createChannel_tags = (CreateChannel -> Maybe (NonEmpty Tag))
-> (CreateChannel -> Maybe (NonEmpty Tag) -> CreateChannel)
-> Lens
CreateChannel
CreateChannel
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateChannel
s@CreateChannel' {} Maybe (NonEmpty Tag)
a -> CreateChannel
s {$sel:tags:CreateChannel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateChannel) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannel -> f CreateChannel)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannel
-> f CreateChannel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createChannel_appInstanceArn :: Lens.Lens' CreateChannel Prelude.Text
createChannel_appInstanceArn :: (Text -> f Text) -> CreateChannel -> f CreateChannel
createChannel_appInstanceArn = (CreateChannel -> Text)
-> (CreateChannel -> Text -> CreateChannel)
-> Lens CreateChannel CreateChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Text
appInstanceArn :: Text
$sel:appInstanceArn:CreateChannel' :: CreateChannel -> Text
appInstanceArn} -> Text
appInstanceArn) (\s :: CreateChannel
s@CreateChannel' {} Text
a -> CreateChannel
s {$sel:appInstanceArn:CreateChannel' :: Text
appInstanceArn = Text
a} :: CreateChannel)
createChannel_name :: Lens.Lens' CreateChannel Prelude.Text
createChannel_name :: (Text -> f Text) -> CreateChannel -> f CreateChannel
createChannel_name = (CreateChannel -> Sensitive Text)
-> (CreateChannel -> Sensitive Text -> CreateChannel)
-> Lens
CreateChannel CreateChannel (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Sensitive Text
name :: Sensitive Text
$sel:name:CreateChannel' :: CreateChannel -> Sensitive Text
name} -> Sensitive Text
name) (\s :: CreateChannel
s@CreateChannel' {} Sensitive Text
a -> CreateChannel
s {$sel:name:CreateChannel' :: Sensitive Text
name = Sensitive Text
a} :: CreateChannel) ((Sensitive Text -> f (Sensitive Text))
-> CreateChannel -> f CreateChannel)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateChannel
-> f CreateChannel
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
createChannel_clientRequestToken :: Lens.Lens' CreateChannel Prelude.Text
createChannel_clientRequestToken :: (Text -> f Text) -> CreateChannel -> f CreateChannel
createChannel_clientRequestToken = (CreateChannel -> Sensitive Text)
-> (CreateChannel -> Sensitive Text -> CreateChannel)
-> Lens
CreateChannel CreateChannel (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Sensitive Text
clientRequestToken :: Sensitive Text
$sel:clientRequestToken:CreateChannel' :: CreateChannel -> Sensitive Text
clientRequestToken} -> Sensitive Text
clientRequestToken) (\s :: CreateChannel
s@CreateChannel' {} Sensitive Text
a -> CreateChannel
s {$sel:clientRequestToken:CreateChannel' :: Sensitive Text
clientRequestToken = Sensitive Text
a} :: CreateChannel) ((Sensitive Text -> f (Sensitive Text))
-> CreateChannel -> f CreateChannel)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateChannel
-> f CreateChannel
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
createChannel_chimeBearer :: Lens.Lens' CreateChannel Prelude.Text
createChannel_chimeBearer :: (Text -> f Text) -> CreateChannel -> f CreateChannel
createChannel_chimeBearer = (CreateChannel -> Text)
-> (CreateChannel -> Text -> CreateChannel)
-> Lens CreateChannel CreateChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Text
chimeBearer :: Text
$sel:chimeBearer:CreateChannel' :: CreateChannel -> Text
chimeBearer} -> Text
chimeBearer) (\s :: CreateChannel
s@CreateChannel' {} Text
a -> CreateChannel
s {$sel:chimeBearer:CreateChannel' :: Text
chimeBearer = Text
a} :: CreateChannel)
instance Core.AWSRequest CreateChannel where
type
AWSResponse CreateChannel =
CreateChannelResponse
request :: CreateChannel -> Request CreateChannel
request = Service -> CreateChannel -> Request CreateChannel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateChannel)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateChannel))
-> Logger
-> Service
-> Proxy CreateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateChannel)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> CreateChannelResponse
CreateChannelResponse'
(Maybe Text -> Int -> CreateChannelResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateChannelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelArn")
Either String (Int -> CreateChannelResponse)
-> Either String Int -> Either String CreateChannelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateChannel
instance Prelude.NFData CreateChannel
instance Core.ToHeaders CreateChannel where
toHeaders :: CreateChannel -> ResponseHeaders
toHeaders CreateChannel' {Maybe (NonEmpty Tag)
Maybe (Sensitive Text)
Maybe ChannelMode
Maybe ChannelPrivacy
Text
Sensitive Text
chimeBearer :: Text
clientRequestToken :: Sensitive Text
name :: Sensitive Text
appInstanceArn :: Text
tags :: Maybe (NonEmpty Tag)
metadata :: Maybe (Sensitive Text)
privacy :: Maybe ChannelPrivacy
mode :: Maybe ChannelMode
$sel:chimeBearer:CreateChannel' :: CreateChannel -> Text
$sel:clientRequestToken:CreateChannel' :: CreateChannel -> Sensitive Text
$sel:name:CreateChannel' :: CreateChannel -> Sensitive Text
$sel:appInstanceArn:CreateChannel' :: CreateChannel -> Text
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (NonEmpty Tag)
$sel:metadata:CreateChannel' :: CreateChannel -> Maybe (Sensitive Text)
$sel:privacy:CreateChannel' :: CreateChannel -> Maybe ChannelPrivacy
$sel:mode:CreateChannel' :: CreateChannel -> Maybe ChannelMode
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
chimeBearer]
instance Core.ToJSON CreateChannel where
toJSON :: CreateChannel -> Value
toJSON CreateChannel' {Maybe (NonEmpty Tag)
Maybe (Sensitive Text)
Maybe ChannelMode
Maybe ChannelPrivacy
Text
Sensitive Text
chimeBearer :: Text
clientRequestToken :: Sensitive Text
name :: Sensitive Text
appInstanceArn :: Text
tags :: Maybe (NonEmpty Tag)
metadata :: Maybe (Sensitive Text)
privacy :: Maybe ChannelPrivacy
mode :: Maybe ChannelMode
$sel:chimeBearer:CreateChannel' :: CreateChannel -> Text
$sel:clientRequestToken:CreateChannel' :: CreateChannel -> Sensitive Text
$sel:name:CreateChannel' :: CreateChannel -> Sensitive Text
$sel:appInstanceArn:CreateChannel' :: CreateChannel -> Text
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (NonEmpty Tag)
$sel:metadata:CreateChannel' :: CreateChannel -> Maybe (Sensitive Text)
$sel:privacy:CreateChannel' :: CreateChannel -> Maybe ChannelPrivacy
$sel:mode:CreateChannel' :: CreateChannel -> Maybe ChannelMode
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Mode" Text -> ChannelMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChannelMode -> Pair) -> Maybe ChannelMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelMode
mode,
(Text
"Privacy" Text -> ChannelPrivacy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChannelPrivacy -> Pair) -> Maybe ChannelPrivacy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelPrivacy
privacy,
(Text
"Metadata" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
metadata,
(Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AppInstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appInstanceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ClientRequestToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientRequestToken)
]
)
instance Core.ToPath CreateChannel where
toPath :: CreateChannel -> ByteString
toPath = ByteString -> CreateChannel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/channels"
instance Core.ToQuery CreateChannel where
toQuery :: CreateChannel -> QueryString
toQuery = QueryString -> CreateChannel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateChannelResponse = CreateChannelResponse'
{
CreateChannelResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
CreateChannelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateChannelResponse -> CreateChannelResponse -> Bool
(CreateChannelResponse -> CreateChannelResponse -> Bool)
-> (CreateChannelResponse -> CreateChannelResponse -> Bool)
-> Eq CreateChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelResponse -> CreateChannelResponse -> Bool
$c/= :: CreateChannelResponse -> CreateChannelResponse -> Bool
== :: CreateChannelResponse -> CreateChannelResponse -> Bool
$c== :: CreateChannelResponse -> CreateChannelResponse -> Bool
Prelude.Eq, ReadPrec [CreateChannelResponse]
ReadPrec CreateChannelResponse
Int -> ReadS CreateChannelResponse
ReadS [CreateChannelResponse]
(Int -> ReadS CreateChannelResponse)
-> ReadS [CreateChannelResponse]
-> ReadPrec CreateChannelResponse
-> ReadPrec [CreateChannelResponse]
-> Read CreateChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateChannelResponse]
$creadListPrec :: ReadPrec [CreateChannelResponse]
readPrec :: ReadPrec CreateChannelResponse
$creadPrec :: ReadPrec CreateChannelResponse
readList :: ReadS [CreateChannelResponse]
$creadList :: ReadS [CreateChannelResponse]
readsPrec :: Int -> ReadS CreateChannelResponse
$creadsPrec :: Int -> ReadS CreateChannelResponse
Prelude.Read, Int -> CreateChannelResponse -> ShowS
[CreateChannelResponse] -> ShowS
CreateChannelResponse -> String
(Int -> CreateChannelResponse -> ShowS)
-> (CreateChannelResponse -> String)
-> ([CreateChannelResponse] -> ShowS)
-> Show CreateChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelResponse] -> ShowS
$cshowList :: [CreateChannelResponse] -> ShowS
show :: CreateChannelResponse -> String
$cshow :: CreateChannelResponse -> String
showsPrec :: Int -> CreateChannelResponse -> ShowS
$cshowsPrec :: Int -> CreateChannelResponse -> ShowS
Prelude.Show, (forall x. CreateChannelResponse -> Rep CreateChannelResponse x)
-> (forall x. Rep CreateChannelResponse x -> CreateChannelResponse)
-> Generic CreateChannelResponse
forall x. Rep CreateChannelResponse x -> CreateChannelResponse
forall x. CreateChannelResponse -> Rep CreateChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannelResponse x -> CreateChannelResponse
$cfrom :: forall x. CreateChannelResponse -> Rep CreateChannelResponse x
Prelude.Generic)
newCreateChannelResponse ::
Prelude.Int ->
CreateChannelResponse
newCreateChannelResponse :: Int -> CreateChannelResponse
newCreateChannelResponse Int
pHttpStatus_ =
CreateChannelResponse' :: Maybe Text -> Int -> CreateChannelResponse
CreateChannelResponse'
{ $sel:channelArn:CreateChannelResponse' :: Maybe Text
channelArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateChannelResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createChannelResponse_channelArn :: Lens.Lens' CreateChannelResponse (Prelude.Maybe Prelude.Text)
createChannelResponse_channelArn :: (Maybe Text -> f (Maybe Text))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_channelArn = (CreateChannelResponse -> Maybe Text)
-> (CreateChannelResponse -> Maybe Text -> CreateChannelResponse)
-> Lens
CreateChannelResponse
CreateChannelResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:CreateChannelResponse' :: CreateChannelResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe Text
a -> CreateChannelResponse
s {$sel:channelArn:CreateChannelResponse' :: Maybe Text
channelArn = Maybe Text
a} :: CreateChannelResponse)
createChannelResponse_httpStatus :: Lens.Lens' CreateChannelResponse Prelude.Int
createChannelResponse_httpStatus :: (Int -> f Int) -> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_httpStatus = (CreateChannelResponse -> Int)
-> (CreateChannelResponse -> Int -> CreateChannelResponse)
-> Lens CreateChannelResponse CreateChannelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateChannelResponse' :: CreateChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Int
a -> CreateChannelResponse
s {$sel:httpStatus:CreateChannelResponse' :: Int
httpStatus = Int
a} :: CreateChannelResponse)
instance Prelude.NFData CreateChannelResponse