{-# 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.CreateChannelBan
(
CreateChannelBan (..),
newCreateChannelBan,
createChannelBan_chimeBearer,
createChannelBan_channelArn,
createChannelBan_memberArn,
CreateChannelBanResponse (..),
newCreateChannelBanResponse,
createChannelBanResponse_channelArn,
createChannelBanResponse_member,
createChannelBanResponse_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 CreateChannelBan = CreateChannelBan'
{
CreateChannelBan -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
CreateChannelBan -> Text
channelArn :: Prelude.Text,
CreateChannelBan -> Text
memberArn :: Prelude.Text
}
deriving (CreateChannelBan -> CreateChannelBan -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelBan -> CreateChannelBan -> Bool
$c/= :: CreateChannelBan -> CreateChannelBan -> Bool
== :: CreateChannelBan -> CreateChannelBan -> Bool
$c== :: CreateChannelBan -> CreateChannelBan -> Bool
Prelude.Eq, ReadPrec [CreateChannelBan]
ReadPrec CreateChannelBan
Int -> ReadS CreateChannelBan
ReadS [CreateChannelBan]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateChannelBan]
$creadListPrec :: ReadPrec [CreateChannelBan]
readPrec :: ReadPrec CreateChannelBan
$creadPrec :: ReadPrec CreateChannelBan
readList :: ReadS [CreateChannelBan]
$creadList :: ReadS [CreateChannelBan]
readsPrec :: Int -> ReadS CreateChannelBan
$creadsPrec :: Int -> ReadS CreateChannelBan
Prelude.Read, Int -> CreateChannelBan -> ShowS
[CreateChannelBan] -> ShowS
CreateChannelBan -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelBan] -> ShowS
$cshowList :: [CreateChannelBan] -> ShowS
show :: CreateChannelBan -> String
$cshow :: CreateChannelBan -> String
showsPrec :: Int -> CreateChannelBan -> ShowS
$cshowsPrec :: Int -> CreateChannelBan -> ShowS
Prelude.Show, forall x. Rep CreateChannelBan x -> CreateChannelBan
forall x. CreateChannelBan -> Rep CreateChannelBan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannelBan x -> CreateChannelBan
$cfrom :: forall x. CreateChannelBan -> Rep CreateChannelBan x
Prelude.Generic)
newCreateChannelBan ::
Prelude.Text ->
Prelude.Text ->
CreateChannelBan
newCreateChannelBan :: Text -> Text -> CreateChannelBan
newCreateChannelBan Text
pChannelArn_ Text
pMemberArn_ =
CreateChannelBan'
{ $sel:chimeBearer:CreateChannelBan' :: Maybe Text
chimeBearer = forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:CreateChannelBan' :: Text
channelArn = Text
pChannelArn_,
$sel:memberArn:CreateChannelBan' :: Text
memberArn = Text
pMemberArn_
}
createChannelBan_chimeBearer :: Lens.Lens' CreateChannelBan (Prelude.Maybe Prelude.Text)
createChannelBan_chimeBearer :: Lens' CreateChannelBan (Maybe Text)
createChannelBan_chimeBearer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelBan' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:CreateChannelBan' :: CreateChannelBan -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: CreateChannelBan
s@CreateChannelBan' {} Maybe Text
a -> CreateChannelBan
s {$sel:chimeBearer:CreateChannelBan' :: Maybe Text
chimeBearer = Maybe Text
a} :: CreateChannelBan)
createChannelBan_channelArn :: Lens.Lens' CreateChannelBan Prelude.Text
createChannelBan_channelArn :: Lens' CreateChannelBan Text
createChannelBan_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelBan' {Text
channelArn :: Text
$sel:channelArn:CreateChannelBan' :: CreateChannelBan -> Text
channelArn} -> Text
channelArn) (\s :: CreateChannelBan
s@CreateChannelBan' {} Text
a -> CreateChannelBan
s {$sel:channelArn:CreateChannelBan' :: Text
channelArn = Text
a} :: CreateChannelBan)
createChannelBan_memberArn :: Lens.Lens' CreateChannelBan Prelude.Text
createChannelBan_memberArn :: Lens' CreateChannelBan Text
createChannelBan_memberArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelBan' {Text
memberArn :: Text
$sel:memberArn:CreateChannelBan' :: CreateChannelBan -> Text
memberArn} -> Text
memberArn) (\s :: CreateChannelBan
s@CreateChannelBan' {} Text
a -> CreateChannelBan
s {$sel:memberArn:CreateChannelBan' :: Text
memberArn = Text
a} :: CreateChannelBan)
instance Core.AWSRequest CreateChannelBan where
type
AWSResponse CreateChannelBan =
CreateChannelBanResponse
request :: (Service -> Service)
-> CreateChannelBan -> Request CreateChannelBan
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateChannelBan
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateChannelBan)))
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 -> Maybe Identity -> Int -> CreateChannelBanResponse
CreateChannelBanResponse'
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Member")
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 CreateChannelBan where
hashWithSalt :: Int -> CreateChannelBan -> Int
hashWithSalt Int
_salt CreateChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:channelArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:chimeBearer:CreateChannelBan' :: CreateChannelBan -> 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` Text
channelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
memberArn
instance Prelude.NFData CreateChannelBan where
rnf :: CreateChannelBan -> ()
rnf CreateChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:channelArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:chimeBearer:CreateChannelBan' :: CreateChannelBan -> 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 Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
memberArn
instance Data.ToHeaders CreateChannelBan where
toHeaders :: CreateChannelBan -> ResponseHeaders
toHeaders CreateChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:channelArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:chimeBearer:CreateChannelBan' :: CreateChannelBan -> 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 CreateChannelBan where
toJSON :: CreateChannelBan -> Value
toJSON CreateChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:channelArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:chimeBearer:CreateChannelBan' :: CreateChannelBan -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"MemberArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
memberArn)]
)
instance Data.ToPath CreateChannelBan where
toPath :: CreateChannelBan -> ByteString
toPath CreateChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:channelArn:CreateChannelBan' :: CreateChannelBan -> Text
$sel:chimeBearer:CreateChannelBan' :: CreateChannelBan -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelArn, ByteString
"/bans"]
instance Data.ToQuery CreateChannelBan where
toQuery :: CreateChannelBan -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateChannelBanResponse = CreateChannelBanResponse'
{
CreateChannelBanResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
CreateChannelBanResponse -> Maybe Identity
member :: Prelude.Maybe Identity,
CreateChannelBanResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateChannelBanResponse -> CreateChannelBanResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelBanResponse -> CreateChannelBanResponse -> Bool
$c/= :: CreateChannelBanResponse -> CreateChannelBanResponse -> Bool
== :: CreateChannelBanResponse -> CreateChannelBanResponse -> Bool
$c== :: CreateChannelBanResponse -> CreateChannelBanResponse -> Bool
Prelude.Eq, Int -> CreateChannelBanResponse -> ShowS
[CreateChannelBanResponse] -> ShowS
CreateChannelBanResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelBanResponse] -> ShowS
$cshowList :: [CreateChannelBanResponse] -> ShowS
show :: CreateChannelBanResponse -> String
$cshow :: CreateChannelBanResponse -> String
showsPrec :: Int -> CreateChannelBanResponse -> ShowS
$cshowsPrec :: Int -> CreateChannelBanResponse -> ShowS
Prelude.Show, forall x.
Rep CreateChannelBanResponse x -> CreateChannelBanResponse
forall x.
CreateChannelBanResponse -> Rep CreateChannelBanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateChannelBanResponse x -> CreateChannelBanResponse
$cfrom :: forall x.
CreateChannelBanResponse -> Rep CreateChannelBanResponse x
Prelude.Generic)
newCreateChannelBanResponse ::
Prelude.Int ->
CreateChannelBanResponse
newCreateChannelBanResponse :: Int -> CreateChannelBanResponse
newCreateChannelBanResponse Int
pHttpStatus_ =
CreateChannelBanResponse'
{ $sel:channelArn:CreateChannelBanResponse' :: Maybe Text
channelArn =
forall a. Maybe a
Prelude.Nothing,
$sel:member:CreateChannelBanResponse' :: Maybe Identity
member = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateChannelBanResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createChannelBanResponse_channelArn :: Lens.Lens' CreateChannelBanResponse (Prelude.Maybe Prelude.Text)
createChannelBanResponse_channelArn :: Lens' CreateChannelBanResponse (Maybe Text)
createChannelBanResponse_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelBanResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:CreateChannelBanResponse' :: CreateChannelBanResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: CreateChannelBanResponse
s@CreateChannelBanResponse' {} Maybe Text
a -> CreateChannelBanResponse
s {$sel:channelArn:CreateChannelBanResponse' :: Maybe Text
channelArn = Maybe Text
a} :: CreateChannelBanResponse)
createChannelBanResponse_member :: Lens.Lens' CreateChannelBanResponse (Prelude.Maybe Identity)
createChannelBanResponse_member :: Lens' CreateChannelBanResponse (Maybe Identity)
createChannelBanResponse_member = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelBanResponse' {Maybe Identity
member :: Maybe Identity
$sel:member:CreateChannelBanResponse' :: CreateChannelBanResponse -> Maybe Identity
member} -> Maybe Identity
member) (\s :: CreateChannelBanResponse
s@CreateChannelBanResponse' {} Maybe Identity
a -> CreateChannelBanResponse
s {$sel:member:CreateChannelBanResponse' :: Maybe Identity
member = Maybe Identity
a} :: CreateChannelBanResponse)
createChannelBanResponse_httpStatus :: Lens.Lens' CreateChannelBanResponse Prelude.Int
createChannelBanResponse_httpStatus :: Lens' CreateChannelBanResponse Int
createChannelBanResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelBanResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateChannelBanResponse' :: CreateChannelBanResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateChannelBanResponse
s@CreateChannelBanResponse' {} Int
a -> CreateChannelBanResponse
s {$sel:httpStatus:CreateChannelBanResponse' :: Int
httpStatus = Int
a} :: CreateChannelBanResponse)
instance Prelude.NFData CreateChannelBanResponse where
rnf :: CreateChannelBanResponse -> ()
rnf CreateChannelBanResponse' {Int
Maybe Text
Maybe Identity
httpStatus :: Int
member :: Maybe Identity
channelArn :: Maybe Text
$sel:httpStatus:CreateChannelBanResponse' :: CreateChannelBanResponse -> Int
$sel:member:CreateChannelBanResponse' :: CreateChannelBanResponse -> Maybe Identity
$sel:channelArn:CreateChannelBanResponse' :: CreateChannelBanResponse -> 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 Maybe Identity
member
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus