{-# 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.Connect.CreateContactFlow
-- 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 contact flow for the specified Amazon Connect instance.
--
-- You can also create and update contact flows using the
-- <https://docs.aws.amazon.com/connect/latest/adminguide/flow-language.html Amazon Connect Flow language>.
module Amazonka.Connect.CreateContactFlow
  ( -- * Creating a Request
    CreateContactFlow (..),
    newCreateContactFlow,

    -- * Request Lenses
    createContactFlow_description,
    createContactFlow_tags,
    createContactFlow_instanceId,
    createContactFlow_name,
    createContactFlow_type,
    createContactFlow_content,

    -- * Destructuring the Response
    CreateContactFlowResponse (..),
    newCreateContactFlowResponse,

    -- * Response Lenses
    createContactFlowResponse_contactFlowArn,
    createContactFlowResponse_contactFlowId,
    createContactFlowResponse_httpStatus,
  )
where

import Amazonka.Connect.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:/ 'newCreateContactFlow' smart constructor.
data CreateContactFlow = CreateContactFlow'
  { -- | The description of the contact flow.
    CreateContactFlow -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    CreateContactFlow -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identifier of the Amazon Connect instance.
    CreateContactFlow -> Text
instanceId :: Prelude.Text,
    -- | The name of the contact flow.
    CreateContactFlow -> Text
name :: Prelude.Text,
    -- | The type of the contact flow. For descriptions of the available types,
    -- see
    -- <https://docs.aws.amazon.com/connect/latest/adminguide/create-contact-flow.html#contact-flow-types Choose a Contact Flow Type>
    -- in the /Amazon Connect Administrator Guide/.
    CreateContactFlow -> ContactFlowType
type' :: ContactFlowType,
    -- | The content of the contact flow.
    CreateContactFlow -> Text
content :: Prelude.Text
  }
  deriving (CreateContactFlow -> CreateContactFlow -> Bool
(CreateContactFlow -> CreateContactFlow -> Bool)
-> (CreateContactFlow -> CreateContactFlow -> Bool)
-> Eq CreateContactFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateContactFlow -> CreateContactFlow -> Bool
$c/= :: CreateContactFlow -> CreateContactFlow -> Bool
== :: CreateContactFlow -> CreateContactFlow -> Bool
$c== :: CreateContactFlow -> CreateContactFlow -> Bool
Prelude.Eq, ReadPrec [CreateContactFlow]
ReadPrec CreateContactFlow
Int -> ReadS CreateContactFlow
ReadS [CreateContactFlow]
(Int -> ReadS CreateContactFlow)
-> ReadS [CreateContactFlow]
-> ReadPrec CreateContactFlow
-> ReadPrec [CreateContactFlow]
-> Read CreateContactFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateContactFlow]
$creadListPrec :: ReadPrec [CreateContactFlow]
readPrec :: ReadPrec CreateContactFlow
$creadPrec :: ReadPrec CreateContactFlow
readList :: ReadS [CreateContactFlow]
$creadList :: ReadS [CreateContactFlow]
readsPrec :: Int -> ReadS CreateContactFlow
$creadsPrec :: Int -> ReadS CreateContactFlow
Prelude.Read, Int -> CreateContactFlow -> ShowS
[CreateContactFlow] -> ShowS
CreateContactFlow -> String
(Int -> CreateContactFlow -> ShowS)
-> (CreateContactFlow -> String)
-> ([CreateContactFlow] -> ShowS)
-> Show CreateContactFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateContactFlow] -> ShowS
$cshowList :: [CreateContactFlow] -> ShowS
show :: CreateContactFlow -> String
$cshow :: CreateContactFlow -> String
showsPrec :: Int -> CreateContactFlow -> ShowS
$cshowsPrec :: Int -> CreateContactFlow -> ShowS
Prelude.Show, (forall x. CreateContactFlow -> Rep CreateContactFlow x)
-> (forall x. Rep CreateContactFlow x -> CreateContactFlow)
-> Generic CreateContactFlow
forall x. Rep CreateContactFlow x -> CreateContactFlow
forall x. CreateContactFlow -> Rep CreateContactFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateContactFlow x -> CreateContactFlow
$cfrom :: forall x. CreateContactFlow -> Rep CreateContactFlow x
Prelude.Generic)

-- |
-- Create a value of 'CreateContactFlow' 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:
--
-- 'description', 'createContactFlow_description' - The description of the contact flow.
--
-- 'tags', 'createContactFlow_tags' - One or more tags.
--
-- 'instanceId', 'createContactFlow_instanceId' - The identifier of the Amazon Connect instance.
--
-- 'name', 'createContactFlow_name' - The name of the contact flow.
--
-- 'type'', 'createContactFlow_type' - The type of the contact flow. For descriptions of the available types,
-- see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/create-contact-flow.html#contact-flow-types Choose a Contact Flow Type>
-- in the /Amazon Connect Administrator Guide/.
--
-- 'content', 'createContactFlow_content' - The content of the contact flow.
newCreateContactFlow ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'type''
  ContactFlowType ->
  -- | 'content'
  Prelude.Text ->
  CreateContactFlow
newCreateContactFlow :: Text -> Text -> ContactFlowType -> Text -> CreateContactFlow
newCreateContactFlow
  Text
pInstanceId_
  Text
pName_
  ContactFlowType
pType_
  Text
pContent_ =
    CreateContactFlow' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> ContactFlowType
-> Text
-> CreateContactFlow
CreateContactFlow'
      { $sel:description:CreateContactFlow' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateContactFlow' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:CreateContactFlow' :: Text
instanceId = Text
pInstanceId_,
        $sel:name:CreateContactFlow' :: Text
name = Text
pName_,
        $sel:type':CreateContactFlow' :: ContactFlowType
type' = ContactFlowType
pType_,
        $sel:content:CreateContactFlow' :: Text
content = Text
pContent_
      }

-- | The description of the contact flow.
createContactFlow_description :: Lens.Lens' CreateContactFlow (Prelude.Maybe Prelude.Text)
createContactFlow_description :: (Maybe Text -> f (Maybe Text))
-> CreateContactFlow -> f CreateContactFlow
createContactFlow_description = (CreateContactFlow -> Maybe Text)
-> (CreateContactFlow -> Maybe Text -> CreateContactFlow)
-> Lens
     CreateContactFlow CreateContactFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlow' {Maybe Text
description :: Maybe Text
$sel:description:CreateContactFlow' :: CreateContactFlow -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateContactFlow
s@CreateContactFlow' {} Maybe Text
a -> CreateContactFlow
s {$sel:description:CreateContactFlow' :: Maybe Text
description = Maybe Text
a} :: CreateContactFlow)

-- | One or more tags.
createContactFlow_tags :: Lens.Lens' CreateContactFlow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createContactFlow_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateContactFlow -> f CreateContactFlow
createContactFlow_tags = (CreateContactFlow -> Maybe (HashMap Text Text))
-> (CreateContactFlow
    -> Maybe (HashMap Text Text) -> CreateContactFlow)
-> Lens
     CreateContactFlow
     CreateContactFlow
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlow' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateContactFlow' :: CreateContactFlow -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateContactFlow
s@CreateContactFlow' {} Maybe (HashMap Text Text)
a -> CreateContactFlow
s {$sel:tags:CreateContactFlow' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateContactFlow) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateContactFlow -> f CreateContactFlow)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateContactFlow
-> f CreateContactFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the Amazon Connect instance.
createContactFlow_instanceId :: Lens.Lens' CreateContactFlow Prelude.Text
createContactFlow_instanceId :: (Text -> f Text) -> CreateContactFlow -> f CreateContactFlow
createContactFlow_instanceId = (CreateContactFlow -> Text)
-> (CreateContactFlow -> Text -> CreateContactFlow)
-> Lens CreateContactFlow CreateContactFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlow' {Text
instanceId :: Text
$sel:instanceId:CreateContactFlow' :: CreateContactFlow -> Text
instanceId} -> Text
instanceId) (\s :: CreateContactFlow
s@CreateContactFlow' {} Text
a -> CreateContactFlow
s {$sel:instanceId:CreateContactFlow' :: Text
instanceId = Text
a} :: CreateContactFlow)

