{-# 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.ECR.BatchDeleteImage
-- 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 a list of specified images within a repository. Images are
-- specified with either an @imageTag@ or @imageDigest@.
--
-- You can remove a tag from an image by specifying the image\'s tag in
-- your request. When you remove the last tag from an image, the image is
-- deleted from your repository.
--
-- You can completely delete an image (and all of its tags) by specifying
-- the image\'s digest in your request.
module Amazonka.ECR.BatchDeleteImage
  ( -- * Creating a Request
    BatchDeleteImage (..),
    newBatchDeleteImage,

    -- * Request Lenses
    batchDeleteImage_registryId,
    batchDeleteImage_repositoryName,
    batchDeleteImage_imageIds,

    -- * Destructuring the Response
    BatchDeleteImageResponse (..),
    newBatchDeleteImageResponse,

    -- * Response Lenses
    batchDeleteImageResponse_failures,
    batchDeleteImageResponse_imageIds,
    batchDeleteImageResponse_httpStatus,
  )
where

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

-- | Deletes specified images within a specified repository. Images are
-- specified with either the @imageTag@ or @imageDigest@.
--
-- /See:/ 'newBatchDeleteImage' smart constructor.
data BatchDeleteImage = BatchDeleteImage'
  { -- | The Amazon Web Services account ID associated with the registry that
    -- contains the image to delete. If you do not specify a registry, the
    -- default registry is assumed.
    BatchDeleteImage -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The repository that contains the image to delete.
    BatchDeleteImage -> Text
repositoryName :: Prelude.Text,
    -- | A list of image ID references that correspond to images to delete. The
    -- format of the @imageIds@ reference is @imageTag=tag@ or
    -- @imageDigest=digest@.
    BatchDeleteImage -> [ImageIdentifier]
imageIds :: [ImageIdentifier]
  }
  deriving (BatchDeleteImage -> BatchDeleteImage -> Bool
(BatchDeleteImage -> BatchDeleteImage -> Bool)
-> (BatchDeleteImage -> BatchDeleteImage -> Bool)
-> Eq BatchDeleteImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteImage -> BatchDeleteImage -> Bool
$c/= :: BatchDeleteImage -> BatchDeleteImage -> Bool
== :: BatchDeleteImage -> BatchDeleteImage -> Bool
$c== :: BatchDeleteImage -> BatchDeleteImage -> Bool
Prelude.Eq, ReadPrec [BatchDeleteImage]
ReadPrec BatchDeleteImage
Int -> ReadS BatchDeleteImage
ReadS [BatchDeleteImage]
(Int -> ReadS BatchDeleteImage)
-> ReadS [BatchDeleteImage]
-> ReadPrec BatchDeleteImage
-> ReadPrec [BatchDeleteImage]
-> Read BatchDeleteImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteImage]
$creadListPrec :: ReadPrec [BatchDeleteImage]
readPrec :: ReadPrec BatchDeleteImage
$creadPrec :: ReadPrec BatchDeleteImage
readList :: ReadS [BatchDeleteImage]
$creadList :: ReadS [BatchDeleteImage]
readsPrec :: Int -> ReadS BatchDeleteImage
$creadsPrec :: Int -> ReadS BatchDeleteImage
Prelude.Read, Int -> BatchDeleteImage -> ShowS
[BatchDeleteImage] -> ShowS
BatchDeleteImage -> String
(Int -> BatchDeleteImage -> ShowS)
-> (BatchDeleteImage -> String)
-> ([BatchDeleteImage] -> ShowS)
-> Show BatchDeleteImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteImage] -> ShowS
$cshowList :: [BatchDeleteImage] -> ShowS
show :: BatchDeleteImage -> String
$cshow :: BatchDeleteImage -> String
showsPrec :: Int -> BatchDeleteImage -> ShowS
$cshowsPrec :: Int -> BatchDeleteImage -> ShowS
Prelude.Show, (forall x. BatchDeleteImage -> Rep BatchDeleteImage x)
-> (forall x. Rep BatchDeleteImage x -> BatchDeleteImage)
-> Generic BatchDeleteImage
forall x. Rep BatchDeleteImage x -> BatchDeleteImage
forall x. BatchDeleteImage -> Rep BatchDeleteImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDeleteImage x -> BatchDeleteImage
$cfrom :: forall x. BatchDeleteImage -> Rep BatchDeleteImage x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteImage' 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:
--
-- 'registryId', 'batchDeleteImage_registryId' - The Amazon Web Services account ID associated with the registry that
-- contains the image to delete. If you do not specify a registry, the
-- default registry is assumed.
--
-- 'repositoryName', 'batchDeleteImage_repositoryName' - The repository that contains the image to delete.
--
-- 'imageIds', 'batchDeleteImage_imageIds' - A list of image ID references that correspond to images to delete. The
-- format of the @imageIds@ reference is @imageTag=tag@ or
-- @imageDigest=digest@.
newBatchDeleteImage ::
  -- | 'repositoryName'
  Prelude.Text ->
  BatchDeleteImage
