{-# 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.KinesisVideo.GetDataEndpoint
(
GetDataEndpoint (..),
newGetDataEndpoint,
getDataEndpoint_streamARN,
getDataEndpoint_streamName,
getDataEndpoint_aPIName,
GetDataEndpointResponse (..),
newGetDataEndpointResponse,
getDataEndpointResponse_dataEndpoint,
getDataEndpointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideo.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 GetDataEndpoint = GetDataEndpoint'
{
GetDataEndpoint -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
GetDataEndpoint -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
GetDataEndpoint -> APIName
aPIName :: APIName
}
deriving (GetDataEndpoint -> GetDataEndpoint -> Bool
(GetDataEndpoint -> GetDataEndpoint -> Bool)
-> (GetDataEndpoint -> GetDataEndpoint -> Bool)
-> Eq GetDataEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDataEndpoint -> GetDataEndpoint -> Bool
$c/= :: GetDataEndpoint -> GetDataEndpoint -> Bool
== :: GetDataEndpoint -> GetDataEndpoint -> Bool
$c== :: GetDataEndpoint -> GetDataEndpoint -> Bool
Prelude.Eq, ReadPrec [GetDataEndpoint]
ReadPrec GetDataEndpoint
Int -> ReadS GetDataEndpoint
ReadS [GetDataEndpoint]
(Int -> ReadS GetDataEndpoint)
-> ReadS [GetDataEndpoint]
-> ReadPrec GetDataEndpoint
-> ReadPrec [GetDataEndpoint]
-> Read GetDataEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDataEndpoint]
$creadListPrec :: ReadPrec [GetDataEndpoint]
readPrec :: ReadPrec GetDataEndpoint
$creadPrec :: ReadPrec GetDataEndpoint
readList :: ReadS [GetDataEndpoint]
$creadList :: ReadS [GetDataEndpoint]
readsPrec :: Int -> ReadS GetDataEndpoint
$creadsPrec :: Int -> ReadS GetDataEndpoint
Prelude.Read, Int -> GetDataEndpoint -> ShowS
[GetDataEndpoint] -> ShowS
GetDataEndpoint -> String
(Int -> GetDataEndpoint -> ShowS)
-> (GetDataEndpoint -> String)
-> ([GetDataEndpoint] -> ShowS)
-> Show GetDataEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDataEndpoint] -> ShowS
$cshowList :: [GetDataEndpoint] -> ShowS
show :: GetDataEndpoint -> String
$cshow :: GetDataEndpoint -> String
showsPrec :: Int -> GetDataEndpoint -> ShowS
$cshowsPrec :: Int -> GetDataEndpoint -> ShowS
Prelude.Show, (forall x. GetDataEndpoint -> Rep GetDataEndpoint x)
-> (forall x. Rep GetDataEndpoint x -> GetDataEndpoint)
-> Generic GetDataEndpoint
forall x. Rep GetDataEndpoint x -> GetDataEndpoint
forall x. GetDataEndpoint -> Rep GetDataEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDataEndpoint x -> GetDataEndpoint
$cfrom :: forall x. GetDataEndpoint -> Rep GetDataEndpoint x
Prelude.Generic)
newGetDataEndpoint ::
APIName ->
GetDataEndpoint
newGetDataEndpoint :: APIName -> GetDataEndpoint
newGetDataEndpoint APIName
pAPIName_ =
GetDataEndpoint' :: Maybe Text -> Maybe Text -> APIName -> GetDataEndpoint
GetDataEndpoint'
{ $sel:streamARN:GetDataEndpoint' :: Maybe Text
streamARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:GetDataEndpoint' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aPIName:GetDataEndpoint' :: APIName
aPIName = APIName
pAPIName_
}
getDataEndpoint_streamARN :: Lens.Lens' GetDataEndpoint (Prelude.Maybe Prelude.Text)
getDataEndpoint_streamARN :: (Maybe Text -> f (Maybe Text))
-> GetDataEndpoint -> f GetDataEndpoint
getDataEndpoint_streamARN = (GetDataEndpoint -> Maybe Text)
-> (GetDataEndpoint -> Maybe Text -> GetDataEndpoint)
-> Lens GetDataEndpoint GetDataEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataEndpoint' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:GetDataEndpoint' :: GetDataEndpoint -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: GetDataEndpoint
s@GetDataEndpoint' {} Maybe Text
a -> GetDataEndpoint
s {$sel:streamARN:GetDataEndpoint' :: Maybe Text
streamARN = Maybe Text
a} :: GetDataEndpoint)
getDataEndpoint_streamName :: Lens.Lens' GetDataEndpoint (Prelude.Maybe Prelude.Text)
getDataEndpoint_streamName :: (Maybe Text -> f (Maybe Text))
-> GetDataEndpoint -> f GetDataEndpoint
getDataEndpoint_streamName = (GetDataEndpoint -> Maybe Text)
-> (GetDataEndpoint -> Maybe Text -> GetDataEndpoint)
-> Lens GetDataEndpoint GetDataEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataEndpoint' {Maybe Text
streamName :: Maybe Text
$sel:streamName:GetDataEndpoint' :: GetDataEndpoint -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: GetDataEndpoint
s@GetDataEndpoint' {} Maybe Text
a -> GetDataEndpoint
s {$sel:streamName:GetDataEndpoint' :: Maybe Text
streamName = Maybe Text
a} :: GetDataEndpoint)
getDataEndpoint_aPIName :: Lens.Lens' GetDataEndpoint APIName
getDataEndpoint_aPIName :: (APIName -> f APIName) -> GetDataEndpoint -> f GetDataEndpoint
getDataEndpoint_aPIName = (GetDataEndpoint -> APIName)
-> (GetDataEndpoint -> APIName -> GetDataEndpoint)
-> Lens GetDataEndpoint GetDataEndpoint APIName APIName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataEndpoint' {APIName
aPIName :: APIName
$sel:aPIName:GetDataEndpoint' :: GetDataEndpoint -> APIName
aPIName} -> APIName
aPIName) (\s :: GetDataEndpoint
s@GetDataEndpoint' {} APIName
a -> GetDataEndpoint
s {$sel:aPIName:GetDataEndpoint' :: APIName
aPIName = APIName
a} :: GetDataEndpoint)
instance Core.AWSRequest GetDataEndpoint where
type
AWSResponse GetDataEndpoint =
GetDataEndpointResponse
request :: GetDataEndpoint -> Request GetDataEndpoint
request = Service -> GetDataEndpoint -> Request GetDataEndpoint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetDataEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDataEndpoint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDataEndpoint))
-> Logger
-> Service
-> Proxy GetDataEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDataEndpoint)))
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 Text -> Int -> GetDataEndpointResponse
GetDataEndpointResponse'
(Maybe Text -> Int -> GetDataEndpointResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetDataEndpointResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DataEndpoint")
Either String (Int -> GetDataEndpointResponse)
-> Either String Int -> Either String GetDataEndpointResponse
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 GetDataEndpoint
instance Prelude.NFData GetDataEndpoint
instance Core.ToHeaders GetDataEndpoint where
toHeaders :: GetDataEndpoint -> ResponseHeaders
toHeaders = ResponseHeaders -> GetDataEndpoint -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON GetDataEndpoint where
toJSON :: GetDataEndpoint -> Value
toJSON GetDataEndpoint' {Maybe Text
APIName
aPIName :: APIName
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:aPIName:GetDataEndpoint' :: GetDataEndpoint -> APIName
$sel:streamName:GetDataEndpoint' :: GetDataEndpoint -> Maybe Text
$sel:streamARN:GetDataEndpoint' :: GetDataEndpoint -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StreamARN" 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
streamARN,
(Text
"StreamName" 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
streamName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"APIName" Text -> APIName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= APIName
aPIName)
]
)
instance Core.ToPath GetDataEndpoint where
toPath :: GetDataEndpoint -> ByteString
toPath = ByteString -> GetDataEndpoint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/getDataEndpoint"
instance Core.ToQuery GetDataEndpoint where
toQuery :: GetDataEndpoint -> QueryString
toQuery = QueryString -> GetDataEndpoint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetDataEndpointResponse = GetDataEndpointResponse'
{
GetDataEndpointResponse -> Maybe Text
dataEndpoint :: Prelude.Maybe Prelude.Text,
GetDataEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDataEndpointResponse -> GetDataEndpointResponse -> Bool
(GetDataEndpointResponse -> GetDataEndpointResponse -> Bool)
-> (GetDataEndpointResponse -> GetDataEndpointResponse -> Bool)
-> Eq GetDataEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDataEndpointResponse -> GetDataEndpointResponse -> Bool
$c/= :: GetDataEndpointResponse -> GetDataEndpointResponse -> Bool
== :: GetDataEndpointResponse -> GetDataEndpointResponse -> Bool
$c== :: GetDataEndpointResponse -> GetDataEndpointResponse -> Bool
Prelude.Eq, ReadPrec [GetDataEndpointResponse]
ReadPrec GetDataEndpointResponse
Int -> ReadS GetDataEndpointResponse
ReadS [GetDataEndpointResponse]
(Int -> ReadS GetDataEndpointResponse)
-> ReadS [GetDataEndpointResponse]
-> ReadPrec GetDataEndpointResponse
-> ReadPrec [GetDataEndpointResponse]
-> Read GetDataEndpointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDataEndpointResponse]
$creadListPrec :: ReadPrec [GetDataEndpointResponse]
readPrec :: ReadPrec GetDataEndpointResponse
$creadPrec :: ReadPrec GetDataEndpointResponse
readList :: ReadS [GetDataEndpointResponse]
$creadList :: ReadS [GetDataEndpointResponse]
readsPrec :: Int -> ReadS GetDataEndpointResponse
$creadsPrec :: Int -> ReadS GetDataEndpointResponse
Prelude.Read, Int -> GetDataEndpointResponse -> ShowS
[GetDataEndpointResponse] -> ShowS
GetDataEndpointResponse -> String
(Int -> GetDataEndpointResponse -> ShowS)
-> (GetDataEndpointResponse -> String)
-> ([GetDataEndpointResponse] -> ShowS)
-> Show GetDataEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDataEndpointResponse] -> ShowS
$cshowList :: [GetDataEndpointResponse] -> ShowS
show :: GetDataEndpointResponse -> String
$cshow :: GetDataEndpointResponse -> String
showsPrec :: Int -> GetDataEndpointResponse -> ShowS
$cshowsPrec :: Int -> GetDataEndpointResponse -> ShowS
Prelude.Show, (forall x.
GetDataEndpointResponse -> Rep GetDataEndpointResponse x)
-> (forall x.
Rep GetDataEndpointResponse x -> GetDataEndpointResponse)
-> Generic GetDataEndpointResponse
forall x. Rep GetDataEndpointResponse x -> GetDataEndpointResponse
forall x. GetDataEndpointResponse -> Rep GetDataEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDataEndpointResponse x -> GetDataEndpointResponse
$cfrom :: forall x. GetDataEndpointResponse -> Rep GetDataEndpointResponse x
Prelude.Generic)
newGetDataEndpointResponse ::
Prelude.Int ->
GetDataEndpointResponse
newGetDataEndpointResponse :: Int -> GetDataEndpointResponse
newGetDataEndpointResponse Int
pHttpStatus_ =
GetDataEndpointResponse' :: Maybe Text -> Int -> GetDataEndpointResponse
GetDataEndpointResponse'
{ $sel:dataEndpoint:GetDataEndpointResponse' :: Maybe Text
dataEndpoint =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDataEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDataEndpointResponse_dataEndpoint :: Lens.Lens' GetDataEndpointResponse (Prelude.Maybe Prelude.Text)
getDataEndpointResponse_dataEndpoint :: (Maybe Text -> f (Maybe Text))
-> GetDataEndpointResponse -> f GetDataEndpointResponse
getDataEndpointResponse_dataEndpoint = (GetDataEndpointResponse -> Maybe Text)
-> (GetDataEndpointResponse
-> Maybe Text -> GetDataEndpointResponse)
-> Lens
GetDataEndpointResponse
GetDataEndpointResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataEndpointResponse' {Maybe Text
dataEndpoint :: Maybe Text
$sel:dataEndpoint:GetDataEndpointResponse' :: GetDataEndpointResponse -> Maybe Text
dataEndpoint} -> Maybe Text
dataEndpoint) (\s :: GetDataEndpointResponse
s@GetDataEndpointResponse' {} Maybe Text
a -> GetDataEndpointResponse
s {$sel:dataEndpoint:GetDataEndpointResponse' :: Maybe Text
dataEndpoint = Maybe Text
a} :: GetDataEndpointResponse)
getDataEndpointResponse_httpStatus :: Lens.Lens' GetDataEndpointResponse Prelude.Int
getDataEndpointResponse_httpStatus :: (Int -> f Int)
-> GetDataEndpointResponse -> f GetDataEndpointResponse
getDataEndpointResponse_httpStatus = (GetDataEndpointResponse -> Int)
-> (GetDataEndpointResponse -> Int -> GetDataEndpointResponse)
-> Lens GetDataEndpointResponse GetDataEndpointResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDataEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDataEndpointResponse' :: GetDataEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDataEndpointResponse
s@GetDataEndpointResponse' {} Int
a -> GetDataEndpointResponse
s {$sel:httpStatus:GetDataEndpointResponse' :: Int
httpStatus = Int
a} :: GetDataEndpointResponse)
instance Prelude.NFData GetDataEndpointResponse