{-# 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.GetStreamingDistributionConfig
(
GetStreamingDistributionConfig (..),
newGetStreamingDistributionConfig,
getStreamingDistributionConfig_id,
GetStreamingDistributionConfigResponse (..),
newGetStreamingDistributionConfigResponse,
getStreamingDistributionConfigResponse_eTag,
getStreamingDistributionConfigResponse_streamingDistributionConfig,
getStreamingDistributionConfigResponse_httpStatus,
)
where
import Amazonka.CloudFront.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetStreamingDistributionConfig = GetStreamingDistributionConfig'
{
GetStreamingDistributionConfig -> Text
id :: Prelude.Text
}
deriving (GetStreamingDistributionConfig
-> GetStreamingDistributionConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStreamingDistributionConfig
-> GetStreamingDistributionConfig -> Bool
$c/= :: GetStreamingDistributionConfig
-> GetStreamingDistributionConfig -> Bool
== :: GetStreamingDistributionConfig
-> GetStreamingDistributionConfig -> Bool
$c== :: GetStreamingDistributionConfig
-> GetStreamingDistributionConfig -> Bool
Prelude.Eq, ReadPrec [GetStreamingDistributionConfig]
ReadPrec GetStreamingDistributionConfig
Int -> ReadS GetStreamingDistributionConfig
ReadS [GetStreamingDistributionConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStreamingDistributionConfig]
$creadListPrec :: ReadPrec [GetStreamingDistributionConfig]
readPrec :: ReadPrec GetStreamingDistributionConfig
$creadPrec :: ReadPrec GetStreamingDistributionConfig
readList :: ReadS [GetStreamingDistributionConfig]
$creadList :: ReadS [GetStreamingDistributionConfig]
readsPrec :: Int -> ReadS GetStreamingDistributionConfig
$creadsPrec :: Int -> ReadS GetStreamingDistributionConfig
Prelude.Read, Int -> GetStreamingDistributionConfig -> ShowS
[GetStreamingDistributionConfig] -> ShowS
GetStreamingDistributionConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStreamingDistributionConfig] -> ShowS
$cshowList :: [GetStreamingDistributionConfig] -> ShowS
show :: GetStreamingDistributionConfig -> String
$cshow :: GetStreamingDistributionConfig -> String
showsPrec :: Int -> GetStreamingDistributionConfig -> ShowS
$cshowsPrec :: Int -> GetStreamingDistributionConfig -> ShowS
Prelude.Show, forall x.
Rep GetStreamingDistributionConfig x
-> GetStreamingDistributionConfig
forall x.
GetStreamingDistributionConfig
-> Rep GetStreamingDistributionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStreamingDistributionConfig x
-> GetStreamingDistributionConfig
$cfrom :: forall x.
GetStreamingDistributionConfig
-> Rep GetStreamingDistributionConfig x
Prelude.Generic)
newGetStreamingDistributionConfig ::
Prelude.Text ->
GetStreamingDistributionConfig
newGetStreamingDistributionConfig :: Text -> GetStreamingDistributionConfig
newGetStreamingDistributionConfig Text
pId_ =
GetStreamingDistributionConfig' {$sel:id:GetStreamingDistributionConfig' :: Text
id = Text
pId_}
getStreamingDistributionConfig_id :: Lens.Lens' GetStreamingDistributionConfig Prelude.Text
getStreamingDistributionConfig_id :: Lens' GetStreamingDistributionConfig Text
getStreamingDistributionConfig_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionConfig' {Text
id :: Text
$sel:id:GetStreamingDistributionConfig' :: GetStreamingDistributionConfig -> Text
id} -> Text
id) (\s :: GetStreamingDistributionConfig
s@GetStreamingDistributionConfig' {} Text
a -> GetStreamingDistributionConfig
s {$sel:id:GetStreamingDistributionConfig' :: Text
id = Text
a} :: GetStreamingDistributionConfig)
instance
Core.AWSRequest
GetStreamingDistributionConfig
where
type
AWSResponse GetStreamingDistributionConfig =
GetStreamingDistributionConfigResponse
request :: (Service -> Service)
-> GetStreamingDistributionConfig
-> Request GetStreamingDistributionConfig
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetStreamingDistributionConfig
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetStreamingDistributionConfig)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe StreamingDistributionConfig
-> Int
-> GetStreamingDistributionConfigResponse
GetStreamingDistributionConfigResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"ETag")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetStreamingDistributionConfig
where
hashWithSalt :: Int -> GetStreamingDistributionConfig -> Int
hashWithSalt
Int
_salt
GetStreamingDistributionConfig' {Text
id :: Text
$sel:id:GetStreamingDistributionConfig' :: GetStreamingDistributionConfig -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance
Prelude.NFData
GetStreamingDistributionConfig
where
rnf :: GetStreamingDistributionConfig -> ()
rnf GetStreamingDistributionConfig' {Text
id :: Text
$sel:id:GetStreamingDistributionConfig' :: GetStreamingDistributionConfig -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance
Data.ToHeaders
GetStreamingDistributionConfig
where
toHeaders :: GetStreamingDistributionConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetStreamingDistributionConfig where
toPath :: GetStreamingDistributionConfig -> ByteString
toPath GetStreamingDistributionConfig' {Text
id :: Text
$sel:id:GetStreamingDistributionConfig' :: GetStreamingDistributionConfig -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/streaming-distribution/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
id,
ByteString
"/config"
]
instance Data.ToQuery GetStreamingDistributionConfig where
toQuery :: GetStreamingDistributionConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetStreamingDistributionConfigResponse = GetStreamingDistributionConfigResponse'
{
GetStreamingDistributionConfigResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
GetStreamingDistributionConfigResponse
-> Maybe StreamingDistributionConfig
streamingDistributionConfig :: Prelude.Maybe StreamingDistributionConfig,
GetStreamingDistributionConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetStreamingDistributionConfigResponse
-> GetStreamingDistributionConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetStreamingDistributionConfigResponse
-> GetStreamingDistributionConfigResponse -> Bool
$c/= :: GetStreamingDistributionConfigResponse
-> GetStreamingDistributionConfigResponse -> Bool
== :: GetStreamingDistributionConfigResponse
-> GetStreamingDistributionConfigResponse -> Bool
$c== :: GetStreamingDistributionConfigResponse
-> GetStreamingDistributionConfigResponse -> Bool
Prelude.Eq, ReadPrec [GetStreamingDistributionConfigResponse]
ReadPrec GetStreamingDistributionConfigResponse
Int -> ReadS GetStreamingDistributionConfigResponse
ReadS [GetStreamingDistributionConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetStreamingDistributionConfigResponse]
$creadListPrec :: ReadPrec [GetStreamingDistributionConfigResponse]
readPrec :: ReadPrec GetStreamingDistributionConfigResponse
$creadPrec :: ReadPrec GetStreamingDistributionConfigResponse
readList :: ReadS [GetStreamingDistributionConfigResponse]
$creadList :: ReadS [GetStreamingDistributionConfigResponse]
readsPrec :: Int -> ReadS GetStreamingDistributionConfigResponse
$creadsPrec :: Int -> ReadS GetStreamingDistributionConfigResponse
Prelude.Read, Int -> GetStreamingDistributionConfigResponse -> ShowS
[GetStreamingDistributionConfigResponse] -> ShowS
GetStreamingDistributionConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetStreamingDistributionConfigResponse] -> ShowS
$cshowList :: [GetStreamingDistributionConfigResponse] -> ShowS
show :: GetStreamingDistributionConfigResponse -> String
$cshow :: GetStreamingDistributionConfigResponse -> String
showsPrec :: Int -> GetStreamingDistributionConfigResponse -> ShowS
$cshowsPrec :: Int -> GetStreamingDistributionConfigResponse -> ShowS
Prelude.Show, forall x.
Rep GetStreamingDistributionConfigResponse x
-> GetStreamingDistributionConfigResponse
forall x.
GetStreamingDistributionConfigResponse
-> Rep GetStreamingDistributionConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetStreamingDistributionConfigResponse x
-> GetStreamingDistributionConfigResponse
$cfrom :: forall x.
GetStreamingDistributionConfigResponse
-> Rep GetStreamingDistributionConfigResponse x
Prelude.Generic)
newGetStreamingDistributionConfigResponse ::
Prelude.Int ->
GetStreamingDistributionConfigResponse
newGetStreamingDistributionConfigResponse :: Int -> GetStreamingDistributionConfigResponse
newGetStreamingDistributionConfigResponse
Int
pHttpStatus_ =
GetStreamingDistributionConfigResponse'
{ $sel:eTag:GetStreamingDistributionConfigResponse' :: Maybe Text
eTag =
forall a. Maybe a
Prelude.Nothing,
$sel:streamingDistributionConfig:GetStreamingDistributionConfigResponse' :: Maybe StreamingDistributionConfig
streamingDistributionConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetStreamingDistributionConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getStreamingDistributionConfigResponse_eTag :: Lens.Lens' GetStreamingDistributionConfigResponse (Prelude.Maybe Prelude.Text)
getStreamingDistributionConfigResponse_eTag :: Lens' GetStreamingDistributionConfigResponse (Maybe Text)
getStreamingDistributionConfigResponse_eTag = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionConfigResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetStreamingDistributionConfigResponse' :: GetStreamingDistributionConfigResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetStreamingDistributionConfigResponse
s@GetStreamingDistributionConfigResponse' {} Maybe Text
a -> GetStreamingDistributionConfigResponse
s {$sel:eTag:GetStreamingDistributionConfigResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetStreamingDistributionConfigResponse)
getStreamingDistributionConfigResponse_streamingDistributionConfig :: Lens.Lens' GetStreamingDistributionConfigResponse (Prelude.Maybe StreamingDistributionConfig)
getStreamingDistributionConfigResponse_streamingDistributionConfig :: Lens'
GetStreamingDistributionConfigResponse
(Maybe StreamingDistributionConfig)
getStreamingDistributionConfigResponse_streamingDistributionConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionConfigResponse' {Maybe StreamingDistributionConfig
streamingDistributionConfig :: Maybe StreamingDistributionConfig
$sel:streamingDistributionConfig:GetStreamingDistributionConfigResponse' :: GetStreamingDistributionConfigResponse
-> Maybe StreamingDistributionConfig
streamingDistributionConfig} -> Maybe StreamingDistributionConfig
streamingDistributionConfig) (\s :: GetStreamingDistributionConfigResponse
s@GetStreamingDistributionConfigResponse' {} Maybe StreamingDistributionConfig
a -> GetStreamingDistributionConfigResponse
s {$sel:streamingDistributionConfig:GetStreamingDistributionConfigResponse' :: Maybe StreamingDistributionConfig
streamingDistributionConfig = Maybe StreamingDistributionConfig
a} :: GetStreamingDistributionConfigResponse)
getStreamingDistributionConfigResponse_httpStatus :: Lens.Lens' GetStreamingDistributionConfigResponse Prelude.Int
getStreamingDistributionConfigResponse_httpStatus :: Lens' GetStreamingDistributionConfigResponse Int
getStreamingDistributionConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetStreamingDistributionConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetStreamingDistributionConfigResponse' :: GetStreamingDistributionConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetStreamingDistributionConfigResponse
s@GetStreamingDistributionConfigResponse' {} Int
a -> GetStreamingDistributionConfigResponse
s {$sel:httpStatus:GetStreamingDistributionConfigResponse' :: Int
httpStatus = Int
a} :: GetStreamingDistributionConfigResponse)
instance
Prelude.NFData
GetStreamingDistributionConfigResponse
where
rnf :: GetStreamingDistributionConfigResponse -> ()
rnf GetStreamingDistributionConfigResponse' {Int
Maybe Text
Maybe StreamingDistributionConfig
httpStatus :: Int
streamingDistributionConfig :: Maybe StreamingDistributionConfig
eTag :: Maybe Text
$sel:httpStatus:GetStreamingDistributionConfigResponse' :: GetStreamingDistributionConfigResponse -> Int
$sel:streamingDistributionConfig:GetStreamingDistributionConfigResponse' :: GetStreamingDistributionConfigResponse
-> Maybe StreamingDistributionConfig
$sel:eTag:GetStreamingDistributionConfigResponse' :: GetStreamingDistributionConfigResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eTag
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamingDistributionConfig
streamingDistributionConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus