{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DataBrew.BatchDeleteRecipeVersion
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes one or more versions of a recipe at a time.
--
-- The entire request will be rejected if:
--
-- -   The recipe does not exist.
--
-- -   There is an invalid version identifier in the list of versions.
--
-- -   The version list is empty.
--
-- -   The version list size exceeds 50.
--
-- -   The version list contains duplicate entries.
--
-- The request will complete successfully, but with partial failures, if:
--
-- -   A version does not exist.
--
-- -   A version is being used by a job.
--
-- -   You specify @LATEST_WORKING@, but it\'s being used by a project.
--
-- -   The version fails to be deleted.
--
-- The @LATEST_WORKING@ version will only be deleted if the recipe has no
-- other versions. If you try to delete @LATEST_WORKING@ while other
-- versions exist (or if they can\'t be deleted), then @LATEST_WORKING@
-- will be listed as partial failure in the response.
module Amazonka.DataBrew.BatchDeleteRecipeVersion
  ( -- * Creating a Request
    BatchDeleteRecipeVersion (..),
    newBatchDeleteRecipeVersion,

    -- * Request Lenses
    batchDeleteRecipeVersion_name,
    batchDeleteRecipeVersion_recipeVersions,

    -- * Destructuring the Response
    BatchDeleteRecipeVersionResponse (..),
    newBatchDeleteRecipeVersionResponse,

    -- * Response Lenses
    batchDeleteRecipeVersionResponse_errors,
    batchDeleteRecipeVersionResponse_httpStatus,
    batchDeleteRecipeVersionResponse_name,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataBrew.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

-- | /See:/ 'newBatchDeleteRecipeVersion' smart constructor.
data BatchDeleteRecipeVersion = BatchDeleteRecipeVersion'
  { -- | The name of the recipe whose versions are to be deleted.
    BatchDeleteRecipeVersion -> Text
name :: Prelude.Text,
    -- | An array of version identifiers, for the recipe versions to be deleted.
    -- You can specify numeric versions (@X.Y@) or @LATEST_WORKING@.
    -- @LATEST_PUBLISHED@ is not supported.
    BatchDeleteRecipeVersion -> NonEmpty Text
recipeVersions :: Prelude.NonEmpty Prelude.Text
  }
  deriving (BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool
(BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool)
-> (BatchDeleteRecipeVersion -> BatchDeleteRecipeVersion -> Bool)
-> Eq BatchDeleteRecipeVersion
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]
(Int -> ReadS BatchDeleteRecipeVersion)
-> ReadS [BatchDeleteRecipeVersion]
-> ReadPrec BatchDeleteRecipeVersion
-> ReadPrec [BatchDeleteRecipeVersion]
-> Read 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
(Int -> BatchDeleteRecipeVersion -> ShowS)
-> (BatchDeleteRecipeVersion -> String)
-> ([BatchDeleteRecipeVersion] -> ShowS)
-> Show BatchDeleteRecipeVersion
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.
 BatchDeleteRecipeVersion -> Rep BatchDeleteRecipeVersion x)
-> (forall x.
    Rep BatchDeleteRecipeVersion x -> BatchDeleteRecipeVersion)
-> Generic BatchDeleteRecipeVersion
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)

-- |
-- Create a value of 'BatchDeleteRecipeVersion' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'name', 'batchDeleteRecipeVersion_name' - The name of the recipe whose versions are to be deleted.
--
-- 'recipeVersions', 'batchDeleteRecipeVersion_recipeVersions' - An array of version identifiers, for the recipe versions to be deleted.
-- You can specify numeric versions (@X.Y@) or @LATEST_WORKING@.
-- @LATEST_PUBLISHED@ is not supported.
newBatchDeleteRecipeVersion ::
  -- | 'name'
  Prelude.Text ->
  -- | 'recipeVersions'
  Prelude.NonEmpty Prelude.Text ->
  BatchDeleteRecipeVersion
newBatchDeleteRecipeVersion :: Text -> NonEmpty Text -> BatchDeleteRecipeVersion
newBatchDeleteRecipeVersion Text
pName_ NonEmpty Text
pRecipeVersions_ =
  BatchDeleteRecipeVersion' :: Text -> NonEmpty Text -> BatchDeleteRecipeVersion
BatchDeleteRecipeVersion'
    { $sel:name:BatchDeleteRecipeVersion' :: Text
name = Text
pName_,
      $sel:recipeVersions:BatchDeleteRecipeVersion' :: NonEmpty Text
recipeVersions =
        Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pRecipeVersions_
    }

-- | The name of the recipe whose versions are to be deleted.
batchDeleteRecipeVersion_name :: Lens.Lens' BatchDeleteRecipeVersion Prelude.Text
batchDeleteRecipeVersion_name :: (Text -> f Text)
-> BatchDeleteRecipeVersion -> f BatchDeleteRecipeVersion
batchDeleteRecipeVersion_name = (BatchDeleteRecipeVersion -> Text)
-> (BatchDeleteRecipeVersion -> Text -> BatchDeleteRecipeVersion)
-> Lens BatchDeleteRecipeVersion BatchDeleteRecipeVersion Text Text
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)

