{-# 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.UpdateSipMediaApplication
(
UpdateSipMediaApplication (..),
newUpdateSipMediaApplication,
updateSipMediaApplication_name,
updateSipMediaApplication_endpoints,
updateSipMediaApplication_sipMediaApplicationId,
UpdateSipMediaApplicationResponse (..),
newUpdateSipMediaApplicationResponse,
updateSipMediaApplicationResponse_sipMediaApplication,
updateSipMediaApplicationResponse_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
data UpdateSipMediaApplication = UpdateSipMediaApplication'
{
UpdateSipMediaApplication -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateSipMediaApplication
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints :: Prelude.Maybe (Prelude.NonEmpty SipMediaApplicationEndpoint),
UpdateSipMediaApplication -> Text
sipMediaApplicationId :: Prelude.Text
}
deriving (UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool
(UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool)
-> (UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool)
-> Eq UpdateSipMediaApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool
$c/= :: UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool
== :: UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool
$c== :: UpdateSipMediaApplication -> UpdateSipMediaApplication -> Bool
Prelude.Eq, Int -> UpdateSipMediaApplication -> ShowS
[UpdateSipMediaApplication] -> ShowS
UpdateSipMediaApplication -> String
(Int -> UpdateSipMediaApplication -> ShowS)
-> (UpdateSipMediaApplication -> String)
-> ([UpdateSipMediaApplication] -> ShowS)
-> Show UpdateSipMediaApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSipMediaApplication] -> ShowS
$cshowList :: [UpdateSipMediaApplication] -> ShowS
show :: UpdateSipMediaApplication -> String
$cshow :: UpdateSipMediaApplication -> String
showsPrec :: Int -> UpdateSipMediaApplication -> ShowS
$cshowsPrec :: Int -> UpdateSipMediaApplication -> ShowS
Prelude.Show, (forall x.
UpdateSipMediaApplication -> Rep UpdateSipMediaApplication x)
-> (forall x.
Rep UpdateSipMediaApplication x -> UpdateSipMediaApplication)
-> Generic UpdateSipMediaApplication
forall x.
Rep UpdateSipMediaApplication x -> UpdateSipMediaApplication
forall x.
UpdateSipMediaApplication -> Rep UpdateSipMediaApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSipMediaApplication x -> UpdateSipMediaApplication
$cfrom :: forall x.
UpdateSipMediaApplication -> Rep UpdateSipMediaApplication x
Prelude.Generic)
newUpdateSipMediaApplication ::
Prelude.Text ->
UpdateSipMediaApplication
newUpdateSipMediaApplication :: Text -> UpdateSipMediaApplication
newUpdateSipMediaApplication Text
pSipMediaApplicationId_ =
UpdateSipMediaApplication' :: Maybe Text
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
-> Text
-> UpdateSipMediaApplication
UpdateSipMediaApplication'
{ $sel:name:UpdateSipMediaApplication' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoints:UpdateSipMediaApplication' :: Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints = Maybe (NonEmpty SipMediaApplicationEndpoint)
forall a. Maybe a
Prelude.Nothing,
$sel:sipMediaApplicationId:UpdateSipMediaApplication' :: Text
sipMediaApplicationId = Text
pSipMediaApplicationId_
}
updateSipMediaApplication_name :: Lens.Lens' UpdateSipMediaApplication (Prelude.Maybe Prelude.Text)
updateSipMediaApplication_name :: (Maybe Text -> f (Maybe Text))
-> UpdateSipMediaApplication -> f UpdateSipMediaApplication
updateSipMediaApplication_name = (UpdateSipMediaApplication -> Maybe Text)
-> (UpdateSipMediaApplication
-> Maybe Text -> UpdateSipMediaApplication)
-> Lens
UpdateSipMediaApplication
UpdateSipMediaApplication
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplication' {Maybe Text
name :: Maybe Text
$sel:name:UpdateSipMediaApplication' :: UpdateSipMediaApplication -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateSipMediaApplication
s@UpdateSipMediaApplication' {} Maybe Text
a -> UpdateSipMediaApplication
s {$sel:name:UpdateSipMediaApplication' :: Maybe Text
name = Maybe Text
a} :: UpdateSipMediaApplication)
updateSipMediaApplication_endpoints :: Lens.Lens' UpdateSipMediaApplication (Prelude.Maybe (Prelude.NonEmpty SipMediaApplicationEndpoint))
updateSipMediaApplication_endpoints :: (Maybe (NonEmpty SipMediaApplicationEndpoint)
-> f (Maybe (NonEmpty SipMediaApplicationEndpoint)))
-> UpdateSipMediaApplication -> f UpdateSipMediaApplication
updateSipMediaApplication_endpoints = (UpdateSipMediaApplication
-> Maybe (NonEmpty SipMediaApplicationEndpoint))
-> (UpdateSipMediaApplication
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
-> UpdateSipMediaApplication)
-> Lens
UpdateSipMediaApplication
UpdateSipMediaApplication
(Maybe (NonEmpty SipMediaApplicationEndpoint))
(Maybe (NonEmpty SipMediaApplicationEndpoint))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplication' {Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints :: Maybe (NonEmpty SipMediaApplicationEndpoint)
$sel:endpoints:UpdateSipMediaApplication' :: UpdateSipMediaApplication
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints} -> Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints) (\s :: UpdateSipMediaApplication
s@UpdateSipMediaApplication' {} Maybe (NonEmpty SipMediaApplicationEndpoint)
a -> UpdateSipMediaApplication
s {$sel:endpoints:UpdateSipMediaApplication' :: Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints = Maybe (NonEmpty SipMediaApplicationEndpoint)
a} :: UpdateSipMediaApplication) ((Maybe (NonEmpty SipMediaApplicationEndpoint)
-> f (Maybe (NonEmpty SipMediaApplicationEndpoint)))
-> UpdateSipMediaApplication -> f UpdateSipMediaApplication)
-> ((Maybe (NonEmpty SipMediaApplicationEndpoint)
-> f (Maybe (NonEmpty SipMediaApplicationEndpoint)))
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
-> f (Maybe (NonEmpty SipMediaApplicationEndpoint)))
-> (Maybe (NonEmpty SipMediaApplicationEndpoint)
-> f (Maybe (NonEmpty SipMediaApplicationEndpoint)))
-> UpdateSipMediaApplication
-> f UpdateSipMediaApplication
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty SipMediaApplicationEndpoint)
(NonEmpty SipMediaApplicationEndpoint)
(NonEmpty SipMediaApplicationEndpoint)
(NonEmpty SipMediaApplicationEndpoint)
-> Iso
(Maybe (NonEmpty SipMediaApplicationEndpoint))
(Maybe (NonEmpty SipMediaApplicationEndpoint))
(Maybe (NonEmpty SipMediaApplicationEndpoint))
(Maybe (NonEmpty SipMediaApplicationEndpoint))
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
(NonEmpty SipMediaApplicationEndpoint)
(NonEmpty SipMediaApplicationEndpoint)
(NonEmpty SipMediaApplicationEndpoint)
(NonEmpty SipMediaApplicationEndpoint)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateSipMediaApplication_sipMediaApplicationId :: Lens.Lens' UpdateSipMediaApplication Prelude.Text
updateSipMediaApplication_sipMediaApplicationId :: (Text -> f Text)
-> UpdateSipMediaApplication -> f UpdateSipMediaApplication
updateSipMediaApplication_sipMediaApplicationId = (UpdateSipMediaApplication -> Text)
-> (UpdateSipMediaApplication -> Text -> UpdateSipMediaApplication)
-> Lens
UpdateSipMediaApplication UpdateSipMediaApplication Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplication' {Text
sipMediaApplicationId :: Text
$sel:sipMediaApplicationId:UpdateSipMediaApplication' :: UpdateSipMediaApplication -> Text
sipMediaApplicationId} -> Text
sipMediaApplicationId) (\s :: UpdateSipMediaApplication
s@UpdateSipMediaApplication' {} Text
a -> UpdateSipMediaApplication
s {$sel:sipMediaApplicationId:UpdateSipMediaApplication' :: Text
sipMediaApplicationId = Text
a} :: UpdateSipMediaApplication)
instance Core.AWSRequest UpdateSipMediaApplication where
type
AWSResponse UpdateSipMediaApplication =
UpdateSipMediaApplicationResponse
request :: UpdateSipMediaApplication -> Request UpdateSipMediaApplication
request = Service
-> UpdateSipMediaApplication -> Request UpdateSipMediaApplication
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateSipMediaApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateSipMediaApplication)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateSipMediaApplication))
-> Logger
-> Service
-> Proxy UpdateSipMediaApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateSipMediaApplication)))
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 SipMediaApplication
-> Int -> UpdateSipMediaApplicationResponse
UpdateSipMediaApplicationResponse'
(Maybe SipMediaApplication
-> Int -> UpdateSipMediaApplicationResponse)
-> Either String (Maybe SipMediaApplication)
-> Either String (Int -> UpdateSipMediaApplicationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SipMediaApplication)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SipMediaApplication")
Either String (Int -> UpdateSipMediaApplicationResponse)
-> Either String Int
-> Either String UpdateSipMediaApplicationResponse
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 UpdateSipMediaApplication
instance Prelude.NFData UpdateSipMediaApplication
instance Core.ToHeaders UpdateSipMediaApplication where
toHeaders :: UpdateSipMediaApplication -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateSipMediaApplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateSipMediaApplication where
toJSON :: UpdateSipMediaApplication -> Value
toJSON UpdateSipMediaApplication' {Maybe (NonEmpty SipMediaApplicationEndpoint)
Maybe Text
Text
sipMediaApplicationId :: Text
endpoints :: Maybe (NonEmpty SipMediaApplicationEndpoint)
name :: Maybe Text
$sel:sipMediaApplicationId:UpdateSipMediaApplication' :: UpdateSipMediaApplication -> Text
$sel:endpoints:UpdateSipMediaApplication' :: UpdateSipMediaApplication
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
$sel:name:UpdateSipMediaApplication' :: UpdateSipMediaApplication -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Name" 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
name,
(Text
"Endpoints" Text -> NonEmpty SipMediaApplicationEndpoint -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty SipMediaApplicationEndpoint -> Pair)
-> Maybe (NonEmpty SipMediaApplicationEndpoint) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty SipMediaApplicationEndpoint)
endpoints
]
)
instance Core.ToPath UpdateSipMediaApplication where
toPath :: UpdateSipMediaApplication -> ByteString
toPath UpdateSipMediaApplication' {Maybe (NonEmpty SipMediaApplicationEndpoint)
Maybe Text
Text
sipMediaApplicationId :: Text
endpoints :: Maybe (NonEmpty SipMediaApplicationEndpoint)
name :: Maybe Text
$sel:sipMediaApplicationId:UpdateSipMediaApplication' :: UpdateSipMediaApplication -> Text
$sel:endpoints:UpdateSipMediaApplication' :: UpdateSipMediaApplication
-> Maybe (NonEmpty SipMediaApplicationEndpoint)
$sel:name:UpdateSipMediaApplication' :: UpdateSipMediaApplication -> Maybe 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
]
instance Core.ToQuery UpdateSipMediaApplication where
toQuery :: UpdateSipMediaApplication -> QueryString
toQuery = QueryString -> UpdateSipMediaApplication -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateSipMediaApplicationResponse = UpdateSipMediaApplicationResponse'
{
UpdateSipMediaApplicationResponse -> Maybe SipMediaApplication
sipMediaApplication :: Prelude.Maybe SipMediaApplication,
UpdateSipMediaApplicationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool
(UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool)
-> (UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool)
-> Eq UpdateSipMediaApplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool
$c/= :: UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool
== :: UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool
$c== :: UpdateSipMediaApplicationResponse
-> UpdateSipMediaApplicationResponse -> Bool
Prelude.Eq, Int -> UpdateSipMediaApplicationResponse -> ShowS
[UpdateSipMediaApplicationResponse] -> ShowS
UpdateSipMediaApplicationResponse -> String
(Int -> UpdateSipMediaApplicationResponse -> ShowS)
-> (UpdateSipMediaApplicationResponse -> String)
-> ([UpdateSipMediaApplicationResponse] -> ShowS)
-> Show UpdateSipMediaApplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSipMediaApplicationResponse] -> ShowS
$cshowList :: [UpdateSipMediaApplicationResponse] -> ShowS
show :: UpdateSipMediaApplicationResponse -> String
$cshow :: UpdateSipMediaApplicationResponse -> String
showsPrec :: Int -> UpdateSipMediaApplicationResponse -> ShowS
$cshowsPrec :: Int -> UpdateSipMediaApplicationResponse -> ShowS
Prelude.Show, (forall x.
UpdateSipMediaApplicationResponse
-> Rep UpdateSipMediaApplicationResponse x)
-> (forall x.
Rep UpdateSipMediaApplicationResponse x
-> UpdateSipMediaApplicationResponse)
-> Generic UpdateSipMediaApplicationResponse
forall x.
Rep UpdateSipMediaApplicationResponse x
-> UpdateSipMediaApplicationResponse
forall x.
UpdateSipMediaApplicationResponse
-> Rep UpdateSipMediaApplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSipMediaApplicationResponse x
-> UpdateSipMediaApplicationResponse
$cfrom :: forall x.
UpdateSipMediaApplicationResponse
-> Rep UpdateSipMediaApplicationResponse x
Prelude.Generic)
newUpdateSipMediaApplicationResponse ::
Prelude.Int ->
UpdateSipMediaApplicationResponse
newUpdateSipMediaApplicationResponse :: Int -> UpdateSipMediaApplicationResponse
newUpdateSipMediaApplicationResponse Int
pHttpStatus_ =
UpdateSipMediaApplicationResponse' :: Maybe SipMediaApplication
-> Int -> UpdateSipMediaApplicationResponse
UpdateSipMediaApplicationResponse'
{ $sel:sipMediaApplication:UpdateSipMediaApplicationResponse' :: Maybe SipMediaApplication
sipMediaApplication =
Maybe SipMediaApplication
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateSipMediaApplicationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateSipMediaApplicationResponse_sipMediaApplication :: Lens.Lens' UpdateSipMediaApplicationResponse (Prelude.Maybe SipMediaApplication)
updateSipMediaApplicationResponse_sipMediaApplication :: (Maybe SipMediaApplication -> f (Maybe SipMediaApplication))
-> UpdateSipMediaApplicationResponse
-> f UpdateSipMediaApplicationResponse
updateSipMediaApplicationResponse_sipMediaApplication = (UpdateSipMediaApplicationResponse -> Maybe SipMediaApplication)
-> (UpdateSipMediaApplicationResponse
-> Maybe SipMediaApplication -> UpdateSipMediaApplicationResponse)
-> Lens
UpdateSipMediaApplicationResponse
UpdateSipMediaApplicationResponse
(Maybe SipMediaApplication)
(Maybe SipMediaApplication)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplicationResponse' {Maybe SipMediaApplication
sipMediaApplication :: Maybe SipMediaApplication
$sel:sipMediaApplication:UpdateSipMediaApplicationResponse' :: UpdateSipMediaApplicationResponse -> Maybe SipMediaApplication
sipMediaApplication} -> Maybe SipMediaApplication
sipMediaApplication) (\s :: UpdateSipMediaApplicationResponse
s@UpdateSipMediaApplicationResponse' {} Maybe SipMediaApplication
a -> UpdateSipMediaApplicationResponse
s {$sel:sipMediaApplication:UpdateSipMediaApplicationResponse' :: Maybe SipMediaApplication
sipMediaApplication = Maybe SipMediaApplication
a} :: UpdateSipMediaApplicationResponse)
updateSipMediaApplicationResponse_httpStatus :: Lens.Lens' UpdateSipMediaApplicationResponse Prelude.Int
updateSipMediaApplicationResponse_httpStatus :: (Int -> f Int)
-> UpdateSipMediaApplicationResponse
-> f UpdateSipMediaApplicationResponse
updateSipMediaApplicationResponse_httpStatus = (UpdateSipMediaApplicationResponse -> Int)
-> (UpdateSipMediaApplicationResponse
-> Int -> UpdateSipMediaApplicationResponse)
-> Lens
UpdateSipMediaApplicationResponse
UpdateSipMediaApplicationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSipMediaApplicationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSipMediaApplicationResponse' :: UpdateSipMediaApplicationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSipMediaApplicationResponse
s@UpdateSipMediaApplicationResponse' {} Int
a -> UpdateSipMediaApplicationResponse
s {$sel:httpStatus:UpdateSipMediaApplicationResponse' :: Int
httpStatus = Int
a} :: UpdateSipMediaApplicationResponse)
instance
Prelude.NFData
UpdateSipMediaApplicationResponse