{-# 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.SSMContacts.CreateContactChannel
-- 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)
--
-- A contact channel is the method that Incident Manager uses to engage
-- your contact.
module Amazonka.SSMContacts.CreateContactChannel
  ( -- * Creating a Request
    CreateContactChannel (..),
    newCreateContactChannel,

    -- * Request Lenses
    createContactChannel_idempotencyToken,
    createContactChannel_deferActivation,
    createContactChannel_contactId,
    createContactChannel_name,
    createContactChannel_type,
    createContactChannel_deliveryAddress,

    -- * Destructuring the Response
    CreateContactChannelResponse (..),
    newCreateContactChannelResponse,

    -- * Response Lenses
    createContactChannelResponse_httpStatus,
    createContactChannelResponse_contactChannelArn,
  )
where

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
import Amazonka.SSMContacts.Types

-- | /See:/ 'newCreateContactChannel' smart constructor.
data CreateContactChannel = CreateContactChannel'
  { -- | A token ensuring that the operation is called only once with the
    -- specified details.
    CreateContactChannel -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
    -- | If you want to activate the channel at a later time, you can choose to
    -- defer activation. Incident Manager can\'t engage your contact channel
    -- until it has been activated.
    CreateContactChannel -> Maybe Bool
deferActivation :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of the contact you are adding the contact
    -- channel to.
    CreateContactChannel -> Text
contactId :: Prelude.Text,
    -- | The name of the contact channel.
    CreateContactChannel -> Text
name :: Prelude.Text,
    -- | Incident Manager supports three types of contact channels:
    --
    -- -   @SMS@
    --
    -- -   @VOICE@
    --
    -- -   @EMAIL@
    CreateContactChannel -> ChannelType
type' :: ChannelType,
    -- | The details that Incident Manager uses when trying to engage the contact
    -- channel. The format is dependent on the type of the contact channel. The
    -- following are the expected formats:
    --
    -- -   SMS - \'+\' followed by the country code and phone number
    --
    -- -   VOICE - \'+\' followed by the country code and phone number
    --
    -- -   EMAIL - any standard email format
    CreateContactChannel -> ContactChannelAddress
deliveryAddress :: ContactChannelAddress
  }
  deriving (CreateContactChannel -> CreateContactChannel -> Bool
(CreateContactChannel -> CreateContactChannel -> Bool)
-> (CreateContactChannel -> CreateContactChannel -> Bool)
-> Eq CreateContactChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateContactChannel -> CreateContactChannel -> Bool
$c/= :: CreateContactChannel -> CreateContactChannel -> Bool
== :: CreateContactChannel -> CreateContactChannel -> Bool
$c== :: CreateContactChannel -> CreateContactChannel -> Bool
Prelude.Eq, ReadPrec [CreateContactChannel]
ReadPrec CreateContactChannel
Int -> ReadS CreateContactChannel
ReadS [CreateContactChannel]
(Int -> ReadS CreateContactChannel)
-> ReadS [CreateContactChannel]
-> ReadPrec CreateContactChannel
-> ReadPrec [CreateContactChannel]
-> Read CreateContactChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateContactChannel]
$creadListPrec :: ReadPrec [CreateContactChannel]
readPrec :: ReadPrec CreateContactChannel
$creadPrec :: ReadPrec CreateContactChannel
readList :: ReadS [CreateContactChannel]
$creadList :: ReadS [CreateContactChannel]
readsPrec :: Int -> ReadS CreateContactChannel
$creadsPrec :: Int -> ReadS CreateContactChannel
Prelude.Read, Int -> CreateContactChannel -> ShowS
[CreateContactChannel] -> ShowS
CreateContactChannel -> String
(Int -> CreateContactChannel -> ShowS)
-> (CreateContactChannel -> String)
-> ([CreateContactChannel] -> ShowS)
-> Show CreateContactChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateContactChannel] -> ShowS
$cshowList :: [CreateContactChannel] -> ShowS
show :: CreateContactChannel -> String
$cshow :: CreateContactChannel -> String
showsPrec :: Int -> CreateContactChannel -> ShowS
$cshowsPrec :: Int -> CreateContactChannel -> ShowS
Prelude.Show, (forall x. CreateContactChannel -> Rep CreateContactChannel x)
-> (forall x. Rep CreateContactChannel x -> CreateContactChannel)
-> Generic CreateContactChannel
forall x. Rep CreateContactChannel x -> CreateContactChannel
forall x. CreateContactChannel -> Rep CreateContactChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateContactChannel x -> CreateContactChannel
$cfrom :: forall x. CreateContactChannel -> Rep CreateContactChannel x
Prelude.Generic)

-- |
-- Create a value of 'CreateContactChannel' 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:
--
-- 'idempotencyToken', 'createContactChannel_idempotencyToken' - A token ensuring that the operation is called only once with the
-- specified details.
--
-- 'deferActivation', 'createContactChannel_deferActivation' - If you want to activate the channel at a later time, you can choose to
-- defer activation. Incident Manager can\'t engage your contact channel
-- until it has been activated.
--
-- 'contactId', 'createContactChannel_contactId' - The Amazon Resource Name (ARN) of the contact you are adding the contact
-- channel to.
--
-- 'name', 'createContactChannel_name' - The name of the contact channel.
--
-- 'type'', 'createContactChannel_type' - Incident Manager supports three types of contact channels:
--
-- -   @SMS@
--
-- -   @VOICE@
--
-- -   @EMAIL@
--
-- 'deliveryAddress', 'createContactChannel_deliveryAddress' - The details that Incident Manager uses when trying to engage the contact
-- channel. The format is dependent on the type of the contact channel. The
-- following are the expected formats:
--
-- -   SMS - \'+\' followed by the country code and phone number
--
-- -   VOICE - \'+\' followed by the country code and phone number
--
-- -   EMAIL - any standard email format
newCreateContactChannel ::
  -- | 'contactId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'type''
  ChannelType ->
  -- | 'deliveryAddress'
  ContactChannelAddress ->
  CreateContactChannel
newCreateContactChannel :: Text
-> Text
-> ChannelType
-> ContactChannelAddress
-> CreateContactChannel
newCreateContactChannel
  Text
pContactId_
  Text
pName_
  ChannelType
pType_
  ContactChannelAddress
pDeliveryAddress_ =
    CreateContactChannel' :: Maybe Text
-> Maybe Bool
-> Text
-> Text
-> ChannelType
-> ContactChannelAddress
-> CreateContactChannel
CreateContactChannel'
      { $sel:idempotencyToken:CreateContactChannel' :: Maybe Text
idempotencyToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:deferActivation:CreateContactChannel' :: Maybe Bool
deferActivation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:contactId:CreateContactChannel' :: Text
contactId = Text
pContactId_,
        $sel:name:CreateContactChannel' :: Text
name = Text
pName_,
        $sel:type':CreateContactChannel' :: ChannelType
type' = ChannelType
pType_,
        $sel:deliveryAddress:CreateContactChannel' :: ContactChannelAddress
deliveryAddress = ContactChannelAddress
pDeliveryAddress_
      }

-- | A token ensuring that the operation is called only once with the
-- specified details.
createContactChannel_idempotencyToken :: Lens.Lens' CreateContactChannel (Prelude.Maybe Prelude.Text)
createContactChannel_idempotencyToken :: (Maybe Text -> f (Maybe Text))
-> CreateContactChannel -> f CreateContactChannel
createContactChannel_idempotencyToken = (CreateContactChannel -> Maybe Text)
-> (CreateContactChannel -> Maybe Text -> CreateContactChannel)
-> Lens
     CreateContactChannel CreateContactChannel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactChannel' {Maybe Text
idempotencyToken :: Maybe Text
$sel:idempotencyToken:CreateContactChannel' :: CreateContactChannel -> Maybe Text
idempotencyToken} -> Maybe Text
idempotencyToken) (\s :: CreateContactChannel
s@CreateContactChannel' {} Maybe Text
a -> CreateContactChannel
s {$sel:idempotencyToken:CreateContactChannel' :: Maybe Text
idempotencyToken = Maybe Text
a} :: CreateContactChannel)

-- | If you want to activate the channel at a later time, you can choose to
-- defer activation. Incident Manager can\'t engage your contact channel
-- until it has been activated.
createContactChannel_deferActivation :: Lens.Lens' CreateContactChannel (Prelude.Maybe Prelude.Bool)
createContactChannel_deferActivation :: (Maybe Bool -> f (Maybe Bool))
-> CreateContactChannel -> f CreateContactChannel
createContactChannel_deferActivation = (CreateContactChannel -> Maybe Bool)
-> (CreateContactChannel -> Maybe Bool -> CreateContactChannel)
-> Lens
     CreateContactChannel CreateContactChannel (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactChannel' {Maybe Bool
deferActivation :: Maybe Bool
$sel:deferActivation:CreateContactChannel' :: CreateContactChannel -> Maybe Bool
deferActivation} -> Maybe Bool
deferActivation) (\s :: CreateContactChannel
s@CreateContactChannel' {} Maybe Bool
a -> CreateContactChannel
s {$sel:deferActivation:CreateContactChannel' :: Maybe Bool
deferActivation = Maybe Bool
a} :: CreateContactChannel)

-- | The Amazon Resource Name (ARN) of the contact you are adding the contact
-- channel to.
createContactChannel_contactId :: Lens.Lens' CreateContactChannel Prelude.Text
createContactChannel_contactId :: (Text -> f Text) -> CreateContactChannel -> f CreateContactChannel
createContactChannel_contactId = (CreateContactChannel -> Text)
-> (CreateContactChannel -> Text -> CreateContactChannel)
-> Lens CreateContactChannel CreateContactChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactChannel' {Text
contactId :: Text
$sel:contactId:CreateContactChannel' :: CreateContactChannel -> Text
contactId} -> Text
contactId) (\s :: CreateContactChannel
s@CreateContactChannel' {} Text
a -> CreateContactChannel
s {$sel:contactId:CreateContactChannel' :: Text
contactId = Text
a} :: CreateContactChannel)

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

-- | Incident Manager supports three types of contact channels:
--
-- -   @SMS@
--
-- -   @VOICE@
--
-- -   @EMAIL@
createContactChannel_type :: Lens.Lens' CreateContactChannel ChannelType
createContactChannel_type :: (ChannelType -> f ChannelType)
-> CreateContactChannel -> f CreateContactChannel
createContactChannel_type = (CreateContactChannel -> ChannelType)
-> (CreateContactChannel -> ChannelType -> CreateContactChannel)
-> Lens
     CreateContactChannel CreateContactChannel ChannelType ChannelType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactChannel' {ChannelType
type' :: ChannelType
$sel:type':CreateContactChannel' :: CreateContactChannel -> ChannelType
type'} -> ChannelType
type') (\s :: CreateContactChannel
s@CreateContactChannel' {} ChannelType
a -> CreateContactChannel
s {$sel:type':CreateContactChannel' :: ChannelType
type' = ChannelType
a} :: CreateContactChannel)

-- | The details that Incident Manager uses when trying to engage the contact
-- channel. The format is dependent on the type of the contact channel. The
-- following are the expected formats:
--
-- -   SMS - \'+\' followed by the country code and phone number
--
-- -   VOICE - \'+\' followed by the country code and phone number
--
-- -   EMAIL - any standard email format
createContactChannel_deliveryAddress :: Lens.Lens' CreateContactChannel ContactChannelAddress
createContactChannel_deliveryAddress :: (ContactChannelAddress -> f ContactChannelAddress)
-> CreateContactChannel -> f CreateContactChannel
createContactChannel_deliveryAddress = (CreateContactChannel -> ContactChannelAddress)
-> (CreateContactChannel
    -> ContactChannelAddress -> CreateContactChannel)
-> Lens
     CreateContactChannel
     CreateContactChannel
     ContactChannelAddress
     ContactChannelAddress
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactChannel' {ContactChannelAddress
deliveryAddress :: ContactChannelAddress
$sel:deliveryAddress:CreateContactChannel' :: CreateContactChannel -> ContactChannelAddress
deliveryAddress} -> ContactChannelAddress
deliveryAddress) (\s :: CreateContactChannel
s@CreateContactChannel' {} ContactChannelAddress
a -> CreateContactChannel
s {$sel:deliveryAddress:CreateContactChannel' :: ContactChannelAddress
deliveryAddress = ContactChannelAddress
a} :: CreateContactChannel)

instance Core.AWSRequest CreateContactChannel where
  type
    AWSResponse CreateContactChannel =
      CreateContactChannelResponse
  request :: CreateContactChannel -> Request CreateContactChannel
request = Service -> CreateContactChannel -> Request CreateContactChannel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateContactChannel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateContactChannel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateContactChannel))
-> Logger
-> Service
-> Proxy CreateContactChannel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateContactChannel)))
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 ->
          Int -> Text -> CreateContactChannelResponse
CreateContactChannelResponse'
            (Int -> Text -> CreateContactChannelResponse)
-> Either String Int
-> Either String (Text -> CreateContactChannelResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (Text -> CreateContactChannelResponse)
-> Either String Text -> Either String CreateContactChannelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ContactChannelArn")
      )

instance Prelude.Hashable CreateContactChannel

instance Prelude.NFData CreateContactChannel

instance Core.ToHeaders CreateContactChannel where
  toHeaders :: CreateContactChannel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateContactChannel -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SSMContacts.CreateContactChannel" ::
                          Prelude.ByteString
                      ),
            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 CreateContactChannel where
  toJSON :: CreateContactChannel -> Value
toJSON CreateContactChannel' {Maybe Bool
Maybe Text
Text
ChannelType
ContactChannelAddress
deliveryAddress :: ContactChannelAddress
type' :: ChannelType
name :: Text
contactId :: Text
deferActivation :: Maybe Bool
idempotencyToken :: Maybe Text
$sel:deliveryAddress:CreateContactChannel' :: CreateContactChannel -> ContactChannelAddress
$sel:type':CreateContactChannel' :: CreateContactChannel -> ChannelType
$sel:name:CreateContactChannel' :: CreateContactChannel -> Text
$sel:contactId:CreateContactChannel' :: CreateContactChannel -> Text
$sel:deferActivation:CreateContactChannel' :: CreateContactChannel -> Maybe Bool
$sel:idempotencyToken:CreateContactChannel' :: CreateContactChannel -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IdempotencyToken" 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
idempotencyToken,
            (Text
"DeferActivation" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deferActivation,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactId),
            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 -> ChannelType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChannelType
type'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DeliveryAddress" Text -> ContactChannelAddress -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ContactChannelAddress
deliveryAddress)
          ]
      )

instance Core.ToPath CreateContactChannel where
  toPath :: CreateContactChannel -> ByteString
toPath = ByteString -> CreateContactChannel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'CreateContactChannelResponse' 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:
--
-- 'httpStatus', 'createContactChannelResponse_httpStatus' - The response's http status code.
--
-- 'contactChannelArn', 'createContactChannelResponse_contactChannelArn' - The Amazon Resource Name (ARN) of the contact channel.
newCreateContactChannelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'contactChannelArn'
  Prelude.Text ->
  CreateContactChannelResponse
newCreateContactChannelResponse :: Int -> Text -> CreateContactChannelResponse
newCreateContactChannelResponse
  Int
pHttpStatus_
  Text
pContactChannelArn_ =
    CreateContactChannelResponse' :: Int -> Text -> CreateContactChannelResponse
CreateContactChannelResponse'
      { $sel:httpStatus:CreateContactChannelResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:contactChannelArn:CreateContactChannelResponse' :: Text
contactChannelArn = Text
pContactChannelArn_
      }

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

-- | The Amazon Resource Name (ARN) of the contact channel.
createContactChannelResponse_contactChannelArn :: Lens.Lens' CreateContactChannelResponse Prelude.Text
createContactChannelResponse_contactChannelArn :: (Text -> f Text)
-> CreateContactChannelResponse -> f CreateContactChannelResponse
createContactChannelResponse_contactChannelArn = (CreateContactChannelResponse -> Text)
-> (CreateContactChannelResponse
    -> Text -> CreateContactChannelResponse)
-> Lens
     CreateContactChannelResponse CreateContactChannelResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContactChannelResponse' {Text
contactChannelArn :: Text
$sel:contactChannelArn:CreateContactChannelResponse' :: CreateContactChannelResponse -> Text
contactChannelArn} -> Text
contactChannelArn) (\s :: CreateContactChannelResponse
s@CreateContactChannelResponse' {} Text
a -> CreateContactChannelResponse
s {$sel:contactChannelArn:CreateContactChannelResponse' :: Text
contactChannelArn = Text
a} :: CreateContactChannelResponse)

instance Prelude.NFData CreateContactChannelResponse