{-# 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.UpdateSchema
(
UpdateSchema (..),
newUpdateSchema,
updateSchema_compatibility,
updateSchema_description,
updateSchema_schemaVersionNumber,
updateSchema_schemaId,
UpdateSchemaResponse (..),
newUpdateSchemaResponse,
updateSchemaResponse_registryName,
updateSchemaResponse_schemaArn,
updateSchemaResponse_schemaName,
updateSchemaResponse_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 UpdateSchema = UpdateSchema'
{
UpdateSchema -> Maybe Compatibility
compatibility :: Prelude.Maybe Compatibility,
UpdateSchema -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateSchema -> Maybe SchemaVersionNumber
schemaVersionNumber :: Prelude.Maybe SchemaVersionNumber,
UpdateSchema -> SchemaId
schemaId :: SchemaId
}
deriving (UpdateSchema -> UpdateSchema -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSchema -> UpdateSchema -> Bool
$c/= :: UpdateSchema -> UpdateSchema -> Bool
== :: UpdateSchema -> UpdateSchema -> Bool
$c== :: UpdateSchema -> UpdateSchema -> Bool
Prelude.Eq, ReadPrec [UpdateSchema]
ReadPrec UpdateSchema
Int -> ReadS UpdateSchema
ReadS [UpdateSchema]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSchema]
$creadListPrec :: ReadPrec [UpdateSchema]
readPrec :: ReadPrec UpdateSchema
$creadPrec :: ReadPrec UpdateSchema
readList :: ReadS [UpdateSchema]
$creadList :: ReadS [UpdateSchema]
readsPrec :: Int -> ReadS UpdateSchema
$creadsPrec :: Int -> ReadS UpdateSchema
Prelude.Read, Int -> UpdateSchema -> ShowS
[UpdateSchema] -> ShowS
UpdateSchema -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSchema] -> ShowS
$cshowList :: [UpdateSchema] -> ShowS
show :: UpdateSchema -> String
$cshow :: UpdateSchema -> String
showsPrec :: Int -> UpdateSchema -> ShowS
$cshowsPrec :: Int -> UpdateSchema -> ShowS
Prelude.Show, forall x. Rep UpdateSchema x -> UpdateSchema
forall x. UpdateSchema -> Rep UpdateSchema x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSchema x -> UpdateSchema
$cfrom :: forall x. UpdateSchema -> Rep UpdateSchema x
Prelude.Generic)
newUpdateSchema ::
SchemaId ->
UpdateSchema
newUpdateSchema :: SchemaId -> UpdateSchema
newUpdateSchema SchemaId
pSchemaId_ =
UpdateSchema'
{ $sel:compatibility:UpdateSchema' :: Maybe Compatibility
compatibility = forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateSchema' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:schemaVersionNumber:UpdateSchema' :: Maybe SchemaVersionNumber
schemaVersionNumber = forall a. Maybe a
Prelude.Nothing,
$sel:schemaId:UpdateSchema' :: SchemaId
schemaId = SchemaId
pSchemaId_
}
updateSchema_compatibility :: Lens.Lens' UpdateSchema (Prelude.Maybe Compatibility)
updateSchema_compatibility :: Lens' UpdateSchema (Maybe Compatibility)
updateSchema_compatibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe Compatibility
compatibility :: Maybe Compatibility
$sel:compatibility:UpdateSchema' :: UpdateSchema -> Maybe Compatibility
compatibility} -> Maybe Compatibility
compatibility) (\s :: UpdateSchema
s@UpdateSchema' {} Maybe Compatibility
a -> UpdateSchema
s {$sel:compatibility:UpdateSchema' :: Maybe Compatibility
compatibility = Maybe Compatibility
a} :: UpdateSchema)
updateSchema_description :: Lens.Lens' UpdateSchema (Prelude.Maybe Prelude.Text)
updateSchema_description :: Lens' UpdateSchema (Maybe Text)
updateSchema_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe Text
description :: Maybe Text
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateSchema
s@UpdateSchema' {} Maybe Text
a -> UpdateSchema
s {$sel:description:UpdateSchema' :: Maybe Text
description = Maybe Text
a} :: UpdateSchema)
updateSchema_schemaVersionNumber :: Lens.Lens' UpdateSchema (Prelude.Maybe SchemaVersionNumber)
updateSchema_schemaVersionNumber :: Lens' UpdateSchema (Maybe SchemaVersionNumber)
updateSchema_schemaVersionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe SchemaVersionNumber
schemaVersionNumber :: Maybe SchemaVersionNumber
$sel:schemaVersionNumber:UpdateSchema' :: UpdateSchema -> Maybe SchemaVersionNumber
schemaVersionNumber} -> Maybe SchemaVersionNumber
schemaVersionNumber) (\s :: UpdateSchema
s@UpdateSchema' {} Maybe SchemaVersionNumber
a -> UpdateSchema
s {$sel:schemaVersionNumber:UpdateSchema' :: Maybe SchemaVersionNumber
schemaVersionNumber = Maybe SchemaVersionNumber
a} :: UpdateSchema)
updateSchema_schemaId :: Lens.Lens' UpdateSchema SchemaId
updateSchema_schemaId :: Lens' UpdateSchema SchemaId
updateSchema_schemaId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {SchemaId
schemaId :: SchemaId
$sel:schemaId:UpdateSchema' :: UpdateSchema -> SchemaId
schemaId} -> SchemaId
schemaId) (\s :: UpdateSchema
s@UpdateSchema' {} SchemaId
a -> UpdateSchema
s {$sel:schemaId:UpdateSchema' :: SchemaId
schemaId = SchemaId
a} :: UpdateSchema)
instance Core.AWSRequest UpdateSchema where
type AWSResponse UpdateSchema = UpdateSchemaResponse
request :: (Service -> Service) -> UpdateSchema -> Request UpdateSchema
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 UpdateSchema
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateSchema)))
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 -> Maybe Text -> Int -> UpdateSchemaResponse
UpdateSchemaResponse'
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
"RegistryName")
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
"SchemaArn")
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
"SchemaName")
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 UpdateSchema where
hashWithSalt :: Int -> UpdateSchema -> Int
hashWithSalt Int
_salt UpdateSchema' {Maybe Text
Maybe Compatibility
Maybe SchemaVersionNumber
SchemaId
schemaId :: SchemaId
schemaVersionNumber :: Maybe SchemaVersionNumber
description :: Maybe Text
compatibility :: Maybe Compatibility
$sel:schemaId:UpdateSchema' :: UpdateSchema -> SchemaId
$sel:schemaVersionNumber:UpdateSchema' :: UpdateSchema -> Maybe SchemaVersionNumber
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:compatibility:UpdateSchema' :: UpdateSchema -> Maybe Compatibility
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Compatibility
compatibility
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SchemaVersionNumber
schemaVersionNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SchemaId
schemaId
instance Prelude.NFData UpdateSchema where
rnf :: UpdateSchema -> ()
rnf UpdateSchema' {Maybe Text
Maybe Compatibility
Maybe SchemaVersionNumber
SchemaId
schemaId :: SchemaId
schemaVersionNumber :: Maybe SchemaVersionNumber
description :: Maybe Text
compatibility :: Maybe Compatibility
$sel:schemaId:UpdateSchema' :: UpdateSchema -> SchemaId
$sel:schemaVersionNumber:UpdateSchema' :: UpdateSchema -> Maybe SchemaVersionNumber
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:compatibility:UpdateSchema' :: UpdateSchema -> Maybe Compatibility
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Compatibility
compatibility
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe SchemaVersionNumber
schemaVersionNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SchemaId
schemaId
instance Data.ToHeaders UpdateSchema where
toHeaders :: UpdateSchema -> 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.UpdateSchema" :: 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 UpdateSchema where
toJSON :: UpdateSchema -> Value
toJSON UpdateSchema' {Maybe Text
Maybe Compatibility
Maybe SchemaVersionNumber
SchemaId
schemaId :: SchemaId
schemaVersionNumber :: Maybe SchemaVersionNumber
description :: Maybe Text
compatibility :: Maybe Compatibility
$sel:schemaId:UpdateSchema' :: UpdateSchema -> SchemaId
$sel:schemaVersionNumber:UpdateSchema' :: UpdateSchema -> Maybe SchemaVersionNumber
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:compatibility:UpdateSchema' :: UpdateSchema -> Maybe Compatibility
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Compatibility" 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 Compatibility
compatibility,
(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,
(Key
"SchemaVersionNumber" 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 SchemaVersionNumber
schemaVersionNumber,
forall a. a -> Maybe a
Prelude.Just (Key
"SchemaId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SchemaId
schemaId)
]
)
instance Data.ToPath UpdateSchema where
toPath :: UpdateSchema -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateSchema where
toQuery :: UpdateSchema -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateSchemaResponse = UpdateSchemaResponse'
{
UpdateSchemaResponse -> Maybe Text
registryName :: Prelude.Maybe Prelude.Text,
UpdateSchemaResponse -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
UpdateSchemaResponse -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
UpdateSchemaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
$c/= :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
== :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
$c== :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSchemaResponse]
ReadPrec UpdateSchemaResponse
Int -> ReadS UpdateSchemaResponse
ReadS [UpdateSchemaResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSchemaResponse]
$creadListPrec :: ReadPrec [UpdateSchemaResponse]
readPrec :: ReadPrec UpdateSchemaResponse
$creadPrec :: ReadPrec UpdateSchemaResponse
readList :: ReadS [UpdateSchemaResponse]
$creadList :: ReadS [UpdateSchemaResponse]
readsPrec :: Int -> ReadS UpdateSchemaResponse
$creadsPrec :: Int -> ReadS UpdateSchemaResponse
Prelude.Read, Int -> UpdateSchemaResponse -> ShowS
[UpdateSchemaResponse] -> ShowS
UpdateSchemaResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSchemaResponse] -> ShowS
$cshowList :: [UpdateSchemaResponse] -> ShowS
show :: UpdateSchemaResponse -> String
$cshow :: UpdateSchemaResponse -> String
showsPrec :: Int -> UpdateSchemaResponse -> ShowS
$cshowsPrec :: Int -> UpdateSchemaResponse -> ShowS
Prelude.Show, forall x. Rep UpdateSchemaResponse x -> UpdateSchemaResponse
forall x. UpdateSchemaResponse -> Rep UpdateSchemaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSchemaResponse x -> UpdateSchemaResponse
$cfrom :: forall x. UpdateSchemaResponse -> Rep UpdateSchemaResponse x
Prelude.Generic)
newUpdateSchemaResponse ::
Prelude.Int ->
UpdateSchemaResponse
newUpdateSchemaResponse :: Int -> UpdateSchemaResponse
newUpdateSchemaResponse Int
pHttpStatus_ =
UpdateSchemaResponse'
{ $sel:registryName:UpdateSchemaResponse' :: Maybe Text
registryName =
forall a. Maybe a
Prelude.Nothing,
$sel:schemaArn:UpdateSchemaResponse' :: Maybe Text
schemaArn = forall a. Maybe a
Prelude.Nothing,
$sel:schemaName:UpdateSchemaResponse' :: Maybe Text
schemaName = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateSchemaResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateSchemaResponse_registryName :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_registryName :: Lens' UpdateSchemaResponse (Maybe Text)
updateSchemaResponse_registryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
registryName :: Maybe Text
$sel:registryName:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
registryName} -> Maybe Text
registryName) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:registryName:UpdateSchemaResponse' :: Maybe Text
registryName = Maybe Text
a} :: UpdateSchemaResponse)
updateSchemaResponse_schemaArn :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_schemaArn :: Lens' UpdateSchemaResponse (Maybe Text)
updateSchemaResponse_schemaArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:schemaArn:UpdateSchemaResponse' :: Maybe Text
schemaArn = Maybe Text
a} :: UpdateSchemaResponse)
updateSchemaResponse_schemaName :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_schemaName :: Lens' UpdateSchemaResponse (Maybe Text)
updateSchemaResponse_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:schemaName:UpdateSchemaResponse' :: Maybe Text
schemaName = Maybe Text
a} :: UpdateSchemaResponse)
updateSchemaResponse_httpStatus :: Lens.Lens' UpdateSchemaResponse Prelude.Int
updateSchemaResponse_httpStatus :: Lens' UpdateSchemaResponse Int
updateSchemaResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSchemaResponse' :: UpdateSchemaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Int
a -> UpdateSchemaResponse
s {$sel:httpStatus:UpdateSchemaResponse' :: Int
httpStatus = Int
a} :: UpdateSchemaResponse)
instance Prelude.NFData UpdateSchemaResponse where
rnf :: UpdateSchemaResponse -> ()
rnf UpdateSchemaResponse' {Int
Maybe Text
httpStatus :: Int
schemaName :: Maybe Text
schemaArn :: Maybe Text
registryName :: Maybe Text
$sel:httpStatus:UpdateSchemaResponse' :: UpdateSchemaResponse -> Int
$sel:schemaName:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
$sel:schemaArn:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
$sel:registryName:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
..} =
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 Maybe Text
schemaArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus