{-# 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.ImageBuilder.GetDistributionConfiguration
(
GetDistributionConfiguration (..),
newGetDistributionConfiguration,
getDistributionConfiguration_distributionConfigurationArn,
GetDistributionConfigurationResponse (..),
newGetDistributionConfigurationResponse,
getDistributionConfigurationResponse_requestId,
getDistributionConfigurationResponse_distributionConfiguration,
getDistributionConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.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 GetDistributionConfiguration = GetDistributionConfiguration'
{
GetDistributionConfiguration -> Text
distributionConfigurationArn :: Prelude.Text
}
deriving (GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool
(GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool)
-> (GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool)
-> Eq GetDistributionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool
$c/= :: GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool
== :: GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool
$c== :: GetDistributionConfiguration
-> GetDistributionConfiguration -> Bool
Prelude.Eq, ReadPrec [GetDistributionConfiguration]
ReadPrec GetDistributionConfiguration
Int -> ReadS GetDistributionConfiguration
ReadS [GetDistributionConfiguration]
(Int -> ReadS GetDistributionConfiguration)
-> ReadS [GetDistributionConfiguration]
-> ReadPrec GetDistributionConfiguration
-> ReadPrec [GetDistributionConfiguration]
-> Read GetDistributionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDistributionConfiguration]
$creadListPrec :: ReadPrec [GetDistributionConfiguration]
readPrec :: ReadPrec GetDistributionConfiguration
$creadPrec :: ReadPrec GetDistributionConfiguration
readList :: ReadS [GetDistributionConfiguration]
$creadList :: ReadS [GetDistributionConfiguration]
readsPrec :: Int -> ReadS GetDistributionConfiguration
$creadsPrec :: Int -> ReadS GetDistributionConfiguration
Prelude.Read, Int -> GetDistributionConfiguration -> ShowS
[GetDistributionConfiguration] -> ShowS
GetDistributionConfiguration -> String
(Int -> GetDistributionConfiguration -> ShowS)
-> (GetDistributionConfiguration -> String)
-> ([GetDistributionConfiguration] -> ShowS)
-> Show GetDistributionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDistributionConfiguration] -> ShowS
$cshowList :: [GetDistributionConfiguration] -> ShowS
show :: GetDistributionConfiguration -> String
$cshow :: GetDistributionConfiguration -> String
showsPrec :: Int -> GetDistributionConfiguration -> ShowS
$cshowsPrec :: Int -> GetDistributionConfiguration -> ShowS
Prelude.Show, (forall x.
GetDistributionConfiguration -> Rep GetDistributionConfiguration x)
-> (forall x.
Rep GetDistributionConfiguration x -> GetDistributionConfiguration)
-> Generic GetDistributionConfiguration
forall x.
Rep GetDistributionConfiguration x -> GetDistributionConfiguration
forall x.
GetDistributionConfiguration -> Rep GetDistributionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDistributionConfiguration x -> GetDistributionConfiguration
$cfrom :: forall x.
GetDistributionConfiguration -> Rep GetDistributionConfiguration x
Prelude.Generic)
newGetDistributionConfiguration ::
Prelude.Text ->
GetDistributionConfiguration
newGetDistributionConfiguration :: Text -> GetDistributionConfiguration
newGetDistributionConfiguration
Text
pDistributionConfigurationArn_ =
GetDistributionConfiguration' :: Text -> GetDistributionConfiguration
GetDistributionConfiguration'
{ $sel:distributionConfigurationArn:GetDistributionConfiguration' :: Text
distributionConfigurationArn =
Text
pDistributionConfigurationArn_
}
getDistributionConfiguration_distributionConfigurationArn :: Lens.Lens' GetDistributionConfiguration Prelude.Text
getDistributionConfiguration_distributionConfigurationArn :: (Text -> f Text)
-> GetDistributionConfiguration -> f GetDistributionConfiguration
getDistributionConfiguration_distributionConfigurationArn = (GetDistributionConfiguration -> Text)
-> (GetDistributionConfiguration
-> Text -> GetDistributionConfiguration)
-> Lens
GetDistributionConfiguration GetDistributionConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionConfiguration' {Text
distributionConfigurationArn :: Text
$sel:distributionConfigurationArn:GetDistributionConfiguration' :: GetDistributionConfiguration -> Text
distributionConfigurationArn} -> Text
distributionConfigurationArn) (\s :: GetDistributionConfiguration
s@GetDistributionConfiguration' {} Text
a -> GetDistributionConfiguration
s {$sel:distributionConfigurationArn:GetDistributionConfiguration' :: Text
distributionConfigurationArn = Text
a} :: GetDistributionConfiguration)
instance Core.AWSRequest GetDistributionConfiguration where
type
AWSResponse GetDistributionConfiguration =
GetDistributionConfigurationResponse
request :: GetDistributionConfiguration
-> Request GetDistributionConfiguration
request = Service
-> GetDistributionConfiguration
-> Request GetDistributionConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetDistributionConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDistributionConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDistributionConfiguration))
-> Logger
-> Service
-> Proxy GetDistributionConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDistributionConfiguration)))
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
-> Maybe DistributionConfiguration
-> Int
-> GetDistributionConfigurationResponse
GetDistributionConfigurationResponse'
(Maybe Text
-> Maybe DistributionConfiguration
-> Int
-> GetDistributionConfigurationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe DistributionConfiguration
-> Int -> GetDistributionConfigurationResponse)
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
"requestId")
Either
String
(Maybe DistributionConfiguration
-> Int -> GetDistributionConfigurationResponse)
-> Either String (Maybe DistributionConfiguration)
-> Either String (Int -> GetDistributionConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DistributionConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"distributionConfiguration")
Either String (Int -> GetDistributionConfigurationResponse)
-> Either String Int
-> Either String GetDistributionConfigurationResponse
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
GetDistributionConfiguration
instance Prelude.NFData GetDistributionConfiguration
instance Core.ToHeaders GetDistributionConfiguration where
toHeaders :: GetDistributionConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetDistributionConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath GetDistributionConfiguration where
toPath :: GetDistributionConfiguration -> ByteString
toPath =
ByteString -> GetDistributionConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/GetDistributionConfiguration"
instance Core.ToQuery GetDistributionConfiguration where
toQuery :: GetDistributionConfiguration -> QueryString
toQuery GetDistributionConfiguration' {Text
distributionConfigurationArn :: Text
$sel:distributionConfigurationArn:GetDistributionConfiguration' :: GetDistributionConfiguration -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"distributionConfigurationArn"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
distributionConfigurationArn
]
data GetDistributionConfigurationResponse = GetDistributionConfigurationResponse'
{
GetDistributionConfigurationResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
GetDistributionConfigurationResponse
-> Maybe DistributionConfiguration
distributionConfiguration :: Prelude.Maybe DistributionConfiguration,
GetDistributionConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool
(GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool)
-> (GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool)
-> Eq GetDistributionConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool
$c/= :: GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool
== :: GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool
$c== :: GetDistributionConfigurationResponse
-> GetDistributionConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetDistributionConfigurationResponse]
ReadPrec GetDistributionConfigurationResponse
Int -> ReadS GetDistributionConfigurationResponse
ReadS [GetDistributionConfigurationResponse]
(Int -> ReadS GetDistributionConfigurationResponse)
-> ReadS [GetDistributionConfigurationResponse]
-> ReadPrec GetDistributionConfigurationResponse
-> ReadPrec [GetDistributionConfigurationResponse]
-> Read GetDistributionConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDistributionConfigurationResponse]
$creadListPrec :: ReadPrec [GetDistributionConfigurationResponse]
readPrec :: ReadPrec GetDistributionConfigurationResponse
$creadPrec :: ReadPrec GetDistributionConfigurationResponse
readList :: ReadS [GetDistributionConfigurationResponse]
$creadList :: ReadS [GetDistributionConfigurationResponse]
readsPrec :: Int -> ReadS GetDistributionConfigurationResponse
$creadsPrec :: Int -> ReadS GetDistributionConfigurationResponse
Prelude.Read, Int -> GetDistributionConfigurationResponse -> ShowS
[GetDistributionConfigurationResponse] -> ShowS
GetDistributionConfigurationResponse -> String
(Int -> GetDistributionConfigurationResponse -> ShowS)
-> (GetDistributionConfigurationResponse -> String)
-> ([GetDistributionConfigurationResponse] -> ShowS)
-> Show GetDistributionConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDistributionConfigurationResponse] -> ShowS
$cshowList :: [GetDistributionConfigurationResponse] -> ShowS
show :: GetDistributionConfigurationResponse -> String
$cshow :: GetDistributionConfigurationResponse -> String
showsPrec :: Int -> GetDistributionConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetDistributionConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetDistributionConfigurationResponse
-> Rep GetDistributionConfigurationResponse x)
-> (forall x.
Rep GetDistributionConfigurationResponse x
-> GetDistributionConfigurationResponse)
-> Generic GetDistributionConfigurationResponse
forall x.
Rep GetDistributionConfigurationResponse x
-> GetDistributionConfigurationResponse
forall x.
GetDistributionConfigurationResponse
-> Rep GetDistributionConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDistributionConfigurationResponse x
-> GetDistributionConfigurationResponse
$cfrom :: forall x.
GetDistributionConfigurationResponse
-> Rep GetDistributionConfigurationResponse x
Prelude.Generic)
newGetDistributionConfigurationResponse ::
Prelude.Int ->
GetDistributionConfigurationResponse
newGetDistributionConfigurationResponse :: Int -> GetDistributionConfigurationResponse
newGetDistributionConfigurationResponse Int
pHttpStatus_ =
GetDistributionConfigurationResponse' :: Maybe Text
-> Maybe DistributionConfiguration
-> Int
-> GetDistributionConfigurationResponse
GetDistributionConfigurationResponse'
{ $sel:requestId:GetDistributionConfigurationResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:distributionConfiguration:GetDistributionConfigurationResponse' :: Maybe DistributionConfiguration
distributionConfiguration =
Maybe DistributionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDistributionConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDistributionConfigurationResponse_requestId :: Lens.Lens' GetDistributionConfigurationResponse (Prelude.Maybe Prelude.Text)
getDistributionConfigurationResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> GetDistributionConfigurationResponse
-> f GetDistributionConfigurationResponse
getDistributionConfigurationResponse_requestId = (GetDistributionConfigurationResponse -> Maybe Text)
-> (GetDistributionConfigurationResponse
-> Maybe Text -> GetDistributionConfigurationResponse)
-> Lens
GetDistributionConfigurationResponse
GetDistributionConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionConfigurationResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:GetDistributionConfigurationResponse' :: GetDistributionConfigurationResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: GetDistributionConfigurationResponse
s@GetDistributionConfigurationResponse' {} Maybe Text
a -> GetDistributionConfigurationResponse
s {$sel:requestId:GetDistributionConfigurationResponse' :: Maybe Text
requestId = Maybe Text
a} :: GetDistributionConfigurationResponse)
getDistributionConfigurationResponse_distributionConfiguration :: Lens.Lens' GetDistributionConfigurationResponse (Prelude.Maybe DistributionConfiguration)
getDistributionConfigurationResponse_distributionConfiguration :: (Maybe DistributionConfiguration
-> f (Maybe DistributionConfiguration))
-> GetDistributionConfigurationResponse
-> f GetDistributionConfigurationResponse
getDistributionConfigurationResponse_distributionConfiguration = (GetDistributionConfigurationResponse
-> Maybe DistributionConfiguration)
-> (GetDistributionConfigurationResponse
-> Maybe DistributionConfiguration
-> GetDistributionConfigurationResponse)
-> Lens
GetDistributionConfigurationResponse
GetDistributionConfigurationResponse
(Maybe DistributionConfiguration)
(Maybe DistributionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionConfigurationResponse' {Maybe DistributionConfiguration
distributionConfiguration :: Maybe DistributionConfiguration
$sel:distributionConfiguration:GetDistributionConfigurationResponse' :: GetDistributionConfigurationResponse
-> Maybe DistributionConfiguration
distributionConfiguration} -> Maybe DistributionConfiguration
distributionConfiguration) (\s :: GetDistributionConfigurationResponse
s@GetDistributionConfigurationResponse' {} Maybe DistributionConfiguration
a -> GetDistributionConfigurationResponse
s {$sel:distributionConfiguration:GetDistributionConfigurationResponse' :: Maybe DistributionConfiguration
distributionConfiguration = Maybe DistributionConfiguration
a} :: GetDistributionConfigurationResponse)
getDistributionConfigurationResponse_httpStatus :: Lens.Lens' GetDistributionConfigurationResponse Prelude.Int
getDistributionConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetDistributionConfigurationResponse
-> f GetDistributionConfigurationResponse
getDistributionConfigurationResponse_httpStatus = (GetDistributionConfigurationResponse -> Int)
-> (GetDistributionConfigurationResponse
-> Int -> GetDistributionConfigurationResponse)
-> Lens
GetDistributionConfigurationResponse
GetDistributionConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDistributionConfigurationResponse' :: GetDistributionConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDistributionConfigurationResponse
s@GetDistributionConfigurationResponse' {} Int
a -> GetDistributionConfigurationResponse
s {$sel:httpStatus:GetDistributionConfigurationResponse' :: Int
httpStatus = Int
a} :: GetDistributionConfigurationResponse)
instance
Prelude.NFData
GetDistributionConfigurationResponse