{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types
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
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]
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
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. 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'
{ $sel:description:UpdateBlueprint' :: Maybe Text
description = 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 :: Lens' UpdateBlueprint (Maybe Text)
updateBlueprint_description = 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 :: Lens' UpdateBlueprint Text
updateBlueprint_name = 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 :: Lens' UpdateBlueprint Text
updateBlueprint_blueprintLocation = 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 :: (Service -> Service) -> UpdateBlueprint -> Request UpdateBlueprint
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateBlueprint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBlueprint)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> UpdateBlueprintResponse
UpdateBlueprintResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateBlueprint where
hashWithSalt :: Int -> UpdateBlueprint -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
blueprintLocation
instance Prelude.NFData UpdateBlueprint where
rnf :: UpdateBlueprint -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
blueprintLocation
instance Data.ToHeaders UpdateBlueprint where
toHeaders :: UpdateBlueprint -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AWSGlue.UpdateBlueprint" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just
(Key
"BlueprintLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
blueprintLocation)
]
)
instance Data.ToPath UpdateBlueprint where
toPath :: UpdateBlueprint -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateBlueprint where
toQuery :: UpdateBlueprint -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
{ $sel:name:UpdateBlueprintResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateBlueprintResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateBlueprintResponse_name :: Lens.Lens' UpdateBlueprintResponse (Prelude.Maybe Prelude.Text)
updateBlueprintResponse_name :: Lens' UpdateBlueprintResponse (Maybe Text)
updateBlueprintResponse_name = 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 :: Lens' UpdateBlueprintResponse Int
updateBlueprintResponse_httpStatus = 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 where
rnf :: UpdateBlueprintResponse -> ()
rnf UpdateBlueprintResponse' {Int
Maybe Text
httpStatus :: Int
name :: Maybe Text
$sel:httpStatus:UpdateBlueprintResponse' :: UpdateBlueprintResponse -> Int
$sel:name:UpdateBlueprintResponse' :: UpdateBlueprintResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus