{-# 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.Chime.UpdateChannel
(
UpdateChannel (..),
newUpdateChannel,
updateChannel_chimeBearer,
updateChannel_metadata,
updateChannel_channelArn,
updateChannel_name,
updateChannel_mode,
UpdateChannelResponse (..),
newUpdateChannelResponse,
updateChannelResponse_channelArn,
updateChannelResponse_httpStatus,
)
where
import Amazonka.Chime.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 Text
chimeBearer :: Prelude.Maybe Prelude.Text,
UpdateChannel -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateChannel -> Text
channelArn :: Prelude.Text,
UpdateChannel -> Sensitive Text
name :: Data.Sensitive Prelude.Text,
UpdateChannel -> ChannelMode
mode :: ChannelMode
}
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 ->
ChannelMode ->
UpdateChannel
newUpdateChannel :: Text -> Text -> ChannelMode -> UpdateChannel
newUpdateChannel Text
pChannelArn_ Text
pName_ ChannelMode
pMode_ =
UpdateChannel'
{ $sel:chimeBearer:UpdateChannel' :: Maybe Text
chimeBearer = forall a. Maybe a
Prelude.Nothing,
$sel:metadata:UpdateChannel' :: Maybe (Sensitive Text)
metadata = forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:UpdateChannel' :: Text
channelArn = Text
pChannelArn_,
$sel:name:UpdateChannel' :: Sensitive Text
name = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pName_,
$sel:mode:UpdateChannel' :: ChannelMode
mode = ChannelMode
pMode_
}
updateChannel_chimeBearer :: Lens.Lens' UpdateChannel (Prelude.Maybe Prelude.Text)
updateChannel_chimeBearer :: Lens' UpdateChannel (Maybe Text)
updateChannel_chimeBearer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: UpdateChannel
s@UpdateChannel' {} Maybe Text
a -> UpdateChannel
s {$sel:chimeBearer:UpdateChannel' :: Maybe Text
chimeBearer = Maybe Text
a} :: UpdateChannel)
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_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_name :: Lens.Lens' UpdateChannel Prelude.Text
updateChannel_name :: Lens' UpdateChannel Text
updateChannel_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Sensitive Text
name :: Sensitive Text
$sel:name:UpdateChannel' :: UpdateChannel -> Sensitive Text
name} -> Sensitive Text
name) (\s :: UpdateChannel
s@UpdateChannel' {} Sensitive Text
a -> UpdateChannel
s {$sel:name:UpdateChannel' :: Sensitive Text
name = Sensitive Text
a} :: UpdateChannel) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
updateChannel_mode :: Lens.Lens' UpdateChannel ChannelMode
updateChannel_mode :: Lens' UpdateChannel ChannelMode
updateChannel_mode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {ChannelMode
mode :: ChannelMode
$sel:mode:UpdateChannel' :: UpdateChannel -> ChannelMode
mode} -> ChannelMode
mode) (\s :: UpdateChannel
s@UpdateChannel' {} ChannelMode
a -> UpdateChannel
s {$sel:mode:UpdateChannel' :: ChannelMode
mode = ChannelMode
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 Text
Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMode
mode :: ChannelMode
name :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:mode:UpdateChannel' :: UpdateChannel -> ChannelMode
$sel:name:UpdateChannel' :: UpdateChannel -> Sensitive Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
chimeBearer
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
metadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ChannelMode
mode
instance Prelude.NFData UpdateChannel where
rnf :: UpdateChannel -> ()
rnf UpdateChannel' {Maybe Text
Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMode
mode :: ChannelMode
name :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:mode:UpdateChannel' :: UpdateChannel -> ChannelMode
$sel:name:UpdateChannel' :: UpdateChannel -> Sensitive Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
chimeBearer
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ChannelMode
mode
instance Data.ToHeaders UpdateChannel where
toHeaders :: UpdateChannel -> ResponseHeaders
toHeaders UpdateChannel' {Maybe Text
Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMode
mode :: ChannelMode
name :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:mode:UpdateChannel' :: UpdateChannel -> ChannelMode
$sel:name:UpdateChannel' :: UpdateChannel -> Sensitive Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
chimeBearer]
instance Data.ToJSON UpdateChannel where
toJSON :: UpdateChannel -> Value
toJSON UpdateChannel' {Maybe Text
Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMode
mode :: ChannelMode
name :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:mode:UpdateChannel' :: UpdateChannel -> ChannelMode
$sel:name:UpdateChannel' :: UpdateChannel -> Sensitive Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Maybe 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,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Mode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ChannelMode
mode)
]
)
instance Data.ToPath UpdateChannel where
toPath :: UpdateChannel -> ByteString
toPath UpdateChannel' {Maybe Text
Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMode
mode :: ChannelMode
name :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:mode:UpdateChannel' :: UpdateChannel -> ChannelMode
$sel:name:UpdateChannel' :: UpdateChannel -> Sensitive Text
$sel:channelArn:UpdateChannel' :: UpdateChannel -> Text
$sel:metadata:UpdateChannel' :: UpdateChannel -> Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannel' :: UpdateChannel -> Maybe 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