{-# 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.UpdateBlueprint
(
UpdateBlueprint (..),
newUpdateBlueprint,
updateBlueprint_description,
updateBlueprint_name,
updateBlueprint_blueprintLocation,
UpdateBlueprintResponse (..),
newUpdateBlueprintResponse,
updateBlueprintResponse_name,
updateBlueprintResponse_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 UpdateBlueprint = UpdateBlueprint'
{
UpdateBlueprint -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateBlueprint -> Text
name :: Prelude.Text,
UpdateBlueprint -> Text
blueprintLocation :: Prelude.Text
}
deriving (UpdateBlueprint -> UpdateBlueprint -> Bool
(UpdateBlueprint -> UpdateBlueprint -> Bool)
-> (UpdateBlueprint -> UpdateBlueprint -> Bool)
-> Eq UpdateBlueprint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBlueprint -> UpdateBlueprint -> Bool
$c/= :: UpdateBlueprint -> UpdateBlueprint -> Bool
== :: UpdateBlueprint -> UpdateBlueprint -> Bool
$c== :: UpdateBlueprint -> UpdateBlueprint -> Bool
Prelude.Eq, ReadPrec [UpdateBlueprint]
ReadPrec UpdateBlueprint
Int -> ReadS UpdateBlueprint
ReadS [UpdateBlueprint]
(Int -> ReadS UpdateBlueprint)
-> ReadS [UpdateBlueprint]
-> ReadPrec UpdateBlueprint
-> ReadPrec [UpdateBlueprint]
-> Read UpdateBlueprint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBlueprint]
$creadListPrec :: ReadPrec [UpdateBlueprint]
readPrec :: ReadPrec UpdateBlueprint
$creadPrec :: ReadPrec UpdateBlueprint
readList :: ReadS [UpdateBlueprint]
$creadList :: ReadS [UpdateBlueprint]
readsPrec :: Int -> ReadS UpdateBlueprint
$creadsPrec :: Int -> ReadS UpdateBlueprint
Prelude.Read, Int -> UpdateBlueprint -> ShowS
[UpdateBlueprint] -> ShowS
UpdateBlueprint -> String
(Int -> UpdateBlueprint -> ShowS)
-> (UpdateBlueprint -> String)
-> ([UpdateBlueprint] -> ShowS)
-> Show UpdateBlueprint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBlueprint] -> ShowS
$cshowList :: [UpdateBlueprint] -> ShowS
show :: UpdateBlueprint -> String
$cshow :: UpdateBlueprint -> String
showsPrec :: Int -> UpdateBlueprint -> ShowS
$cshowsPrec :: Int -> UpdateBlueprint -> ShowS
Prelude.Show, (forall x. UpdateBlueprint -> Rep UpdateBlueprint x)
-> (forall x. Rep UpdateBlueprint x -> UpdateBlueprint)
-> Generic UpdateBlueprint
forall x. Rep UpdateBlueprint x -> UpdateBlueprint
forall x. UpdateBlueprint -> Rep UpdateBlueprint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBlueprint x -> UpdateBlueprint
$cfrom :: forall x. UpdateBlueprint -> Rep UpdateBlueprint x
Prelude.Generic)
newUpdateBlueprint ::
Prelude.Text ->
Prelude.Text ->
UpdateBlueprint
newUpdateBlueprint :: Text -> Text -> UpdateBlueprint
newUpdateBlueprint Text
pName_ Text
pBlueprintLocation_ =
UpdateBlueprint' :: Maybe Text -> Text -> Text -> UpdateBlueprint
UpdateBlueprint'
{ $sel:description:UpdateBlueprint' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateBlueprint' :: Text
name = Text
pName_,
$sel:blueprintLocation:UpdateBlueprint' :: Text
blueprintLocation = Text
pBlueprintLocation_
}
updateBlueprint_description :: Lens.Lens' UpdateBlueprint (Prelude.Maybe Prelude.Text)
updateBlueprint_description :: (Maybe Text -> f (Maybe Text))
-> UpdateBlueprint -> f UpdateBlueprint
updateBlueprint_description = (UpdateBlueprint -> Maybe Text)
-> (UpdateBlueprint -> Maybe Text -> UpdateBlueprint)
-> Lens UpdateBlueprint UpdateBlueprint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBlueprint' {Maybe Text
description :: Maybe Text
$sel:description:UpdateBlueprint' :: UpdateBlueprint -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateBlueprint
s@UpdateBlueprint' {} Maybe Text
a -> UpdateBlueprint
s {$sel:description:UpdateBlueprint' :: Maybe Text
description = Maybe Text
a} :: UpdateBlueprint)
updateBlueprint_name :: Lens.Lens' UpdateBlueprint Prelude.Text
updateBlueprint_name :: (Text -> f Text) -> UpdateBlueprint -> f UpdateBlueprint
updateBlueprint_name = (UpdateBlueprint -> Text)
-> (UpdateBlueprint -> Text -> UpdateBlueprint)
-> Lens UpdateBlueprint UpdateBlueprint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBlueprint' {Text
name :: Text
$sel:name:UpdateBlueprint' :: UpdateBlueprint -> Text
name} -> Text
name) (\s :: UpdateBlueprint
s@UpdateBlueprint' {} Text
a -> UpdateBlueprint
s {$sel:name:UpdateBlueprint' :: Text
name = Text
a} :: UpdateBlueprint)
updateBlueprint_blueprintLocation :: Lens.Lens' UpdateBlueprint Prelude.Text
updateBlueprint_blueprintLocation :: (Text -> f Text) -> UpdateBlueprint -> f UpdateBlueprint
updateBlueprint_blueprintLocation = (UpdateBlueprint -> Text)
-> (UpdateBlueprint -> Text -> UpdateBlueprint)
-> Lens UpdateBlueprint UpdateBlueprint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBlueprint' {Text
blueprintLocation :: Text
$sel:blueprintLocation:UpdateBlueprint' :: UpdateBlueprint -> Text
blueprintLocation} -> Text
blueprintLocation) (\s :: UpdateBlueprint
s@UpdateBlueprint' {} Text
a -> UpdateBlueprint
s {$sel:blueprintLocation:UpdateBlueprint' :: Text
blueprintLocation = Text
a} :: UpdateBlueprint)
instance Core.AWSRequest UpdateBlueprint where
type
AWSResponse UpdateBlueprint =
UpdateBlueprintResponse
request :: UpdateBlueprint -> Request UpdateBlueprint
request = Service -> UpdateBlueprint -> Request UpdateBlueprint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateBlueprint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBlueprint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateBlueprint))
-> Logger
-> Service
-> Proxy UpdateBlueprint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBlueprint)))
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 -> Int -> UpdateBlueprintResponse
UpdateBlueprintResponse'
(Maybe Text -> Int -> UpdateBlueprintResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateBlueprintResponse)
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
"Name")
Either String (Int -> UpdateBlueprintResponse)
-> Either String Int -> Either String UpdateBlueprintResponse
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 UpdateBlueprint
instance Prelude.NFData UpdateBlueprint
instance Core.ToHeaders UpdateBlueprint where
toHeaders :: UpdateBlueprint -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateBlueprint -> 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.UpdateBlueprint" :: 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 UpdateBlueprint where
toJSON :: UpdateBlueprint -> Value
toJSON UpdateBlueprint' {Maybe Text
Text
blueprintLocation :: Text
name :: Text
description :: Maybe Text
$sel:blueprintLocation:UpdateBlueprint' :: UpdateBlueprint -> Text
$sel:name:UpdateBlueprint' :: UpdateBlueprint -> Text
$sel:description:UpdateBlueprint' :: UpdateBlueprint -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"BlueprintLocation" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
blueprintLocation)
]
)
instance Core.ToPath UpdateBlueprint where
toPath :: UpdateBlueprint -> ByteString
toPath = ByteString -> UpdateBlueprint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateBlueprint where
toQuery :: UpdateBlueprint -> QueryString
toQuery = QueryString -> UpdateBlueprint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateBlueprintResponse = UpdateBlueprintResponse'
{
UpdateBlueprintResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateBlueprintResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool
(UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool)
-> (UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool)
-> Eq UpdateBlueprintResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool
$c/= :: UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool
== :: UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool
$c== :: UpdateBlueprintResponse -> UpdateBlueprintResponse -> Bool
Prelude.Eq, ReadPrec [UpdateBlueprintResponse]
ReadPrec UpdateBlueprintResponse
Int -> ReadS UpdateBlueprintResponse
ReadS [UpdateBlueprintResponse]
(Int -> ReadS UpdateBlueprintResponse)
-> ReadS [UpdateBlueprintResponse]
-> ReadPrec UpdateBlueprintResponse
-> ReadPrec [UpdateBlueprintResponse]
-> Read UpdateBlueprintResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBlueprintResponse]
$creadListPrec :: ReadPrec [UpdateBlueprintResponse]
readPrec :: ReadPrec UpdateBlueprintResponse
$creadPrec :: ReadPrec UpdateBlueprintResponse
readList :: ReadS [UpdateBlueprintResponse]
$creadList :: ReadS [UpdateBlueprintResponse]
readsPrec :: Int -> ReadS UpdateBlueprintResponse
$creadsPrec :: Int -> ReadS UpdateBlueprintResponse
Prelude.Read, Int -> UpdateBlueprintResponse -> ShowS
[UpdateBlueprintResponse] -> ShowS
UpdateBlueprintResponse -> String
(Int -> UpdateBlueprintResponse -> ShowS)
-> (UpdateBlueprintResponse -> String)
-> ([UpdateBlueprintResponse] -> ShowS)
-> Show UpdateBlueprintResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBlueprintResponse] -> ShowS
$cshowList :: [UpdateBlueprintResponse] -> ShowS
show :: UpdateBlueprintResponse -> String
$cshow :: UpdateBlueprintResponse -> String
showsPrec :: Int -> UpdateBlueprintResponse -> ShowS
$cshowsPrec :: Int -> UpdateBlueprintResponse -> ShowS
Prelude.Show, (forall x.
UpdateBlueprintResponse -> Rep UpdateBlueprintResponse x)
-> (forall x.
Rep UpdateBlueprintResponse x -> UpdateBlueprintResponse)
-> Generic UpdateBlueprintResponse
forall x. Rep UpdateBlueprintResponse x -> UpdateBlueprintResponse
forall x. UpdateBlueprintResponse -> Rep UpdateBlueprintResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBlueprintResponse x -> UpdateBlueprintResponse
$cfrom :: forall x. UpdateBlueprintResponse -> Rep UpdateBlueprintResponse x
Prelude.Generic)
newUpdateBlueprintResponse ::
Prelude.Int ->
UpdateBlueprintResponse
newUpdateBlueprintResponse :: Int -> UpdateBlueprintResponse
newUpdateBlueprintResponse Int
pHttpStatus_ =
UpdateBlueprintResponse' :: Maybe Text -> Int -> UpdateBlueprintResponse
UpdateBlueprintResponse'
{ $sel:name:UpdateBlueprintResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateBlueprintResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateBlueprintResponse_name :: Lens.Lens' UpdateBlueprintResponse (Prelude.Maybe Prelude.Text)
updateBlueprintResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateBlueprintResponse -> f UpdateBlueprintResponse
updateBlueprintResponse_name = (UpdateBlueprintResponse -> Maybe Text)
-> (UpdateBlueprintResponse
-> Maybe Text -> UpdateBlueprintResponse)
-> Lens
UpdateBlueprintResponse
UpdateBlueprintResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBlueprintResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateBlueprintResponse' :: UpdateBlueprintResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateBlueprintResponse
s@UpdateBlueprintResponse' {} Maybe Text
a -> UpdateBlueprintResponse
s {$sel:name:UpdateBlueprintResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateBlueprintResponse)
updateBlueprintResponse_httpStatus :: Lens.Lens' UpdateBlueprintResponse Prelude.Int
updateBlueprintResponse_httpStatus :: (Int -> f Int)
-> UpdateBlueprintResponse -> f UpdateBlueprintResponse
updateBlueprintResponse_httpStatus = (UpdateBlueprintResponse -> Int)
-> (UpdateBlueprintResponse -> Int -> UpdateBlueprintResponse)
-> Lens UpdateBlueprintResponse UpdateBlueprintResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBlueprintResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateBlueprintResponse' :: UpdateBlueprintResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateBlueprintResponse
s@UpdateBlueprintResponse' {} Int
a -> UpdateBlueprintResponse
s {$sel:httpStatus:UpdateBlueprintResponse' :: Int
httpStatus = Int
a} :: UpdateBlueprintResponse)
instance Prelude.NFData UpdateBlueprintResponse