{-# 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.DeleteSchemaVersions
(
DeleteSchemaVersions (..),
newDeleteSchemaVersions,
deleteSchemaVersions_schemaId,
deleteSchemaVersions_versions,
DeleteSchemaVersionsResponse (..),
newDeleteSchemaVersionsResponse,
deleteSchemaVersionsResponse_schemaVersionErrors,
deleteSchemaVersionsResponse_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 DeleteSchemaVersions = DeleteSchemaVersions'
{
DeleteSchemaVersions -> SchemaId
schemaId :: SchemaId,
DeleteSchemaVersions -> Text
versions :: Prelude.Text
}
deriving (DeleteSchemaVersions -> DeleteSchemaVersions -> Bool
(DeleteSchemaVersions -> DeleteSchemaVersions -> Bool)
-> (DeleteSchemaVersions -> DeleteSchemaVersions -> Bool)
-> Eq DeleteSchemaVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSchemaVersions -> DeleteSchemaVersions -> Bool
$c/= :: DeleteSchemaVersions -> DeleteSchemaVersions -> Bool
== :: DeleteSchemaVersions -> DeleteSchemaVersions -> Bool
$c== :: DeleteSchemaVersions -> DeleteSchemaVersions -> Bool
Prelude.Eq, ReadPrec [DeleteSchemaVersions]
ReadPrec DeleteSchemaVersions
Int -> ReadS DeleteSchemaVersions
ReadS [DeleteSchemaVersions]
(Int -> ReadS DeleteSchemaVersions)
-> ReadS [DeleteSchemaVersions]
-> ReadPrec DeleteSchemaVersions
-> ReadPrec [DeleteSchemaVersions]
-> Read DeleteSchemaVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSchemaVersions]
$creadListPrec :: ReadPrec [DeleteSchemaVersions]
readPrec :: ReadPrec DeleteSchemaVersions
$creadPrec :: ReadPrec DeleteSchemaVersions
readList :: ReadS [DeleteSchemaVersions]
$creadList :: ReadS [DeleteSchemaVersions]
readsPrec :: Int -> ReadS DeleteSchemaVersions
$creadsPrec :: Int -> ReadS DeleteSchemaVersions
Prelude.Read, Int -> DeleteSchemaVersions -> ShowS
[DeleteSchemaVersions] -> ShowS
DeleteSchemaVersions -> String
(Int -> DeleteSchemaVersions -> ShowS)
-> (DeleteSchemaVersions -> String)
-> ([DeleteSchemaVersions] -> ShowS)
-> Show DeleteSchemaVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSchemaVersions] -> ShowS
$cshowList :: [DeleteSchemaVersions] -> ShowS
show :: DeleteSchemaVersions -> String
$cshow :: DeleteSchemaVersions -> String
showsPrec :: Int -> DeleteSchemaVersions -> ShowS
$cshowsPrec :: Int -> DeleteSchemaVersions -> ShowS
Prelude.Show, (forall x. DeleteSchemaVersions -> Rep DeleteSchemaVersions x)
-> (forall x. Rep DeleteSchemaVersions x -> DeleteSchemaVersions)
-> Generic DeleteSchemaVersions
forall x. Rep DeleteSchemaVersions x -> DeleteSchemaVersions
forall x. DeleteSchemaVersions -> Rep DeleteSchemaVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSchemaVersions x -> DeleteSchemaVersions
$cfrom :: forall x. DeleteSchemaVersions -> Rep DeleteSchemaVersions x
Prelude.Generic)
newDeleteSchemaVersions ::
SchemaId ->
Prelude.Text ->
DeleteSchemaVersions
newDeleteSchemaVersions :: SchemaId -> Text -> DeleteSchemaVersions
newDeleteSchemaVersions SchemaId
pSchemaId_ Text
pVersions_ =
DeleteSchemaVersions' :: SchemaId -> Text -> DeleteSchemaVersions
DeleteSchemaVersions'
{ $sel:schemaId:DeleteSchemaVersions' :: SchemaId
schemaId = SchemaId
pSchemaId_,
$sel:versions:DeleteSchemaVersions' :: Text
versions = Text
pVersions_
}
deleteSchemaVersions_schemaId :: Lens.Lens' DeleteSchemaVersions SchemaId
deleteSchemaVersions_schemaId :: (SchemaId -> f SchemaId)
-> DeleteSchemaVersions -> f DeleteSchemaVersions
deleteSchemaVersions_schemaId = (DeleteSchemaVersions -> SchemaId)
-> (DeleteSchemaVersions -> SchemaId -> DeleteSchemaVersions)
-> Lens DeleteSchemaVersions DeleteSchemaVersions SchemaId SchemaId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchemaVersions' {SchemaId
schemaId :: SchemaId
$sel:schemaId:DeleteSchemaVersions' :: DeleteSchemaVersions -> SchemaId
schemaId} -> SchemaId
schemaId) (\s :: DeleteSchemaVersions
s@DeleteSchemaVersions' {} SchemaId
a -> DeleteSchemaVersions
s {$sel:schemaId:DeleteSchemaVersions' :: SchemaId
schemaId = SchemaId
a} :: DeleteSchemaVersions)
deleteSchemaVersions_versions :: Lens.Lens' DeleteSchemaVersions Prelude.Text
deleteSchemaVersions_versions :: (Text -> f Text) -> DeleteSchemaVersions -> f DeleteSchemaVersions
deleteSchemaVersions_versions = (DeleteSchemaVersions -> Text)
-> (DeleteSchemaVersions -> Text -> DeleteSchemaVersions)
-> Lens DeleteSchemaVersions DeleteSchemaVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchemaVersions' {Text
versions :: Text
$sel:versions:DeleteSchemaVersions' :: DeleteSchemaVersions -> Text
versions} -> Text
versions) (\s :: DeleteSchemaVersions
s@DeleteSchemaVersions' {} Text
a -> DeleteSchemaVersions
s {$sel:versions:DeleteSchemaVersions' :: Text
versions = Text
a} :: DeleteSchemaVersions)
instance Core.AWSRequest DeleteSchemaVersions where
type
AWSResponse DeleteSchemaVersions =
DeleteSchemaVersionsResponse
request :: DeleteSchemaVersions -> Request DeleteSchemaVersions
request = Service -> DeleteSchemaVersions -> Request DeleteSchemaVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSchemaVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSchemaVersions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteSchemaVersions))
-> Logger
-> Service
-> Proxy DeleteSchemaVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSchemaVersions)))
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 [SchemaVersionErrorItem]
-> Int -> DeleteSchemaVersionsResponse
DeleteSchemaVersionsResponse'
(Maybe [SchemaVersionErrorItem]
-> Int -> DeleteSchemaVersionsResponse)
-> Either String (Maybe [SchemaVersionErrorItem])
-> Either String (Int -> DeleteSchemaVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [SchemaVersionErrorItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SchemaVersionErrors"
Either String (Maybe (Maybe [SchemaVersionErrorItem]))
-> Maybe [SchemaVersionErrorItem]
-> Either String (Maybe [SchemaVersionErrorItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SchemaVersionErrorItem]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DeleteSchemaVersionsResponse)
-> Either String Int -> Either String DeleteSchemaVersionsResponse
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 DeleteSchemaVersions
instance Prelude.NFData DeleteSchemaVersions
instance Core.ToHeaders DeleteSchemaVersions where
toHeaders :: DeleteSchemaVersions -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteSchemaVersions -> 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.DeleteSchemaVersions" ::
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 DeleteSchemaVersions where
toJSON :: DeleteSchemaVersions -> Value
toJSON DeleteSchemaVersions' {Text
SchemaId
versions :: Text
schemaId :: SchemaId
$sel:versions:DeleteSchemaVersions' :: DeleteSchemaVersions -> Text
$sel:schemaId:DeleteSchemaVersions' :: DeleteSchemaVersions -> SchemaId
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SchemaId" Text -> SchemaId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaId
schemaId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Versions" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
versions)
]
)
instance Core.ToPath DeleteSchemaVersions where
toPath :: DeleteSchemaVersions -> ByteString
toPath = ByteString -> DeleteSchemaVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteSchemaVersions where
toQuery :: DeleteSchemaVersions -> QueryString
toQuery = QueryString -> DeleteSchemaVersions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSchemaVersionsResponse = DeleteSchemaVersionsResponse'
{
DeleteSchemaVersionsResponse -> Maybe [SchemaVersionErrorItem]
schemaVersionErrors :: Prelude.Maybe [SchemaVersionErrorItem],
DeleteSchemaVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool
(DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool)
-> (DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool)
-> Eq DeleteSchemaVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool
$c/= :: DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool
== :: DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool
$c== :: DeleteSchemaVersionsResponse
-> DeleteSchemaVersionsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSchemaVersionsResponse]
ReadPrec DeleteSchemaVersionsResponse
Int -> ReadS DeleteSchemaVersionsResponse
ReadS [DeleteSchemaVersionsResponse]
(Int -> ReadS DeleteSchemaVersionsResponse)
-> ReadS [DeleteSchemaVersionsResponse]
-> ReadPrec DeleteSchemaVersionsResponse
-> ReadPrec [DeleteSchemaVersionsResponse]
-> Read DeleteSchemaVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSchemaVersionsResponse]
$creadListPrec :: ReadPrec [DeleteSchemaVersionsResponse]
readPrec :: ReadPrec DeleteSchemaVersionsResponse
$creadPrec :: ReadPrec DeleteSchemaVersionsResponse
readList :: ReadS [DeleteSchemaVersionsResponse]
$creadList :: ReadS [DeleteSchemaVersionsResponse]
readsPrec :: Int -> ReadS DeleteSchemaVersionsResponse
$creadsPrec :: Int -> ReadS DeleteSchemaVersionsResponse
Prelude.Read, Int -> DeleteSchemaVersionsResponse -> ShowS
[DeleteSchemaVersionsResponse] -> ShowS
DeleteSchemaVersionsResponse -> String
(Int -> DeleteSchemaVersionsResponse -> ShowS)
-> (DeleteSchemaVersionsResponse -> String)
-> ([DeleteSchemaVersionsResponse] -> ShowS)
-> Show DeleteSchemaVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSchemaVersionsResponse] -> ShowS
$cshowList :: [DeleteSchemaVersionsResponse] -> ShowS
show :: DeleteSchemaVersionsResponse -> String
$cshow :: DeleteSchemaVersionsResponse -> String
showsPrec :: Int -> DeleteSchemaVersionsResponse -> ShowS
$cshowsPrec :: Int -> DeleteSchemaVersionsResponse -> ShowS
Prelude.Show, (forall x.
DeleteSchemaVersionsResponse -> Rep DeleteSchemaVersionsResponse x)
-> (forall x.
Rep DeleteSchemaVersionsResponse x -> DeleteSchemaVersionsResponse)
-> Generic DeleteSchemaVersionsResponse
forall x.
Rep DeleteSchemaVersionsResponse x -> DeleteSchemaVersionsResponse
forall x.
DeleteSchemaVersionsResponse -> Rep DeleteSchemaVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSchemaVersionsResponse x -> DeleteSchemaVersionsResponse
$cfrom :: forall x.
DeleteSchemaVersionsResponse -> Rep DeleteSchemaVersionsResponse x
Prelude.Generic)
newDeleteSchemaVersionsResponse ::
Prelude.Int ->
DeleteSchemaVersionsResponse
newDeleteSchemaVersionsResponse :: Int -> DeleteSchemaVersionsResponse
newDeleteSchemaVersionsResponse Int
pHttpStatus_ =
DeleteSchemaVersionsResponse' :: Maybe [SchemaVersionErrorItem]
-> Int -> DeleteSchemaVersionsResponse
DeleteSchemaVersionsResponse'
{ $sel:schemaVersionErrors:DeleteSchemaVersionsResponse' :: Maybe [SchemaVersionErrorItem]
schemaVersionErrors =
Maybe [SchemaVersionErrorItem]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteSchemaVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteSchemaVersionsResponse_schemaVersionErrors :: Lens.Lens' DeleteSchemaVersionsResponse (Prelude.Maybe [SchemaVersionErrorItem])
deleteSchemaVersionsResponse_schemaVersionErrors :: (Maybe [SchemaVersionErrorItem]
-> f (Maybe [SchemaVersionErrorItem]))
-> DeleteSchemaVersionsResponse -> f DeleteSchemaVersionsResponse
deleteSchemaVersionsResponse_schemaVersionErrors = (DeleteSchemaVersionsResponse -> Maybe [SchemaVersionErrorItem])
-> (DeleteSchemaVersionsResponse
-> Maybe [SchemaVersionErrorItem] -> DeleteSchemaVersionsResponse)
-> Lens
DeleteSchemaVersionsResponse
DeleteSchemaVersionsResponse
(Maybe [SchemaVersionErrorItem])
(Maybe [SchemaVersionErrorItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchemaVersionsResponse' {Maybe [SchemaVersionErrorItem]
schemaVersionErrors :: Maybe [SchemaVersionErrorItem]
$sel:schemaVersionErrors:DeleteSchemaVersionsResponse' :: DeleteSchemaVersionsResponse -> Maybe [SchemaVersionErrorItem]
schemaVersionErrors} -> Maybe [SchemaVersionErrorItem]
schemaVersionErrors) (\s :: DeleteSchemaVersionsResponse
s@DeleteSchemaVersionsResponse' {} Maybe [SchemaVersionErrorItem]
a -> DeleteSchemaVersionsResponse
s {$sel:schemaVersionErrors:DeleteSchemaVersionsResponse' :: Maybe [SchemaVersionErrorItem]
schemaVersionErrors = Maybe [SchemaVersionErrorItem]
a} :: DeleteSchemaVersionsResponse) ((Maybe [SchemaVersionErrorItem]
-> f (Maybe [SchemaVersionErrorItem]))
-> DeleteSchemaVersionsResponse -> f DeleteSchemaVersionsResponse)
-> ((Maybe [SchemaVersionErrorItem]
-> f (Maybe [SchemaVersionErrorItem]))
-> Maybe [SchemaVersionErrorItem]
-> f (Maybe [SchemaVersionErrorItem]))
-> (Maybe [SchemaVersionErrorItem]
-> f (Maybe [SchemaVersionErrorItem]))
-> DeleteSchemaVersionsResponse
-> f DeleteSchemaVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SchemaVersionErrorItem]
[SchemaVersionErrorItem]
[SchemaVersionErrorItem]
[SchemaVersionErrorItem]
-> Iso
(Maybe [SchemaVersionErrorItem])
(Maybe [SchemaVersionErrorItem])
(Maybe [SchemaVersionErrorItem])
(Maybe [SchemaVersionErrorItem])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[SchemaVersionErrorItem]
[SchemaVersionErrorItem]
[SchemaVersionErrorItem]
[SchemaVersionErrorItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteSchemaVersionsResponse_httpStatus :: Lens.Lens' DeleteSchemaVersionsResponse Prelude.Int
deleteSchemaVersionsResponse_httpStatus :: (Int -> f Int)
-> DeleteSchemaVersionsResponse -> f DeleteSchemaVersionsResponse
deleteSchemaVersionsResponse_httpStatus = (DeleteSchemaVersionsResponse -> Int)
-> (DeleteSchemaVersionsResponse
-> Int -> DeleteSchemaVersionsResponse)
-> Lens
DeleteSchemaVersionsResponse DeleteSchemaVersionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchemaVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSchemaVersionsResponse' :: DeleteSchemaVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSchemaVersionsResponse
s@DeleteSchemaVersionsResponse' {} Int
a -> DeleteSchemaVersionsResponse
s {$sel:httpStatus:DeleteSchemaVersionsResponse' :: Int
httpStatus = Int
a} :: DeleteSchemaVersionsResponse)
instance Prelude.NFData DeleteSchemaVersionsResponse