{-# 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.ECRPublic.BatchCheckLayerAvailability
-- 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)
--
-- Checks the availability of one or more image layers within a repository
-- in a public registry. When an image is pushed to a repository, each
-- image layer is checked to verify if it has been uploaded before. If it
-- has been uploaded, then the image layer is skipped.
--
-- This operation is used by the Amazon ECR proxy and is not generally used
-- by customers for pulling and pushing images. In most cases, you should
-- use the @docker@ CLI to pull, tag, and push images.
module Amazonka.ECRPublic.BatchCheckLayerAvailability
  ( -- * Creating a Request
    BatchCheckLayerAvailability (..),
    newBatchCheckLayerAvailability,

    -- * Request Lenses
    batchCheckLayerAvailability_registryId,
    batchCheckLayerAvailability_repositoryName,
    batchCheckLayerAvailability_layerDigests,

    -- * Destructuring the Response
    BatchCheckLayerAvailabilityResponse (..),
    newBatchCheckLayerAvailabilityResponse,

    -- * Response Lenses
    batchCheckLayerAvailabilityResponse_failures,
    batchCheckLayerAvailabilityResponse_layers,
    batchCheckLayerAvailabilityResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ECRPublic.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:/ 'newBatchCheckLayerAvailability' smart constructor.
data BatchCheckLayerAvailability = BatchCheckLayerAvailability'
  { -- | The AWS account ID associated with the public registry that contains the
    -- image layers to check. If you do not specify a registry, the default
    -- public registry is assumed.
    BatchCheckLayerAvailability -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository that is associated with the image layers to
    -- check.
    BatchCheckLayerAvailability -> Text
repositoryName :: Prelude.Text,
    -- | The digests of the image layers to check.
    BatchCheckLayerAvailability -> NonEmpty Text
layerDigests :: Prelude.NonEmpty Prelude.Text
  }
  deriving (BatchCheckLayerAvailability -> BatchCheckLayerAvailability -> Bool
(BatchCheckLayerAvailability
 -> BatchCheckLayerAvailability -> Bool)
-> (BatchCheckLayerAvailability
    -> BatchCheckLayerAvailability -> Bool)
-> Eq BatchCheckLayerAvailability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCheckLayerAvailability -> BatchCheckLayerAvailability -> Bool
$c/= :: BatchCheckLayerAvailability -> BatchCheckLayerAvailability -> Bool
== :: BatchCheckLayerAvailability -> BatchCheckLayerAvailability -> Bool
$c== :: BatchCheckLayerAvailability -> BatchCheckLayerAvailability -> Bool
Prelude.Eq, ReadPrec [BatchCheckLayerAvailability]
ReadPrec BatchCheckLayerAvailability
Int -> ReadS BatchCheckLayerAvailability
ReadS [BatchCheckLayerAvailability]
(Int -> ReadS BatchCheckLayerAvailability)
-> ReadS [BatchCheckLayerAvailability]
-> ReadPrec BatchCheckLayerAvailability
-> ReadPrec [BatchCheckLayerAvailability]
-> Read BatchCheckLayerAvailability
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCheckLayerAvailability]
$creadListPrec :: ReadPrec [BatchCheckLayerAvailability]
readPrec :: ReadPrec BatchCheckLayerAvailability
$creadPrec :: ReadPrec BatchCheckLayerAvailability
readList :: ReadS [BatchCheckLayerAvailability]
$creadList :: ReadS [BatchCheckLayerAvailability]
readsPrec :: Int -> ReadS BatchCheckLayerAvailability
$creadsPrec :: Int -> ReadS BatchCheckLayerAvailability
Prelude.Read, Int -> BatchCheckLayerAvailability -> ShowS
[BatchCheckLayerAvailability] -> ShowS
BatchCheckLayerAvailability -> String
(Int -> BatchCheckLayerAvailability -> ShowS)
-> (BatchCheckLayerAvailability -> String)
-> ([BatchCheckLayerAvailability] -> ShowS)
-> Show BatchCheckLayerAvailability
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCheckLayerAvailability] -> ShowS
$cshowList :: [BatchCheckLayerAvailability] -> ShowS
show :: BatchCheckLayerAvailability -> String
$cshow :: BatchCheckLayerAvailability -> String
showsPrec :: Int -> BatchCheckLayerAvailability -> ShowS
$cshowsPrec :: Int -> BatchCheckLayerAvailability -> ShowS
Prelude.Show, (forall x.
 BatchCheckLayerAvailability -> Rep BatchCheckLayerAvailability x)
