{-# 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.UpdateChannel
(
UpdateChannel (..),
newUpdateChannel,
updateChannel_metadata,
updateChannel_mode,
updateChannel_name,
updateChannel_channelArn,
updateChannel_chimeBearer,
UpdateChannelResponse (..),
newUpdateChannelResponse,
updateChannelResponse_channelArn,
updateChannelResponse_httpStatus,
)
where
import Amazonka.ChimeSDKMessaging.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 UpdateChannel = UpdateChannel'
{
UpdateChannel -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateChannel -> Maybe ChannelMode
mode :: Prelude.Maybe ChannelMode,
UpdateChannel -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateChannel -> Text
channelArn :: Prelude.Text,
UpdateChannel -> Text
chimeBearer :: Prelude.Text
}
deriving (UpdateChannel -> UpdateChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannel -> UpdateChannel -> Bool
$c/= :: UpdateChannel -> UpdateChannel -> Bool
== :: UpdateChannel -> UpdateChannel -> Bool
$c== :: UpdateChannel -> UpdateChannel -> Bool
Prelude.Eq, Int -> UpdateChannel -> ShowS
[UpdateChannel] -> ShowS
UpdateChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannel] -> ShowS
$cshowList :: [UpdateChannel] -> ShowS
show :: UpdateChannel -> String
$cshow :: UpdateChannel -> String
showsPrec :: Int -> UpdateChannel -> ShowS
$cshowsPrec :: Int -> UpdateChannel -> ShowS
Prelude.Show, forall x. Rep UpdateChannel x -> UpdateChannel
forall x. UpdateChannel -> Rep UpdateChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChannel x -> UpdateChannel
$cfrom :: forall x. UpdateChannel -> Rep UpdateChannel x
Prelude.Generic)
newUpdateChannel ::
Prelude.Text ->
Prelude.Text ->
UpdateChannel
newUpdateChannel :: Text -> Text -> UpdateChannel
newUpdateChannel Text
pChannelArn_ Text
pChimeBearer_ =
UpdateChannel'
{ $sel:metadata:UpdateChannel' :: Maybe (Sensitive Text)
metadata = forall a. Maybe a
Prelude.Nothing,
$sel:mode:UpdateChannel' :: Maybe ChannelMode
mode = forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateChannel' :: Maybe (Sensitive Text)
name = forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:UpdateChannel' :: Text
channelArn = Text
pChannelArn_,
$sel:chimeBearer:UpdateChannel' :: Text
chimeBearer = Text
pChimeBearer_
}
updateChannel_metadata :: Lens.Lens' UpdateChannel (Prelude.Maybe Prelude.Text)
updateChannel_metadata :: Lens' UpdateChannel (Maybe Text)
updateChannel_metadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: UpdateChannel
s@UpdateChannel' {} Maybe (Sensitive Text)
a -> UpdateChannel
s {$sel:metadata:UpdateChannel' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: UpdateChannel) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
updateChannel_mode :: Lens.Lens' UpdateChannel (Prelude.Maybe ChannelMode)
updateChannel_mode :: Lens' UpdateChannel (Maybe ChannelMode)
updateChannel_mode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Maybe ChannelMode
mode :: Maybe ChannelMode
$sel:mode:UpdateChannel' :: UpdateChannel -> Maybe ChannelMode
mode} -> Maybe ChannelMode
mode) (\s :: UpdateChannel
s@UpdateChannel' {} Maybe ChannelMode
a -> UpdateChannel
s {$sel:mode:UpdateChannel' :: Maybe ChannelMode
mode = Maybe ChannelMode
a} :: UpdateChannel)
updateChannel_name :: Lens.Lens' UpdateChannel (Prelude.Maybe Prelude.Text)
updateChannel_name :: Lens' UpdateChannel (Maybe Text)
updateChannel_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: UpdateChannel
s@UpdateChannel' {} Maybe (Sensitive Text)
a -> UpdateChannel
s {$sel:name:UpdateChannel' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: UpdateChannel) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
updateChannel_channelArn :: Lens.Lens' UpdateChannel Prelude.Text
updateChannel_channelArn :: Lens' UpdateChannel Text
updateChannel_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Text
channelArn :: Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
channelArn} -> Text
channelArn) (\s :: UpdateChannel
s@UpdateChannel' {} Text
a -> UpdateChannel
s {$sel:channelArn:UpdateChannel' :: Text
channelArn = Text
a} :: UpdateChannel)
updateChannel_chimeBearer :: Lens.Lens' UpdateChannel Prelude.Text
updateChannel_chimeBearer :: Lens' UpdateChannel Text
updateChannel_chimeBearer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Text
chimeBearer :: Text
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Text
chimeBearer} -> Text
chimeBearer) (\s :: UpdateChannel
s@UpdateChannel' {} Text
a -> UpdateChannel
s {$sel:chimeBearer:UpdateChannel' :: Text
chimeBearer = Text
a} :: UpdateChannel)
instance Core.AWSRequest UpdateChannel where
type
AWSResponse UpdateChannel =
UpdateChannelResponse
request :: (Service -> Service) -> UpdateChannel -> Request UpdateChannel
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 UpdateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateChannel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> UpdateChannelResponse
UpdateChannelResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ChannelArn")
forall (f :: * -> *) a b. Applicative f => 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 UpdateChannel where
hashWithSalt :: Int -> UpdateChannel -> Int
hashWithSalt Int
_salt UpdateChannel' {Maybe (Sensitive Text)
Maybe ChannelMode
Text
chimeBearer :: Text
channelArn :: Text
name :: Maybe (Sensitive Text)
mode :: Maybe ChannelMode
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:name:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:mode:UpdateChannel' :: UpdateChannel -> Maybe ChannelMode
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
metadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChannelMode
mode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
chimeBearer
instance Prelude.NFData UpdateChannel where
rnf :: UpdateChannel -> ()
rnf UpdateChannel' {Maybe (Sensitive Text)
Maybe ChannelMode
Text
chimeBearer :: Text
channelArn :: Text
name :: Maybe (Sensitive Text)
mode :: Maybe ChannelMode
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:name:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:mode:UpdateChannel' :: UpdateChannel -> Maybe ChannelMode
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
metadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChannelMode
mode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
chimeBearer
instance Data.ToHeaders UpdateChannel where
toHeaders :: UpdateChannel -> ResponseHeaders
toHeaders UpdateChannel' {Maybe (Sensitive Text)
Maybe ChannelMode
Text
chimeBearer :: Text
channelArn :: Text
name :: Maybe (Sensitive Text)
mode :: Maybe ChannelMode
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:name:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:mode:UpdateChannel' :: UpdateChannel -> Maybe ChannelMode
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Text
chimeBearer]
instance Data.ToJSON UpdateChannel where
toJSON :: UpdateChannel -> Value
toJSON UpdateChannel' {Maybe (Sensitive Text)
Maybe ChannelMode
Text
chimeBearer :: Text
channelArn :: Text
name :: Maybe (Sensitive Text)
mode :: Maybe ChannelMode
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:name:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:mode:UpdateChannel' :: UpdateChannel -> Maybe ChannelMode
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Metadata" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
metadata,
(Key
"Mode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelMode
mode,
(Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
name
]
)
instance Data.ToPath UpdateChannel where
toPath :: UpdateChannel -> ByteString
toPath UpdateChannel' {Maybe (Sensitive Text)
Maybe ChannelMode
Text
chimeBearer :: Text
channelArn :: Text
name :: Maybe (Sensitive Text)
mode :: Maybe ChannelMode
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:name:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:mode:UpdateChannel' :: UpdateChannel -> Maybe ChannelMode
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelArn]
instance Data.ToQuery UpdateChannel where
toQuery :: UpdateChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateChannelResponse = UpdateChannelResponse'
{
UpdateChannelResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
UpdateChannelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateChannelResponse -> UpdateChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
$c/= :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
== :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
$c== :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateChannelResponse]
ReadPrec UpdateChannelResponse
Int -> ReadS UpdateChannelResponse
ReadS [UpdateChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChannelResponse]
$creadListPrec :: ReadPrec [UpdateChannelResponse]
readPrec :: ReadPrec UpdateChannelResponse
$creadPrec :: ReadPrec UpdateChannelResponse
readList :: ReadS [UpdateChannelResponse]
$creadList :: ReadS [UpdateChannelResponse]
readsPrec :: Int -> ReadS UpdateChannelResponse
$creadsPrec :: Int -> ReadS UpdateChannelResponse
Prelude.Read, Int -> UpdateChannelResponse -> ShowS
[UpdateChannelResponse] -> ShowS
UpdateChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannelResponse] -> ShowS
$cshowList :: [UpdateChannelResponse] -> ShowS
show :: UpdateChannelResponse -> String
$cshow :: UpdateChannelResponse -> String
showsPrec :: Int -> UpdateChannelResponse -> ShowS
$cshowsPrec :: Int -> UpdateChannelResponse -> ShowS
Prelude.Show, forall x. Rep UpdateChannelResponse x -> UpdateChannelResponse
forall x. UpdateChannelResponse -> Rep UpdateChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChannelResponse x -> UpdateChannelResponse
$cfrom :: forall x. UpdateChannelResponse -> Rep UpdateChannelResponse x
Prelude.Generic)
newUpdateChannelResponse ::
Prelude.Int ->
UpdateChannelResponse
newUpdateChannelResponse :: Int -> UpdateChannelResponse
newUpdateChannelResponse Int
pHttpStatus_ =
UpdateChannelResponse'
{ $sel:channelArn:UpdateChannelResponse' :: Maybe Text
channelArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateChannelResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateChannelResponse_channelArn :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe Prelude.Text)
updateChannelResponse_channelArn :: Lens' UpdateChannelResponse (Maybe Text)
updateChannelResponse_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe Text
a -> UpdateChannelResponse
s {$sel:channelArn:UpdateChannelResponse' :: Maybe Text
channelArn = Maybe Text
a} :: UpdateChannelResponse)
updateChannelResponse_httpStatus :: Lens.Lens' UpdateChannelResponse Prelude.Int
updateChannelResponse_httpStatus :: Lens' UpdateChannelResponse Int
updateChannelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateChannelResponse' :: UpdateChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Int
a -> UpdateChannelResponse
s {$sel:httpStatus:UpdateChannelResponse' :: Int
httpStatus = Int
a} :: UpdateChannelResponse)
instance Prelude.NFData UpdateChannelResponse where
rnf :: UpdateChannelResponse -> ()
rnf UpdateChannelResponse' {Int
Maybe Text
httpStatus :: Int
channelArn :: Maybe Text
$sel:httpStatus:UpdateChannelResponse' :: UpdateChannelResponse -> Int
$sel:channelArn:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus