{-# 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.GetInfrastructureConfiguration
(
GetInfrastructureConfiguration (..),
newGetInfrastructureConfiguration,
getInfrastructureConfiguration_infrastructureConfigurationArn,
GetInfrastructureConfigurationResponse (..),
newGetInfrastructureConfigurationResponse,
getInfrastructureConfigurationResponse_requestId,
getInfrastructureConfigurationResponse_infrastructureConfiguration,
getInfrastructureConfigurationResponse_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 GetInfrastructureConfiguration = GetInfrastructureConfiguration'
{
GetInfrastructureConfiguration -> Text
infrastructureConfigurationArn :: Prelude.Text
}
deriving (GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool
(GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool)
-> (GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool)
-> Eq GetInfrastructureConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool
$c/= :: GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool
== :: GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool
$c== :: GetInfrastructureConfiguration
-> GetInfrastructureConfiguration -> Bool
Prelude.Eq, ReadPrec [GetInfrastructureConfiguration]
ReadPrec GetInfrastructureConfiguration
Int -> ReadS GetInfrastructureConfiguration
ReadS [GetInfrastructureConfiguration]
(Int -> ReadS GetInfrastructureConfiguration)
-> ReadS [GetInfrastructureConfiguration]
-> ReadPrec GetInfrastructureConfiguration
-> ReadPrec [GetInfrastructureConfiguration]
-> Read GetInfrastructureConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInfrastructureConfiguration]
$creadListPrec :: ReadPrec [GetInfrastructureConfiguration]
readPrec :: ReadPrec GetInfrastructureConfiguration
$creadPrec :: ReadPrec GetInfrastructureConfiguration
readList :: ReadS [GetInfrastructureConfiguration]
$creadList :: ReadS [GetInfrastructureConfiguration]
readsPrec :: Int -> ReadS GetInfrastructureConfiguration
$creadsPrec :: Int -> ReadS GetInfrastructureConfiguration
Prelude.Read, Int -> GetInfrastructureConfiguration -> ShowS
[GetInfrastructureConfiguration] -> ShowS
GetInfrastructureConfiguration -> String
(Int -> GetInfrastructureConfiguration -> ShowS)
-> (GetInfrastructureConfiguration -> String)
-> ([GetInfrastructureConfiguration] -> ShowS)
-> Show GetInfrastructureConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInfrastructureConfiguration] -> ShowS
$cshowList :: [GetInfrastructureConfiguration] -> ShowS
show :: GetInfrastructureConfiguration -> String
$cshow :: GetInfrastructureConfiguration -> String
showsPrec :: Int -> GetInfrastructureConfiguration -> ShowS
$cshowsPrec :: Int -> GetInfrastructureConfiguration -> ShowS
Prelude.Show, (forall x.
GetInfrastructureConfiguration
-> Rep GetInfrastructureConfiguration x)
-> (forall x.
Rep GetInfrastructureConfiguration x
-> GetInfrastructureConfiguration)
-> Generic GetInfrastructureConfiguration
forall x.
Rep GetInfrastructureConfiguration x
-> GetInfrastructureConfiguration
forall x.
GetInfrastructureConfiguration
-> Rep GetInfrastructureConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInfrastructureConfiguration x
-> GetInfrastructureConfiguration
$cfrom :: forall x.
GetInfrastructureConfiguration
-> Rep GetInfrastructureConfiguration x
Prelude.Generic)
newGetInfrastructureConfiguration ::
Prelude.Text ->
GetInfrastructureConfiguration
newGetInfrastructureConfiguration :: Text -> GetInfrastructureConfiguration
newGetInfrastructureConfiguration
Text
pInfrastructureConfigurationArn_ =
GetInfrastructureConfiguration' :: Text -> GetInfrastructureConfiguration
GetInfrastructureConfiguration'
{ $sel:infrastructureConfigurationArn:GetInfrastructureConfiguration' :: Text
infrastructureConfigurationArn =
Text
pInfrastructureConfigurationArn_
}
getInfrastructureConfiguration_infrastructureConfigurationArn :: Lens.Lens' GetInfrastructureConfiguration Prelude.Text
getInfrastructureConfiguration_infrastructureConfigurationArn :: (Text -> f Text)
-> GetInfrastructureConfiguration
-> f GetInfrastructureConfiguration
getInfrastructureConfiguration_infrastructureConfigurationArn = (GetInfrastructureConfiguration -> Text)
-> (GetInfrastructureConfiguration
-> Text -> GetInfrastructureConfiguration)
-> Lens
GetInfrastructureConfiguration
GetInfrastructureConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInfrastructureConfiguration' {Text
infrastructureConfigurationArn :: Text
$sel:infrastructureConfigurationArn:GetInfrastructureConfiguration' :: GetInfrastructureConfiguration -> Text
infrastructureConfigurationArn} -> Text
infrastructureConfigurationArn) (\s :: GetInfrastructureConfiguration
s@GetInfrastructureConfiguration' {} Text
a -> GetInfrastructureConfiguration
s {$sel:infrastructureConfigurationArn:GetInfrastructureConfiguration' :: Text
infrastructureConfigurationArn = Text
a} :: GetInfrastructureConfiguration)
instance
Core.AWSRequest
GetInfrastructureConfiguration
where
type
AWSResponse GetInfrastructureConfiguration =
GetInfrastructureConfigurationResponse
request :: GetInfrastructureConfiguration
-> Request GetInfrastructureConfiguration
request = Service
-> GetInfrastructureConfiguration
-> Request GetInfrastructureConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetInfrastructureConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetInfrastructureConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetInfrastructureConfiguration))
-> Logger
-> Service
-> Proxy GetInfrastructureConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetInfrastructureConfiguration)))
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 InfrastructureConfiguration
-> Int
-> GetInfrastructureConfigurationResponse
GetInfrastructureConfigurationResponse'
(Maybe Text
-> Maybe InfrastructureConfiguration
-> Int
-> GetInfrastructureConfigurationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe InfrastructureConfiguration
-> Int -> GetInfrastructureConfigurationResponse)
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 InfrastructureConfiguration
-> Int -> GetInfrastructureConfigurationResponse)
-> Either String (Maybe InfrastructureConfiguration)
-> Either String (Int -> GetInfrastructureConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe InfrastructureConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"infrastructureConfiguration")
Either String (Int -> GetInfrastructureConfigurationResponse)
-> Either String Int
-> Either String GetInfrastructureConfigurationResponse
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
GetInfrastructureConfiguration
instance
Prelude.NFData
GetInfrastructureConfiguration
instance
Core.ToHeaders
GetInfrastructureConfiguration
where
toHeaders :: GetInfrastructureConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetInfrastructureConfiguration -> 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 GetInfrastructureConfiguration where
toPath :: GetInfrastructureConfiguration -> ByteString
toPath =
ByteString -> GetInfrastructureConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/GetInfrastructureConfiguration"
instance Core.ToQuery GetInfrastructureConfiguration where
toQuery :: GetInfrastructureConfiguration -> QueryString
toQuery GetInfrastructureConfiguration' {Text
infrastructureConfigurationArn :: Text
$sel:infrastructureConfigurationArn:GetInfrastructureConfiguration' :: GetInfrastructureConfiguration -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"infrastructureConfigurationArn"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
infrastructureConfigurationArn
]
data GetInfrastructureConfigurationResponse = GetInfrastructureConfigurationResponse'
{
GetInfrastructureConfigurationResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
GetInfrastructureConfigurationResponse
-> Maybe InfrastructureConfiguration
infrastructureConfiguration :: Prelude.Maybe InfrastructureConfiguration,
GetInfrastructureConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool
(GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool)
-> (GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool)
-> Eq GetInfrastructureConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool
$c/= :: GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool
== :: GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool
$c== :: GetInfrastructureConfigurationResponse
-> GetInfrastructureConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetInfrastructureConfigurationResponse]
ReadPrec GetInfrastructureConfigurationResponse
Int -> ReadS GetInfrastructureConfigurationResponse
ReadS [GetInfrastructureConfigurationResponse]
(Int -> ReadS GetInfrastructureConfigurationResponse)
-> ReadS [GetInfrastructureConfigurationResponse]
-> ReadPrec GetInfrastructureConfigurationResponse
-> ReadPrec [GetInfrastructureConfigurationResponse]
-> Read GetInfrastructureConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInfrastructureConfigurationResponse]
$creadListPrec :: ReadPrec [GetInfrastructureConfigurationResponse]
readPrec :: ReadPrec GetInfrastructureConfigurationResponse
$creadPrec :: ReadPrec GetInfrastructureConfigurationResponse
readList :: ReadS [GetInfrastructureConfigurationResponse]
$creadList :: ReadS [GetInfrastructureConfigurationResponse]
readsPrec :: Int -> ReadS GetInfrastructureConfigurationResponse
$creadsPrec :: Int -> ReadS GetInfrastructureConfigurationResponse
Prelude.Read, Int -> GetInfrastructureConfigurationResponse -> ShowS
[GetInfrastructureConfigurationResponse] -> ShowS
GetInfrastructureConfigurationResponse -> String
(Int -> GetInfrastructureConfigurationResponse -> ShowS)
-> (GetInfrastructureConfigurationResponse -> String)
-> ([GetInfrastructureConfigurationResponse] -> ShowS)
-> Show GetInfrastructureConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInfrastructureConfigurationResponse] -> ShowS
$cshowList :: [GetInfrastructureConfigurationResponse] -> ShowS
show :: GetInfrastructureConfigurationResponse -> String
$cshow :: GetInfrastructureConfigurationResponse -> String
showsPrec :: Int -> GetInfrastructureConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetInfrastructureConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetInfrastructureConfigurationResponse
-> Rep GetInfrastructureConfigurationResponse x)
-> (forall x.
Rep GetInfrastructureConfigurationResponse x
-> GetInfrastructureConfigurationResponse)
-> Generic GetInfrastructureConfigurationResponse
forall x.
Rep GetInfrastructureConfigurationResponse x
-> GetInfrastructureConfigurationResponse
forall x.
GetInfrastructureConfigurationResponse
-> Rep GetInfrastructureConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInfrastructureConfigurationResponse x
-> GetInfrastructureConfigurationResponse
$cfrom :: forall x.
GetInfrastructureConfigurationResponse
-> Rep GetInfrastructureConfigurationResponse x
Prelude.Generic)
newGetInfrastructureConfigurationResponse ::
Prelude.Int ->
GetInfrastructureConfigurationResponse
newGetInfrastructureConfigurationResponse :: Int -> GetInfrastructureConfigurationResponse
newGetInfrastructureConfigurationResponse
Int
pHttpStatus_ =
GetInfrastructureConfigurationResponse' :: Maybe Text
-> Maybe InfrastructureConfiguration
-> Int
-> GetInfrastructureConfigurationResponse
GetInfrastructureConfigurationResponse'
{ $sel:requestId:GetInfrastructureConfigurationResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:infrastructureConfiguration:GetInfrastructureConfigurationResponse' :: Maybe InfrastructureConfiguration
infrastructureConfiguration =
Maybe InfrastructureConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetInfrastructureConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getInfrastructureConfigurationResponse_requestId :: Lens.Lens' GetInfrastructureConfigurationResponse (Prelude.Maybe Prelude.Text)
getInfrastructureConfigurationResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> GetInfrastructureConfigurationResponse
-> f GetInfrastructureConfigurationResponse
getInfrastructureConfigurationResponse_requestId = (GetInfrastructureConfigurationResponse -> Maybe Text)
-> (GetInfrastructureConfigurationResponse
-> Maybe Text -> GetInfrastructureConfigurationResponse)
-> Lens
GetInfrastructureConfigurationResponse
GetInfrastructureConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInfrastructureConfigurationResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:GetInfrastructureConfigurationResponse' :: GetInfrastructureConfigurationResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: GetInfrastructureConfigurationResponse
s@GetInfrastructureConfigurationResponse' {} Maybe Text
a -> GetInfrastructureConfigurationResponse
s {$sel:requestId:GetInfrastructureConfigurationResponse' :: Maybe Text
requestId = Maybe Text
a} :: GetInfrastructureConfigurationResponse)
getInfrastructureConfigurationResponse_infrastructureConfiguration :: Lens.Lens' GetInfrastructureConfigurationResponse (Prelude.Maybe InfrastructureConfiguration)
getInfrastructureConfigurationResponse_infrastructureConfiguration :: (Maybe InfrastructureConfiguration
-> f (Maybe InfrastructureConfiguration))
-> GetInfrastructureConfigurationResponse
-> f GetInfrastructureConfigurationResponse
getInfrastructureConfigurationResponse_infrastructureConfiguration = (GetInfrastructureConfigurationResponse
-> Maybe InfrastructureConfiguration)
-> (GetInfrastructureConfigurationResponse
-> Maybe InfrastructureConfiguration
-> GetInfrastructureConfigurationResponse)
-> Lens
GetInfrastructureConfigurationResponse
GetInfrastructureConfigurationResponse
(Maybe InfrastructureConfiguration)
(Maybe InfrastructureConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInfrastructureConfigurationResponse' {Maybe InfrastructureConfiguration
infrastructureConfiguration :: Maybe InfrastructureConfiguration
$sel:infrastructureConfiguration:GetInfrastructureConfigurationResponse' :: GetInfrastructureConfigurationResponse
-> Maybe InfrastructureConfiguration
infrastructureConfiguration} -> Maybe InfrastructureConfiguration
infrastructureConfiguration) (\s :: GetInfrastructureConfigurationResponse
s@GetInfrastructureConfigurationResponse' {} Maybe InfrastructureConfiguration
a -> GetInfrastructureConfigurationResponse
s {$sel:infrastructureConfiguration:GetInfrastructureConfigurationResponse' :: Maybe InfrastructureConfiguration
infrastructureConfiguration = Maybe InfrastructureConfiguration
a} :: GetInfrastructureConfigurationResponse)
getInfrastructureConfigurationResponse_httpStatus :: Lens.Lens' GetInfrastructureConfigurationResponse Prelude.Int
getInfrastructureConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetInfrastructureConfigurationResponse
-> f GetInfrastructureConfigurationResponse
getInfrastructureConfigurationResponse_httpStatus = (GetInfrastructureConfigurationResponse -> Int)
-> (GetInfrastructureConfigurationResponse
-> Int -> GetInfrastructureConfigurationResponse)
-> Lens
GetInfrastructureConfigurationResponse
GetInfrastructureConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInfrastructureConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetInfrastructureConfigurationResponse' :: GetInfrastructureConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetInfrastructureConfigurationResponse
s@GetInfrastructureConfigurationResponse' {} Int
a -> GetInfrastructureConfigurationResponse
s {$sel:httpStatus:GetInfrastructureConfigurationResponse' :: Int
httpStatus = Int
a} :: GetInfrastructureConfigurationResponse)
instance
Prelude.NFData
GetInfrastructureConfigurationResponse