-> (forall x.
    Rep BatchCheckLayerAvailability x -> BatchCheckLayerAvailability)
-> Generic BatchCheckLayerAvailability
forall x.
Rep BatchCheckLayerAvailability x -> BatchCheckLayerAvailability
forall x.
BatchCheckLayerAvailability -> Rep BatchCheckLayerAvailability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchCheckLayerAvailability x -> BatchCheckLayerAvailability
$cfrom :: forall x.
BatchCheckLayerAvailability -> Rep BatchCheckLayerAvailability x
Prelude.Generic)

-- |
-- Create a value of 'BatchCheckLayerAvailability' 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', 'batchCheckLayerAvailability_registryId' - The AWS account ID associated with the public registry that contains the
-- image layers to check. If you do not specify a registry, the default
-- public registry is assumed.
--
-- 'repositoryName', 'batchCheckLayerAvailability_repositoryName' - The name of the repository that is associated with the image layers to
-- check.
--
-- 'layerDigests', 'batchCheckLayerAvailability_layerDigests' - The digests of the image layers to check.
newBatchCheckLayerAvailability ::
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'layerDigests'
  Prelude.NonEmpty Prelude.Text ->
  BatchCheckLayerAvailability
newBatchCheckLayerAvailability :: Text -> NonEmpty Text -> BatchCheckLayerAvailability
newBatchCheckLayerAvailability
  Text
pRepositoryName_
  NonEmpty Text
pLayerDigests_ =
    BatchCheckLayerAvailability' :: Maybe Text -> Text -> NonEmpty Text -> BatchCheckLayerAvailability
BatchCheckLayerAvailability'
      { $sel:registryId:BatchCheckLayerAvailability' :: Maybe Text
registryId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:repositoryName:BatchCheckLayerAvailability' :: Text
repositoryName = Text
pRepositoryName_,
        $sel:layerDigests:BatchCheckLayerAvailability' :: NonEmpty Text
layerDigests =
          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
pLayerDigests_
      }

-- | The AWS account ID associated with the public registry that contains the
-- image layers to check. If you do not specify a registry, the default
-- public registry is assumed.
batchCheckLayerAvailability_registryId :: Lens.Lens' BatchCheckLayerAvailability (Prelude.Maybe Prelude.Text)
batchCheckLayerAvailability_registryId :: (Maybe Text -> f (Maybe Text))
-> BatchCheckLayerAvailability -> f BatchCheckLayerAvailability
batchCheckLayerAvailability_registryId = (BatchCheckLayerAvailability -> Maybe Text)
-> (BatchCheckLayerAvailability
    -> Maybe Text -> BatchCheckLayerAvailability)
-> Lens
     BatchCheckLayerAvailability
     BatchCheckLayerAvailability
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCheckLayerAvailability' {Maybe Text
registryId :: Maybe Text
$sel:registryId:BatchCheckLayerAvailability' :: BatchCheckLayerAvailability -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: BatchCheckLayerAvailability
s@BatchCheckLayerAvailability' {} Maybe Text
a -> BatchCheckLayerAvailability
s {$sel:registryId:BatchCheckLayerAvailability' :: Maybe Text
registryId = Maybe Text
a} :: BatchCheckLayerAvailability)

-- | The name of the repository that is associated with the image layers to
-- check.
batchCheckLayerAvailability_repositoryName :: Lens.Lens' BatchCheckLayerAvailability Prelude.Text
batchCheckLayerAvailability_repositoryName :: (Text -> f Text)
-> BatchCheckLayerAvailability -> f BatchCheckLayerAvailability
batchCheckLayerAvailability_repositoryName = (BatchCheckLayerAvailability -> Text)
-> (BatchCheckLayerAvailability
    -> Text -> BatchCheckLayerAvailability)
-> Lens
     BatchCheckLayerAvailability BatchCheckLayerAvailability Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCheckLayerAvailability' {Text
repositoryName :: Text
$sel:repositoryName:BatchCheckLayerAvailability' :: BatchCheckLayerAvailability -> Text
repositoryName} -> Text
repositoryName) (\s :: BatchCheckLayerAvailability
s@BatchCheckLayerAvailability' {} Text
a -> BatchCheckLayerAvailability
s {$sel:repositoryName:BatchCheckLayerAvailability' :: Text
repositoryName = Text
a} :: BatchCheckLayerAvailability)

-- | The digests of the image layers to check.
batchCheckLayerAvailability_layerDigests :: Lens.Lens' BatchCheckLayerAvailability (Prelude.NonEmpty Prelude.Text)
batchCheckLayerAvailability_layerDigests :: (NonEmpty Text -> f (NonEmpty Text))
-> BatchCheckLayerAvailability -> f BatchCheckLayerAvailability
batchCheckLayerAvailability_layerDigests = (BatchCheckLayerAvailability -> NonEmpty Text)
-> (BatchCheckLayerAvailability
    -> NonEmpty Text -> BatchCheckLayerAvailability)
-> Lens
     BatchCheckLayerAvailability
     BatchCheckLayerAvailability
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCheckLayerAvailability' {NonEmpty Text
layerDigests :: NonEmpty Text
$sel:layerDigests:BatchCheckLayerAvailability' :: BatchCheckLayerAvailability -> NonEmpty Text
layerDigests} -> NonEmpty Text
layerDigests) (\s :: BatchCheckLayerAvailability
s@BatchCheckLayerAvailability' {} NonEmpty Text
a -> BatchCheckLayerAvailability
s {$sel:layerDigests:BatchCheckLayerAvailability' :: NonEmpty Text
layerDigests = NonEmpty Text
a} :: BatchCheckLayerAvailability) ((NonEmpty Text -> f (NonEmpty Text))
 -> BatchCheckLayerAvailability -> f BatchCheckLayerAvailability)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> BatchCheckLayerAvailability
-> f BatchCheckLayerAvailability
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 BatchCheckLayerAvailability where
  type
    AWSResponse BatchCheckLayerAvailability =
      BatchCheckLayerAvailabilityResponse
  request :: BatchCheckLayerAvailability -> Request BatchCheckLayerAvailability
request = Service
-> BatchCheckLayerAvailability
-> Request BatchCheckLayerAvailability
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchCheckLayerAvailability
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchCheckLayerAvailability)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchCheckLayerAvailability))
-> Logger
-> Service
-> Proxy BatchCheckLayerAvailability
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchCheckLayerAvailability)))
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 [LayerFailure]
-> Maybe [Layer] -> Int -> BatchCheckLayerAvailabilityResponse
BatchCheckLayerAvailabilityResponse'
            (Maybe [LayerFailure]
 -> Maybe [Layer] -> Int -> BatchCheckLayerAvailabilityResponse)
-> Either String (Maybe [LayerFailure])
-> Either
     String
     (Maybe [Layer] -> Int -> BatchCheckLayerAvailabilityResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [LayerFailure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failures" Either String (Maybe (Maybe [LayerFailure]))
-> Maybe [LayerFailure] -> Either String (Maybe [LayerFailure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LayerFailure]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [Layer] -> Int -> BatchCheckLayerAvailabilityResponse)
-> Either String (Maybe [Layer])
-> Either String (Int -> BatchCheckLayerAvailabilityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Layer]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"layers" Either String (Maybe (Maybe [Layer]))
-> Maybe [Layer] -> Either String (Maybe [Layer])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Layer]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> BatchCheckLayerAvailabilityResponse)
-> Either String Int
-> Either String BatchCheckLayerAvailabilityResponse
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 BatchCheckLayerAvailability

instance Prelude.NFData BatchCheckLayerAvailability

instance Core.ToHeaders BatchCheckLayerAvailability where
  toHeaders :: BatchCheckLayerAvailability -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchCheckLayerAvailability -> 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
"SpencerFrontendService.BatchCheckLayerAvailability" ::
                          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 BatchCheckLayerAvailability where
  toJSON :: BatchCheckLayerAvailability -> Value
toJSON BatchCheckLayerAvailability' {Maybe Text
NonEmpty Text
Text
layerDigests :: NonEmpty Text
repositoryName :: Text
registryId :: Maybe Text
$sel:layerDigests:BatchCheckLayerAvailability' :: BatchCheckLayerAvailability -> NonEmpty Text
$sel:repositoryName:BatchCheckLayerAvailability' :: BatchCheckLayerAvailability -> Text
$sel:registryId:BatchCheckLayerAvailability' :: BatchCheckLayerAvailability -> 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
"layerDigests" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
layerDigests)
          ]
      )

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

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

-- | /See:/ 'newBatchCheckLayerAvailabilityResponse' smart constructor.
data BatchCheckLayerAvailabilityResponse = BatchCheckLayerAvailabilityResponse'
  { -- | Any failures associated with the call.
    BatchCheckLayerAvailabilityResponse -> Maybe [LayerFailure]
failures :: Prelude.Maybe [LayerFailure],
    -- | A list of image layer objects corresponding to the image layer
    -- references in the request.
    BatchCheckLayerAvailabilityResponse -> Maybe [Layer]
layers :: Prelude.Maybe [Layer],
    -- | The response's http status code.
    BatchCheckLayerAvailabilityResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchCheckLayerAvailabilityResponse
-> BatchCheckLayerAvailabilityResponse -> Bool
(BatchCheckLayerAvailabilityResponse
 -> BatchCheckLayerAvailabilityResponse -> Bool)
-> (BatchCheckLayerAvailabilityResponse
    -> BatchCheckLayerAvailabilityResponse -> Bool)
-> Eq BatchCheckLayerAvailabilityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCheckLayerAvailabilityResponse
-> BatchCheckLayerAvailabilityResponse -> Bool
$c/= :: BatchCheckLayerAvailabilityResponse
-> BatchCheckLayerAvailabilityResponse -> Bool
== :: BatchCheckLayerAvailabilityResponse
-> BatchCheckLayerAvailabilityResponse -> Bool
$c== :: BatchCheckLayerAvailabilityResponse
-> BatchCheckLayerAvailabilityResponse -> Bool
Prelude.Eq, ReadPrec [BatchCheckLayerAvailabilityResponse]
ReadPrec BatchCheckLayerAvailabilityResponse
Int -> ReadS BatchCheckLayerAvailabilityResponse
ReadS [BatchCheckLayerAvailabilityResponse]
(Int -> ReadS BatchCheckLayerAvailabilityResponse)
-> ReadS [BatchCheckLayerAvailabilityResponse]
-> ReadPrec BatchCheckLayerAvailabilityResponse
-> ReadPrec [BatchCheckLayerAvailabilityResponse]
-> Read BatchCheckLayerAvailabilityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCheckLayerAvailabilityResponse]
$creadListPrec :: ReadPrec [BatchCheckLayerAvailabilityResponse]
readPrec :: ReadPrec BatchCheckLayerAvailabilityResponse
$creadPrec :: ReadPrec BatchCheckLayerAvailabilityResponse
readList :: ReadS [BatchCheckLayerAvailabilityResponse]
$creadList :: ReadS [BatchCheckLayerAvailabilityResponse]
readsPrec :: Int -> ReadS BatchCheckLayerAvailabilityResponse
$creadsPrec :: Int -> ReadS BatchCheckLayerAvailabilityResponse
Prelude.Read, Int -> BatchCheckLayerAvailabilityResponse -> ShowS
[BatchCheckLayerAvailabilityResponse] -> ShowS
BatchCheckLayerAvailabilityResponse -> String
(Int -> BatchCheckLayerAvailabilityResponse -> ShowS)
-> (BatchCheckLayerAvailabilityResponse -> String)
-> ([BatchCheckLayerAvailabilityResponse] -> ShowS)
-> Show BatchCheckLayerAvailabilityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCheckLayerAvailabilityResponse] -> ShowS
$cshowList :: [BatchCheckLayerAvailabilityResponse] -> ShowS
show :: BatchCheckLayerAvailabilityResponse -> String
$cshow :: BatchCheckLayerAvailabilityResponse -> String
showsPrec :: Int -> BatchCheckLayerAvailabilityResponse -> ShowS
$cshowsPrec :: Int -> BatchCheckLayerAvailabilityResponse -> ShowS
Prelude.Show, (forall x.
 BatchCheckLayerAvailabilityResponse
 -> Rep BatchCheckLayerAvailabilityResponse x)
