{-# 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.ChimeSdkVoice.UpdateSipMediaApplicationCall
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- -- | Undocumented operation.
module Amazonka.ChimeSdkVoice.UpdateSipMediaApplicationCall
  ( -- * Creating a Request
    UpdateSipMediaApplicationCall (..),
    newUpdateSipMediaApplicationCall,

    -- * Request Lenses
    updateSipMediaApplicationCall_sipMediaApplicationId,
    updateSipMediaApplicationCall_transactionId,
    updateSipMediaApplicationCall_arguments,

    -- * Destructuring the Response
    UpdateSipMediaApplicationCallResponse (..),
    newUpdateSipMediaApplicationCallResponse,

    -- * Response Lenses
    updateSipMediaApplicationCallResponse_sipMediaApplicationCall,
    updateSipMediaApplicationCallResponse_httpStatus,
  )
where

import Amazonka.ChimeSdkVoice.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateSipMediaApplicationCall' smart constructor.
data UpdateSipMediaApplicationCall = UpdateSipMediaApplicationCall'
  { UpdateSipMediaApplicationCall -> Text
sipMediaApplicationId :: Prelude.Text,
    UpdateSipMediaApplicationCall -> Text
transactionId :: Prelude.Text,
    UpdateSipMediaApplicationCall -> HashMap Text (Sensitive Text)
arguments :: Prelude.HashMap Prelude.Text (Data.Sensitive Prelude.Text)
  }
  deriving (UpdateSipMediaApplicationCall
-> UpdateSipMediaApplicationCall -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSipMediaApplicationCall
-> UpdateSipMediaApplicationCall -> Bool
$c/= :: UpdateSipMediaApplicationCall
-> UpdateSipMediaApplicationCall -> Bool
== :: UpdateSipMediaApplicationCall
-> UpdateSipMediaApplicationCall -> Bool
$c== :: UpdateSipMediaApplicationCall
-> UpdateSipMediaApplicationCall -> Bool
Prelude.Eq, Int -> UpdateSipMediaApplicationCall -> ShowS
[UpdateSipMediaApplicationCall] -> ShowS
UpdateSipMediaApplicationCall -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSipMediaApplicationCall] -> ShowS
$cshowList :: [UpdateSipMediaApplicationCall] -> ShowS
show :: UpdateSipMediaApplicationCall -> String
$cshow :: UpdateSipMediaApplicationCall -> String
showsPrec :: Int -> UpdateSipMediaApplicationCall -> ShowS
$cshowsPrec :: Int -> UpdateSipMediaApplicationCall -> ShowS
Prelude.Show, forall x.
Rep UpdateSipMediaApplicationCall x
-> UpdateSipMediaApplicationCall
forall x.
UpdateSipMediaApplicationCall
-> Rep UpdateSipMediaApplicationCall x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSipMediaApplicationCall x
-> UpdateSipMediaApplicationCall
$cfrom :: forall x.
UpdateSipMediaApplicationCall
-> Rep UpdateSipMediaApplicationCall x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSipMediaApplicationCall' 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:
--
-- 'sipMediaApplicationId', 'updateSipMediaApplicationCall_sipMediaApplicationId' - Undocumented member.
--
-- 'transactionId', 'updateSipMediaApplicationCall_transactionId' - Undocumented member.
--
-- 'arguments', 'updateSipMediaApplicationCall_arguments' - Undocumented member.
newUpdateSipMediaApplicationCall ::
  -- | 'sipMediaApplicationId'
  Prelude.Text ->
  -- | 'transactionId'
  Prelude.Text ->
  UpdateSipMediaApplicationCall
newUpdateSipMediaApplicationCall :: Text -> Text -> UpdateSipMediaApplicationCall
newUpdateSipMediaApplicationCall
  Text
pSipMediaApplicationId_
  Text
pTransactionId_ =
    UpdateSipMediaApplicationCall'
      { $sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: Text
sipMediaApplicationId =
          Text
pSipMediaApplicationId_,
        $sel:transactionId:UpdateSipMediaApplicationCall' :: Text
transactionId = Text
pTransactionId_,
        $sel:arguments:UpdateSipMediaApplicationCall' :: HashMap Text (Sensitive Text)
arguments = forall a. Monoid a => a
Prelude.mempty
      }

-- | Undocumented member.
updateSipMediaApplicationCall_sipMediaApplicationId :: Lens.Lens' UpdateSipMediaApplicationCall Prelude.Text
updateSipMediaApplicationCall_sipMediaApplicationId :: Lens' UpdateSipMediaApplicationCall Text
updateSipMediaApplicationCall_sipMediaApplicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplicationCall' {Text
sipMediaApplicationId :: Text
$sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
sipMediaApplicationId} -> Text
sipMediaApplicationId) (\s :: UpdateSipMediaApplicationCall
s@UpdateSipMediaApplicationCall' {} Text
a -> UpdateSipMediaApplicationCall
s {$sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: Text
sipMediaApplicationId = Text
a} :: UpdateSipMediaApplicationCall)

