{-# 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.DescribeChannelFlow
(
DescribeChannelFlow (..),
newDescribeChannelFlow,
describeChannelFlow_channelFlowArn,
DescribeChannelFlowResponse (..),
newDescribeChannelFlowResponse,
describeChannelFlowResponse_channelFlow,
describeChannelFlowResponse_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 DescribeChannelFlow = DescribeChannelFlow'
{
DescribeChannelFlow -> Text
channelFlowArn :: Prelude.Text
}
deriving (DescribeChannelFlow -> DescribeChannelFlow -> Bool
(DescribeChannelFlow -> DescribeChannelFlow -> Bool)
-> (DescribeChannelFlow -> DescribeChannelFlow -> Bool)
-> Eq DescribeChannelFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelFlow -> DescribeChannelFlow -> Bool
$c/= :: DescribeChannelFlow -> DescribeChannelFlow -> Bool
== :: DescribeChannelFlow -> DescribeChannelFlow -> Bool
$c== :: DescribeChannelFlow -> DescribeChannelFlow -> Bool
Prelude.Eq, ReadPrec [DescribeChannelFlow]
ReadPrec DescribeChannelFlow
Int -> ReadS DescribeChannelFlow
ReadS [DescribeChannelFlow]
(Int -> ReadS DescribeChannelFlow)
-> ReadS [DescribeChannelFlow]
-> ReadPrec DescribeChannelFlow
-> ReadPrec [DescribeChannelFlow]
-> Read DescribeChannelFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeChannelFlow]
$creadListPrec :: ReadPrec [DescribeChannelFlow]
readPrec :: ReadPrec DescribeChannelFlow
$creadPrec :: ReadPrec DescribeChannelFlow
readList :: ReadS [DescribeChannelFlow]
$creadList :: ReadS [DescribeChannelFlow]
readsPrec :: Int -> ReadS DescribeChannelFlow
$creadsPrec :: Int -> ReadS DescribeChannelFlow
Prelude.Read, Int -> DescribeChannelFlow -> ShowS
[DescribeChannelFlow] -> ShowS
DescribeChannelFlow -> String
(Int -> DescribeChannelFlow -> ShowS)
-> (DescribeChannelFlow -> String)
-> ([DescribeChannelFlow] -> ShowS)
-> Show DescribeChannelFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelFlow] -> ShowS
$cshowList :: [DescribeChannelFlow] -> ShowS
show :: DescribeChannelFlow -> String
$cshow :: DescribeChannelFlow -> String
showsPrec :: Int -> DescribeChannelFlow -> ShowS
$cshowsPrec :: Int -> DescribeChannelFlow -> ShowS
Prelude.Show, (forall x. DescribeChannelFlow -> Rep DescribeChannelFlow x)
-> (forall x. Rep DescribeChannelFlow x -> DescribeChannelFlow)
-> Generic DescribeChannelFlow
forall x. Rep DescribeChannelFlow x -> DescribeChannelFlow
forall x. DescribeChannelFlow -> Rep DescribeChannelFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeChannelFlow x -> DescribeChannelFlow
$cfrom :: forall x. DescribeChannelFlow -> Rep DescribeChannelFlow x
Prelude.Generic)
newDescribeChannelFlow ::
Prelude.Text ->
DescribeChannelFlow
newDescribeChannelFlow :: Text -> DescribeChannelFlow
newDescribeChannelFlow Text
pChannelFlowArn_ =
DescribeChannelFlow' :: Text -> DescribeChannelFlow
DescribeChannelFlow'
{ $sel:channelFlowArn:DescribeChannelFlow' :: Text
channelFlowArn =
Text
pChannelFlowArn_
}
describeChannelFlow_channelFlowArn :: Lens.Lens' DescribeChannelFlow Prelude.Text
describeChannelFlow_channelFlowArn :: (Text -> f Text) -> DescribeChannelFlow -> f DescribeChannelFlow
describeChannelFlow_channelFlowArn = (DescribeChannelFlow -> Text)
-> (DescribeChannelFlow -> Text -> DescribeChannelFlow)
-> Lens DescribeChannelFlow DescribeChannelFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelFlow' {Text
channelFlowArn :: Text
$sel:channelFlowArn:DescribeChannelFlow' :: DescribeChannelFlow -> Text
channelFlowArn} -> Text
channelFlowArn) (\s :: DescribeChannelFlow
s@DescribeChannelFlow' {} Text
a -> DescribeChannelFlow
s {$sel:channelFlowArn:DescribeChannelFlow' :: Text
channelFlowArn = Text
a} :: DescribeChannelFlow)
instance Core.AWSRequest DescribeChannelFlow where
type
AWSResponse DescribeChannelFlow =
DescribeChannelFlowResponse
request :: DescribeChannelFlow -> Request DescribeChannelFlow
request = Service -> DescribeChannelFlow -> Request DescribeChannelFlow
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeChannelFlow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelFlow)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeChannelFlow))
-> Logger
-> Service
-> Proxy DescribeChannelFlow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelFlow)))
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 ChannelFlow -> Int -> DescribeChannelFlowResponse
DescribeChannelFlowResponse'
(Maybe ChannelFlow -> Int -> DescribeChannelFlowResponse)
-> Either String (Maybe ChannelFlow)
-> Either String (Int -> DescribeChannelFlowResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ChannelFlow)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelFlow")
Either String (Int -> DescribeChannelFlowResponse)
-> Either String Int -> Either String DescribeChannelFlowResponse
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 DescribeChannelFlow
instance Prelude.NFData DescribeChannelFlow
instance Core.ToHeaders DescribeChannelFlow where
toHeaders :: DescribeChannelFlow -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeChannelFlow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeChannelFlow where
toPath :: DescribeChannelFlow -> ByteString
toPath DescribeChannelFlow' {Text
channelFlowArn :: Text
$sel:channelFlowArn:DescribeChannelFlow' :: DescribeChannelFlow -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channel-flows/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelFlowArn]
instance Core.ToQuery DescribeChannelFlow where
toQuery :: DescribeChannelFlow -> QueryString
toQuery = QueryString -> DescribeChannelFlow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeChannelFlowResponse = DescribeChannelFlowResponse'
{
DescribeChannelFlowResponse -> Maybe ChannelFlow
channelFlow :: Prelude.Maybe ChannelFlow,
DescribeChannelFlowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeChannelFlowResponse -> DescribeChannelFlowResponse -> Bool
(DescribeChannelFlowResponse
-> DescribeChannelFlowResponse -> Bool)
-> (DescribeChannelFlowResponse
-> DescribeChannelFlowResponse -> Bool)
-> Eq DescribeChannelFlowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelFlowResponse -> DescribeChannelFlowResponse -> Bool
$c/= :: DescribeChannelFlowResponse -> DescribeChannelFlowResponse -> Bool
== :: DescribeChannelFlowResponse -> DescribeChannelFlowResponse -> Bool
$c== :: DescribeChannelFlowResponse -> DescribeChannelFlowResponse -> Bool
Prelude.Eq, Int -> DescribeChannelFlowResponse -> ShowS
[DescribeChannelFlowResponse] -> ShowS
DescribeChannelFlowResponse -> String
(Int -> DescribeChannelFlowResponse -> ShowS)
-> (DescribeChannelFlowResponse -> String)
-> ([DescribeChannelFlowResponse] -> ShowS)
-> Show DescribeChannelFlowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelFlowResponse] -> ShowS
$cshowList :: [DescribeChannelFlowResponse] -> ShowS
show :: DescribeChannelFlowResponse -> String
$cshow :: DescribeChannelFlowResponse -> String
showsPrec :: Int -> DescribeChannelFlowResponse -> ShowS
$cshowsPrec :: Int -> DescribeChannelFlowResponse -> ShowS
Prelude.Show, (forall x.
DescribeChannelFlowResponse -> Rep DescribeChannelFlowResponse x)
-> (forall x.
Rep DescribeChannelFlowResponse x -> DescribeChannelFlowResponse)
-> Generic DescribeChannelFlowResponse
forall x.
Rep DescribeChannelFlowResponse x -> DescribeChannelFlowResponse
forall x.
DescribeChannelFlowResponse -> Rep DescribeChannelFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelFlowResponse x -> DescribeChannelFlowResponse
$cfrom :: forall x.
DescribeChannelFlowResponse -> Rep DescribeChannelFlowResponse x
Prelude.Generic)
newDescribeChannelFlowResponse ::
Prelude.Int ->
DescribeChannelFlowResponse
newDescribeChannelFlowResponse :: Int -> DescribeChannelFlowResponse
newDescribeChannelFlowResponse Int
pHttpStatus_ =
DescribeChannelFlowResponse' :: Maybe ChannelFlow -> Int -> DescribeChannelFlowResponse
DescribeChannelFlowResponse'
{ $sel:channelFlow:DescribeChannelFlowResponse' :: Maybe ChannelFlow
channelFlow =
Maybe ChannelFlow
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeChannelFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeChannelFlowResponse_channelFlow :: Lens.Lens' DescribeChannelFlowResponse (Prelude.Maybe ChannelFlow)
describeChannelFlowResponse_channelFlow :: (Maybe ChannelFlow -> f (Maybe ChannelFlow))
-> DescribeChannelFlowResponse -> f DescribeChannelFlowResponse
describeChannelFlowResponse_channelFlow = (DescribeChannelFlowResponse -> Maybe ChannelFlow)
-> (DescribeChannelFlowResponse
-> Maybe ChannelFlow -> DescribeChannelFlowResponse)
-> Lens
DescribeChannelFlowResponse
DescribeChannelFlowResponse
(Maybe ChannelFlow)
(Maybe ChannelFlow)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelFlowResponse' {Maybe ChannelFlow
channelFlow :: Maybe ChannelFlow
$sel:channelFlow:DescribeChannelFlowResponse' :: DescribeChannelFlowResponse -> Maybe ChannelFlow
channelFlow} -> Maybe ChannelFlow
channelFlow) (\s :: DescribeChannelFlowResponse
s@DescribeChannelFlowResponse' {} Maybe ChannelFlow
a -> DescribeChannelFlowResponse
s {$sel:channelFlow:DescribeChannelFlowResponse' :: Maybe ChannelFlow
channelFlow = Maybe ChannelFlow
a} :: DescribeChannelFlowResponse)
describeChannelFlowResponse_httpStatus :: Lens.Lens' DescribeChannelFlowResponse Prelude.Int
describeChannelFlowResponse_httpStatus :: (Int -> f Int)
-> DescribeChannelFlowResponse -> f DescribeChannelFlowResponse
describeChannelFlowResponse_httpStatus = (DescribeChannelFlowResponse -> Int)
-> (DescribeChannelFlowResponse
-> Int -> DescribeChannelFlowResponse)
-> Lens
DescribeChannelFlowResponse DescribeChannelFlowResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelFlowResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeChannelFlowResponse' :: DescribeChannelFlowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeChannelFlowResponse
s@DescribeChannelFlowResponse' {} Int
a -> DescribeChannelFlowResponse
s {$sel:httpStatus:DescribeChannelFlowResponse' :: Int
httpStatus = Int
a} :: DescribeChannelFlowResponse)
instance Prelude.NFData DescribeChannelFlowResponse