-- | An array of version identifiers, for the recipe versions to be deleted.
-- You can specify numeric versions (@X.Y@) or @LATEST_WORKING@.
-- @LATEST_PUBLISHED@ is not supported.
batchDeleteRecipeVersion_recipeVersions :: Lens.Lens' BatchDeleteRecipeVersion (Prelude.NonEmpty Prelude.Text)
batchDeleteRecipeVersion_recipeVersions :: (NonEmpty Text -> f (NonEmpty Text))
-> BatchDeleteRecipeVersion -> f BatchDeleteRecipeVersion
batchDeleteRecipeVersion_recipeVersions = (BatchDeleteRecipeVersion -> NonEmpty Text)
-> (BatchDeleteRecipeVersion
    -> NonEmpty Text -> BatchDeleteRecipeVersion)
-> Lens
     BatchDeleteRecipeVersion
     BatchDeleteRecipeVersion
     (NonEmpty Text)
     (NonEmpty Text)
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) ((NonEmpty Text -> f (NonEmpty Text))
 -> BatchDeleteRecipeVersion -> f BatchDeleteRecipeVersion)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> BatchDeleteRecipeVersion
-> f BatchDeleteRecipeVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
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 :: BatchDeleteRecipeVersion -> Request BatchDeleteRecipeVersion
request = Service
-> BatchDeleteRecipeVersion -> Request BatchDeleteRecipeVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchDeleteRecipeVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchDeleteRecipeVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchDeleteRecipeVersion))
-> Logger
-> Service
-> Proxy BatchDeleteRecipeVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchDeleteRecipeVersion)))
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 [RecipeVersionErrorDetail]
-> Int -> Text -> BatchDeleteRecipeVersionResponse
BatchDeleteRecipeVersionResponse'
            (Maybe [RecipeVersionErrorDetail]
 -> Int -> Text -> BatchDeleteRecipeVersionResponse)
-> Either String (Maybe [RecipeVersionErrorDetail])
-> Either String (Int -> Text -> BatchDeleteRecipeVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [RecipeVersionErrorDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe (Maybe [RecipeVersionErrorDetail]))
-> Maybe [RecipeVersionErrorDetail]
-> Either String (Maybe [RecipeVersionErrorDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RecipeVersionErrorDetail]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> Text -> BatchDeleteRecipeVersionResponse)
-> Either String Int
-> Either String (Text -> BatchDeleteRecipeVersionResponse)
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))
            Either String (Text -> BatchDeleteRecipeVersionResponse)
-> Either String Text
-> Either String BatchDeleteRecipeVersionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Name")
      )

instance Prelude.Hashable BatchDeleteRecipeVersion

instance Prelude.NFData BatchDeleteRecipeVersion

instance Core.ToHeaders BatchDeleteRecipeVersion where
  toHeaders :: BatchDeleteRecipeVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDeleteRecipeVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RecipeVersions" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
recipeVersions)
          ]
      )

instance Core.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
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/recipes/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name,
        ByteString
"/batchDeleteRecipeVersion"
      ]

instance Core.ToQuery BatchDeleteRecipeVersion where
  toQuery :: BatchDeleteRecipeVersion -> QueryString
toQuery = QueryString -> BatchDeleteRecipeVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchDeleteRecipeVersionResponse' smart constructor.
data BatchDeleteRecipeVersionResponse = BatchDeleteRecipeVersionResponse'
  { -- | Errors, if any, that occurred while attempting to delete the recipe
    -- versions.
    BatchDeleteRecipeVersionResponse
-> Maybe [RecipeVersionErrorDetail]
errors :: Prelude.Maybe [RecipeVersionErrorDetail],
    -- | The response's http status code.
    BatchDeleteRecipeVersionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The name of the recipe that was modified.
    BatchDeleteRecipeVersionResponse -> Text
name :: Prelude.Text
  }
  deriving (BatchDeleteRecipeVersionResponse
-> BatchDeleteRecipeVersionResponse -> Bool
(BatchDeleteRecipeVersionResponse
 -> BatchDeleteRecipeVersionResponse -> Bool)
-> (BatchDeleteRecipeVersionResponse
    -> BatchDeleteRecipeVersionResponse -> Bool)
-> Eq BatchDeleteRecipeVersionResponse
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]
(Int -> ReadS BatchDeleteRecipeVersionResponse)
-> ReadS [BatchDeleteRecipeVersionResponse]
-> ReadPrec BatchDeleteRecipeVersionResponse
-> ReadPrec [BatchDeleteRecipeVersionResponse]
-> Read 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
(Int -> BatchDeleteRecipeVersionResponse -> ShowS)
-> (BatchDeleteRecipeVersionResponse -> String)
-> ([BatchDeleteRecipeVersionResponse] -> ShowS)
-> Show BatchDeleteRecipeVersionResponse
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.
 BatchDeleteRecipeVersionResponse
 -> Rep BatchDeleteRecipeVersionResponse x)
-> (forall x.
    Rep BatchDeleteRecipeVersionResponse x
    -> BatchDeleteRecipeVersionResponse)
-> Generic BatchDeleteRecipeVersionResponse
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)

-- |
-- Create a value of 'BatchDeleteRecipeVersionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'errors', 'batchDeleteRecipeVersionResponse_errors' - Errors, if any, that occurred while attempting to delete the recipe
-- versions.
--
-- 'httpStatus', 'batchDeleteRecipeVersionResponse_httpStatus' - The response's http status code.
--
-- 'name', 'batchDeleteRecipeVersionResponse_name' - The name of the recipe that was modified.
newBatchDeleteRecipeVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  BatchDeleteRecipeVersionResponse
newBatchDeleteRecipeVersionResponse :: Int -> Text -> BatchDeleteRecipeVersionResponse
newBatchDeleteRecipeVersionResponse
  Int
pHttpStatus_
  Text
pName_ =
    BatchDeleteRecipeVersionResponse' :: Maybe [RecipeVersionErrorDetail]
-> Int -> Text -> BatchDeleteRecipeVersionResponse
BatchDeleteRecipeVersionResponse'
      { $sel:errors:BatchDeleteRecipeVersionResponse' :: Maybe [RecipeVersionErrorDetail]
errors =
          Maybe [RecipeVersionErrorDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchDeleteRecipeVersionResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:name:BatchDeleteRecipeVersionResponse' :: Text
name = Text
pName_
      }

-- | Errors, if any, that occurred while attempting to delete the recipe
-- versions.
batchDeleteRecipeVersionResponse_errors :: Lens.Lens' BatchDeleteRecipeVersionResponse (Prelude.Maybe [RecipeVersionErrorDetail])
batchDeleteRecipeVersionResponse_errors :: (Maybe [RecipeVersionErrorDetail]
 -> f (Maybe [RecipeVersionErrorDetail]))
-> BatchDeleteRecipeVersionResponse
-> f BatchDeleteRecipeVersionResponse
batchDeleteRecipeVersionResponse_errors = (BatchDeleteRecipeVersionResponse
 -> Maybe [RecipeVersionErrorDetail])
-> (BatchDeleteRecipeVersionResponse
    -> Maybe [RecipeVersionErrorDetail]
    -> BatchDeleteRecipeVersionResponse)
-> Lens
     BatchDeleteRecipeVersionResponse
     BatchDeleteRecipeVersionResponse
     (Maybe [RecipeVersionErrorDetail])
     (Maybe [RecipeVersionErrorDetail])
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) ((Maybe [RecipeVersionErrorDetail]
  -> f (Maybe [RecipeVersionErrorDetail]))
 -> BatchDeleteRecipeVersionResponse
 -> f BatchDeleteRecipeVersionResponse)
-> ((Maybe [RecipeVersionErrorDetail]
     -> f (Maybe [RecipeVersionErrorDetail]))
    -> Maybe [RecipeVersionErrorDetail]
    -> f (Maybe [RecipeVersionErrorDetail]))
-> (Maybe [RecipeVersionErrorDetail]
    -> f (Maybe [RecipeVersionErrorDetail]))
-> BatchDeleteRecipeVersionResponse
-> f BatchDeleteRecipeVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RecipeVersionErrorDetail]
  [RecipeVersionErrorDetail]
  [RecipeVersionErrorDetail]
  [RecipeVersionErrorDetail]
-> Iso
     (Maybe [RecipeVersionErrorDetail])
     (Maybe [RecipeVersionErrorDetail])
     (Maybe [RecipeVersionErrorDetail])
     (Maybe [RecipeVersionErrorDetail])
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
  [RecipeVersionErrorDetail]
  [RecipeVersionErrorDetail]
  [RecipeVersionErrorDetail]
  [RecipeVersionErrorDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
batchDeleteRecipeVersionResponse_httpStatus :: Lens.Lens' BatchDeleteRecipeVersionResponse Prelude.Int
batchDeleteRecipeVersionResponse_httpStatus :: (Int -> f Int)
-> BatchDeleteRecipeVersionResponse
-> f BatchDeleteRecipeVersionResponse
batchDeleteRecipeVersionResponse_httpStatus = (BatchDeleteRecipeVersionResponse -> Int)
-> (BatchDeleteRecipeVersionResponse
    -> Int -> BatchDeleteRecipeVersionResponse)
-> Lens
     BatchDeleteRecipeVersionResponse
     BatchDeleteRecipeVersionResponse
     Int
     Int
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)

-- | The name of the recipe that was modified.
batchDeleteRecipeVersionResponse_name :: Lens.Lens' BatchDeleteRecipeVersionResponse Prelude.Text
batchDeleteRecipeVersionResponse_name :: (Text -> f Text)
-> BatchDeleteRecipeVersionResponse
-> f BatchDeleteRecipeVersionResponse
batchDeleteRecipeVersionResponse_name = (BatchDeleteRecipeVersionResponse -> Text)
-> (BatchDeleteRecipeVersionResponse
    -> Text -> BatchDeleteRecipeVersionResponse)
-> Lens
     BatchDeleteRecipeVersionResponse
     BatchDeleteRecipeVersionResponse
     Text
     Text
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