-> (forall x.
    Rep BatchCheckLayerAvailabilityResponse x
    -> BatchCheckLayerAvailabilityResponse)
-> Generic BatchCheckLayerAvailabilityResponse
forall x.
Rep BatchCheckLayerAvailabilityResponse x
-> BatchCheckLayerAvailabilityResponse
forall x.
BatchCheckLayerAvailabilityResponse
-> Rep BatchCheckLayerAvailabilityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchCheckLayerAvailabilityResponse x
-> BatchCheckLayerAvailabilityResponse
$cfrom :: forall x.
BatchCheckLayerAvailabilityResponse
-> Rep BatchCheckLayerAvailabilityResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchCheckLayerAvailabilityResponse' 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', 'batchCheckLayerAvailabilityResponse_failures' - Any failures associated with the call.
--
-- 'layers', 'batchCheckLayerAvailabilityResponse_layers' - A list of image layer objects corresponding to the image layer
-- references in the request.
--
-- 'httpStatus', 'batchCheckLayerAvailabilityResponse_httpStatus' - The response's http status code.
newBatchCheckLayerAvailabilityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchCheckLayerAvailabilityResponse
newBatchCheckLayerAvailabilityResponse :: Int -> BatchCheckLayerAvailabilityResponse
newBatchCheckLayerAvailabilityResponse Int
pHttpStatus_ =
  BatchCheckLayerAvailabilityResponse' :: Maybe [LayerFailure]
-> Maybe [Layer] -> Int -> BatchCheckLayerAvailabilityResponse
BatchCheckLayerAvailabilityResponse'
    { $sel:failures:BatchCheckLayerAvailabilityResponse' :: Maybe [LayerFailure]
failures =
        Maybe [LayerFailure]
forall a. Maybe a
Prelude.Nothing,
      $sel:layers:BatchCheckLayerAvailabilityResponse' :: Maybe [Layer]
layers = Maybe [Layer]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchCheckLayerAvailabilityResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of image layer objects corresponding to the image layer
-- references in the request.
batchCheckLayerAvailabilityResponse_layers :: Lens.Lens' BatchCheckLayerAvailabilityResponse (Prelude.Maybe [Layer])
batchCheckLayerAvailabilityResponse_layers :: (Maybe [Layer] -> f (Maybe [Layer]))
-> BatchCheckLayerAvailabilityResponse
-> f BatchCheckLayerAvailabilityResponse
batchCheckLayerAvailabilityResponse_layers = (BatchCheckLayerAvailabilityResponse -> Maybe [Layer])
-> (BatchCheckLayerAvailabilityResponse
    -> Maybe [Layer] -> BatchCheckLayerAvailabilityResponse)
-> Lens
     BatchCheckLayerAvailabilityResponse
     BatchCheckLayerAvailabilityResponse
     (Maybe [Layer])
     (Maybe [Layer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCheckLayerAvailabilityResponse' {Maybe [Layer]
layers :: Maybe [Layer]
$sel:layers:BatchCheckLayerAvailabilityResponse' :: BatchCheckLayerAvailabilityResponse -> Maybe [Layer]
layers} -> Maybe [Layer]
layers) (\s :: BatchCheckLayerAvailabilityResponse
s@BatchCheckLayerAvailabilityResponse' {} Maybe [Layer]
a -> BatchCheckLayerAvailabilityResponse
s {$sel:layers:BatchCheckLayerAvailabilityResponse' :: Maybe [Layer]
layers = Maybe [Layer]
a} :: BatchCheckLayerAvailabilityResponse) ((Maybe [Layer] -> f (Maybe [Layer]))
 -> BatchCheckLayerAvailabilityResponse
 -> f BatchCheckLayerAvailabilityResponse)
-> ((Maybe [Layer] -> f (Maybe [Layer]))
    -> Maybe [Layer] -> f (Maybe [Layer]))
-> (Maybe [Layer] -> f (Maybe [Layer]))
-> BatchCheckLayerAvailabilityResponse
-> f BatchCheckLayerAvailabilityResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Layer] [Layer] [Layer] [Layer]
-> Iso
     (Maybe [Layer]) (Maybe [Layer]) (Maybe [Layer]) (Maybe [Layer])
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 [Layer] [Layer] [Layer] [Layer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    BatchCheckLayerAvailabilityResponse