-- | The name of the contact flow.
createContactFlow_name :: Lens.Lens' CreateContactFlow Prelude.Text
createContactFlow_name :: (Text -> f Text) -> CreateContactFlow -> f CreateContactFlow
createContactFlow_name = (CreateContactFlow -> Text)
-> (CreateContactFlow -> Text -> CreateContactFlow)
-> Lens CreateContactFlow CreateContactFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlow' {Text
name :: Text
$sel:name:CreateContactFlow' :: CreateContactFlow -> Text
name} -> Text
name) (\s :: CreateContactFlow
s@CreateContactFlow' {} Text
a -> CreateContactFlow
s {$sel:name:CreateContactFlow' :: Text
name = Text
a} :: CreateContactFlow)

-- | The type of the contact flow. For descriptions of the available types,
-- see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/create-contact-flow.html#contact-flow-types Choose a Contact Flow Type>
-- in the /Amazon Connect Administrator Guide/.
createContactFlow_type :: Lens.Lens' CreateContactFlow ContactFlowType
createContactFlow_type :: (ContactFlowType -> f ContactFlowType)
-> CreateContactFlow -> f CreateContactFlow
createContactFlow_type = (CreateContactFlow -> ContactFlowType)
-> (CreateContactFlow -> ContactFlowType -> CreateContactFlow)
-> Lens
     CreateContactFlow CreateContactFlow ContactFlowType ContactFlowType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlow' {ContactFlowType
type' :: ContactFlowType
$sel:type':CreateContactFlow' :: CreateContactFlow -> ContactFlowType
type'} -> ContactFlowType
type') (\s :: CreateContactFlow
s@CreateContactFlow' {} ContactFlowType
a -> CreateContactFlow
s {$sel:type':CreateContactFlow' :: ContactFlowType
type' = ContactFlowType
a} :: CreateContactFlow)

-- | The content of the contact flow.
createContactFlow_content :: Lens.Lens' CreateContactFlow Prelude.Text
createContactFlow_content :: (Text -> f Text) -> CreateContactFlow -> f CreateContactFlow
createContactFlow_content = (CreateContactFlow -> Text)
-> (CreateContactFlow -> Text -> CreateContactFlow)
-> Lens CreateContactFlow CreateContactFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlow' {Text
content :: Text
$sel:content:CreateContactFlow' :: CreateContactFlow -> Text
content} -> Text
content) (\s :: CreateContactFlow
s@CreateContactFlow' {} Text
a -> CreateContactFlow
s {$sel:content:CreateContactFlow' :: Text
content = Text
a} :: CreateContactFlow)

instance Core.AWSRequest CreateContactFlow where
  type
    AWSResponse CreateContactFlow =
      CreateContactFlowResponse
  request :: CreateContactFlow -> Request CreateContactFlow
request = Service -> CreateContactFlow -> Request CreateContactFlow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateContactFlow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateContactFlow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateContactFlow))
-> Logger
-> Service
-> Proxy CreateContactFlow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateContactFlow)))
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 -> Maybe Text -> Int -> CreateContactFlowResponse
CreateContactFlowResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateContactFlowResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateContactFlowResponse)
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
"ContactFlowArn")
            Either String (Maybe Text -> Int -> CreateContactFlowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateContactFlowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ContactFlowId")
            Either String (Int -> CreateContactFlowResponse)
-> Either String Int -> Either String CreateContactFlowResponse
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 CreateContactFlow

instance Prelude.NFData CreateContactFlow

instance Core.ToHeaders CreateContactFlow where
  toHeaders :: CreateContactFlow -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateContactFlow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateContactFlow where
  toJSON :: CreateContactFlow -> Value
toJSON CreateContactFlow' {Maybe Text
Maybe (HashMap Text Text)
Text
ContactFlowType
content :: Text
type' :: ContactFlowType
name :: Text
instanceId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:content:CreateContactFlow' :: CreateContactFlow -> Text
$sel:type':CreateContactFlow' :: CreateContactFlow -> ContactFlowType
$sel:name:CreateContactFlow' :: CreateContactFlow -> Text
$sel:instanceId:CreateContactFlow' :: CreateContactFlow -> Text
$sel:tags:CreateContactFlow' :: CreateContactFlow -> Maybe (HashMap Text Text)
$sel:description:CreateContactFlow' :: CreateContactFlow -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> ContactFlowType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ContactFlowType
type'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
content)
          ]
      )

instance Core.ToPath CreateContactFlow where
  toPath :: CreateContactFlow -> ByteString
toPath CreateContactFlow' {Maybe Text
Maybe (HashMap Text Text)
Text
ContactFlowType
content :: Text
type' :: ContactFlowType
name :: Text
instanceId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:content:CreateContactFlow' :: CreateContactFlow -> Text
$sel:type':CreateContactFlow' :: CreateContactFlow -> ContactFlowType
$sel:name:CreateContactFlow' :: CreateContactFlow -> Text
$sel:instanceId:CreateContactFlow' :: CreateContactFlow -> Text
$sel:tags:CreateContactFlow' :: CreateContactFlow -> Maybe (HashMap Text Text)
$sel:description:CreateContactFlow' :: CreateContactFlow -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/contact-flows/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId]

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

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

-- |
-- Create a value of 'CreateContactFlowResponse' 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:
--
-- 'contactFlowArn', 'createContactFlowResponse_contactFlowArn' - The Amazon Resource Name (ARN) of the contact flow.
--
-- 'contactFlowId', 'createContactFlowResponse_contactFlowId' - The identifier of the contact flow.
--
-- 'httpStatus', 'createContactFlowResponse_httpStatus' - The response's http status code.
newCreateContactFlowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateContactFlowResponse
newCreateContactFlowResponse :: Int -> CreateContactFlowResponse
newCreateContactFlowResponse Int
pHttpStatus_ =
  CreateContactFlowResponse' :: Maybe Text -> Maybe Text -> Int -> CreateContactFlowResponse
CreateContactFlowResponse'
    { $sel:contactFlowArn:CreateContactFlowResponse' :: Maybe Text
contactFlowArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contactFlowId:CreateContactFlowResponse' :: Maybe Text
contactFlowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateContactFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the contact flow.
createContactFlowResponse_contactFlowArn :: Lens.Lens' CreateContactFlowResponse (Prelude.Maybe Prelude.Text)
createContactFlowResponse_contactFlowArn :: (Maybe Text -> f (Maybe Text))
-> CreateContactFlowResponse -> f CreateContactFlowResponse
createContactFlowResponse_contactFlowArn = (CreateContactFlowResponse -> Maybe Text)
-> (CreateContactFlowResponse
    -> Maybe Text -> CreateContactFlowResponse)
-> Lens
     CreateContactFlowResponse
     CreateContactFlowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlowResponse' {Maybe Text
contactFlowArn :: Maybe Text
$sel:contactFlowArn:CreateContactFlowResponse' :: CreateContactFlowResponse -> Maybe Text
contactFlowArn} -> Maybe Text
contactFlowArn) (\s :: CreateContactFlowResponse
s@CreateContactFlowResponse' {} Maybe Text
a -> CreateContactFlowResponse
s {$sel:contactFlowArn:CreateContactFlowResponse' :: Maybe Text
contactFlowArn = Maybe Text
a} :: CreateContactFlowResponse)

-- | The identifier of the contact flow.
createContactFlowResponse_contactFlowId :: Lens.Lens' CreateContactFlowResponse (Prelude.Maybe Prelude.Text)
createContactFlowResponse_contactFlowId :: (Maybe Text -> f (Maybe Text))
-> CreateContactFlowResponse -> f CreateContactFlowResponse
createContactFlowResponse_contactFlowId = (CreateContactFlowResponse -> Maybe Text)
-> (CreateContactFlowResponse
    -> Maybe Text -> CreateContactFlowResponse)
-> Lens
     CreateContactFlowResponse
     CreateContactFlowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactFlowResponse' {Maybe Text
contactFlowId :: Maybe Text
$sel:contactFlowId:CreateContactFlowResponse' :: CreateContactFlowResponse -> Maybe Text
contactFlowId} -> Maybe Text
contactFlowId) (\s :: CreateContactFlowResponse
s@CreateContactFlowResponse' {} Maybe Text
a -> CreateContactFlowResponse
s {$sel:contactFlowId:CreateContactFlowResponse' :: Maybe Text
contactFlowId = Maybe Text
a} :: CreateContactFlowResponse)

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

instance Prelude.NFData CreateContactFlowResponse