{-# 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.DataBrew.BatchDeleteRecipeVersion
(
BatchDeleteRecipeVersion (..),
newBatchDeleteRecipeVersion,
batchDeleteRecipeVersion_name,
batchDeleteRecipeVersion_recipeVersions,
BatchDeleteRecipeVersionResponse (..),
newBatchDeleteRecipeVersionResponse,
batchDeleteRecipeVersionResponse_errors,
batchDeleteRecipeVersionResponse_httpStatus,
batchDeleteRecipeVersionResponse_name,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataBrew.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data BatchDeleteRecipeVersion = BatchDeleteRecipeVersion'
{
BatchDeleteRecipeVersion -> Text
name :: Prelude.Text,
BatchDeleteRecipeVersion -> NonEmpty Text
recipeVersions :: Prelude.NonEmpty Prelude.Text
}
deriving (BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool
$c/= :: BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool
== :: BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool
$c== :: BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool
Prelude.Eq, ReadPrec [BatchDeleteRecipeVersion]
ReadPrec BatchDeleteRecipeVersion
Int -> ReadS BatchDeleteRecipeVersion
ReadS [BatchDeleteRecipeVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteRecipeVersion]
$creadListPrec :: ReadPrec [BatchDeleteRecipeVersion]
readPrec :: ReadPrec BatchDeleteRecipeVersion
$creadPrec :: ReadPrec BatchDeleteRecipeVersion
readList :: ReadS [BatchDeleteRecipeVersion]
$creadList :: ReadS [BatchDeleteRecipeVersion]
readsPrec :: Int -> ReadS BatchDeleteRecipeVersion
$creadsPrec :: Int -> ReadS BatchDeleteRecipeVersion
Prelude.Read, Int -> BatchDeleteRecipeVersion -> ShowS
[BatchDeleteRecipeVersion] -> ShowS
BatchDeleteRecipeVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteRecipeVersion] -> ShowS
$cshowList :: [BatchDeleteRecipeVersion] -> ShowS
show :: BatchDeleteRecipeVersion -> String
$cshow :: BatchDeleteRecipeVersion -> String
showsPrec :: Int -> BatchDeleteRecipeVersion -> ShowS
$cshowsPrec :: Int -> BatchDeleteRecipeVersion -> ShowS
Prelude.Show, forall x.
Rep BatchDeleteRecipeVersion x -> BatchDeleteRecipeVersion
forall x.
BatchDeleteRecipeVersion -> Rep BatchDeleteRecipeVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteRecipeVersion x -> BatchDeleteRecipeVersion
$cfrom :: forall x.
BatchDeleteRecipeVersion -> Rep BatchDeleteRecipeVersion x
Prelude.Generic)
newBatchDeleteRecipeVersion ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
BatchDeleteRecipeVersion
newBatchDeleteRecipeVersion :: Text -> NonEmpty Text -> BatchDeleteRecipeVersion
newBatchDeleteRecipeVersion Text
pName_ NonEmpty Text
pRecipeVersions_ =
BatchDeleteRecipeVersion'
{ $sel:name:BatchDeleteRecipeVersion' :: Text
name = Text
pName_,
$sel:recipeVersions:BatchDeleteRecipeVersion' :: NonEmpty Text
recipeVersions =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pRecipeVersions_
}
batchDeleteRecipeVersion_name :: Lens.Lens' BatchDeleteRecipeVersion Prelude.Text
batchDeleteRecipeVersion_name :: Lens' BatchDeleteRecipeVersion Text
batchDeleteRecipeVersion_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteRecipeVersion' {Text
name :: Text
$sel:name:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> Text
name} -> Text
name) (\s :: BatchDeleteRecipeVersion
s@BatchDeleteRecipeVersion' {} Text
a -> BatchDeleteRecipeVersion
s {$sel:name:BatchDeleteRecipeVersion' :: Text
name = Text
a} :: BatchDeleteRecipeVersion)
batchDeleteRecipeVersion_recipeVersions :: Lens.Lens' BatchDeleteRecipeVersion (Prelude.NonEmpty Prelude.Text)
batchDeleteRecipeVersion_recipeVersions :: Lens' BatchDeleteRecipeVersion (NonEmpty Text)
batchDeleteRecipeVersion_recipeVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteRecipeVersion' {NonEmpty Text
recipeVersions :: NonEmpty Text
$sel:recipeVersions:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> NonEmpty Text
recipeVersions} -> NonEmpty Text
recipeVersions) (\s :: BatchDeleteRecipeVersion
s@BatchDeleteRecipeVersion' {} NonEmpty Text
a -> BatchDeleteRecipeVersion
s {$sel:recipeVersions:BatchDeleteRecipeVersion' :: NonEmpty Text
recipeVersions = NonEmpty Text
a} :: BatchDeleteRecipeVersion) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest BatchDeleteRecipeVersion where
type
AWSResponse BatchDeleteRecipeVersion =
BatchDeleteRecipeVersionResponse
request :: (Service -> Service)
-> BatchDeleteRecipeVersion -> Request BatchDeleteRecipeVersion
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 BatchDeleteRecipeVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchDeleteRecipeVersion)))
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 [RecipeVersionErrorDetail]
-> Int -> Text -> BatchDeleteRecipeVersionResponse
BatchDeleteRecipeVersionResponse'
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
"Errors" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"Name")
)
instance Prelude.Hashable BatchDeleteRecipeVersion where
hashWithSalt :: Int -> BatchDeleteRecipeVersion -> Int
hashWithSalt Int
_salt BatchDeleteRecipeVersion' {NonEmpty Text
Text
recipeVersions :: NonEmpty Text
name :: Text
$sel:recipeVersions:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> NonEmpty Text
$sel:name:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
recipeVersions
instance Prelude.NFData BatchDeleteRecipeVersion where
rnf :: BatchDeleteRecipeVersion -> ()
rnf BatchDeleteRecipeVersion' {NonEmpty Text
Text
recipeVersions :: NonEmpty Text
name :: Text
$sel:recipeVersions:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> NonEmpty Text
$sel:name:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> Text
..} =
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 NonEmpty Text
recipeVersions
instance Data.ToHeaders BatchDeleteRecipeVersion where
toHeaders :: BatchDeleteRecipeVersion -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON BatchDeleteRecipeVersion where
toJSON :: BatchDeleteRecipeVersion -> Value
toJSON BatchDeleteRecipeVersion' {NonEmpty Text
Text
recipeVersions :: NonEmpty Text
name :: Text
$sel:recipeVersions:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> NonEmpty Text
$sel:name:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"RecipeVersions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
recipeVersions)
]
)
instance Data.ToPath BatchDeleteRecipeVersion where
toPath :: BatchDeleteRecipeVersion -> ByteString
toPath BatchDeleteRecipeVersion' {NonEmpty Text
Text
recipeVersions :: NonEmpty Text
name :: Text
$sel:recipeVersions:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> NonEmpty Text
$sel:name:BatchDeleteRecipeVersion' :: BatchDeleteRecipeVersion -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/recipes/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
name,
ByteString
"/batchDeleteRecipeVersion"
]
instance Data.ToQuery BatchDeleteRecipeVersion where
toQuery :: BatchDeleteRecipeVersion -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data BatchDeleteRecipeVersionResponse = BatchDeleteRecipeVersionResponse'
{
BatchDeleteRecipeVersionResponse
-> Maybe [RecipeVersionErrorDetail]
errors :: Prelude.Maybe [RecipeVersionErrorDetail],
BatchDeleteRecipeVersionResponse -> Int
httpStatus :: Prelude.Int,
BatchDeleteRecipeVersionResponse -> Text
name :: Prelude.Text
}
deriving (BatchDeleteRecipeVersionResponse
-> BatchDeleteRecipeVersionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteRecipeVersionResponse
-> BatchDeleteRecipeVersionResponse -> Bool
$c/= :: BatchDeleteRecipeVersionResponse
-> BatchDeleteRecipeVersionResponse -> Bool
== :: BatchDeleteRecipeVersionResponse
-> BatchDeleteRecipeVersionResponse -> Bool
$c== :: BatchDeleteRecipeVersionResponse
-> BatchDeleteRecipeVersionResponse -> Bool
Prelude.Eq, ReadPrec [BatchDeleteRecipeVersionResponse]
ReadPrec BatchDeleteRecipeVersionResponse
Int -> ReadS BatchDeleteRecipeVersionResponse
ReadS [BatchDeleteRecipeVersionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteRecipeVersionResponse]
$creadListPrec :: ReadPrec [BatchDeleteRecipeVersionResponse]
readPrec :: ReadPrec BatchDeleteRecipeVersionResponse
$creadPrec :: ReadPrec BatchDeleteRecipeVersionResponse
readList :: ReadS [BatchDeleteRecipeVersionResponse]
$creadList :: ReadS [BatchDeleteRecipeVersionResponse]
readsPrec :: Int -> ReadS BatchDeleteRecipeVersionResponse
$creadsPrec :: Int -> ReadS BatchDeleteRecipeVersionResponse
Prelude.Read, Int -> BatchDeleteRecipeVersionResponse -> ShowS
[BatchDeleteRecipeVersionResponse] -> ShowS
BatchDeleteRecipeVersionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteRecipeVersionResponse] -> ShowS
$cshowList :: [BatchDeleteRecipeVersionResponse] -> ShowS
show :: BatchDeleteRecipeVersionResponse -> String
$cshow :: BatchDeleteRecipeVersionResponse -> String
showsPrec :: Int -> BatchDeleteRecipeVersionResponse -> ShowS
$cshowsPrec :: Int -> BatchDeleteRecipeVersionResponse -> ShowS
Prelude.Show, forall x.
Rep BatchDeleteRecipeVersionResponse x
-> BatchDeleteRecipeVersionResponse
forall x.
BatchDeleteRecipeVersionResponse
-> Rep BatchDeleteRecipeVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteRecipeVersionResponse x
-> BatchDeleteRecipeVersionResponse
$cfrom :: forall x.
BatchDeleteRecipeVersionResponse
-> Rep BatchDeleteRecipeVersionResponse x
Prelude.Generic)
newBatchDeleteRecipeVersionResponse ::
Prelude.Int ->
Prelude.Text ->
BatchDeleteRecipeVersionResponse
newBatchDeleteRecipeVersionResponse :: Int -> Text -> BatchDeleteRecipeVersionResponse
newBatchDeleteRecipeVersionResponse
Int
pHttpStatus_
Text
pName_ =
BatchDeleteRecipeVersionResponse'
{ $sel:errors:BatchDeleteRecipeVersionResponse' :: Maybe [RecipeVersionErrorDetail]
errors =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchDeleteRecipeVersionResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:name:BatchDeleteRecipeVersionResponse' :: Text
name = Text
pName_
}
batchDeleteRecipeVersionResponse_errors :: Lens.Lens' BatchDeleteRecipeVersionResponse (Prelude.Maybe [RecipeVersionErrorDetail])
batchDeleteRecipeVersionResponse_errors :: Lens'
BatchDeleteRecipeVersionResponse (Maybe [RecipeVersionErrorDetail])
batchDeleteRecipeVersionResponse_errors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteRecipeVersionResponse' {Maybe [RecipeVersionErrorDetail]
errors :: Maybe [RecipeVersionErrorDetail]
$sel:errors:BatchDeleteRecipeVersionResponse' :: BatchDeleteRecipeVersionResponse
-> Maybe [RecipeVersionErrorDetail]
errors} -> Maybe [RecipeVersionErrorDetail]
errors) (\s :: BatchDeleteRecipeVersionResponse
s@BatchDeleteRecipeVersionResponse' {} Maybe [RecipeVersionErrorDetail]
a -> BatchDeleteRecipeVersionResponse
s {$sel:errors:BatchDeleteRecipeVersionResponse' :: Maybe [RecipeVersionErrorDetail]
errors = Maybe [RecipeVersionErrorDetail]
a} :: BatchDeleteRecipeVersionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchDeleteRecipeVersionResponse_httpStatus :: Lens.Lens' BatchDeleteRecipeVersionResponse Prelude.Int
batchDeleteRecipeVersionResponse_httpStatus :: Lens' BatchDeleteRecipeVersionResponse Int
batchDeleteRecipeVersionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteRecipeVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchDeleteRecipeVersionResponse' :: BatchDeleteRecipeVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchDeleteRecipeVersionResponse
s@BatchDeleteRecipeVersionResponse' {} Int
a -> BatchDeleteRecipeVersionResponse
s {$sel:httpStatus:BatchDeleteRecipeVersionResponse' :: Int
httpStatus = Int
a} :: BatchDeleteRecipeVersionResponse)
batchDeleteRecipeVersionResponse_name :: Lens.Lens' BatchDeleteRecipeVersionResponse Prelude.Text
batchDeleteRecipeVersionResponse_name :: Lens' BatchDeleteRecipeVersionResponse Text
batchDeleteRecipeVersionResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteRecipeVersionResponse' {Text
name :: Text
$sel:name:BatchDeleteRecipeVersionResponse' :: BatchDeleteRecipeVersionResponse -> Text
name} -> Text
name) (\s :: BatchDeleteRecipeVersionResponse
s@BatchDeleteRecipeVersionResponse' {} Text
a -> BatchDeleteRecipeVersionResponse
s {$sel:name:BatchDeleteRecipeVersionResponse' :: Text
name = Text
a} :: BatchDeleteRecipeVersionResponse)
instance
Prelude.NFData
BatchDeleteRecipeVersionResponse
where
rnf :: BatchDeleteRecipeVersionResponse -> ()
rnf BatchDeleteRecipeVersionResponse' {Int
Maybe [RecipeVersionErrorDetail]
Text
name :: Text
httpStatus :: Int
errors :: Maybe [RecipeVersionErrorDetail]
$sel:name:BatchDeleteRecipeVersionResponse' :: BatchDeleteRecipeVersionResponse -> Text
$sel:httpStatus:BatchDeleteRecipeVersionResponse' :: BatchDeleteRecipeVersionResponse -> Int
$sel:errors:BatchDeleteRecipeVersionResponse' :: BatchDeleteRecipeVersionResponse
-> Maybe [RecipeVersionErrorDetail]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecipeVersionErrorDetail]
errors
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name