{-# 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.GetContainerRecipePolicy
(
GetContainerRecipePolicy (..),
newGetContainerRecipePolicy,
getContainerRecipePolicy_containerRecipeArn,
GetContainerRecipePolicyResponse (..),
newGetContainerRecipePolicyResponse,
getContainerRecipePolicyResponse_requestId,
getContainerRecipePolicyResponse_policy,
getContainerRecipePolicyResponse_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 GetContainerRecipePolicy = GetContainerRecipePolicy'
{
GetContainerRecipePolicy -> Text
containerRecipeArn :: Prelude.Text
}
deriving (GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool
(GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool)
-> (GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool)
-> Eq GetContainerRecipePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool
$c/= :: GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool
== :: GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool
$c== :: GetContainerRecipePolicy -> GetContainerRecipePolicy -> Bool
Prelude.Eq, ReadPrec [GetContainerRecipePolicy]
ReadPrec GetContainerRecipePolicy
Int -> ReadS GetContainerRecipePolicy
ReadS [GetContainerRecipePolicy]
(Int -> ReadS GetContainerRecipePolicy)
-> ReadS [GetContainerRecipePolicy]
-> ReadPrec GetContainerRecipePolicy
-> ReadPrec [GetContainerRecipePolicy]
-> Read GetContainerRecipePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContainerRecipePolicy]
$creadListPrec :: ReadPrec [GetContainerRecipePolicy]
readPrec :: ReadPrec GetContainerRecipePolicy
$creadPrec :: ReadPrec GetContainerRecipePolicy
readList :: ReadS [GetContainerRecipePolicy]
$creadList :: ReadS [GetContainerRecipePolicy]
readsPrec :: Int -> ReadS GetContainerRecipePolicy
$creadsPrec :: Int -> ReadS GetContainerRecipePolicy
Prelude.Read, Int -> GetContainerRecipePolicy -> ShowS
[GetContainerRecipePolicy] -> ShowS
GetContainerRecipePolicy -> String
(Int -> GetContainerRecipePolicy -> ShowS)
-> (GetContainerRecipePolicy -> String)
-> ([GetContainerRecipePolicy] -> ShowS)
-> Show GetContainerRecipePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContainerRecipePolicy] -> ShowS
$cshowList :: [GetContainerRecipePolicy] -> ShowS
show :: GetContainerRecipePolicy -> String
$cshow :: GetContainerRecipePolicy -> String
showsPrec :: Int -> GetContainerRecipePolicy -> ShowS
$cshowsPrec :: Int -> GetContainerRecipePolicy -> ShowS
Prelude.Show, (forall x.
GetContainerRecipePolicy -> Rep GetContainerRecipePolicy x)
-> (forall x.
Rep GetContainerRecipePolicy x -> GetContainerRecipePolicy)
-> Generic GetContainerRecipePolicy
forall x.
Rep GetContainerRecipePolicy x -> GetContainerRecipePolicy
forall x.
GetContainerRecipePolicy -> Rep GetContainerRecipePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContainerRecipePolicy x -> GetContainerRecipePolicy
$cfrom :: forall x.
GetContainerRecipePolicy -> Rep GetContainerRecipePolicy x
Prelude.Generic)
newGetContainerRecipePolicy ::
Prelude.Text ->
GetContainerRecipePolicy
newGetContainerRecipePolicy :: Text -> GetContainerRecipePolicy
newGetContainerRecipePolicy Text
pContainerRecipeArn_ =
GetContainerRecipePolicy' :: Text -> GetContainerRecipePolicy
GetContainerRecipePolicy'
{ $sel:containerRecipeArn:GetContainerRecipePolicy' :: Text
containerRecipeArn =
Text
pContainerRecipeArn_
}
getContainerRecipePolicy_containerRecipeArn :: Lens.Lens' GetContainerRecipePolicy Prelude.Text
getContainerRecipePolicy_containerRecipeArn :: (Text -> f Text)
-> GetContainerRecipePolicy -> f GetContainerRecipePolicy
getContainerRecipePolicy_containerRecipeArn = (GetContainerRecipePolicy -> Text)
-> (GetContainerRecipePolicy -> Text -> GetContainerRecipePolicy)
-> Lens GetContainerRecipePolicy GetContainerRecipePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerRecipePolicy' {Text
containerRecipeArn :: Text
$sel:containerRecipeArn:GetContainerRecipePolicy' :: GetContainerRecipePolicy -> Text
containerRecipeArn} -> Text
containerRecipeArn) (\s :: GetContainerRecipePolicy
s@GetContainerRecipePolicy' {} Text
a -> GetContainerRecipePolicy
s {$sel:containerRecipeArn:GetContainerRecipePolicy' :: Text
containerRecipeArn = Text
a} :: GetContainerRecipePolicy)
instance Core.AWSRequest GetContainerRecipePolicy where
type
AWSResponse GetContainerRecipePolicy =
GetContainerRecipePolicyResponse
request :: GetContainerRecipePolicy -> Request GetContainerRecipePolicy
request = Service
-> GetContainerRecipePolicy -> Request GetContainerRecipePolicy
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetContainerRecipePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContainerRecipePolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetContainerRecipePolicy))
-> Logger
-> Service
-> Proxy GetContainerRecipePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContainerRecipePolicy)))
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 Text -> Int -> GetContainerRecipePolicyResponse
GetContainerRecipePolicyResponse'
(Maybe Text
-> Maybe Text -> Int -> GetContainerRecipePolicyResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> GetContainerRecipePolicyResponse)
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 Text -> Int -> GetContainerRecipePolicyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetContainerRecipePolicyResponse)
forall (f :: * -> *) a b. Applicative f => 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
"policy")
Either String (Int -> GetContainerRecipePolicyResponse)
-> Either String Int
-> Either String GetContainerRecipePolicyResponse
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 GetContainerRecipePolicy
instance Prelude.NFData GetContainerRecipePolicy
instance Core.ToHeaders GetContainerRecipePolicy where
toHeaders :: GetContainerRecipePolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetContainerRecipePolicy -> 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 GetContainerRecipePolicy where
toPath :: GetContainerRecipePolicy -> ByteString
toPath = ByteString -> GetContainerRecipePolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/GetContainerRecipePolicy"
instance Core.ToQuery GetContainerRecipePolicy where
toQuery :: GetContainerRecipePolicy -> QueryString
toQuery GetContainerRecipePolicy' {Text
containerRecipeArn :: Text
$sel:containerRecipeArn:GetContainerRecipePolicy' :: GetContainerRecipePolicy -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"containerRecipeArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
containerRecipeArn]
data GetContainerRecipePolicyResponse = GetContainerRecipePolicyResponse'
{
GetContainerRecipePolicyResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
GetContainerRecipePolicyResponse -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
GetContainerRecipePolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool
(GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool)
-> (GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool)
-> Eq GetContainerRecipePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool
$c/= :: GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool
== :: GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool
$c== :: GetContainerRecipePolicyResponse
-> GetContainerRecipePolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetContainerRecipePolicyResponse]
ReadPrec GetContainerRecipePolicyResponse
Int -> ReadS GetContainerRecipePolicyResponse
ReadS [GetContainerRecipePolicyResponse]
(Int -> ReadS GetContainerRecipePolicyResponse)
-> ReadS [GetContainerRecipePolicyResponse]
-> ReadPrec GetContainerRecipePolicyResponse
-> ReadPrec [GetContainerRecipePolicyResponse]
-> Read GetContainerRecipePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContainerRecipePolicyResponse]
$creadListPrec :: ReadPrec [GetContainerRecipePolicyResponse]
readPrec :: ReadPrec GetContainerRecipePolicyResponse
$creadPrec :: ReadPrec GetContainerRecipePolicyResponse
readList :: ReadS [GetContainerRecipePolicyResponse]
$creadList :: ReadS [GetContainerRecipePolicyResponse]
readsPrec :: Int -> ReadS GetContainerRecipePolicyResponse
$creadsPrec :: Int -> ReadS GetContainerRecipePolicyResponse
Prelude.Read, Int -> GetContainerRecipePolicyResponse -> ShowS
[GetContainerRecipePolicyResponse] -> ShowS
GetContainerRecipePolicyResponse -> String
(Int -> GetContainerRecipePolicyResponse -> ShowS)
-> (GetContainerRecipePolicyResponse -> String)
-> ([GetContainerRecipePolicyResponse] -> ShowS)
-> Show GetContainerRecipePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContainerRecipePolicyResponse] -> ShowS
$cshowList :: [GetContainerRecipePolicyResponse] -> ShowS
show :: GetContainerRecipePolicyResponse -> String
$cshow :: GetContainerRecipePolicyResponse -> String
showsPrec :: Int -> GetContainerRecipePolicyResponse -> ShowS
$cshowsPrec :: Int -> GetContainerRecipePolicyResponse -> ShowS
Prelude.Show, (forall x.
GetContainerRecipePolicyResponse
-> Rep GetContainerRecipePolicyResponse x)
-> (forall x.
Rep GetContainerRecipePolicyResponse x
-> GetContainerRecipePolicyResponse)
-> Generic GetContainerRecipePolicyResponse
forall x.
Rep GetContainerRecipePolicyResponse x
-> GetContainerRecipePolicyResponse
forall x.
GetContainerRecipePolicyResponse
-> Rep GetContainerRecipePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContainerRecipePolicyResponse x
-> GetContainerRecipePolicyResponse
$cfrom :: forall x.
GetContainerRecipePolicyResponse
-> Rep GetContainerRecipePolicyResponse x
Prelude.Generic)
newGetContainerRecipePolicyResponse ::
Prelude.Int ->
GetContainerRecipePolicyResponse
newGetContainerRecipePolicyResponse :: Int -> GetContainerRecipePolicyResponse
newGetContainerRecipePolicyResponse Int
pHttpStatus_ =
GetContainerRecipePolicyResponse' :: Maybe Text -> Maybe Text -> Int -> GetContainerRecipePolicyResponse
GetContainerRecipePolicyResponse'
{ $sel:requestId:GetContainerRecipePolicyResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policy:GetContainerRecipePolicyResponse' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetContainerRecipePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getContainerRecipePolicyResponse_requestId :: Lens.Lens' GetContainerRecipePolicyResponse (Prelude.Maybe Prelude.Text)
getContainerRecipePolicyResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> GetContainerRecipePolicyResponse
-> f GetContainerRecipePolicyResponse
getContainerRecipePolicyResponse_requestId = (GetContainerRecipePolicyResponse -> Maybe Text)
-> (GetContainerRecipePolicyResponse
-> Maybe Text -> GetContainerRecipePolicyResponse)
-> Lens
GetContainerRecipePolicyResponse
GetContainerRecipePolicyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerRecipePolicyResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:GetContainerRecipePolicyResponse' :: GetContainerRecipePolicyResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: GetContainerRecipePolicyResponse
s@GetContainerRecipePolicyResponse' {} Maybe Text
a -> GetContainerRecipePolicyResponse
s {$sel:requestId:GetContainerRecipePolicyResponse' :: Maybe Text
requestId = Maybe Text
a} :: GetContainerRecipePolicyResponse)
getContainerRecipePolicyResponse_policy :: Lens.Lens' GetContainerRecipePolicyResponse (Prelude.Maybe Prelude.Text)
getContainerRecipePolicyResponse_policy :: (Maybe Text -> f (Maybe Text))
-> GetContainerRecipePolicyResponse
-> f GetContainerRecipePolicyResponse
getContainerRecipePolicyResponse_policy = (GetContainerRecipePolicyResponse -> Maybe Text)
-> (GetContainerRecipePolicyResponse
-> Maybe Text -> GetContainerRecipePolicyResponse)
-> Lens
GetContainerRecipePolicyResponse
GetContainerRecipePolicyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerRecipePolicyResponse' {Maybe Text
policy :: Maybe Text
$sel:policy:GetContainerRecipePolicyResponse' :: GetContainerRecipePolicyResponse -> Maybe Text
policy} -> Maybe Text
policy) (\s :: GetContainerRecipePolicyResponse
s@GetContainerRecipePolicyResponse' {} Maybe Text
a -> GetContainerRecipePolicyResponse
s {$sel:policy:GetContainerRecipePolicyResponse' :: Maybe Text
policy = Maybe Text
a} :: GetContainerRecipePolicyResponse)
getContainerRecipePolicyResponse_httpStatus :: Lens.Lens' GetContainerRecipePolicyResponse Prelude.Int
getContainerRecipePolicyResponse_httpStatus :: (Int -> f Int)
-> GetContainerRecipePolicyResponse
-> f GetContainerRecipePolicyResponse
getContainerRecipePolicyResponse_httpStatus = (GetContainerRecipePolicyResponse -> Int)
-> (GetContainerRecipePolicyResponse
-> Int -> GetContainerRecipePolicyResponse)
-> Lens
GetContainerRecipePolicyResponse
GetContainerRecipePolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContainerRecipePolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetContainerRecipePolicyResponse' :: GetContainerRecipePolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetContainerRecipePolicyResponse
s@GetContainerRecipePolicyResponse' {} Int
a -> GetContainerRecipePolicyResponse
s {$sel:httpStatus:GetContainerRecipePolicyResponse' :: Int
httpStatus = Int
a} :: GetContainerRecipePolicyResponse)
instance
Prelude.NFData
GetContainerRecipePolicyResponse