newBatchDeleteImage :: Text -> BatchDeleteImage
newBatchDeleteImage Text
pRepositoryName_ =
  BatchDeleteImage' :: Maybe Text -> Text -> [ImageIdentifier] -> BatchDeleteImage
BatchDeleteImage'
    { $sel:registryId:BatchDeleteImage' :: Maybe Text
registryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:BatchDeleteImage' :: Text
repositoryName = Text
pRepositoryName_,
      $sel:imageIds:BatchDeleteImage' :: [ImageIdentifier]
imageIds = [ImageIdentifier]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The Amazon Web Services account ID associated with the registry that
-- contains the image to delete. If you do not specify a registry, the
-- default registry is assumed.
batchDeleteImage_registryId :: Lens.Lens' BatchDeleteImage (Prelude.Maybe Prelude.Text)
batchDeleteImage_registryId :: (Maybe Text -> f (Maybe Text))
-> BatchDeleteImage -> f BatchDeleteImage
batchDeleteImage_registryId = (BatchDeleteImage -> Maybe Text)
-> (BatchDeleteImage -> Maybe Text -> BatchDeleteImage)
-> Lens BatchDeleteImage BatchDeleteImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImage' {Maybe Text
registryId :: Maybe Text
$sel:registryId:BatchDeleteImage' :: BatchDeleteImage -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: BatchDeleteImage
s@BatchDeleteImage' {} Maybe Text
a -> BatchDeleteImage
s {$sel:registryId:BatchDeleteImage' :: Maybe Text
registryId = Maybe Text
a} :: BatchDeleteImage)

-- | The repository that contains the image to delete.
batchDeleteImage_repositoryName :: Lens.Lens' BatchDeleteImage Prelude.Text
batchDeleteImage_repositoryName :: (Text -> f Text) -> BatchDeleteImage -> f BatchDeleteImage
batchDeleteImage_repositoryName = (BatchDeleteImage -> Text)
-> (BatchDeleteImage -> Text -> BatchDeleteImage)
-> Lens BatchDeleteImage BatchDeleteImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImage' {Text
repositoryName :: Text
$sel:repositoryName:BatchDeleteImage' :: BatchDeleteImage -> Text
repositoryName} -> Text
repositoryName) (\s :: BatchDeleteImage
s@BatchDeleteImage' {} Text
a -> BatchDeleteImage
s {$sel:repositoryName:BatchDeleteImage' :: Text
repositoryName = Text
a} :: BatchDeleteImage)

-- | A list of image ID references that correspond to images to delete. The
-- format of the @imageIds@ reference is @imageTag=tag@ or
-- @imageDigest=digest@.
batchDeleteImage_imageIds :: Lens.Lens' BatchDeleteImage [ImageIdentifier]
batchDeleteImage_imageIds :: ([ImageIdentifier] -> f [ImageIdentifier])
-> BatchDeleteImage -> f BatchDeleteImage
batchDeleteImage_imageIds = (BatchDeleteImage -> [ImageIdentifier])
-> (BatchDeleteImage -> [ImageIdentifier] -> BatchDeleteImage)
-> Lens
     BatchDeleteImage
     BatchDeleteImage
     [ImageIdentifier]
     [ImageIdentifier]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImage' {[ImageIdentifier]
imageIds :: [ImageIdentifier]
$sel:imageIds:BatchDeleteImage' :: BatchDeleteImage -> [ImageIdentifier]
imageIds} -> [ImageIdentifier]
imageIds) (\s :: BatchDeleteImage
s@BatchDeleteImage' {} [ImageIdentifier]
a -> BatchDeleteImage
s {$sel:imageIds:BatchDeleteImage' :: [ImageIdentifier]
imageIds = [ImageIdentifier]
a} :: BatchDeleteImage) (([ImageIdentifier] -> f [ImageIdentifier])
 -> BatchDeleteImage -> f BatchDeleteImage)
-> (([ImageIdentifier] -> f [ImageIdentifier])
    -> [ImageIdentifier] -> f [ImageIdentifier])
-> ([ImageIdentifier] -> f [ImageIdentifier])
-> BatchDeleteImage
-> f BatchDeleteImage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ImageIdentifier] -> f [ImageIdentifier])
-> [ImageIdentifier] -> f [ImageIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest BatchDeleteImage where
  type
    AWSResponse BatchDeleteImage =
      BatchDeleteImageResponse
  request :: BatchDeleteImage -> Request BatchDeleteImage
request = Service -> BatchDeleteImage -> Request BatchDeleteImage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchDeleteImage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchDeleteImage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchDeleteImage))
-> Logger
-> Service
-> Proxy BatchDeleteImage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchDeleteImage)))
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 [ImageFailure]
-> Maybe [ImageIdentifier] -> Int -> BatchDeleteImageResponse
BatchDeleteImageResponse'
            (Maybe [ImageFailure]
 -> Maybe [ImageIdentifier] -> Int -> BatchDeleteImageResponse)
-> Either String (Maybe [ImageFailure])
-> Either
     String (Maybe [ImageIdentifier] -> Int -> BatchDeleteImageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ImageFailure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failures" Either String (Maybe (Maybe [ImageFailure]))
-> Maybe [ImageFailure] -> Either String (Maybe [ImageFailure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ImageFailure]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe [ImageIdentifier] -> Int -> BatchDeleteImageResponse)
-> Either String (Maybe [ImageIdentifier])
-> Either String (Int -> BatchDeleteImageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ImageIdentifier]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"imageIds" Either String (Maybe (Maybe [ImageIdentifier]))
-> Maybe [ImageIdentifier]
-> Either String (Maybe [ImageIdentifier])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ImageIdentifier]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> BatchDeleteImageResponse)
-> Either String Int -> Either String BatchDeleteImageResponse
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 BatchDeleteImage

instance Prelude.NFData BatchDeleteImage

instance Core.ToHeaders BatchDeleteImage where
  toHeaders :: BatchDeleteImage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchDeleteImage -> 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
"AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage" ::
                          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 BatchDeleteImage where
  toJSON :: BatchDeleteImage -> Value
toJSON BatchDeleteImage' {[ImageIdentifier]
Maybe Text
Text
imageIds :: [ImageIdentifier]
repositoryName :: Text
registryId :: Maybe Text
$sel:imageIds:BatchDeleteImage' :: BatchDeleteImage -> [ImageIdentifier]
$sel:repositoryName:BatchDeleteImage' :: BatchDeleteImage -> Text
$sel:registryId:BatchDeleteImage' :: BatchDeleteImage -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"registryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
registryId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"imageIds" Text -> [ImageIdentifier] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [ImageIdentifier]
imageIds)
          ]
      )

instance Core.ToPath BatchDeleteImage where
  toPath :: BatchDeleteImage -> ByteString
toPath = ByteString -> BatchDeleteImage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newBatchDeleteImageResponse' smart constructor.
data BatchDeleteImageResponse = BatchDeleteImageResponse'
  { -- | Any failures associated with the call.
    BatchDeleteImageResponse -> Maybe [ImageFailure]
failures :: Prelude.Maybe [ImageFailure],
    -- | The image IDs of the deleted images.
    BatchDeleteImageResponse -> Maybe [ImageIdentifier]
imageIds :: Prelude.Maybe [ImageIdentifier],
    -- | The response's http status code.
    BatchDeleteImageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool
(BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool)
-> (BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool)
-> Eq BatchDeleteImageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool
$c/= :: BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool
== :: BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool
$c== :: BatchDeleteImageResponse -> BatchDeleteImageResponse -> Bool
Prelude.Eq, ReadPrec [BatchDeleteImageResponse]
ReadPrec BatchDeleteImageResponse
Int -> ReadS BatchDeleteImageResponse
ReadS [BatchDeleteImageResponse]
(Int -> ReadS BatchDeleteImageResponse)
-> ReadS [BatchDeleteImageResponse]
-> ReadPrec BatchDeleteImageResponse
-> ReadPrec [BatchDeleteImageResponse]
-> Read BatchDeleteImageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteImageResponse]
$creadListPrec :: ReadPrec [BatchDeleteImageResponse]
readPrec :: ReadPrec BatchDeleteImageResponse
$creadPrec :: ReadPrec BatchDeleteImageResponse
readList :: ReadS [BatchDeleteImageResponse]
$creadList :: ReadS [BatchDeleteImageResponse]
readsPrec :: Int -> ReadS BatchDeleteImageResponse
$creadsPrec :: Int -> ReadS BatchDeleteImageResponse
Prelude.Read, Int -> BatchDeleteImageResponse -> ShowS
[BatchDeleteImageResponse] -> ShowS
BatchDeleteImageResponse -> String
(Int -> BatchDeleteImageResponse -> ShowS)
-> (BatchDeleteImageResponse -> String)
-> ([BatchDeleteImageResponse] -> ShowS)
-> Show BatchDeleteImageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteImageResponse] -> ShowS
$cshowList :: [BatchDeleteImageResponse] -> ShowS
show :: BatchDeleteImageResponse -> String
$cshow :: BatchDeleteImageResponse -> String
showsPrec :: Int -> BatchDeleteImageResponse -> ShowS
$cshowsPrec :: Int -> BatchDeleteImageResponse -> ShowS
Prelude.Show, (forall x.
 BatchDeleteImageResponse -> Rep BatchDeleteImageResponse x)
-> (forall x.
    Rep BatchDeleteImageResponse x -> BatchDeleteImageResponse)
-> Generic BatchDeleteImageResponse
forall x.
Rep BatchDeleteImageResponse x -> BatchDeleteImageResponse
forall x.
BatchDeleteImageResponse -> Rep BatchDeleteImageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteImageResponse x -> BatchDeleteImageResponse
$cfrom :: forall x.
BatchDeleteImageResponse -> Rep BatchDeleteImageResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteImageResponse' 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:
--
-- 'failures', 'batchDeleteImageResponse_failures' - Any failures associated with the call.
--
-- 'imageIds', 'batchDeleteImageResponse_imageIds' - The image IDs of the deleted images.
--
-- 'httpStatus', 'batchDeleteImageResponse_httpStatus' - The response's http status code.
newBatchDeleteImageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchDeleteImageResponse
newBatchDeleteImageResponse :: Int -> BatchDeleteImageResponse
newBatchDeleteImageResponse Int
pHttpStatus_ =
  BatchDeleteImageResponse' :: Maybe [ImageFailure]
-> Maybe [ImageIdentifier] -> Int -> BatchDeleteImageResponse
BatchDeleteImageResponse'
    { $sel:failures:BatchDeleteImageResponse' :: Maybe [ImageFailure]
failures =
        Maybe [ImageFailure]
forall a. Maybe a
Prelude.Nothing,
      $sel:imageIds:BatchDeleteImageResponse' :: Maybe [ImageIdentifier]
imageIds = Maybe [ImageIdentifier]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchDeleteImageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Any failures associated with the call.
batchDeleteImageResponse_failures :: Lens.Lens' BatchDeleteImageResponse (Prelude.Maybe [ImageFailure])
batchDeleteImageResponse_failures :: (Maybe [ImageFailure] -> f (Maybe [ImageFailure]))
-> BatchDeleteImageResponse -> f BatchDeleteImageResponse
batchDeleteImageResponse_failures = (BatchDeleteImageResponse -> Maybe [ImageFailure])
-> (BatchDeleteImageResponse
    -> Maybe [ImageFailure] -> BatchDeleteImageResponse)
-> Lens
     BatchDeleteImageResponse
     BatchDeleteImageResponse
     (Maybe [ImageFailure])
     (Maybe [ImageFailure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImageResponse' {Maybe [ImageFailure]
failures :: Maybe [ImageFailure]
$sel:failures:BatchDeleteImageResponse' :: BatchDeleteImageResponse -> Maybe [ImageFailure]
failures} -> Maybe [ImageFailure]
failures) (\s :: BatchDeleteImageResponse
s@BatchDeleteImageResponse' {} Maybe [ImageFailure]
a -> BatchDeleteImageResponse
s {$sel:failures:BatchDeleteImageResponse' :: Maybe [ImageFailure]
failures = Maybe [ImageFailure]
a} :: BatchDeleteImageResponse) ((Maybe [ImageFailure] -> f (Maybe [ImageFailure]))
 -> BatchDeleteImageResponse -> f BatchDeleteImageResponse)
-> ((Maybe [ImageFailure] -> f (Maybe [ImageFailure]))
    -> Maybe [ImageFailure] -> f (Maybe [ImageFailure]))
-> (Maybe [ImageFailure] -> f (Maybe [ImageFailure]))
-> BatchDeleteImageResponse
-> f BatchDeleteImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ImageFailure] [ImageFailure] [ImageFailure] [ImageFailure]
-> Iso
     (Maybe [ImageFailure])
     (Maybe [ImageFailure])
     (Maybe [ImageFailure])
     (Maybe [ImageFailure])
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 [ImageFailure] [ImageFailure] [ImageFailure] [ImageFailure]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The image IDs of the deleted images.
batchDeleteImageResponse_imageIds :: Lens.Lens' BatchDeleteImageResponse (Prelude.Maybe [ImageIdentifier])
batchDeleteImageResponse_imageIds :: (Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
-> BatchDeleteImageResponse -> f BatchDeleteImageResponse
batchDeleteImageResponse_imageIds = (BatchDeleteImageResponse -> Maybe [ImageIdentifier])
-> (BatchDeleteImageResponse
    -> Maybe [ImageIdentifier] -> BatchDeleteImageResponse)
-> Lens
     BatchDeleteImageResponse
     BatchDeleteImageResponse
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImageResponse' {Maybe [ImageIdentifier]
imageIds :: Maybe [ImageIdentifier]
$sel:imageIds:BatchDeleteImageResponse' :: BatchDeleteImageResponse -> Maybe [ImageIdentifier]
imageIds} -> Maybe [ImageIdentifier]
imageIds) (\s :: BatchDeleteImageResponse
s@BatchDeleteImageResponse' {} Maybe [ImageIdentifier]
a -> BatchDeleteImageResponse
s {$sel:imageIds:BatchDeleteImageResponse' :: Maybe [ImageIdentifier]
imageIds = Maybe [ImageIdentifier]
a} :: BatchDeleteImageResponse) ((Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
 -> BatchDeleteImageResponse -> f BatchDeleteImageResponse)
-> ((Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
    -> Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
-> (Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
-> BatchDeleteImageResponse
-> f BatchDeleteImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
-> Iso
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
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
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
batchDeleteImageResponse_httpStatus :: Lens.Lens' BatchDeleteImageResponse Prelude.Int
batchDeleteImageResponse_httpStatus :: (Int -> f Int)
-> BatchDeleteImageResponse -> f BatchDeleteImageResponse
batchDeleteImageResponse_httpStatus = (BatchDeleteImageResponse -> Int)
-> (BatchDeleteImageResponse -> Int -> BatchDeleteImageResponse)
-> Lens BatchDeleteImageResponse BatchDeleteImageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteImageResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchDeleteImageResponse' :: BatchDeleteImageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchDeleteImageResponse
s@BatchDeleteImageResponse' {} Int
a -> BatchDeleteImageResponse
s {$sel:httpStatus:BatchDeleteImageResponse' :: Int
httpStatus = Int
a} :: BatchDeleteImageResponse)

instance Prelude.NFData BatchDeleteImageResponse