-- | Undocumented member.
updateSipMediaApplicationCall_transactionId :: Lens.Lens' UpdateSipMediaApplicationCall Prelude.Text
updateSipMediaApplicationCall_transactionId :: Lens' UpdateSipMediaApplicationCall Text
updateSipMediaApplicationCall_transactionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplicationCall' {Text
transactionId :: Text
$sel:transactionId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
transactionId} -> Text
transactionId) (\s :: UpdateSipMediaApplicationCall
s@UpdateSipMediaApplicationCall' {} Text
a -> UpdateSipMediaApplicationCall
s {$sel:transactionId:UpdateSipMediaApplicationCall' :: Text
transactionId = Text
a} :: UpdateSipMediaApplicationCall)

-- | Undocumented member.
updateSipMediaApplicationCall_arguments :: Lens.Lens' UpdateSipMediaApplicationCall (Prelude.HashMap Prelude.Text Prelude.Text)
updateSipMediaApplicationCall_arguments :: Lens' UpdateSipMediaApplicationCall (HashMap Text Text)
updateSipMediaApplicationCall_arguments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplicationCall' {HashMap Text (Sensitive Text)
arguments :: HashMap Text (Sensitive Text)
$sel:arguments:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> HashMap Text (Sensitive Text)
arguments} -> HashMap Text (Sensitive Text)
arguments) (\s :: UpdateSipMediaApplicationCall
s@UpdateSipMediaApplicationCall' {} HashMap Text (Sensitive Text)
a -> UpdateSipMediaApplicationCall
s {$sel:arguments:UpdateSipMediaApplicationCall' :: HashMap Text (Sensitive Text)
arguments = HashMap Text (Sensitive Text)
a} :: UpdateSipMediaApplicationCall) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    UpdateSipMediaApplicationCall
  where
  type
    AWSResponse UpdateSipMediaApplicationCall =
      UpdateSipMediaApplicationCallResponse
  request :: (Service -> Service)
-> UpdateSipMediaApplicationCall
-> Request UpdateSipMediaApplicationCall
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateSipMediaApplicationCall
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSipMediaApplicationCall)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe SipMediaApplicationCall
-> Int -> UpdateSipMediaApplicationCallResponse
UpdateSipMediaApplicationCallResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SipMediaApplicationCall")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateSipMediaApplicationCall
  where
  hashWithSalt :: Int -> UpdateSipMediaApplicationCall -> Int
hashWithSalt Int
_salt UpdateSipMediaApplicationCall' {Text
HashMap Text (Sensitive Text)
arguments :: HashMap Text (Sensitive Text)
transactionId :: Text
sipMediaApplicationId :: Text
$sel:arguments:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> HashMap Text (Sensitive Text)
$sel:transactionId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
$sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sipMediaApplicationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
transactionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text (Sensitive Text)
arguments

instance Prelude.NFData UpdateSipMediaApplicationCall where
  rnf :: UpdateSipMediaApplicationCall -> ()
rnf UpdateSipMediaApplicationCall' {Text
HashMap Text (Sensitive Text)
arguments :: HashMap Text (Sensitive Text)
transactionId :: Text
sipMediaApplicationId :: Text
$sel:arguments:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> HashMap Text (Sensitive Text)
$sel:transactionId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
$sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
sipMediaApplicationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
transactionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text (Sensitive Text)
arguments

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

instance Data.ToJSON UpdateSipMediaApplicationCall where
  toJSON :: UpdateSipMediaApplicationCall -> Value
toJSON UpdateSipMediaApplicationCall' {Text
HashMap Text (Sensitive Text)
arguments :: HashMap Text (Sensitive Text)
transactionId :: Text
sipMediaApplicationId :: Text
$sel:arguments:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> HashMap Text (Sensitive Text)
$sel:transactionId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
$sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"Arguments" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text (Sensitive Text)
arguments)]
      )

instance Data.ToPath UpdateSipMediaApplicationCall where
  toPath :: UpdateSipMediaApplicationCall -> ByteString
toPath UpdateSipMediaApplicationCall' {Text
HashMap Text (Sensitive Text)
arguments :: HashMap Text (Sensitive Text)
transactionId :: Text
sipMediaApplicationId :: Text
$sel:arguments:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> HashMap Text (Sensitive Text)
$sel:transactionId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
$sel:sipMediaApplicationId:UpdateSipMediaApplicationCall' :: UpdateSipMediaApplicationCall -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/sip-media-applications/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
sipMediaApplicationId,
        ByteString
"/calls/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
transactionId
      ]

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

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

-- |
-- Create a value of 'UpdateSipMediaApplicationCallResponse' 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', 'updateSipMediaApplicationCallResponse_sipMediaApplicationCall' - Undocumented member.
--
-- 'httpStatus', 'updateSipMediaApplicationCallResponse_httpStatus' - The response's http status code.
newUpdateSipMediaApplicationCallResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSipMediaApplicationCallResponse
newUpdateSipMediaApplicationCallResponse :: Int -> UpdateSipMediaApplicationCallResponse
newUpdateSipMediaApplicationCallResponse Int
pHttpStatus_ =
  UpdateSipMediaApplicationCallResponse'
    { $sel:sipMediaApplicationCall:UpdateSipMediaApplicationCallResponse' :: Maybe SipMediaApplicationCall
sipMediaApplicationCall =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateSipMediaApplicationCallResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
updateSipMediaApplicationCallResponse_sipMediaApplicationCall :: Lens.Lens' UpdateSipMediaApplicationCallResponse (Prelude.Maybe SipMediaApplicationCall)
updateSipMediaApplicationCallResponse_sipMediaApplicationCall :: Lens'
  UpdateSipMediaApplicationCallResponse
  (Maybe SipMediaApplicationCall)
updateSipMediaApplicationCallResponse_sipMediaApplicationCall = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplicationCallResponse' {Maybe SipMediaApplicationCall
sipMediaApplicationCall :: Maybe SipMediaApplicationCall
$sel:sipMediaApplicationCall:UpdateSipMediaApplicationCallResponse' :: UpdateSipMediaApplicationCallResponse
-> Maybe SipMediaApplicationCall
sipMediaApplicationCall} -> Maybe SipMediaApplicationCall
sipMediaApplicationCall) (\s :: UpdateSipMediaApplicationCallResponse
s@UpdateSipMediaApplicationCallResponse' {} Maybe SipMediaApplicationCall
a -> UpdateSipMediaApplicationCallResponse
s {$sel:sipMediaApplicationCall:UpdateSipMediaApplicationCallResponse' :: Maybe SipMediaApplicationCall
sipMediaApplicationCall = Maybe SipMediaApplicationCall
a} :: UpdateSipMediaApplicationCallResponse)

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

instance
  Prelude.NFData
    UpdateSipMediaApplicationCallResponse
  where
  rnf :: UpdateSipMediaApplicationCallResponse -> ()
rnf UpdateSipMediaApplicationCallResponse' {Int
Maybe SipMediaApplicationCall
httpStatus :: Int
sipMediaApplicationCall :: Maybe SipMediaApplicationCall
$sel:httpStatus:UpdateSipMediaApplicationCallResponse' :: UpdateSipMediaApplicationCallResponse -> Int
$sel:sipMediaApplicationCall:UpdateSipMediaApplicationCallResponse' :: UpdateSipMediaApplicationCallResponse
-> Maybe SipMediaApplicationCall
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SipMediaApplicationCall
sipMediaApplicationCall
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus