{-# 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.KinesisVideoSignaling.GetIceServerConfig
(
GetIceServerConfig (..),
newGetIceServerConfig,
getIceServerConfig_clientId,
getIceServerConfig_service,
getIceServerConfig_username,
getIceServerConfig_channelARN,
GetIceServerConfigResponse (..),
newGetIceServerConfigResponse,
getIceServerConfigResponse_iceServerList,
getIceServerConfigResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideoSignaling.Types
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 GetIceServerConfig = GetIceServerConfig'
{
GetIceServerConfig -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
GetIceServerConfig -> Maybe Service
service :: Prelude.Maybe Service,
GetIceServerConfig -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
GetIceServerConfig -> Text
channelARN :: Prelude.Text
}
deriving (GetIceServerConfig -> GetIceServerConfig -> Bool
(GetIceServerConfig -> GetIceServerConfig -> Bool)
-> (GetIceServerConfig -> GetIceServerConfig -> Bool)
-> Eq GetIceServerConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIceServerConfig -> GetIceServerConfig -> Bool
$c/= :: GetIceServerConfig -> GetIceServerConfig -> Bool
== :: GetIceServerConfig -> GetIceServerConfig -> Bool
$c== :: GetIceServerConfig -> GetIceServerConfig -> Bool
Prelude.Eq, ReadPrec [GetIceServerConfig]
ReadPrec GetIceServerConfig
Int -> ReadS GetIceServerConfig
ReadS [GetIceServerConfig]
(Int -> ReadS GetIceServerConfig)
-> ReadS [GetIceServerConfig]
-> ReadPrec GetIceServerConfig
-> ReadPrec [GetIceServerConfig]
-> Read GetIceServerConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIceServerConfig]
$creadListPrec :: ReadPrec [GetIceServerConfig]
readPrec :: ReadPrec GetIceServerConfig
$creadPrec :: ReadPrec GetIceServerConfig
readList :: ReadS [GetIceServerConfig]
$creadList :: ReadS [GetIceServerConfig]
readsPrec :: Int -> ReadS GetIceServerConfig
$creadsPrec :: Int -> ReadS GetIceServerConfig
Prelude.Read, Int -> GetIceServerConfig -> ShowS
[GetIceServerConfig] -> ShowS
GetIceServerConfig -> String
(Int -> GetIceServerConfig -> ShowS)
-> (GetIceServerConfig -> String)
-> ([GetIceServerConfig] -> ShowS)
-> Show GetIceServerConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIceServerConfig] -> ShowS
$cshowList :: [GetIceServerConfig] -> ShowS
show :: GetIceServerConfig -> String
$cshow :: GetIceServerConfig -> String
showsPrec :: Int -> GetIceServerConfig -> ShowS
$cshowsPrec :: Int -> GetIceServerConfig -> ShowS
Prelude.Show, (forall x. GetIceServerConfig -> Rep GetIceServerConfig x)
-> (forall x. Rep GetIceServerConfig x -> GetIceServerConfig)
-> Generic GetIceServerConfig
forall x. Rep GetIceServerConfig x -> GetIceServerConfig
forall x. GetIceServerConfig -> Rep GetIceServerConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIceServerConfig x -> GetIceServerConfig
$cfrom :: forall x. GetIceServerConfig -> Rep GetIceServerConfig x
Prelude.Generic)
newGetIceServerConfig ::
Prelude.Text ->
GetIceServerConfig
newGetIceServerConfig :: Text -> GetIceServerConfig
newGetIceServerConfig Text
pChannelARN_ =
GetIceServerConfig' :: Maybe Text
-> Maybe Service -> Maybe Text -> Text -> GetIceServerConfig
GetIceServerConfig'
{ $sel:clientId:GetIceServerConfig' :: Maybe Text
clientId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:service:GetIceServerConfig' :: Maybe Service
service = Maybe Service
forall a. Maybe a
Prelude.Nothing,
$sel:username:GetIceServerConfig' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:channelARN:GetIceServerConfig' :: Text
channelARN = Text
pChannelARN_
}
getIceServerConfig_clientId :: Lens.Lens' GetIceServerConfig (Prelude.Maybe Prelude.Text)
getIceServerConfig_clientId :: (Maybe Text -> f (Maybe Text))
-> GetIceServerConfig -> f GetIceServerConfig
getIceServerConfig_clientId = (GetIceServerConfig -> Maybe Text)
-> (GetIceServerConfig -> Maybe Text -> GetIceServerConfig)
-> Lens
GetIceServerConfig GetIceServerConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIceServerConfig' {Maybe Text
clientId :: Maybe Text
$sel:clientId:GetIceServerConfig' :: GetIceServerConfig -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: GetIceServerConfig
s@GetIceServerConfig' {} Maybe Text
a -> GetIceServerConfig
s {$sel:clientId:GetIceServerConfig' :: Maybe Text
clientId = Maybe Text
a} :: GetIceServerConfig)
getIceServerConfig_service :: Lens.Lens' GetIceServerConfig (Prelude.Maybe Service)
getIceServerConfig_service :: (Maybe Service -> f (Maybe Service))
-> GetIceServerConfig -> f GetIceServerConfig
getIceServerConfig_service = (GetIceServerConfig -> Maybe Service)
-> (GetIceServerConfig -> Maybe Service -> GetIceServerConfig)
-> Lens
GetIceServerConfig
GetIceServerConfig
(Maybe Service)
(Maybe Service)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIceServerConfig' {Maybe Service
service :: Maybe Service
$sel:service:GetIceServerConfig' :: GetIceServerConfig -> Maybe Service
service} -> Maybe Service
service) (\s :: GetIceServerConfig
s@GetIceServerConfig' {} Maybe Service
a -> GetIceServerConfig
s {$sel:service:GetIceServerConfig' :: Maybe Service
service = Maybe Service
a} :: GetIceServerConfig)
getIceServerConfig_username :: Lens.Lens' GetIceServerConfig (Prelude.Maybe Prelude.Text)
getIceServerConfig_username :: (Maybe Text -> f (Maybe Text))
-> GetIceServerConfig -> f GetIceServerConfig
getIceServerConfig_username = (GetIceServerConfig -> Maybe Text)
-> (GetIceServerConfig -> Maybe Text -> GetIceServerConfig)
-> Lens
GetIceServerConfig GetIceServerConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIceServerConfig' {Maybe Text
username :: Maybe Text
$sel:username:GetIceServerConfig' :: GetIceServerConfig -> Maybe Text
username} -> Maybe Text
username) (\s :: GetIceServerConfig
s@GetIceServerConfig' {} Maybe Text
a -> GetIceServerConfig
s {$sel:username:GetIceServerConfig' :: Maybe Text
username = Maybe Text
a} :: GetIceServerConfig)
getIceServerConfig_channelARN :: Lens.Lens' GetIceServerConfig Prelude.Text
getIceServerConfig_channelARN :: (Text -> f Text) -> GetIceServerConfig -> f GetIceServerConfig
getIceServerConfig_channelARN = (GetIceServerConfig -> Text)
-> (GetIceServerConfig -> Text -> GetIceServerConfig)
-> Lens GetIceServerConfig GetIceServerConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIceServerConfig' {Text
channelARN :: Text
$sel:channelARN:GetIceServerConfig' :: GetIceServerConfig -> Text
channelARN} -> Text
channelARN) (\s :: GetIceServerConfig
s@GetIceServerConfig' {} Text
a -> GetIceServerConfig
s {$sel:channelARN:GetIceServerConfig' :: Text
channelARN = Text
a} :: GetIceServerConfig)
instance Core.AWSRequest GetIceServerConfig where
type
AWSResponse GetIceServerConfig =
GetIceServerConfigResponse
request :: GetIceServerConfig -> Request GetIceServerConfig
request = Service -> GetIceServerConfig -> Request GetIceServerConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetIceServerConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetIceServerConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetIceServerConfig))
-> Logger
-> Service
-> Proxy GetIceServerConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetIceServerConfig)))
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 [IceServer] -> Int -> GetIceServerConfigResponse
GetIceServerConfigResponse'
(Maybe [IceServer] -> Int -> GetIceServerConfigResponse)
-> Either String (Maybe [IceServer])
-> Either String (Int -> GetIceServerConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [IceServer]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IceServerList" Either String (Maybe (Maybe [IceServer]))
-> Maybe [IceServer] -> Either String (Maybe [IceServer])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [IceServer]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetIceServerConfigResponse)
-> Either String Int -> Either String GetIceServerConfigResponse
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 GetIceServerConfig
instance Prelude.NFData GetIceServerConfig
instance Core.ToHeaders GetIceServerConfig where
toHeaders :: GetIceServerConfig -> ResponseHeaders
toHeaders = ResponseHeaders -> GetIceServerConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON GetIceServerConfig where
toJSON :: GetIceServerConfig -> Value
toJSON GetIceServerConfig' {Maybe Text
Maybe Service
Text
channelARN :: Text
username :: Maybe Text
service :: Maybe Service
clientId :: Maybe Text
$sel:channelARN:GetIceServerConfig' :: GetIceServerConfig -> Text
$sel:username:GetIceServerConfig' :: GetIceServerConfig -> Maybe Text
$sel:service:GetIceServerConfig' :: GetIceServerConfig -> Maybe Service
$sel:clientId:GetIceServerConfig' :: GetIceServerConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ClientId" 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
clientId,
(Text
"Service" Text -> Service -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Service -> Pair) -> Maybe Service -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Service
service,
(Text
"Username" 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
username,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ChannelARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
channelARN)
]
)
instance Core.ToPath GetIceServerConfig where
toPath :: GetIceServerConfig -> ByteString
toPath = ByteString -> GetIceServerConfig -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/get-ice-server-config"
instance Core.ToQuery GetIceServerConfig where
toQuery :: GetIceServerConfig -> QueryString
toQuery = QueryString -> GetIceServerConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetIceServerConfigResponse = GetIceServerConfigResponse'
{
GetIceServerConfigResponse -> Maybe [IceServer]
iceServerList :: Prelude.Maybe [IceServer],
GetIceServerConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetIceServerConfigResponse -> GetIceServerConfigResponse -> Bool
(GetIceServerConfigResponse -> GetIceServerConfigResponse -> Bool)
-> (GetIceServerConfigResponse
-> GetIceServerConfigResponse -> Bool)
-> Eq GetIceServerConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIceServerConfigResponse -> GetIceServerConfigResponse -> Bool
$c/= :: GetIceServerConfigResponse -> GetIceServerConfigResponse -> Bool
== :: GetIceServerConfigResponse -> GetIceServerConfigResponse -> Bool
$c== :: GetIceServerConfigResponse -> GetIceServerConfigResponse -> Bool
Prelude.Eq, ReadPrec [GetIceServerConfigResponse]
ReadPrec GetIceServerConfigResponse
Int -> ReadS GetIceServerConfigResponse
ReadS [GetIceServerConfigResponse]
(Int -> ReadS GetIceServerConfigResponse)
-> ReadS [GetIceServerConfigResponse]
-> ReadPrec GetIceServerConfigResponse
-> ReadPrec [GetIceServerConfigResponse]
-> Read GetIceServerConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIceServerConfigResponse]
$creadListPrec :: ReadPrec [GetIceServerConfigResponse]
readPrec :: ReadPrec GetIceServerConfigResponse
$creadPrec :: ReadPrec GetIceServerConfigResponse
readList :: ReadS [GetIceServerConfigResponse]
$creadList :: ReadS [GetIceServerConfigResponse]
readsPrec :: Int -> ReadS GetIceServerConfigResponse
$creadsPrec :: Int -> ReadS GetIceServerConfigResponse
Prelude.Read, Int -> GetIceServerConfigResponse -> ShowS
[GetIceServerConfigResponse] -> ShowS
GetIceServerConfigResponse -> String
(Int -> GetIceServerConfigResponse -> ShowS)
-> (GetIceServerConfigResponse -> String)
-> ([GetIceServerConfigResponse] -> ShowS)
-> Show GetIceServerConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIceServerConfigResponse] -> ShowS
$cshowList :: [GetIceServerConfigResponse] -> ShowS
show :: GetIceServerConfigResponse -> String
$cshow :: GetIceServerConfigResponse -> String
showsPrec :: Int -> GetIceServerConfigResponse -> ShowS
$cshowsPrec :: Int -> GetIceServerConfigResponse -> ShowS
Prelude.Show, (forall x.
GetIceServerConfigResponse -> Rep GetIceServerConfigResponse x)
-> (forall x.
Rep GetIceServerConfigResponse x -> GetIceServerConfigResponse)
-> Generic GetIceServerConfigResponse
forall x.
Rep GetIceServerConfigResponse x -> GetIceServerConfigResponse
forall x.
GetIceServerConfigResponse -> Rep GetIceServerConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetIceServerConfigResponse x -> GetIceServerConfigResponse
$cfrom :: forall x.
GetIceServerConfigResponse -> Rep GetIceServerConfigResponse x
Prelude.Generic)
newGetIceServerConfigResponse ::
Prelude.Int ->
GetIceServerConfigResponse
newGetIceServerConfigResponse :: Int -> GetIceServerConfigResponse
newGetIceServerConfigResponse Int
pHttpStatus_ =
GetIceServerConfigResponse' :: Maybe [IceServer] -> Int -> GetIceServerConfigResponse
GetIceServerConfigResponse'
{ $sel:iceServerList:GetIceServerConfigResponse' :: Maybe [IceServer]
iceServerList =
Maybe [IceServer]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetIceServerConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getIceServerConfigResponse_iceServerList :: Lens.Lens' GetIceServerConfigResponse (Prelude.Maybe [IceServer])
getIceServerConfigResponse_iceServerList :: (Maybe [IceServer] -> f (Maybe [IceServer]))
-> GetIceServerConfigResponse -> f GetIceServerConfigResponse
getIceServerConfigResponse_iceServerList = (GetIceServerConfigResponse -> Maybe [IceServer])
-> (GetIceServerConfigResponse
-> Maybe [IceServer] -> GetIceServerConfigResponse)
-> Lens
GetIceServerConfigResponse
GetIceServerConfigResponse
(Maybe [IceServer])
(Maybe [IceServer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIceServerConfigResponse' {Maybe [IceServer]
iceServerList :: Maybe [IceServer]
$sel:iceServerList:GetIceServerConfigResponse' :: GetIceServerConfigResponse -> Maybe [IceServer]
iceServerList} -> Maybe [IceServer]
iceServerList) (\s :: GetIceServerConfigResponse
s@GetIceServerConfigResponse' {} Maybe [IceServer]
a -> GetIceServerConfigResponse
s {$sel:iceServerList:GetIceServerConfigResponse' :: Maybe [IceServer]
iceServerList = Maybe [IceServer]
a} :: GetIceServerConfigResponse) ((Maybe [IceServer] -> f (Maybe [IceServer]))
-> GetIceServerConfigResponse -> f GetIceServerConfigResponse)
-> ((Maybe [IceServer] -> f (Maybe [IceServer]))
-> Maybe [IceServer] -> f (Maybe [IceServer]))
-> (Maybe [IceServer] -> f (Maybe [IceServer]))
-> GetIceServerConfigResponse
-> f GetIceServerConfigResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IceServer] [IceServer] [IceServer] [IceServer]
-> Iso
(Maybe [IceServer])
(Maybe [IceServer])
(Maybe [IceServer])
(Maybe [IceServer])
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 [IceServer] [IceServer] [IceServer] [IceServer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getIceServerConfigResponse_httpStatus :: Lens.Lens' GetIceServerConfigResponse Prelude.Int
getIceServerConfigResponse_httpStatus :: (Int -> f Int)
-> GetIceServerConfigResponse -> f GetIceServerConfigResponse
getIceServerConfigResponse_httpStatus = (GetIceServerConfigResponse -> Int)
-> (GetIceServerConfigResponse
-> Int -> GetIceServerConfigResponse)
-> Lens
GetIceServerConfigResponse GetIceServerConfigResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIceServerConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetIceServerConfigResponse' :: GetIceServerConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetIceServerConfigResponse
s@GetIceServerConfigResponse' {} Int
a -> GetIceServerConfigResponse
s {$sel:httpStatus:GetIceServerConfigResponse' :: Int
httpStatus = Int
a} :: GetIceServerConfigResponse)
instance Prelude.NFData GetIceServerConfigResponse