{-# 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.Glue.GetBlueprint
(
GetBlueprint (..),
newGetBlueprint,
getBlueprint_includeParameterSpec,
getBlueprint_includeBlueprint,
getBlueprint_name,
GetBlueprintResponse (..),
newGetBlueprintResponse,
getBlueprintResponse_blueprint,
getBlueprintResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Glue.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 GetBlueprint = GetBlueprint'
{
GetBlueprint -> Maybe Bool
includeParameterSpec :: Prelude.Maybe Prelude.Bool,
GetBlueprint -> Maybe Bool
includeBlueprint :: Prelude.Maybe Prelude.Bool,
GetBlueprint -> Text
name :: Prelude.Text
}
deriving (GetBlueprint -> GetBlueprint -> Bool
(GetBlueprint -> GetBlueprint -> Bool)
-> (GetBlueprint -> GetBlueprint -> Bool) -> Eq GetBlueprint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBlueprint -> GetBlueprint -> Bool
$c/= :: GetBlueprint -> GetBlueprint -> Bool
== :: GetBlueprint -> GetBlueprint -> Bool
$c== :: GetBlueprint -> GetBlueprint -> Bool
Prelude.Eq, ReadPrec [GetBlueprint]
ReadPrec GetBlueprint
Int -> ReadS GetBlueprint
ReadS [GetBlueprint]
(Int -> ReadS GetBlueprint)
-> ReadS [GetBlueprint]
-> ReadPrec GetBlueprint
-> ReadPrec [GetBlueprint]
-> Read GetBlueprint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBlueprint]
$creadListPrec :: ReadPrec [GetBlueprint]
readPrec :: ReadPrec GetBlueprint
$creadPrec :: ReadPrec GetBlueprint
readList :: ReadS [GetBlueprint]
$creadList :: ReadS [GetBlueprint]
readsPrec :: Int -> ReadS GetBlueprint
$creadsPrec :: Int -> ReadS GetBlueprint
Prelude.Read, Int -> GetBlueprint -> ShowS
[GetBlueprint] -> ShowS
GetBlueprint -> String
(Int -> GetBlueprint -> ShowS)
-> (GetBlueprint -> String)
-> ([GetBlueprint] -> ShowS)
-> Show GetBlueprint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBlueprint] -> ShowS
$cshowList :: [GetBlueprint] -> ShowS
show :: GetBlueprint -> String
$cshow :: GetBlueprint -> String
showsPrec :: Int -> GetBlueprint -> ShowS
$cshowsPrec :: Int -> GetBlueprint -> ShowS
Prelude.Show, (forall x. GetBlueprint -> Rep GetBlueprint x)
-> (forall x. Rep GetBlueprint x -> GetBlueprint)
-> Generic GetBlueprint
forall x. Rep GetBlueprint x -> GetBlueprint
forall x. GetBlueprint -> Rep GetBlueprint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBlueprint x -> GetBlueprint
$cfrom :: forall x. GetBlueprint -> Rep GetBlueprint x
Prelude.Generic)
newGetBlueprint ::
Prelude.Text ->
GetBlueprint
newGetBlueprint :: Text -> GetBlueprint
newGetBlueprint Text
pName_ =
GetBlueprint' :: Maybe Bool -> Maybe Bool -> Text -> GetBlueprint
GetBlueprint'
{ $sel:includeParameterSpec:GetBlueprint' :: Maybe Bool
includeParameterSpec =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:includeBlueprint:GetBlueprint' :: Maybe Bool
includeBlueprint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:name:GetBlueprint' :: Text
name = Text
pName_
}
getBlueprint_includeParameterSpec :: Lens.Lens' GetBlueprint (Prelude.Maybe Prelude.Bool)
getBlueprint_includeParameterSpec :: (Maybe Bool -> f (Maybe Bool)) -> GetBlueprint -> f GetBlueprint
getBlueprint_includeParameterSpec = (GetBlueprint -> Maybe Bool)
-> (GetBlueprint -> Maybe Bool -> GetBlueprint)
-> Lens GetBlueprint GetBlueprint (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBlueprint' {Maybe Bool
includeParameterSpec :: Maybe Bool
$sel:includeParameterSpec:GetBlueprint' :: GetBlueprint -> Maybe Bool
includeParameterSpec} -> Maybe Bool
includeParameterSpec) (\s :: GetBlueprint
s@GetBlueprint' {} Maybe Bool
a -> GetBlueprint
s {$sel:includeParameterSpec:GetBlueprint' :: Maybe Bool
includeParameterSpec = Maybe Bool
a} :: GetBlueprint)
getBlueprint_includeBlueprint :: Lens.Lens' GetBlueprint (Prelude.Maybe Prelude.Bool)
getBlueprint_includeBlueprint :: (Maybe Bool -> f (Maybe Bool)) -> GetBlueprint -> f GetBlueprint
getBlueprint_includeBlueprint = (GetBlueprint -> Maybe Bool)
-> (GetBlueprint -> Maybe Bool -> GetBlueprint)
-> Lens GetBlueprint GetBlueprint (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBlueprint' {Maybe Bool
includeBlueprint :: Maybe Bool
$sel:includeBlueprint:GetBlueprint' :: GetBlueprint -> Maybe Bool
includeBlueprint} -> Maybe Bool
includeBlueprint) (\s :: GetBlueprint
s@GetBlueprint' {} Maybe Bool
a -> GetBlueprint
s {$sel:includeBlueprint:GetBlueprint' :: Maybe Bool
includeBlueprint = Maybe Bool
a} :: GetBlueprint)
getBlueprint_name :: Lens.Lens' GetBlueprint Prelude.Text
getBlueprint_name :: (Text -> f Text) -> GetBlueprint -> f GetBlueprint
getBlueprint_name = (GetBlueprint -> Text)
-> (GetBlueprint -> Text -> GetBlueprint)
-> Lens GetBlueprint GetBlueprint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBlueprint' {Text
name :: Text
$sel:name:GetBlueprint' :: GetBlueprint -> Text
name} -> Text
name) (\s :: GetBlueprint
s@GetBlueprint' {} Text
a -> GetBlueprint
s {$sel:name:GetBlueprint' :: Text
name = Text
a} :: GetBlueprint)
instance Core.AWSRequest GetBlueprint where
type AWSResponse GetBlueprint = GetBlueprintResponse
request :: GetBlueprint -> Request GetBlueprint
request = Service -> GetBlueprint -> Request GetBlueprint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetBlueprint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBlueprint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetBlueprint))
-> Logger
-> Service
-> Proxy GetBlueprint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetBlueprint)))
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 Blueprint -> Int -> GetBlueprintResponse
GetBlueprintResponse'
(Maybe Blueprint -> Int -> GetBlueprintResponse)
-> Either String (Maybe Blueprint)
-> Either String (Int -> GetBlueprintResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Blueprint)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Blueprint")
Either String (Int -> GetBlueprintResponse)
-> Either String Int -> Either String GetBlueprintResponse
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 GetBlueprint
instance Prelude.NFData GetBlueprint
instance Core.ToHeaders GetBlueprint where
toHeaders :: GetBlueprint -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetBlueprint -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"AWSGlue.GetBlueprint" :: Prelude.ByteString),
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.ToJSON GetBlueprint where
toJSON :: GetBlueprint -> Value
toJSON GetBlueprint' {Maybe Bool
Text
name :: Text
includeBlueprint :: Maybe Bool
includeParameterSpec :: Maybe Bool
$sel:name:GetBlueprint' :: GetBlueprint -> Text
$sel:includeBlueprint:GetBlueprint' :: GetBlueprint -> Maybe Bool
$sel:includeParameterSpec:GetBlueprint' :: GetBlueprint -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IncludeParameterSpec" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeParameterSpec,
(Text
"IncludeBlueprint" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeBlueprint,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)
instance Core.ToPath GetBlueprint where
toPath :: GetBlueprint -> ByteString
toPath = ByteString -> GetBlueprint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetBlueprint where
toQuery :: GetBlueprint -> QueryString
toQuery = QueryString -> GetBlueprint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetBlueprintResponse = GetBlueprintResponse'
{
GetBlueprintResponse -> Maybe Blueprint
blueprint :: Prelude.Maybe Blueprint,
GetBlueprintResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetBlueprintResponse -> GetBlueprintResponse -> Bool
(GetBlueprintResponse -> GetBlueprintResponse -> Bool)
-> (GetBlueprintResponse -> GetBlueprintResponse -> Bool)
-> Eq GetBlueprintResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBlueprintResponse -> GetBlueprintResponse -> Bool
$c/= :: GetBlueprintResponse -> GetBlueprintResponse -> Bool
== :: GetBlueprintResponse -> GetBlueprintResponse -> Bool
$c== :: GetBlueprintResponse -> GetBlueprintResponse -> Bool
Prelude.Eq, ReadPrec [GetBlueprintResponse]
ReadPrec GetBlueprintResponse
Int -> ReadS GetBlueprintResponse
ReadS [GetBlueprintResponse]
(Int -> ReadS GetBlueprintResponse)
-> ReadS [GetBlueprintResponse]
-> ReadPrec GetBlueprintResponse
-> ReadPrec [GetBlueprintResponse]
-> Read GetBlueprintResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBlueprintResponse]
$creadListPrec :: ReadPrec [GetBlueprintResponse]
readPrec :: ReadPrec GetBlueprintResponse
$creadPrec :: ReadPrec GetBlueprintResponse
readList :: ReadS [GetBlueprintResponse]
$creadList :: ReadS [GetBlueprintResponse]
readsPrec :: Int -> ReadS GetBlueprintResponse
$creadsPrec :: Int -> ReadS GetBlueprintResponse
Prelude.Read, Int -> GetBlueprintResponse -> ShowS
[GetBlueprintResponse] -> ShowS
GetBlueprintResponse -> String
(Int -> GetBlueprintResponse -> ShowS)
-> (GetBlueprintResponse -> String)
-> ([GetBlueprintResponse] -> ShowS)
-> Show GetBlueprintResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBlueprintResponse] -> ShowS
$cshowList :: [GetBlueprintResponse] -> ShowS
show :: GetBlueprintResponse -> String
$cshow :: GetBlueprintResponse -> String
showsPrec :: Int -> GetBlueprintResponse -> ShowS
$cshowsPrec :: Int -> GetBlueprintResponse -> ShowS
Prelude.Show, (forall x. GetBlueprintResponse -> Rep GetBlueprintResponse x)
-> (forall x. Rep GetBlueprintResponse x -> GetBlueprintResponse)
-> Generic GetBlueprintResponse
forall x. Rep GetBlueprintResponse x -> GetBlueprintResponse
forall x. GetBlueprintResponse -> Rep GetBlueprintResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBlueprintResponse x -> GetBlueprintResponse
$cfrom :: forall x. GetBlueprintResponse -> Rep GetBlueprintResponse x
Prelude.Generic)
newGetBlueprintResponse ::
Prelude.Int ->
GetBlueprintResponse
newGetBlueprintResponse :: Int -> GetBlueprintResponse
newGetBlueprintResponse Int
pHttpStatus_ =
GetBlueprintResponse' :: Maybe Blueprint -> Int -> GetBlueprintResponse
GetBlueprintResponse'
{ $sel:blueprint:GetBlueprintResponse' :: Maybe Blueprint
blueprint = Maybe Blueprint
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetBlueprintResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getBlueprintResponse_blueprint :: Lens.Lens' GetBlueprintResponse (Prelude.Maybe Blueprint)
getBlueprintResponse_blueprint :: (Maybe Blueprint -> f (Maybe Blueprint))
-> GetBlueprintResponse -> f GetBlueprintResponse
getBlueprintResponse_blueprint = (GetBlueprintResponse -> Maybe Blueprint)
-> (GetBlueprintResponse
-> Maybe Blueprint -> GetBlueprintResponse)
-> Lens
GetBlueprintResponse
GetBlueprintResponse
(Maybe Blueprint)
(Maybe Blueprint)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBlueprintResponse' {Maybe Blueprint
blueprint :: Maybe Blueprint
$sel:blueprint:GetBlueprintResponse' :: GetBlueprintResponse -> Maybe Blueprint
blueprint} -> Maybe Blueprint
blueprint) (\s :: GetBlueprintResponse
s@GetBlueprintResponse' {} Maybe Blueprint
a -> GetBlueprintResponse
s {$sel:blueprint:GetBlueprintResponse' :: Maybe Blueprint
blueprint = Maybe Blueprint
a} :: GetBlueprintResponse)
getBlueprintResponse_httpStatus :: Lens.Lens' GetBlueprintResponse Prelude.Int
getBlueprintResponse_httpStatus :: (Int -> f Int) -> GetBlueprintResponse -> f GetBlueprintResponse
getBlueprintResponse_httpStatus = (GetBlueprintResponse -> Int)
-> (GetBlueprintResponse -> Int -> GetBlueprintResponse)
-> Lens GetBlueprintResponse GetBlueprintResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBlueprintResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBlueprintResponse' :: GetBlueprintResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBlueprintResponse
s@GetBlueprintResponse' {} Int
a -> GetBlueprintResponse
s {$sel:httpStatus:GetBlueprintResponse' :: Int
httpStatus = Int
a} :: GetBlueprintResponse)
instance Prelude.NFData GetBlueprintResponse