{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ChimeSDKMessaging.CreateChannelFlow
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a channel flow, a container for processors. Processors are AWS
-- Lambda functions that perform actions on chat messages, such as
-- stripping out profanity. You can associate channel flows with channels,
-- and the processors in the channel flow then take action on all messages
-- sent to that channel. This is a developer API.
--
-- Channel flows process the following items:
--
-- 1.  New and updated messages
--
-- 2.  Persistent and non-persistent messages
--
-- 3.  The Standard message type
--
-- Channel flows don\'t process Control or System messages. For more
-- information about the message types provided by Chime SDK Messaging,
-- refer to
-- <https://docs.aws.amazon.com/chime/latest/dg/using-the-messaging-sdk.html#msg-types Message types>
-- in the /Amazon Chime developer guide/.
module Amazonka.ChimeSDKMessaging.CreateChannelFlow
  ( -- * Creating a Request
    CreateChannelFlow (..),
    newCreateChannelFlow,

    -- * Request Lenses
    createChannelFlow_tags,
    createChannelFlow_appInstanceArn,
    createChannelFlow_processors,
    createChannelFlow_name,
    createChannelFlow_clientRequestToken,

    -- * Destructuring the Response
    CreateChannelFlowResponse (..),
    newCreateChannelFlowResponse,

    -- * Response Lenses
    createChannelFlowResponse_channelFlowArn,
    createChannelFlowResponse_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

-- | /See:/ 'newCreateChannelFlow' smart constructor.
data CreateChannelFlow = CreateChannelFlow'
  { -- | The tags for the creation request.
    CreateChannelFlow -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The ARN of the channel flow request.
    CreateChannelFlow -> Text
appInstanceArn :: Prelude.Text,
    -- | Information about the processor Lambda functions.
    CreateChannelFlow -> NonEmpty Processor
processors :: Prelude.NonEmpty Processor,
    -- | The name of the channel flow.
    CreateChannelFlow -> Sensitive Text
name :: Core.Sensitive Prelude.Text,
    -- | The client token for the request. An Idempotency token.
    CreateChannelFlow -> Sensitive Text
clientRequestToken :: Core.Sensitive Prelude.Text
  }
  deriving (CreateChannelFlow -> CreateChannelFlow -> Bool
(CreateChannelFlow -> CreateChannelFlow -> Bool)
-> (CreateChannelFlow -> CreateChannelFlow -> Bool)
-> Eq CreateChannelFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelFlow -> CreateChannelFlow -> Bool
$c/= :: CreateChannelFlow -> CreateChannelFlow -> Bool
== :: CreateChannelFlow -> CreateChannelFlow -> Bool
$c== :: CreateChannelFlow -> CreateChannelFlow -> Bool
Prelude.Eq, Int -> CreateChannelFlow -> ShowS
[CreateChannelFlow] -> ShowS
CreateChannelFlow -> String
(Int -> CreateChannelFlow -> ShowS)
-> (CreateChannelFlow -> String)
-> ([CreateChannelFlow] -> ShowS)
-> Show CreateChannelFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelFlow] -> ShowS
$cshowList :: [CreateChannelFlow] -> ShowS
show :: CreateChannelFlow -> String
$cshow :: CreateChannelFlow -> String
showsPrec :: Int -> CreateChannelFlow -> ShowS
$cshowsPrec :: Int -> CreateChannelFlow -> ShowS
Prelude.Show, (forall x. CreateChannelFlow -> Rep CreateChannelFlow x)
-> (forall x. Rep CreateChannelFlow x -> CreateChannelFlow)
-> Generic CreateChannelFlow
forall x. Rep CreateChannelFlow x -> CreateChannelFlow
forall x. CreateChannelFlow -> Rep CreateChannelFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannelFlow x -> CreateChannelFlow
$cfrom :: forall x. CreateChannelFlow -> Rep CreateChannelFlow x
Prelude.Generic)

-- |
-- Create a value of 'CreateChannelFlow' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'tags', 'createChannelFlow_tags' - The tags for the creation request.
--
-- 'appInstanceArn', 'createChannelFlow_appInstanceArn' - The ARN of the channel flow request.
--
-- 'processors', 'createChannelFlow_processors' - Information about the processor Lambda functions.
--
-- 'name', 'createChannelFlow_name' - The name of the channel flow.
--
-- 'clientRequestToken', 'createChannelFlow_clientRequestToken' - The client token for the request. An Idempotency token.
newCreateChannelFlow ::
  -- | 'appInstanceArn'
  Prelude.Text ->
  -- | 'processors'
  Prelude.NonEmpty Processor ->
  -- | 'name'
  Prelude.Text ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  CreateChannelFlow
newCreateChannelFlow :: Text -> NonEmpty Processor -> Text -> Text -> CreateChannelFlow
newCreateChannelFlow
  Text
pAppInstanceArn_
  NonEmpty Processor
pProcessors_
  Text
pName_
  Text
pClientRequestToken_ =
    CreateChannelFlow' :: Maybe (NonEmpty Tag)
-> Text
-> NonEmpty Processor
-> Sensitive Text
-> Sensitive Text
-> CreateChannelFlow
CreateChannelFlow'
      { $sel:tags:CreateChannelFlow' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:appInstanceArn:CreateChannelFlow' :: Text
appInstanceArn = Text
pAppInstanceArn_,
        $sel:processors:CreateChannelFlow' :: NonEmpty Processor
processors = Tagged (NonEmpty Processor) (Identity (NonEmpty Processor))
-> Tagged (NonEmpty Processor) (Identity (NonEmpty Processor))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Processor) (Identity (NonEmpty Processor))
 -> Tagged (NonEmpty Processor) (Identity (NonEmpty Processor)))
-> NonEmpty Processor -> NonEmpty Processor
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Processor
pProcessors_,
        $sel:name:CreateChannelFlow' :: 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:CreateChannelFlow' :: 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_
      }

-- | The tags for the creation request.
createChannelFlow_tags :: Lens.Lens' CreateChannelFlow (Prelude.Maybe (Prelude.NonEmpty Tag))
createChannelFlow_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannelFlow -> f CreateChannelFlow
createChannelFlow_tags = (CreateChannelFlow -> Maybe (NonEmpty Tag))
-> (CreateChannelFlow -> Maybe (NonEmpty Tag) -> CreateChannelFlow)
-> Lens
     CreateChannelFlow
     CreateChannelFlow
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlow' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateChannelFlow' :: CreateChannelFlow -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateChannelFlow
s@CreateChannelFlow' {} Maybe (NonEmpty Tag)
a -> CreateChannelFlow
s {$sel:tags:CreateChannelFlow' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateChannelFlow) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateChannelFlow -> f CreateChannelFlow)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannelFlow
-> f CreateChannelFlow
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

-- | The ARN of the channel flow request.
createChannelFlow_appInstanceArn :: Lens.Lens' CreateChannelFlow Prelude.Text
createChannelFlow_appInstanceArn :: (Text -> f Text) -> CreateChannelFlow -> f CreateChannelFlow
createChannelFlow_appInstanceArn = (CreateChannelFlow -> Text)
-> (CreateChannelFlow -> Text -> CreateChannelFlow)
-> Lens CreateChannelFlow CreateChannelFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlow' {Text
appInstanceArn :: Text
$sel:appInstanceArn:CreateChannelFlow' :: CreateChannelFlow -> Text
appInstanceArn} -> Text
appInstanceArn) (\s :: CreateChannelFlow
s@CreateChannelFlow' {} Text
a -> CreateChannelFlow
s {$sel:appInstanceArn:CreateChannelFlow' :: Text
appInstanceArn = Text
a} :: CreateChannelFlow)

-- | Information about the processor Lambda functions.
createChannelFlow_processors :: Lens.Lens' CreateChannelFlow (Prelude.NonEmpty Processor)
createChannelFlow_processors :: (NonEmpty Processor -> f (NonEmpty Processor))
-> CreateChannelFlow -> f CreateChannelFlow
createChannelFlow_processors = (CreateChannelFlow -> NonEmpty Processor)
-> (CreateChannelFlow -> NonEmpty Processor -> CreateChannelFlow)
-> Lens
     CreateChannelFlow
     CreateChannelFlow
     (NonEmpty Processor)
     (NonEmpty Processor)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlow' {NonEmpty Processor
processors :: NonEmpty Processor
$sel:processors:CreateChannelFlow' :: CreateChannelFlow -> NonEmpty Processor
processors} -> NonEmpty Processor
processors) (\s :: CreateChannelFlow
s@CreateChannelFlow' {} NonEmpty Processor
a -> CreateChannelFlow
s {$sel:processors:CreateChannelFlow' :: NonEmpty Processor
processors = NonEmpty Processor
a} :: CreateChannelFlow) ((NonEmpty Processor -> f (NonEmpty Processor))
 -> CreateChannelFlow -> f CreateChannelFlow)
-> ((NonEmpty Processor -> f (NonEmpty Processor))
    -> NonEmpty Processor -> f (NonEmpty Processor))
-> (NonEmpty Processor -> f (NonEmpty Processor))
-> CreateChannelFlow
-> f CreateChannelFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Processor -> f (NonEmpty Processor))
-> NonEmpty Processor -> f (NonEmpty Processor)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the channel flow.
createChannelFlow_name :: Lens.Lens' CreateChannelFlow Prelude.Text
createChannelFlow_name :: (Text -> f Text) -> CreateChannelFlow -> f CreateChannelFlow
createChannelFlow_name = (CreateChannelFlow -> Sensitive Text)
-> (CreateChannelFlow -> Sensitive Text -> CreateChannelFlow)
-> Lens
     CreateChannelFlow
     CreateChannelFlow
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlow' {Sensitive Text
name :: Sensitive Text
$sel:name:CreateChannelFlow' :: CreateChannelFlow -> Sensitive Text
name} -> Sensitive Text
name) (\s :: CreateChannelFlow
s@CreateChannelFlow' {} Sensitive Text
a -> CreateChannelFlow
s {$sel:name:CreateChannelFlow' :: Sensitive Text
name = Sensitive Text
a} :: CreateChannelFlow) ((Sensitive Text -> f (Sensitive Text))
 -> CreateChannelFlow -> f CreateChannelFlow)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateChannelFlow
-> f CreateChannelFlow
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

-- | The client token for the request. An Idempotency token.
createChannelFlow_clientRequestToken :: Lens.Lens' CreateChannelFlow Prelude.Text
createChannelFlow_clientRequestToken :: (Text -> f Text) -> CreateChannelFlow -> f CreateChannelFlow
createChannelFlow_clientRequestToken = (CreateChannelFlow -> Sensitive Text)
-> (CreateChannelFlow -> Sensitive Text -> CreateChannelFlow)
-> Lens
     CreateChannelFlow
     CreateChannelFlow
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlow' {Sensitive Text
clientRequestToken :: Sensitive Text
$sel:clientRequestToken:CreateChannelFlow' :: CreateChannelFlow -> Sensitive Text
clientRequestToken} -> Sensitive Text
clientRequestToken) (\s :: CreateChannelFlow
s@CreateChannelFlow' {} Sensitive Text
a -> CreateChannelFlow
s {$sel:clientRequestToken:CreateChannelFlow' :: Sensitive Text
clientRequestToken = Sensitive Text
a} :: CreateChannelFlow) ((Sensitive Text -> f (Sensitive Text))
 -> CreateChannelFlow -> f CreateChannelFlow)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateChannelFlow
-> f CreateChannelFlow
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

instance Core.AWSRequest CreateChannelFlow where
  type
    AWSResponse CreateChannelFlow =
      CreateChannelFlowResponse
  request :: CreateChannelFlow -> Request CreateChannelFlow
request = Service -> CreateChannelFlow -> Request CreateChannelFlow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateChannelFlow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateChannelFlow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateChannelFlow))
-> Logger
-> Service
-> Proxy CreateChannelFlow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateChannelFlow)))
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 -> CreateChannelFlowResponse
CreateChannelFlowResponse'
            (Maybe Text -> Int -> CreateChannelFlowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateChannelFlowResponse)
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
"ChannelFlowArn")
            Either String (Int -> CreateChannelFlowResponse)
-> Either String Int -> Either String CreateChannelFlowResponse
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 CreateChannelFlow

instance Prelude.NFData CreateChannelFlow

instance Core.ToHeaders CreateChannelFlow where
  toHeaders :: CreateChannelFlow -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateChannelFlow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateChannelFlow where
  toJSON :: CreateChannelFlow -> Value
toJSON CreateChannelFlow' {Maybe (NonEmpty Tag)
NonEmpty Processor
Text
Sensitive Text
clientRequestToken :: Sensitive Text
name :: Sensitive Text
processors :: NonEmpty Processor
appInstanceArn :: Text
tags :: Maybe (NonEmpty Tag)
$sel:clientRequestToken:CreateChannelFlow' :: CreateChannelFlow -> Sensitive Text
$sel:name:CreateChannelFlow' :: CreateChannelFlow -> Sensitive Text
$sel:processors:CreateChannelFlow' :: CreateChannelFlow -> NonEmpty Processor
$sel:appInstanceArn:CreateChannelFlow' :: CreateChannelFlow -> Text
$sel:tags:CreateChannelFlow' :: CreateChannelFlow -> Maybe (NonEmpty Tag)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"Processors" Text -> NonEmpty Processor -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Processor
processors),
            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 CreateChannelFlow where
  toPath :: CreateChannelFlow -> ByteString
toPath = ByteString -> CreateChannelFlow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/channel-flows"

instance Core.ToQuery CreateChannelFlow where
  toQuery :: CreateChannelFlow -> QueryString
toQuery = QueryString -> CreateChannelFlow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateChannelFlowResponse' smart constructor.
data CreateChannelFlowResponse = CreateChannelFlowResponse'
  { -- | The ARN of the channel flow.
    CreateChannelFlowResponse -> Maybe Text
channelFlowArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateChannelFlowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool
(CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool)
-> (CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool)
-> Eq CreateChannelFlowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool
$c/= :: CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool
== :: CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool
$c== :: CreateChannelFlowResponse -> CreateChannelFlowResponse -> Bool
Prelude.Eq, ReadPrec [CreateChannelFlowResponse]
ReadPrec CreateChannelFlowResponse
Int -> ReadS CreateChannelFlowResponse
ReadS [CreateChannelFlowResponse]
(Int -> ReadS CreateChannelFlowResponse)
-> ReadS [CreateChannelFlowResponse]
-> ReadPrec CreateChannelFlowResponse
-> ReadPrec [CreateChannelFlowResponse]
-> Read CreateChannelFlowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateChannelFlowResponse]
$creadListPrec :: ReadPrec [CreateChannelFlowResponse]
readPrec :: ReadPrec CreateChannelFlowResponse
$creadPrec :: ReadPrec CreateChannelFlowResponse
readList :: ReadS [CreateChannelFlowResponse]
$creadList :: ReadS [CreateChannelFlowResponse]
readsPrec :: Int -> ReadS CreateChannelFlowResponse
$creadsPrec :: Int -> ReadS CreateChannelFlowResponse
Prelude.Read, Int -> CreateChannelFlowResponse -> ShowS
[CreateChannelFlowResponse] -> ShowS
CreateChannelFlowResponse -> String
(Int -> CreateChannelFlowResponse -> ShowS)
-> (CreateChannelFlowResponse -> String)
-> ([CreateChannelFlowResponse] -> ShowS)
-> Show CreateChannelFlowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelFlowResponse] -> ShowS
$cshowList :: [CreateChannelFlowResponse] -> ShowS
show :: CreateChannelFlowResponse -> String
$cshow :: CreateChannelFlowResponse -> String
showsPrec :: Int -> CreateChannelFlowResponse -> ShowS
$cshowsPrec :: Int -> CreateChannelFlowResponse -> ShowS
Prelude.Show, (forall x.
 CreateChannelFlowResponse -> Rep CreateChannelFlowResponse x)
-> (forall x.
    Rep CreateChannelFlowResponse x -> CreateChannelFlowResponse)
-> Generic CreateChannelFlowResponse
forall x.
Rep CreateChannelFlowResponse x -> CreateChannelFlowResponse
forall x.
CreateChannelFlowResponse -> Rep CreateChannelFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateChannelFlowResponse x -> CreateChannelFlowResponse
$cfrom :: forall x.
CreateChannelFlowResponse -> Rep CreateChannelFlowResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateChannelFlowResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'channelFlowArn', 'createChannelFlowResponse_channelFlowArn' - The ARN of the channel flow.
--
-- 'httpStatus', 'createChannelFlowResponse_httpStatus' - The response's http status code.
newCreateChannelFlowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateChannelFlowResponse
newCreateChannelFlowResponse :: Int -> CreateChannelFlowResponse
newCreateChannelFlowResponse Int
pHttpStatus_ =
  CreateChannelFlowResponse' :: Maybe Text -> Int -> CreateChannelFlowResponse
CreateChannelFlowResponse'
    { $sel:channelFlowArn:CreateChannelFlowResponse' :: Maybe Text
channelFlowArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateChannelFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the channel flow.
createChannelFlowResponse_channelFlowArn :: Lens.Lens' CreateChannelFlowResponse (Prelude.Maybe Prelude.Text)
createChannelFlowResponse_channelFlowArn :: (Maybe Text -> f (Maybe Text))
-> CreateChannelFlowResponse -> f CreateChannelFlowResponse
createChannelFlowResponse_channelFlowArn = (CreateChannelFlowResponse -> Maybe Text)
-> (CreateChannelFlowResponse
    -> Maybe Text -> CreateChannelFlowResponse)
-> Lens
     CreateChannelFlowResponse
     CreateChannelFlowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlowResponse' {Maybe Text
channelFlowArn :: Maybe Text
$sel:channelFlowArn:CreateChannelFlowResponse' :: CreateChannelFlowResponse -> Maybe Text
channelFlowArn} -> Maybe Text
channelFlowArn) (\s :: CreateChannelFlowResponse
s@CreateChannelFlowResponse' {} Maybe Text
a -> CreateChannelFlowResponse
s {$sel:channelFlowArn:CreateChannelFlowResponse' :: Maybe Text
channelFlowArn = Maybe Text
a} :: CreateChannelFlowResponse)

-- | The response's http status code.
createChannelFlowResponse_httpStatus :: Lens.Lens' CreateChannelFlowResponse Prelude.Int
createChannelFlowResponse_httpStatus :: (Int -> f Int)
-> CreateChannelFlowResponse -> f CreateChannelFlowResponse
createChannelFlowResponse_httpStatus = (CreateChannelFlowResponse -> Int)
-> (CreateChannelFlowResponse -> Int -> CreateChannelFlowResponse)
-> Lens CreateChannelFlowResponse CreateChannelFlowResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelFlowResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateChannelFlowResponse' :: CreateChannelFlowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateChannelFlowResponse
s@CreateChannelFlowResponse' {} Int
a -> CreateChannelFlowResponse
s {$sel:httpStatus:CreateChannelFlowResponse' :: Int
httpStatus = Int
a} :: CreateChannelFlowResponse)

instance Prelude.NFData CreateChannelFlowResponse