{-# 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.CloudFront.GetStreamingDistribution
(
GetStreamingDistribution (..),
newGetStreamingDistribution,
getStreamingDistribution_id,
GetStreamingDistributionResponse (..),
newGetStreamingDistributionResponse,
getStreamingDistributionResponse_eTag,
getStreamingDistributionResponse_streamingDistribution,
getStreamingDistributionResponse_httpStatus,
)
where
import Amazonka.CloudFront.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 GetStreamingDistribution = GetStreamingDistribution'
{
GetStreamingDistribution -> Text
id :: Prelude.Text
}
deriving (GetStreamingDistribution -> GetStreamingDistribution -> Bool
(GetStreamingDistribution -> GetStreamingDistribution -> Bool)
-> (GetStreamingDistribution -> GetStreamingDistribution -> Bool)
-> Eq GetStreamingDistribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStreamingDistribution -> GetStreamingDistribution -> Bool
$c/= :: GetStreamingDistribution -> GetStreamingDistribution -> Bool
== :: GetStreamingDistribution -> GetStreamingDistribution -> Bool
$c== :: GetStreamingDistribution -> GetStreamingDistribution -> Bool
Prelude.Eq, ReadPrec [GetStreamingDistribution]
ReadPrec GetStreamingDistribution
Int -> ReadS GetStreamingDistribution
ReadS [GetStreamingDistribution]
(Int -> ReadS GetStreamingDistribution)
-> ReadS [GetStreamingDistribution]
-> ReadPrec GetStreamingDistribution
-> ReadPrec [GetStreamingDistribution]
-> Read GetStreamingDistribution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStreamingDistribution]
$creadListPrec :: ReadPrec [GetStreamingDistribution]
readPrec :: ReadPrec GetStreamingDistribution
$creadPrec :: ReadPrec GetStreamingDistribution
readList :: ReadS [GetStreamingDistribution]
$creadList :: ReadS [GetStreamingDistribution]
readsPrec :: Int -> ReadS GetStreamingDistribution
$creadsPrec :: Int -> ReadS GetStreamingDistribution
Prelude.Read, Int -> GetStreamingDistribution -> ShowS
[GetStreamingDistribution] -> ShowS
GetStreamingDistribution -> String
(Int -> GetStreamingDistribution -> ShowS)
-> (GetStreamingDistribution -> String)
-> ([GetStreamingDistribution] -> ShowS)
-> Show GetStreamingDistribution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStreamingDistribution] -> ShowS
$cshowList :: [GetStreamingDistribution] -> ShowS
show :: GetStreamingDistribution -> String
$cshow :: GetStreamingDistribution -> String
showsPrec :: Int -> GetStreamingDistribution -> ShowS
$cshowsPrec :: Int -> GetStreamingDistribution -> ShowS
Prelude.Show, (forall x.
GetStreamingDistribution -> Rep GetStreamingDistribution x)
-> (forall x.
Rep GetStreamingDistribution x -> GetStreamingDistribution)
-> Generic GetStreamingDistribution
forall x.
Rep GetStreamingDistribution x -> GetStreamingDistribution
forall x.
GetStreamingDistribution -> Rep GetStreamingDistribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStreamingDistribution x -> GetStreamingDistribution
$cfrom :: forall x.
GetStreamingDistribution -> Rep GetStreamingDistribution x
Prelude.Generic)
newGetStreamingDistribution ::
Prelude.Text ->
GetStreamingDistribution
newGetStreamingDistribution :: Text -> GetStreamingDistribution
newGetStreamingDistribution Text
pId_ =
GetStreamingDistribution' :: Text -> GetStreamingDistribution
GetStreamingDistribution' {$sel:id:GetStreamingDistribution' :: Text
id = Text
pId_}
getStreamingDistribution_id :: Lens.Lens' GetStreamingDistribution Prelude.Text
getStreamingDistribution_id :: (Text -> f Text)
-> GetStreamingDistribution -> f GetStreamingDistribution
getStreamingDistribution_id = (GetStreamingDistribution -> Text)
-> (GetStreamingDistribution -> Text -> GetStreamingDistribution)
-> Lens GetStreamingDistribution GetStreamingDistribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistribution' {Text
id :: Text
$sel:id:GetStreamingDistribution' :: GetStreamingDistribution -> Text
id} -> Text
id) (\s :: GetStreamingDistribution
s@GetStreamingDistribution' {} Text
a -> GetStreamingDistribution
s {$sel:id:GetStreamingDistribution' :: Text
id = Text
a} :: GetStreamingDistribution)
instance Core.AWSRequest GetStreamingDistribution where
type
AWSResponse GetStreamingDistribution =
GetStreamingDistributionResponse
request :: GetStreamingDistribution -> Request GetStreamingDistribution
request = Service
-> GetStreamingDistribution -> Request GetStreamingDistribution
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetStreamingDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetStreamingDistribution)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetStreamingDistribution))
-> Logger
-> Service
-> Proxy GetStreamingDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetStreamingDistribution)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe StreamingDistribution
-> Int
-> GetStreamingDistributionResponse
GetStreamingDistributionResponse'
(Maybe Text
-> Maybe StreamingDistribution
-> Int
-> GetStreamingDistributionResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe StreamingDistribution
-> Int -> GetStreamingDistributionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
Either
String
(Maybe StreamingDistribution
-> Int -> GetStreamingDistributionResponse)
-> Either String (Maybe StreamingDistribution)
-> Either String (Int -> GetStreamingDistributionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe StreamingDistribution)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> GetStreamingDistributionResponse)
-> Either String Int
-> Either String GetStreamingDistributionResponse
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 GetStreamingDistribution
instance Prelude.NFData GetStreamingDistribution
instance Core.ToHeaders GetStreamingDistribution where
toHeaders :: GetStreamingDistribution -> ResponseHeaders
toHeaders = ResponseHeaders -> GetStreamingDistribution -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetStreamingDistribution where
toPath :: GetStreamingDistribution -> ByteString
toPath GetStreamingDistribution' {Text
id :: Text
$sel:id:GetStreamingDistribution' :: GetStreamingDistribution -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2020-05-31/streaming-distribution/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery GetStreamingDistribution where
toQuery :: GetStreamingDistribution -> QueryString
toQuery = QueryString -> GetStreamingDistribution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetStreamingDistributionResponse = GetStreamingDistributionResponse'
{
GetStreamingDistributionResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
GetStreamingDistributionResponse -> Maybe StreamingDistribution
streamingDistribution :: Prelude.Maybe StreamingDistribution,
GetStreamingDistributionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool
(GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool)
-> (GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool)
-> Eq GetStreamingDistributionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool
$c/= :: GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool
== :: GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool
$c== :: GetStreamingDistributionResponse
-> GetStreamingDistributionResponse -> Bool
Prelude.Eq, ReadPrec [GetStreamingDistributionResponse]
ReadPrec GetStreamingDistributionResponse
Int -> ReadS GetStreamingDistributionResponse
ReadS [GetStreamingDistributionResponse]
(Int -> ReadS GetStreamingDistributionResponse)
-> ReadS [GetStreamingDistributionResponse]
-> ReadPrec GetStreamingDistributionResponse
-> ReadPrec [GetStreamingDistributionResponse]
-> Read GetStreamingDistributionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStreamingDistributionResponse]
$creadListPrec :: ReadPrec [GetStreamingDistributionResponse]
readPrec :: ReadPrec GetStreamingDistributionResponse
$creadPrec :: ReadPrec GetStreamingDistributionResponse
readList :: ReadS [GetStreamingDistributionResponse]
$creadList :: ReadS [GetStreamingDistributionResponse]
readsPrec :: Int -> ReadS GetStreamingDistributionResponse
$creadsPrec :: Int -> ReadS GetStreamingDistributionResponse
Prelude.Read, Int -> GetStreamingDistributionResponse -> ShowS
[GetStreamingDistributionResponse] -> ShowS
GetStreamingDistributionResponse -> String
(Int -> GetStreamingDistributionResponse -> ShowS)
-> (GetStreamingDistributionResponse -> String)
-> ([GetStreamingDistributionResponse] -> ShowS)
-> Show GetStreamingDistributionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStreamingDistributionResponse] -> ShowS
$cshowList :: [GetStreamingDistributionResponse] -> ShowS
show :: GetStreamingDistributionResponse -> String
$cshow :: GetStreamingDistributionResponse -> String
showsPrec :: Int -> GetStreamingDistributionResponse -> ShowS
$cshowsPrec :: Int -> GetStreamingDistributionResponse -> ShowS
Prelude.Show, (forall x.
GetStreamingDistributionResponse
-> Rep GetStreamingDistributionResponse x)
-> (forall x.
Rep GetStreamingDistributionResponse x
-> GetStreamingDistributionResponse)
-> Generic GetStreamingDistributionResponse
forall x.
Rep GetStreamingDistributionResponse x
-> GetStreamingDistributionResponse
forall x.
GetStreamingDistributionResponse
-> Rep GetStreamingDistributionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStreamingDistributionResponse x
-> GetStreamingDistributionResponse
$cfrom :: forall x.
GetStreamingDistributionResponse
-> Rep GetStreamingDistributionResponse x
Prelude.Generic)
newGetStreamingDistributionResponse ::
Prelude.Int ->
GetStreamingDistributionResponse
newGetStreamingDistributionResponse :: Int -> GetStreamingDistributionResponse
newGetStreamingDistributionResponse Int
pHttpStatus_ =
GetStreamingDistributionResponse' :: Maybe Text
-> Maybe StreamingDistribution
-> Int
-> GetStreamingDistributionResponse
GetStreamingDistributionResponse'
{ $sel:eTag:GetStreamingDistributionResponse' :: Maybe Text
eTag =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamingDistribution:GetStreamingDistributionResponse' :: Maybe StreamingDistribution
streamingDistribution = Maybe StreamingDistribution
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetStreamingDistributionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getStreamingDistributionResponse_eTag :: Lens.Lens' GetStreamingDistributionResponse (Prelude.Maybe Prelude.Text)
getStreamingDistributionResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> GetStreamingDistributionResponse
-> f GetStreamingDistributionResponse
getStreamingDistributionResponse_eTag = (GetStreamingDistributionResponse -> Maybe Text)
-> (GetStreamingDistributionResponse
-> Maybe Text -> GetStreamingDistributionResponse)
-> Lens
GetStreamingDistributionResponse
GetStreamingDistributionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetStreamingDistributionResponse' :: GetStreamingDistributionResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetStreamingDistributionResponse
s@GetStreamingDistributionResponse' {} Maybe Text
a -> GetStreamingDistributionResponse
s {$sel:eTag:GetStreamingDistributionResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetStreamingDistributionResponse)
getStreamingDistributionResponse_streamingDistribution :: Lens.Lens' GetStreamingDistributionResponse (Prelude.Maybe StreamingDistribution)
getStreamingDistributionResponse_streamingDistribution :: (Maybe StreamingDistribution -> f (Maybe StreamingDistribution))
-> GetStreamingDistributionResponse
-> f GetStreamingDistributionResponse
getStreamingDistributionResponse_streamingDistribution = (GetStreamingDistributionResponse -> Maybe StreamingDistribution)
-> (GetStreamingDistributionResponse
-> Maybe StreamingDistribution -> GetStreamingDistributionResponse)
-> Lens
GetStreamingDistributionResponse
GetStreamingDistributionResponse
(Maybe StreamingDistribution)
(Maybe StreamingDistribution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionResponse' {Maybe StreamingDistribution
streamingDistribution :: Maybe StreamingDistribution
$sel:streamingDistribution:GetStreamingDistributionResponse' :: GetStreamingDistributionResponse -> Maybe StreamingDistribution
streamingDistribution} -> Maybe StreamingDistribution
streamingDistribution) (\s :: GetStreamingDistributionResponse
s@GetStreamingDistributionResponse' {} Maybe StreamingDistribution
a -> GetStreamingDistributionResponse
s {$sel:streamingDistribution:GetStreamingDistributionResponse' :: Maybe StreamingDistribution
streamingDistribution = Maybe StreamingDistribution
a} :: GetStreamingDistributionResponse)
getStreamingDistributionResponse_httpStatus :: Lens.Lens' GetStreamingDistributionResponse Prelude.Int
getStreamingDistributionResponse_httpStatus :: (Int -> f Int)
-> GetStreamingDistributionResponse
-> f GetStreamingDistributionResponse
getStreamingDistributionResponse_httpStatus = (GetStreamingDistributionResponse -> Int)
-> (GetStreamingDistributionResponse
-> Int -> GetStreamingDistributionResponse)
-> Lens
GetStreamingDistributionResponse
GetStreamingDistributionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetStreamingDistributionResponse' :: GetStreamingDistributionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetStreamingDistributionResponse
s@GetStreamingDistributionResponse' {} Int
a -> GetStreamingDistributionResponse
s {$sel:httpStatus:GetStreamingDistributionResponse' :: Int
httpStatus = Int
a} :: GetStreamingDistributionResponse)
instance
Prelude.NFData
GetStreamingDistributionResponse