{-# 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.UpdateRegistry
(
UpdateRegistry (..),
newUpdateRegistry,
updateRegistry_registryId,
updateRegistry_description,
UpdateRegistryResponse (..),
newUpdateRegistryResponse,
updateRegistryResponse_registryArn,
updateRegistryResponse_registryName,
updateRegistryResponse_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 UpdateRegistry = UpdateRegistry'
{
UpdateRegistry -> RegistryId
registryId :: RegistryId,
UpdateRegistry -> Text
description :: Prelude.Text
}
deriving (UpdateRegistry -> UpdateRegistry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRegistry -> UpdateRegistry -> Bool
$c/= :: UpdateRegistry -> UpdateRegistry -> Bool
== :: UpdateRegistry -> UpdateRegistry -> Bool
$c== :: UpdateRegistry -> UpdateRegistry -> Bool
Prelude.Eq, ReadPrec [UpdateRegistry]
ReadPrec UpdateRegistry
Int -> ReadS UpdateRegistry
ReadS [UpdateRegistry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRegistry]
$creadListPrec :: ReadPrec [UpdateRegistry]
readPrec :: ReadPrec UpdateRegistry
$creadPrec :: ReadPrec UpdateRegistry
readList :: ReadS [UpdateRegistry]
$creadList :: ReadS [UpdateRegistry]
readsPrec :: Int -> ReadS UpdateRegistry
$creadsPrec :: Int -> ReadS UpdateRegistry
Prelude.Read, Int -> UpdateRegistry -> ShowS
[UpdateRegistry] -> ShowS
UpdateRegistry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRegistry] -> ShowS
$cshowList :: [UpdateRegistry] -> ShowS
show :: UpdateRegistry -> String
$cshow :: UpdateRegistry -> String
showsPrec :: Int -> UpdateRegistry -> ShowS
$cshowsPrec :: Int -> UpdateRegistry -> ShowS
Prelude.Show, forall x. Rep UpdateRegistry x -> UpdateRegistry
forall x. UpdateRegistry -> Rep UpdateRegistry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRegistry x -> UpdateRegistry
$cfrom :: forall x. UpdateRegistry -> Rep UpdateRegistry x
Prelude.Generic)
newUpdateRegistry ::
RegistryId ->
Prelude.Text ->
UpdateRegistry
newUpdateRegistry :: RegistryId -> Text -> UpdateRegistry
newUpdateRegistry RegistryId
pRegistryId_ Text
pDescription_ =
UpdateRegistry'
{ $sel:registryId:UpdateRegistry' :: RegistryId
registryId = RegistryId
pRegistryId_,
$sel:description:UpdateRegistry' :: Text
description = Text
pDescription_
}
updateRegistry_registryId :: Lens.Lens' UpdateRegistry RegistryId
updateRegistry_registryId :: Lens' UpdateRegistry RegistryId
updateRegistry_registryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegistry' {RegistryId
registryId :: RegistryId
$sel:registryId:UpdateRegistry' :: UpdateRegistry -> RegistryId
registryId} -> RegistryId
registryId) (\s :: UpdateRegistry
s@UpdateRegistry' {} RegistryId
a -> UpdateRegistry
s {$sel:registryId:UpdateRegistry' :: RegistryId
registryId = RegistryId
a} :: UpdateRegistry)
updateRegistry_description :: Lens.Lens' UpdateRegistry Prelude.Text
updateRegistry_description :: Lens' UpdateRegistry Text
updateRegistry_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegistry' {Text
description :: Text
$sel:description:UpdateRegistry' :: UpdateRegistry -> Text
description} -> Text
description) (\s :: UpdateRegistry
s@UpdateRegistry' {} Text
a -> UpdateRegistry
s {$sel:description:UpdateRegistry' :: Text
description = Text
a} :: UpdateRegistry)
instance Core.AWSRequest UpdateRegistry where
type
AWSResponse UpdateRegistry =
UpdateRegistryResponse
request :: (Service -> Service) -> UpdateRegistry -> Request UpdateRegistry
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 UpdateRegistry
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRegistry)))
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 -> Maybe Text -> Int -> UpdateRegistryResponse
UpdateRegistryResponse'
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
"RegistryArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RegistryName")
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 UpdateRegistry where
hashWithSalt :: Int -> UpdateRegistry -> Int
hashWithSalt Int
_salt UpdateRegistry' {Text
RegistryId
description :: Text
registryId :: RegistryId
$sel:description:UpdateRegistry' :: UpdateRegistry -> Text
$sel:registryId:UpdateRegistry' :: UpdateRegistry -> RegistryId
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RegistryId
registryId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
instance Prelude.NFData UpdateRegistry where
rnf :: UpdateRegistry -> ()
rnf UpdateRegistry' {Text
RegistryId
description :: Text
registryId :: RegistryId
$sel:description:UpdateRegistry' :: UpdateRegistry -> Text
$sel:registryId:UpdateRegistry' :: UpdateRegistry -> RegistryId
..} =
forall a. NFData a => a -> ()
Prelude.rnf RegistryId
registryId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
instance Data.ToHeaders UpdateRegistry where
toHeaders :: UpdateRegistry -> 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.UpdateRegistry" :: 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 UpdateRegistry where
toJSON :: UpdateRegistry -> Value
toJSON UpdateRegistry' {Text
RegistryId
description :: Text
registryId :: RegistryId
$sel:description:UpdateRegistry' :: UpdateRegistry -> Text
$sel:registryId:UpdateRegistry' :: UpdateRegistry -> RegistryId
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"RegistryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RegistryId
registryId),
forall a. a -> Maybe a
Prelude.Just (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
description)
]
)
instance Data.ToPath UpdateRegistry where
toPath :: UpdateRegistry -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateRegistry where
toQuery :: UpdateRegistry -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateRegistryResponse = UpdateRegistryResponse'
{
UpdateRegistryResponse -> Maybe Text
registryArn :: Prelude.Maybe Prelude.Text,
UpdateRegistryResponse -> Maybe Text
registryName :: Prelude.Maybe Prelude.Text,
UpdateRegistryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRegistryResponse -> UpdateRegistryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRegistryResponse -> UpdateRegistryResponse -> Bool
$c/= :: UpdateRegistryResponse -> UpdateRegistryResponse -> Bool
== :: UpdateRegistryResponse -> UpdateRegistryResponse -> Bool
$c== :: UpdateRegistryResponse -> UpdateRegistryResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRegistryResponse]
ReadPrec UpdateRegistryResponse
Int -> ReadS UpdateRegistryResponse
ReadS [UpdateRegistryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRegistryResponse]
$creadListPrec :: ReadPrec [UpdateRegistryResponse]
readPrec :: ReadPrec UpdateRegistryResponse
$creadPrec :: ReadPrec UpdateRegistryResponse
readList :: ReadS [UpdateRegistryResponse]
$creadList :: ReadS [UpdateRegistryResponse]
readsPrec :: Int -> ReadS UpdateRegistryResponse
$creadsPrec :: Int -> ReadS UpdateRegistryResponse
Prelude.Read, Int -> UpdateRegistryResponse -> ShowS
[UpdateRegistryResponse] -> ShowS
UpdateRegistryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRegistryResponse] -> ShowS
$cshowList :: [UpdateRegistryResponse] -> ShowS
show :: UpdateRegistryResponse -> String
$cshow :: UpdateRegistryResponse -> String
showsPrec :: Int -> UpdateRegistryResponse -> ShowS
$cshowsPrec :: Int -> UpdateRegistryResponse -> ShowS
Prelude.Show, forall x. Rep UpdateRegistryResponse x -> UpdateRegistryResponse
forall x. UpdateRegistryResponse -> Rep UpdateRegistryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRegistryResponse x -> UpdateRegistryResponse
$cfrom :: forall x. UpdateRegistryResponse -> Rep UpdateRegistryResponse x
Prelude.Generic)
newUpdateRegistryResponse ::
Prelude.Int ->
UpdateRegistryResponse
newUpdateRegistryResponse :: Int -> UpdateRegistryResponse
newUpdateRegistryResponse Int
pHttpStatus_ =
UpdateRegistryResponse'
{ $sel:registryArn:UpdateRegistryResponse' :: Maybe Text
registryArn =
forall a. Maybe a
Prelude.Nothing,
$sel:registryName:UpdateRegistryResponse' :: Maybe Text
registryName = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateRegistryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateRegistryResponse_registryArn :: Lens.Lens' UpdateRegistryResponse (Prelude.Maybe Prelude.Text)
updateRegistryResponse_registryArn :: Lens' UpdateRegistryResponse (Maybe Text)
updateRegistryResponse_registryArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegistryResponse' {Maybe Text
registryArn :: Maybe Text
$sel:registryArn:UpdateRegistryResponse' :: UpdateRegistryResponse -> Maybe Text
registryArn} -> Maybe Text
registryArn) (\s :: UpdateRegistryResponse
s@UpdateRegistryResponse' {} Maybe Text
a -> UpdateRegistryResponse
s {$sel:registryArn:UpdateRegistryResponse' :: Maybe Text
registryArn = Maybe Text
a} :: UpdateRegistryResponse)
updateRegistryResponse_registryName :: Lens.Lens' UpdateRegistryResponse (Prelude.Maybe Prelude.Text)
updateRegistryResponse_registryName :: Lens' UpdateRegistryResponse (Maybe Text)
updateRegistryResponse_registryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegistryResponse' {Maybe Text
registryName :: Maybe Text
$sel:registryName:UpdateRegistryResponse' :: UpdateRegistryResponse -> Maybe Text
registryName} -> Maybe Text
registryName) (\s :: UpdateRegistryResponse
s@UpdateRegistryResponse' {} Maybe Text
a -> UpdateRegistryResponse
s {$sel:registryName:UpdateRegistryResponse' :: Maybe Text
registryName = Maybe Text
a} :: UpdateRegistryResponse)
updateRegistryResponse_httpStatus :: Lens.Lens' UpdateRegistryResponse Prelude.Int
updateRegistryResponse_httpStatus :: Lens' UpdateRegistryResponse Int
updateRegistryResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegistryResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRegistryResponse' :: UpdateRegistryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRegistryResponse
s@UpdateRegistryResponse' {} Int
a -> UpdateRegistryResponse
s {$sel:httpStatus:UpdateRegistryResponse' :: Int
httpStatus = Int
a} :: UpdateRegistryResponse)
instance Prelude.NFData UpdateRegistryResponse where
rnf :: UpdateRegistryResponse -> ()
rnf UpdateRegistryResponse' {Int
Maybe Text
httpStatus :: Int
registryName :: Maybe Text
registryArn :: Maybe Text
$sel:httpStatus:UpdateRegistryResponse' :: UpdateRegistryResponse -> Int
$sel:registryName:UpdateRegistryResponse' :: UpdateRegistryResponse -> Maybe Text
$sel:registryArn:UpdateRegistryResponse' :: UpdateRegistryResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registryArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registryName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus