{-# 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 #-}
module Amazonka.Chime.PutVoiceConnectorTerminationCredentials
(
PutVoiceConnectorTerminationCredentials (..),
newPutVoiceConnectorTerminationCredentials,
putVoiceConnectorTerminationCredentials_credentials,
putVoiceConnectorTerminationCredentials_voiceConnectorId,
PutVoiceConnectorTerminationCredentialsResponse (..),
newPutVoiceConnectorTerminationCredentialsResponse,
)
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
data PutVoiceConnectorTerminationCredentials = PutVoiceConnectorTerminationCredentials'
{
PutVoiceConnectorTerminationCredentials -> Maybe [Credential]
credentials :: Prelude.Maybe [Credential],
PutVoiceConnectorTerminationCredentials -> Text
voiceConnectorId :: Prelude.Text
}
deriving (PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool
(PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool)
-> (PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool)
-> Eq PutVoiceConnectorTerminationCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool
$c/= :: PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool
== :: PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool
$c== :: PutVoiceConnectorTerminationCredentials
-> PutVoiceConnectorTerminationCredentials -> Bool
Prelude.Eq, Int -> PutVoiceConnectorTerminationCredentials -> ShowS
[PutVoiceConnectorTerminationCredentials] -> ShowS
PutVoiceConnectorTerminationCredentials -> String
(Int -> PutVoiceConnectorTerminationCredentials -> ShowS)
-> (PutVoiceConnectorTerminationCredentials -> String)
-> ([PutVoiceConnectorTerminationCredentials] -> ShowS)
-> Show PutVoiceConnectorTerminationCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutVoiceConnectorTerminationCredentials] -> ShowS
$cshowList :: [PutVoiceConnectorTerminationCredentials] -> ShowS
show :: PutVoiceConnectorTerminationCredentials -> String
$cshow :: PutVoiceConnectorTerminationCredentials -> String
showsPrec :: Int -> PutVoiceConnectorTerminationCredentials -> ShowS
$cshowsPrec :: Int -> PutVoiceConnectorTerminationCredentials -> ShowS
Prelude.Show, (forall x.
PutVoiceConnectorTerminationCredentials
-> Rep PutVoiceConnectorTerminationCredentials x)
-> (forall x.
Rep PutVoiceConnectorTerminationCredentials x
-> PutVoiceConnectorTerminationCredentials)
-> Generic PutVoiceConnectorTerminationCredentials
forall x.
Rep PutVoiceConnectorTerminationCredentials x
-> PutVoiceConnectorTerminationCredentials
forall x.
PutVoiceConnectorTerminationCredentials
-> Rep PutVoiceConnectorTerminationCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutVoiceConnectorTerminationCredentials x
-> PutVoiceConnectorTerminationCredentials
$cfrom :: forall x.
PutVoiceConnectorTerminationCredentials
-> Rep PutVoiceConnectorTerminationCredentials x
Prelude.Generic)
newPutVoiceConnectorTerminationCredentials ::
Prelude.Text ->
PutVoiceConnectorTerminationCredentials
newPutVoiceConnectorTerminationCredentials :: Text -> PutVoiceConnectorTerminationCredentials
newPutVoiceConnectorTerminationCredentials
Text
pVoiceConnectorId_ =
PutVoiceConnectorTerminationCredentials' :: Maybe [Credential]
-> Text -> PutVoiceConnectorTerminationCredentials
PutVoiceConnectorTerminationCredentials'
{ $sel:credentials:PutVoiceConnectorTerminationCredentials' :: Maybe [Credential]
credentials =
Maybe [Credential]
forall a. Maybe a
Prelude.Nothing,
$sel:voiceConnectorId:PutVoiceConnectorTerminationCredentials' :: Text
voiceConnectorId =
Text
pVoiceConnectorId_
}
putVoiceConnectorTerminationCredentials_credentials :: Lens.Lens' PutVoiceConnectorTerminationCredentials (Prelude.Maybe [Credential])
putVoiceConnectorTerminationCredentials_credentials :: (Maybe [Credential] -> f (Maybe [Credential]))
-> PutVoiceConnectorTerminationCredentials
-> f PutVoiceConnectorTerminationCredentials
putVoiceConnectorTerminationCredentials_credentials = (PutVoiceConnectorTerminationCredentials -> Maybe [Credential])
-> (PutVoiceConnectorTerminationCredentials
-> Maybe [Credential] -> PutVoiceConnectorTerminationCredentials)
-> Lens
PutVoiceConnectorTerminationCredentials
PutVoiceConnectorTerminationCredentials
(Maybe [Credential])
(Maybe [Credential])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorTerminationCredentials' {Maybe [Credential]
credentials :: Maybe [Credential]
$sel:credentials:PutVoiceConnectorTerminationCredentials' :: PutVoiceConnectorTerminationCredentials -> Maybe [Credential]
credentials} -> Maybe [Credential]
credentials) (\s :: PutVoiceConnectorTerminationCredentials
s@PutVoiceConnectorTerminationCredentials' {} Maybe [Credential]
a -> PutVoiceConnectorTerminationCredentials
s {$sel:credentials:PutVoiceConnectorTerminationCredentials' :: Maybe [Credential]
credentials = Maybe [Credential]
a} :: PutVoiceConnectorTerminationCredentials) ((Maybe [Credential] -> f (Maybe [Credential]))
-> PutVoiceConnectorTerminationCredentials
-> f PutVoiceConnectorTerminationCredentials)
-> ((Maybe [Credential] -> f (Maybe [Credential]))
-> Maybe [Credential] -> f (Maybe [Credential]))
-> (Maybe [Credential] -> f (Maybe [Credential]))
-> PutVoiceConnectorTerminationCredentials
-> f PutVoiceConnectorTerminationCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Credential] [Credential] [Credential] [Credential]
-> Iso
(Maybe [Credential])
(Maybe [Credential])
(Maybe [Credential])
(Maybe [Credential])
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 [Credential] [Credential] [Credential] [Credential]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putVoiceConnectorTerminationCredentials_voiceConnectorId :: Lens.Lens' PutVoiceConnectorTerminationCredentials Prelude.Text
putVoiceConnectorTerminationCredentials_voiceConnectorId :: (Text -> f Text)
-> PutVoiceConnectorTerminationCredentials
-> f PutVoiceConnectorTerminationCredentials
putVoiceConnectorTerminationCredentials_voiceConnectorId = (PutVoiceConnectorTerminationCredentials -> Text)
-> (PutVoiceConnectorTerminationCredentials
-> Text -> PutVoiceConnectorTerminationCredentials)
-> Lens
PutVoiceConnectorTerminationCredentials
PutVoiceConnectorTerminationCredentials
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorTerminationCredentials' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:PutVoiceConnectorTerminationCredentials' :: PutVoiceConnectorTerminationCredentials -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: PutVoiceConnectorTerminationCredentials
s@PutVoiceConnectorTerminationCredentials' {} Text
a -> PutVoiceConnectorTerminationCredentials
s {$sel:voiceConnectorId:PutVoiceConnectorTerminationCredentials' :: Text
voiceConnectorId = Text
a} :: PutVoiceConnectorTerminationCredentials)
instance
Core.AWSRequest
PutVoiceConnectorTerminationCredentials
where
type
AWSResponse
PutVoiceConnectorTerminationCredentials =
PutVoiceConnectorTerminationCredentialsResponse
request :: PutVoiceConnectorTerminationCredentials
-> Request PutVoiceConnectorTerminationCredentials
request = Service
-> PutVoiceConnectorTerminationCredentials
-> Request PutVoiceConnectorTerminationCredentials
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutVoiceConnectorTerminationCredentials
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse PutVoiceConnectorTerminationCredentials)))
response =
AWSResponse PutVoiceConnectorTerminationCredentials
-> Logger
-> Service
-> Proxy PutVoiceConnectorTerminationCredentials
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse PutVoiceConnectorTerminationCredentials)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutVoiceConnectorTerminationCredentials
PutVoiceConnectorTerminationCredentialsResponse
PutVoiceConnectorTerminationCredentialsResponse'
instance
Prelude.Hashable
PutVoiceConnectorTerminationCredentials
instance
Prelude.NFData
PutVoiceConnectorTerminationCredentials
instance
Core.ToHeaders
PutVoiceConnectorTerminationCredentials
where
toHeaders :: PutVoiceConnectorTerminationCredentials -> [Header]
toHeaders = [Header] -> PutVoiceConnectorTerminationCredentials -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance
Core.ToJSON
PutVoiceConnectorTerminationCredentials
where
toJSON :: PutVoiceConnectorTerminationCredentials -> Value
toJSON PutVoiceConnectorTerminationCredentials' {Maybe [Credential]
Text
voiceConnectorId :: Text
credentials :: Maybe [Credential]
$sel:voiceConnectorId:PutVoiceConnectorTerminationCredentials' :: PutVoiceConnectorTerminationCredentials -> Text
$sel:credentials:PutVoiceConnectorTerminationCredentials' :: PutVoiceConnectorTerminationCredentials -> Maybe [Credential]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Credentials" Text -> [Credential] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Credential] -> Pair) -> Maybe [Credential] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Credential]
credentials]
)
instance
Core.ToPath
PutVoiceConnectorTerminationCredentials
where
toPath :: PutVoiceConnectorTerminationCredentials -> ByteString
toPath PutVoiceConnectorTerminationCredentials' {Maybe [Credential]
Text
voiceConnectorId :: Text
credentials :: Maybe [Credential]
$sel:voiceConnectorId:PutVoiceConnectorTerminationCredentials' :: PutVoiceConnectorTerminationCredentials -> Text
$sel:credentials:PutVoiceConnectorTerminationCredentials' :: PutVoiceConnectorTerminationCredentials -> Maybe [Credential]
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/voice-connectors/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
voiceConnectorId,
ByteString
"/termination/credentials"
]
instance
Core.ToQuery
PutVoiceConnectorTerminationCredentials
where
toQuery :: PutVoiceConnectorTerminationCredentials -> QueryString
toQuery =
QueryString
-> PutVoiceConnectorTerminationCredentials -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=put"])
data PutVoiceConnectorTerminationCredentialsResponse = PutVoiceConnectorTerminationCredentialsResponse'
{
}
deriving (PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool
(PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool)
-> (PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool)
-> Eq PutVoiceConnectorTerminationCredentialsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool
$c/= :: PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool
== :: PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool
$c== :: PutVoiceConnectorTerminationCredentialsResponse
-> PutVoiceConnectorTerminationCredentialsResponse -> Bool
Prelude.Eq, ReadPrec [PutVoiceConnectorTerminationCredentialsResponse]
ReadPrec PutVoiceConnectorTerminationCredentialsResponse
Int -> ReadS PutVoiceConnectorTerminationCredentialsResponse
ReadS [PutVoiceConnectorTerminationCredentialsResponse]
(Int -> ReadS PutVoiceConnectorTerminationCredentialsResponse)
-> ReadS [PutVoiceConnectorTerminationCredentialsResponse]
-> ReadPrec PutVoiceConnectorTerminationCredentialsResponse
-> ReadPrec [PutVoiceConnectorTerminationCredentialsResponse]
-> Read PutVoiceConnectorTerminationCredentialsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutVoiceConnectorTerminationCredentialsResponse]
$creadListPrec :: ReadPrec [PutVoiceConnectorTerminationCredentialsResponse]
readPrec :: ReadPrec PutVoiceConnectorTerminationCredentialsResponse
$creadPrec :: ReadPrec PutVoiceConnectorTerminationCredentialsResponse
readList :: ReadS [PutVoiceConnectorTerminationCredentialsResponse]
$creadList :: ReadS [PutVoiceConnectorTerminationCredentialsResponse]
readsPrec :: Int -> ReadS PutVoiceConnectorTerminationCredentialsResponse
$creadsPrec :: Int -> ReadS PutVoiceConnectorTerminationCredentialsResponse
Prelude.Read, Int -> PutVoiceConnectorTerminationCredentialsResponse -> ShowS
[PutVoiceConnectorTerminationCredentialsResponse] -> ShowS
PutVoiceConnectorTerminationCredentialsResponse -> String
(Int -> PutVoiceConnectorTerminationCredentialsResponse -> ShowS)
-> (PutVoiceConnectorTerminationCredentialsResponse -> String)
-> ([PutVoiceConnectorTerminationCredentialsResponse] -> ShowS)
-> Show PutVoiceConnectorTerminationCredentialsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutVoiceConnectorTerminationCredentialsResponse] -> ShowS
$cshowList :: [PutVoiceConnectorTerminationCredentialsResponse] -> ShowS
show :: PutVoiceConnectorTerminationCredentialsResponse -> String
$cshow :: PutVoiceConnectorTerminationCredentialsResponse -> String
showsPrec :: Int -> PutVoiceConnectorTerminationCredentialsResponse -> ShowS
$cshowsPrec :: Int -> PutVoiceConnectorTerminationCredentialsResponse -> ShowS
Prelude.Show, (forall x.
PutVoiceConnectorTerminationCredentialsResponse
-> Rep PutVoiceConnectorTerminationCredentialsResponse x)
-> (forall x.
Rep PutVoiceConnectorTerminationCredentialsResponse x
-> PutVoiceConnectorTerminationCredentialsResponse)
-> Generic PutVoiceConnectorTerminationCredentialsResponse
forall x.
Rep PutVoiceConnectorTerminationCredentialsResponse x
-> PutVoiceConnectorTerminationCredentialsResponse
forall x.
PutVoiceConnectorTerminationCredentialsResponse
-> Rep PutVoiceConnectorTerminationCredentialsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutVoiceConnectorTerminationCredentialsResponse x
-> PutVoiceConnectorTerminationCredentialsResponse
$cfrom :: forall x.
PutVoiceConnectorTerminationCredentialsResponse
-> Rep PutVoiceConnectorTerminationCredentialsResponse x
Prelude.Generic)
newPutVoiceConnectorTerminationCredentialsResponse ::
PutVoiceConnectorTerminationCredentialsResponse
newPutVoiceConnectorTerminationCredentialsResponse :: PutVoiceConnectorTerminationCredentialsResponse
newPutVoiceConnectorTerminationCredentialsResponse =
PutVoiceConnectorTerminationCredentialsResponse
PutVoiceConnectorTerminationCredentialsResponse'
instance
Prelude.NFData
PutVoiceConnectorTerminationCredentialsResponse