{-# 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.Chime.CreateSipMediaApplicationCall
-- 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 an outbound call to a phone number from the phone number
-- specified in the request, and it invokes the endpoint of the specified
-- @sipMediaApplicationId@.
module Amazonka.Chime.CreateSipMediaApplicationCall
  ( -- * Creating a Request
    CreateSipMediaApplicationCall (..),
    newCreateSipMediaApplicationCall,

    -- * Request Lenses
    createSipMediaApplicationCall_sipHeaders,
    createSipMediaApplicationCall_fromPhoneNumber,
    createSipMediaApplicationCall_toPhoneNumber,
    createSipMediaApplicationCall_sipMediaApplicationId,

    -- * Destructuring the Response
    CreateSipMediaApplicationCallResponse (..),
    newCreateSipMediaApplicationCallResponse,

    -- * Response Lenses
    createSipMediaApplicationCallResponse_sipMediaApplicationCall,
    createSipMediaApplicationCallResponse_httpStatus,
  )
where

import Amazonka.Chime.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:/ 'newCreateSipMediaApplicationCall' smart constructor.
data CreateSipMediaApplicationCall = CreateSipMediaApplicationCall'
  { -- | The SIP headers added to an outbound call leg.
    CreateSipMediaApplicationCall
-> Maybe (HashMap Text (Sensitive Text))
sipHeaders :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
    -- | The phone number that a user calls from. This is a phone number in your
    -- Amazon Chime phone number inventory.
    CreateSipMediaApplicationCall -> Sensitive Text
fromPhoneNumber :: Core.Sensitive Prelude.Text,
    -- | The phone number that the service should call.
    CreateSipMediaApplicationCall -> Sensitive Text
toPhoneNumber :: Core.Sensitive Prelude.Text,
    -- | The ID of the SIP media application.
    CreateSipMediaApplicationCall -> Text
sipMediaApplicationId :: Prelude.Text
  }
  deriving (CreateSipMediaApplicationCall
-> CreateSipMediaApplicationCall -> Bool
(CreateSipMediaApplicationCall
 -> CreateSipMediaApplicationCall -> Bool)
-> (CreateSipMediaApplicationCall
    -> CreateSipMediaApplicationCall -> Bool)
-> Eq CreateSipMediaApplicationCall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSipMediaApplicationCall
-> CreateSipMediaApplicationCall -> Bool
$c/= :: CreateSipMediaApplicationCall
-> CreateSipMediaApplicationCall -> Bool
== :: CreateSipMediaApplicationCall
-> CreateSipMediaApplicationCall -> Bool
$c== :: CreateSipMediaApplicationCall
-> CreateSipMediaApplicationCall -> Bool
Prelude.Eq, Int -> CreateSipMediaApplicationCall -> ShowS
[CreateSipMediaApplicationCall] -> ShowS
CreateSipMediaApplicationCall -> String
(Int -> CreateSipMediaApplicationCall -> ShowS)
-> (CreateSipMediaApplicationCall -> String)
-> ([CreateSipMediaApplicationCall] -> ShowS)
-> Show CreateSipMediaApplicationCall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSipMediaApplicationCall] -> ShowS
$cshowList :: [CreateSipMediaApplicationCall] -> ShowS
show :: CreateSipMediaApplicationCall -> String
$cshow :: CreateSipMediaApplicationCall -> String
showsPrec :: Int -> CreateSipMediaApplicationCall -> ShowS
$cshowsPrec :: Int -> CreateSipMediaApplicationCall -> ShowS
Prelude.Show, (forall x.
 CreateSipMediaApplicationCall
 -> Rep CreateSipMediaApplicationCall x)
-> (forall x.
    Rep CreateSipMediaApplicationCall x
    -> CreateSipMediaApplicationCall)
-> Generic CreateSipMediaApplicationCall
forall x.
Rep CreateSipMediaApplicationCall x
-> CreateSipMediaApplicationCall
forall x.
CreateSipMediaApplicationCall
-> Rep CreateSipMediaApplicationCall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSipMediaApplicationCall x
-> CreateSipMediaApplicationCall
$cfrom :: forall x.
CreateSipMediaApplicationCall
-> Rep CreateSipMediaApplicationCall x
Prelude.Generic)

-- |
-- Create a value of 'CreateSipMediaApplicationCall' 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:
--
-- 'sipHeaders', 'createSipMediaApplicationCall_sipHeaders' - The SIP headers added to an outbound call leg.
--
-- 'fromPhoneNumber', 'createSipMediaApplicationCall_fromPhoneNumber' - The phone number that a user calls from. This is a phone number in your
-- Amazon Chime phone number inventory.
--
-- 'toPhoneNumber', 'createSipMediaApplicationCall_toPhoneNumber' - The phone number that the service should call.
--
-- 'sipMediaApplicationId', 'createSipMediaApplicationCall_sipMediaApplicationId' - The ID of the SIP media application.
newCreateSipMediaApplicationCall ::
  -- | 'fromPhoneNumber'
  Prelude.Text ->
  -- | 'toPhoneNumber'
  Prelude.Text ->
  -- | 'sipMediaApplicationId'
  Prelude.Text ->
  CreateSipMediaApplicationCall
newCreateSipMediaApplicationCall :: Text -> Text -> Text -> CreateSipMediaApplicationCall
newCreateSipMediaApplicationCall
  Text
pFromPhoneNumber_
  Text
pToPhoneNumber_
  Text
pSipMediaApplicationId_ =
    CreateSipMediaApplicationCall' :: Maybe (HashMap Text (Sensitive Text))
-> Sensitive Text
-> Sensitive Text
-> Text
-> CreateSipMediaApplicationCall
CreateSipMediaApplicationCall'
      { $sel:sipHeaders:CreateSipMediaApplicationCall' :: Maybe (HashMap Text (Sensitive Text))
sipHeaders =
          Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
        $sel:fromPhoneNumber:CreateSipMediaApplicationCall' :: Sensitive Text
fromPhoneNumber =
          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
pFromPhoneNumber_,
        $sel:toPhoneNumber:CreateSipMediaApplicationCall' :: Sensitive Text
toPhoneNumber =
          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
pToPhoneNumber_,
        $sel:sipMediaApplicationId:CreateSipMediaApplicationCall' :: Text
sipMediaApplicationId =
          Text
pSipMediaApplicationId_
      }

-- | The SIP headers added to an outbound call leg.
createSipMediaApplicationCall_sipHeaders :: Lens.Lens' CreateSipMediaApplicationCall (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createSipMediaApplicationCall_sipHeaders :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateSipMediaApplicationCall -> f CreateSipMediaApplicationCall
createSipMediaApplicationCall_sipHeaders = (CreateSipMediaApplicationCall
 -> Maybe (HashMap Text (Sensitive Text)))
-> (CreateSipMediaApplicationCall
    -> Maybe (HashMap Text (Sensitive Text))
    -> CreateSipMediaApplicationCall)
-> Lens
     CreateSipMediaApplicationCall
     CreateSipMediaApplicationCall
     (Maybe (HashMap Text (Sensitive Text)))
     (Maybe (HashMap Text (Sensitive Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSipMediaApplicationCall' {Maybe (HashMap Text (Sensitive Text))
sipHeaders :: Maybe (HashMap Text (Sensitive Text))
$sel:sipHeaders:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall
-> Maybe (HashMap Text (Sensitive Text))
sipHeaders} -> Maybe (HashMap Text (Sensitive Text))
sipHeaders) (\s :: CreateSipMediaApplicationCall
s@CreateSipMediaApplicationCall' {} Maybe (HashMap Text (Sensitive Text))
a -> CreateSipMediaApplicationCall
s {$sel:sipHeaders:CreateSipMediaApplicationCall' :: Maybe (HashMap Text (Sensitive Text))
sipHeaders = Maybe (HashMap Text (Sensitive Text))
a} :: CreateSipMediaApplicationCall) ((Maybe (HashMap Text (Sensitive Text))
  -> f (Maybe (HashMap Text (Sensitive Text))))
 -> CreateSipMediaApplicationCall
 -> f CreateSipMediaApplicationCall)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text (Sensitive Text))
    -> f (Maybe (HashMap Text (Sensitive Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateSipMediaApplicationCall
-> f CreateSipMediaApplicationCall
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text (Sensitive Text))
  (HashMap Text (Sensitive Text))
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text (Sensitive Text)))
     (Maybe (HashMap Text (Sensitive 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 (Sensitive Text))
  (HashMap Text (Sensitive 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 phone number that a user calls from. This is a phone number in your
-- Amazon Chime phone number inventory.
createSipMediaApplicationCall_fromPhoneNumber :: Lens.Lens' CreateSipMediaApplicationCall Prelude.Text
createSipMediaApplicationCall_fromPhoneNumber :: (Text -> f Text)
-> CreateSipMediaApplicationCall -> f CreateSipMediaApplicationCall
createSipMediaApplicationCall_fromPhoneNumber = (CreateSipMediaApplicationCall -> Sensitive Text)
-> (CreateSipMediaApplicationCall
    -> Sensitive Text -> CreateSipMediaApplicationCall)
-> Lens
     CreateSipMediaApplicationCall
     CreateSipMediaApplicationCall
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSipMediaApplicationCall' {Sensitive Text
fromPhoneNumber :: Sensitive Text
$sel:fromPhoneNumber:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Sensitive Text
fromPhoneNumber} -> Sensitive Text
fromPhoneNumber) (\s :: CreateSipMediaApplicationCall
s@CreateSipMediaApplicationCall' {} Sensitive Text
a -> CreateSipMediaApplicationCall
s {$sel:fromPhoneNumber:CreateSipMediaApplicationCall' :: Sensitive Text
fromPhoneNumber = Sensitive Text
a} :: CreateSipMediaApplicationCall) ((Sensitive Text -> f (Sensitive Text))
 -> CreateSipMediaApplicationCall
 -> f CreateSipMediaApplicationCall)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateSipMediaApplicationCall
-> f CreateSipMediaApplicationCall
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 phone number that the service should call.
createSipMediaApplicationCall_toPhoneNumber :: Lens.Lens' CreateSipMediaApplicationCall Prelude.Text
createSipMediaApplicationCall_toPhoneNumber :: (Text -> f Text)
-> CreateSipMediaApplicationCall -> f CreateSipMediaApplicationCall
createSipMediaApplicationCall_toPhoneNumber = (CreateSipMediaApplicationCall -> Sensitive Text)
-> (CreateSipMediaApplicationCall
    -> Sensitive Text -> CreateSipMediaApplicationCall)
-> Lens
     CreateSipMediaApplicationCall
     CreateSipMediaApplicationCall
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSipMediaApplicationCall' {Sensitive Text
toPhoneNumber :: Sensitive Text
$sel:toPhoneNumber:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Sensitive Text
toPhoneNumber} -> Sensitive Text
toPhoneNumber) (\s :: CreateSipMediaApplicationCall
s@CreateSipMediaApplicationCall' {} Sensitive Text
a -> CreateSipMediaApplicationCall
s {$sel:toPhoneNumber:CreateSipMediaApplicationCall' :: Sensitive Text
toPhoneNumber = Sensitive Text
a} :: CreateSipMediaApplicationCall) ((Sensitive Text -> f (Sensitive Text))
 -> CreateSipMediaApplicationCall
 -> f CreateSipMediaApplicationCall)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateSipMediaApplicationCall
-> f CreateSipMediaApplicationCall
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 ID of the SIP media application.
createSipMediaApplicationCall_sipMediaApplicationId :: Lens.Lens' CreateSipMediaApplicationCall Prelude.Text
createSipMediaApplicationCall_sipMediaApplicationId :: (Text -> f Text)
-> CreateSipMediaApplicationCall -> f CreateSipMediaApplicationCall
createSipMediaApplicationCall_sipMediaApplicationId = (CreateSipMediaApplicationCall -> Text)
-> (CreateSipMediaApplicationCall
    -> Text -> CreateSipMediaApplicationCall)
-> Lens
     CreateSipMediaApplicationCall
     CreateSipMediaApplicationCall
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSipMediaApplicationCall' {Text
sipMediaApplicationId :: Text
$sel:sipMediaApplicationId:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Text
sipMediaApplicationId} -> Text
sipMediaApplicationId) (\s :: CreateSipMediaApplicationCall
s@CreateSipMediaApplicationCall' {} Text
a -> CreateSipMediaApplicationCall
s {$sel:sipMediaApplicationId:CreateSipMediaApplicationCall' :: Text
sipMediaApplicationId = Text
a} :: CreateSipMediaApplicationCall)

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

instance Prelude.NFData CreateSipMediaApplicationCall

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

instance Core.ToJSON CreateSipMediaApplicationCall where
  toJSON :: CreateSipMediaApplicationCall -> Value
toJSON CreateSipMediaApplicationCall' {Maybe (HashMap Text (Sensitive Text))
Text
Sensitive Text
sipMediaApplicationId :: Text
toPhoneNumber :: Sensitive Text
fromPhoneNumber :: Sensitive Text
sipHeaders :: Maybe (HashMap Text (Sensitive Text))
$sel:sipMediaApplicationId:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Text
$sel:toPhoneNumber:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Sensitive Text
$sel:fromPhoneNumber:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Sensitive Text
$sel:sipHeaders:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall
-> Maybe (HashMap Text (Sensitive Text))
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SipHeaders" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text (Sensitive Text) -> Pair)
-> Maybe (HashMap Text (Sensitive Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text (Sensitive Text))
sipHeaders,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FromPhoneNumber" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
fromPhoneNumber),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ToPhoneNumber" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
toPhoneNumber)
          ]
      )

instance Core.ToPath CreateSipMediaApplicationCall where
  toPath :: CreateSipMediaApplicationCall -> ByteString
toPath CreateSipMediaApplicationCall' {Maybe (HashMap Text (Sensitive Text))
Text
Sensitive Text
sipMediaApplicationId :: Text
toPhoneNumber :: Sensitive Text
fromPhoneNumber :: Sensitive Text
sipHeaders :: Maybe (HashMap Text (Sensitive Text))
$sel:sipMediaApplicationId:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Text
$sel:toPhoneNumber:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Sensitive Text
$sel:fromPhoneNumber:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall -> Sensitive Text
$sel:sipHeaders:CreateSipMediaApplicationCall' :: CreateSipMediaApplicationCall
-> Maybe (HashMap Text (Sensitive Text))
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/sip-media-applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
sipMediaApplicationId,
        ByteString
"/calls"
      ]

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

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

-- |
-- Create a value of 'CreateSipMediaApplicationCallResponse' 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:
--
-- 'sipMediaApplicationCall', 'createSipMediaApplicationCallResponse_sipMediaApplicationCall' - The actual call.
--
-- 'httpStatus', 'createSipMediaApplicationCallResponse_httpStatus' - The response's http status code.
newCreateSipMediaApplicationCallResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateSipMediaApplicationCallResponse
newCreateSipMediaApplicationCallResponse :: Int -> CreateSipMediaApplicationCallResponse
newCreateSipMediaApplicationCallResponse Int
pHttpStatus_ =
  CreateSipMediaApplicationCallResponse' :: Maybe SipMediaApplicationCall
-> Int -> CreateSipMediaApplicationCallResponse
CreateSipMediaApplicationCallResponse'
    { $sel:sipMediaApplicationCall:CreateSipMediaApplicationCallResponse' :: Maybe SipMediaApplicationCall
sipMediaApplicationCall =
        Maybe SipMediaApplicationCall
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateSipMediaApplicationCallResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The actual call.
createSipMediaApplicationCallResponse_sipMediaApplicationCall :: Lens.Lens' CreateSipMediaApplicationCallResponse (Prelude.Maybe SipMediaApplicationCall)
createSipMediaApplicationCallResponse_sipMediaApplicationCall :: (Maybe SipMediaApplicationCall
 -> f (Maybe SipMediaApplicationCall))
-> CreateSipMediaApplicationCallResponse
-> f CreateSipMediaApplicationCallResponse
createSipMediaApplicationCallResponse_sipMediaApplicationCall = (CreateSipMediaApplicationCallResponse
 -> Maybe SipMediaApplicationCall)
-> (CreateSipMediaApplicationCallResponse
    -> Maybe SipMediaApplicationCall
    -> CreateSipMediaApplicationCallResponse)
-> Lens
     CreateSipMediaApplicationCallResponse
     CreateSipMediaApplicationCallResponse
     (Maybe SipMediaApplicationCall)
     (Maybe SipMediaApplicationCall)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSipMediaApplicationCallResponse' {Maybe SipMediaApplicationCall
sipMediaApplicationCall :: Maybe SipMediaApplicationCall
$sel:sipMediaApplicationCall:CreateSipMediaApplicationCallResponse' :: CreateSipMediaApplicationCallResponse
-> Maybe SipMediaApplicationCall
sipMediaApplicationCall} -> Maybe SipMediaApplicationCall
sipMediaApplicationCall) (\s :: CreateSipMediaApplicationCallResponse
s@CreateSipMediaApplicationCallResponse' {} Maybe SipMediaApplicationCall
a -> CreateSipMediaApplicationCallResponse
s {$sel:sipMediaApplicationCall:CreateSipMediaApplicationCallResponse' :: Maybe SipMediaApplicationCall
sipMediaApplicationCall = Maybe SipMediaApplicationCall
a} :: CreateSipMediaApplicationCallResponse)

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

instance
  Prelude.NFData
    CreateSipMediaApplicationCallResponse