{-# 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.GetDownloadUrlForLayer
-- 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)
--
-- Retrieves the pre-signed Amazon S3 download URL corresponding to an
-- image layer. You can only get URLs for image layers that are referenced
-- in an image.
--
-- When an image is pulled, the GetDownloadUrlForLayer API is called once
-- per image layer that is not already cached.
--
-- 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.ECR.GetDownloadUrlForLayer
  ( -- * Creating a Request
    GetDownloadUrlForLayer (..),
    newGetDownloadUrlForLayer,

    -- * Request Lenses
    getDownloadUrlForLayer_registryId,
    getDownloadUrlForLayer_repositoryName,
    getDownloadUrlForLayer_layerDigest,

    -- * Destructuring the Response
    GetDownloadUrlForLayerResponse (..),
    newGetDownloadUrlForLayerResponse,

    -- * Response Lenses
    getDownloadUrlForLayerResponse_layerDigest,
    getDownloadUrlForLayerResponse_downloadUrl,
    getDownloadUrlForLayerResponse_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

-- | /See:/ 'newGetDownloadUrlForLayer' smart constructor.
data GetDownloadUrlForLayer = GetDownloadUrlForLayer'
  { -- | The Amazon Web Services account ID associated with the registry that
    -- contains the image layer to download. If you do not specify a registry,
    -- the default registry is assumed.
    GetDownloadUrlForLayer -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository that is associated with the image layer to
    -- download.
    GetDownloadUrlForLayer -> Text
repositoryName :: Prelude.Text,
    -- | The digest of the image layer to download.
    GetDownloadUrlForLayer -> Text
layerDigest :: Prelude.Text
  }
  deriving (GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool
(GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool)
-> (GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool)
-> Eq GetDownloadUrlForLayer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool
$c/= :: GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool
== :: GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool
$c== :: GetDownloadUrlForLayer -> GetDownloadUrlForLayer -> Bool
Prelude.Eq, ReadPrec [GetDownloadUrlForLayer]
ReadPrec GetDownloadUrlForLayer
Int -> ReadS GetDownloadUrlForLayer
ReadS [GetDownloadUrlForLayer]
(Int -> ReadS GetDownloadUrlForLayer)
-> ReadS [GetDownloadUrlForLayer]
-> ReadPrec GetDownloadUrlForLayer
-> ReadPrec [GetDownloadUrlForLayer]
-> Read GetDownloadUrlForLayer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDownloadUrlForLayer]
$creadListPrec :: ReadPrec [GetDownloadUrlForLayer]
readPrec :: ReadPrec GetDownloadUrlForLayer
$creadPrec :: ReadPrec GetDownloadUrlForLayer
readList :: ReadS [GetDownloadUrlForLayer]
$creadList :: ReadS [GetDownloadUrlForLayer]
readsPrec :: Int -> ReadS GetDownloadUrlForLayer
$creadsPrec :: Int -> ReadS GetDownloadUrlForLayer
Prelude.Read, Int -> GetDownloadUrlForLayer -> ShowS
[GetDownloadUrlForLayer] -> ShowS
GetDownloadUrlForLayer -> String
(Int -> GetDownloadUrlForLayer -> ShowS)
-> (GetDownloadUrlForLayer -> String)
-> ([GetDownloadUrlForLayer] -> ShowS)
-> Show GetDownloadUrlForLayer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDownloadUrlForLayer] -> ShowS
$cshowList :: [GetDownloadUrlForLayer] -> ShowS
show :: GetDownloadUrlForLayer -> String
$cshow :: GetDownloadUrlForLayer -> String
showsPrec :: Int -> GetDownloadUrlForLayer -> ShowS
$cshowsPrec :: Int -> GetDownloadUrlForLayer -> ShowS
Prelude.Show, (forall x. GetDownloadUrlForLayer -> Rep GetDownloadUrlForLayer x)
-> (forall x.
    Rep GetDownloadUrlForLayer x -> GetDownloadUrlForLayer)
-> Generic GetDownloadUrlForLayer
forall x. Rep GetDownloadUrlForLayer x -> GetDownloadUrlForLayer
forall x. GetDownloadUrlForLayer -> Rep GetDownloadUrlForLayer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDownloadUrlForLayer x -> GetDownloadUrlForLayer
$cfrom :: forall x. GetDownloadUrlForLayer -> Rep GetDownloadUrlForLayer x
Prelude.Generic)

-- |
-- Create a value of 'GetDownloadUrlForLayer' 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', 'getDownloadUrlForLayer_registryId' - The Amazon Web Services account ID associated with the registry that
-- contains the image layer to download. If you do not specify a registry,
-- the default registry is assumed.
--
-- 'repositoryName', 'getDownloadUrlForLayer_repositoryName' - The name of the repository that is associated with the image layer to
-- download.
--
-- 'layerDigest', 'getDownloadUrlForLayer_layerDigest' - The digest of the image layer to download.
newGetDownloadUrlForLayer ::
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'layerDigest'
  Prelude.Text ->
  GetDownloadUrlForLayer
newGetDownloadUrlForLayer :: Text -> Text -> GetDownloadUrlForLayer
newGetDownloadUrlForLayer
  Text
pRepositoryName_
  Text
pLayerDigest_ =
    GetDownloadUrlForLayer' :: Maybe Text -> Text -> Text -> GetDownloadUrlForLayer
GetDownloadUrlForLayer'
      { $sel:registryId:GetDownloadUrlForLayer' :: Maybe Text
registryId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:repositoryName:GetDownloadUrlForLayer' :: Text
repositoryName = Text
pRepositoryName_,
        $sel:layerDigest:GetDownloadUrlForLayer' :: Text
layerDigest = Text
pLayerDigest_
      }

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

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

-- | The digest of the image layer to download.
getDownloadUrlForLayer_layerDigest :: Lens.Lens' GetDownloadUrlForLayer Prelude.Text
getDownloadUrlForLayer_layerDigest :: (Text -> f Text)
-> GetDownloadUrlForLayer -> f GetDownloadUrlForLayer
getDownloadUrlForLayer_layerDigest = (GetDownloadUrlForLayer -> Text)
-> (GetDownloadUrlForLayer -> Text -> GetDownloadUrlForLayer)
-> Lens GetDownloadUrlForLayer GetDownloadUrlForLayer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDownloadUrlForLayer' {Text
layerDigest :: Text
$sel:layerDigest:GetDownloadUrlForLayer' :: GetDownloadUrlForLayer -> Text
layerDigest} -> Text
layerDigest) (\s :: GetDownloadUrlForLayer
s@GetDownloadUrlForLayer' {} Text
a -> GetDownloadUrlForLayer
s {$sel:layerDigest:GetDownloadUrlForLayer' :: Text
layerDigest = Text
a} :: GetDownloadUrlForLayer)

instance Core.AWSRequest GetDownloadUrlForLayer where
  type
    AWSResponse GetDownloadUrlForLayer =
      GetDownloadUrlForLayerResponse
  request :: GetDownloadUrlForLayer -> Request GetDownloadUrlForLayer
request = Service -> GetDownloadUrlForLayer -> Request GetDownloadUrlForLayer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDownloadUrlForLayer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDownloadUrlForLayer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDownloadUrlForLayer))
-> Logger
-> Service
-> Proxy GetDownloadUrlForLayer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDownloadUrlForLayer)))
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 Text -> Maybe Text -> Int -> GetDownloadUrlForLayerResponse
GetDownloadUrlForLayerResponse'
            (Maybe Text -> Maybe Text -> Int -> GetDownloadUrlForLayerResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> GetDownloadUrlForLayerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"layerDigest")
            Either String (Maybe Text -> Int -> GetDownloadUrlForLayerResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetDownloadUrlForLayerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"downloadUrl")
            Either String (Int -> GetDownloadUrlForLayerResponse)
-> Either String Int
-> Either String GetDownloadUrlForLayerResponse
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 GetDownloadUrlForLayer

instance Prelude.NFData GetDownloadUrlForLayer

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

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

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

-- | /See:/ 'newGetDownloadUrlForLayerResponse' smart constructor.
data GetDownloadUrlForLayerResponse = GetDownloadUrlForLayerResponse'
  { -- | The digest of the image layer to download.
    GetDownloadUrlForLayerResponse -> Maybe Text
layerDigest :: Prelude.Maybe Prelude.Text,
    -- | The pre-signed Amazon S3 download URL for the requested layer.
    GetDownloadUrlForLayerResponse -> Maybe Text
downloadUrl :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetDownloadUrlForLayerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDownloadUrlForLayerResponse
-> GetDownloadUrlForLayerResponse -> Bool
(GetDownloadUrlForLayerResponse
 -> GetDownloadUrlForLayerResponse -> Bool)
-> (GetDownloadUrlForLayerResponse
    -> GetDownloadUrlForLayerResponse -> Bool)
-> Eq GetDownloadUrlForLayerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDownloadUrlForLayerResponse
-> GetDownloadUrlForLayerResponse -> Bool
$c/= :: GetDownloadUrlForLayerResponse
-> GetDownloadUrlForLayerResponse -> Bool
== :: GetDownloadUrlForLayerResponse
-> GetDownloadUrlForLayerResponse -> Bool
$c== :: GetDownloadUrlForLayerResponse
-> GetDownloadUrlForLayerResponse -> Bool
Prelude.Eq, ReadPrec [GetDownloadUrlForLayerResponse]
ReadPrec GetDownloadUrlForLayerResponse
Int -> ReadS GetDownloadUrlForLayerResponse
ReadS [GetDownloadUrlForLayerResponse]
(Int -> ReadS GetDownloadUrlForLayerResponse)
-> ReadS [GetDownloadUrlForLayerResponse]
-> ReadPrec GetDownloadUrlForLayerResponse
-> ReadPrec [GetDownloadUrlForLayerResponse]
-> Read GetDownloadUrlForLayerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDownloadUrlForLayerResponse]
$creadListPrec :: ReadPrec [GetDownloadUrlForLayerResponse]
readPrec :: ReadPrec GetDownloadUrlForLayerResponse
$creadPrec :: ReadPrec GetDownloadUrlForLayerResponse
readList :: ReadS [GetDownloadUrlForLayerResponse]
$creadList :: ReadS [GetDownloadUrlForLayerResponse]
readsPrec :: Int -> ReadS GetDownloadUrlForLayerResponse
$creadsPrec :: Int -> ReadS GetDownloadUrlForLayerResponse
Prelude.Read, Int -> GetDownloadUrlForLayerResponse -> ShowS
[GetDownloadUrlForLayerResponse] -> ShowS
GetDownloadUrlForLayerResponse -> String
(Int -> GetDownloadUrlForLayerResponse -> ShowS)
-> (GetDownloadUrlForLayerResponse -> String)
-> ([GetDownloadUrlForLayerResponse] -> ShowS)
-> Show GetDownloadUrlForLayerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDownloadUrlForLayerResponse] -> ShowS
$cshowList :: [GetDownloadUrlForLayerResponse] -> ShowS
show :: GetDownloadUrlForLayerResponse -> String
$cshow :: GetDownloadUrlForLayerResponse -> String
showsPrec :: Int -> GetDownloadUrlForLayerResponse -> ShowS
$cshowsPrec :: Int -> GetDownloadUrlForLayerResponse -> ShowS
Prelude.Show, (forall x.
 GetDownloadUrlForLayerResponse
 -> Rep GetDownloadUrlForLayerResponse x)
-> (forall x.
    Rep GetDownloadUrlForLayerResponse x
    -> GetDownloadUrlForLayerResponse)
-> Generic GetDownloadUrlForLayerResponse
forall x.
Rep GetDownloadUrlForLayerResponse x
-> GetDownloadUrlForLayerResponse
forall x.
GetDownloadUrlForLayerResponse
-> Rep GetDownloadUrlForLayerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDownloadUrlForLayerResponse x
-> GetDownloadUrlForLayerResponse
$cfrom :: forall x.
GetDownloadUrlForLayerResponse
-> Rep GetDownloadUrlForLayerResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDownloadUrlForLayerResponse' 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:
--
-- 'layerDigest', 'getDownloadUrlForLayerResponse_layerDigest' - The digest of the image layer to download.
--
-- 'downloadUrl', 'getDownloadUrlForLayerResponse_downloadUrl' - The pre-signed Amazon S3 download URL for the requested layer.
--
-- 'httpStatus', 'getDownloadUrlForLayerResponse_httpStatus' - The response's http status code.
newGetDownloadUrlForLayerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDownloadUrlForLayerResponse
newGetDownloadUrlForLayerResponse :: Int -> GetDownloadUrlForLayerResponse
newGetDownloadUrlForLayerResponse Int
pHttpStatus_ =
  GetDownloadUrlForLayerResponse' :: Maybe Text -> Maybe Text -> Int -> GetDownloadUrlForLayerResponse
GetDownloadUrlForLayerResponse'
    { $sel:layerDigest:GetDownloadUrlForLayerResponse' :: Maybe Text
layerDigest =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:downloadUrl:GetDownloadUrlForLayerResponse' :: Maybe Text
downloadUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDownloadUrlForLayerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The digest of the image layer to download.
getDownloadUrlForLayerResponse_layerDigest :: Lens.Lens' GetDownloadUrlForLayerResponse (Prelude.Maybe Prelude.Text)
getDownloadUrlForLayerResponse_layerDigest :: (Maybe Text -> f (Maybe Text))
-> GetDownloadUrlForLayerResponse
-> f GetDownloadUrlForLayerResponse
getDownloadUrlForLayerResponse_layerDigest = (GetDownloadUrlForLayerResponse -> Maybe Text)
-> (GetDownloadUrlForLayerResponse
    -> Maybe Text -> GetDownloadUrlForLayerResponse)
-> Lens
     GetDownloadUrlForLayerResponse
     GetDownloadUrlForLayerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDownloadUrlForLayerResponse' {Maybe Text
layerDigest :: Maybe Text
$sel:layerDigest:GetDownloadUrlForLayerResponse' :: GetDownloadUrlForLayerResponse -> Maybe Text
layerDigest} -> Maybe Text
layerDigest) (\s :: GetDownloadUrlForLayerResponse
s@GetDownloadUrlForLayerResponse' {} Maybe Text
a -> GetDownloadUrlForLayerResponse
s {$sel:layerDigest:GetDownloadUrlForLayerResponse' :: Maybe Text
layerDigest = Maybe Text
a} :: GetDownloadUrlForLayerResponse)

-- | The pre-signed Amazon S3 download URL for the requested layer.
getDownloadUrlForLayerResponse_downloadUrl :: Lens.Lens' GetDownloadUrlForLayerResponse (Prelude.Maybe Prelude.Text)
getDownloadUrlForLayerResponse_downloadUrl :: (Maybe Text -> f (Maybe Text))
-> GetDownloadUrlForLayerResponse
-> f GetDownloadUrlForLayerResponse
getDownloadUrlForLayerResponse_downloadUrl = (GetDownloadUrlForLayerResponse -> Maybe Text)
-> (GetDownloadUrlForLayerResponse
    -> Maybe Text -> GetDownloadUrlForLayerResponse)
-> Lens
     GetDownloadUrlForLayerResponse
     GetDownloadUrlForLayerResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDownloadUrlForLayerResponse' {Maybe Text
downloadUrl :: Maybe Text
$sel:downloadUrl:GetDownloadUrlForLayerResponse' :: GetDownloadUrlForLayerResponse -> Maybe Text
downloadUrl} -> Maybe Text
downloadUrl) (\s :: GetDownloadUrlForLayerResponse
s@GetDownloadUrlForLayerResponse' {} Maybe Text
a -> GetDownloadUrlForLayerResponse
s {$sel:downloadUrl:GetDownloadUrlForLayerResponse' :: Maybe Text
downloadUrl = Maybe Text
a} :: GetDownloadUrlForLayerResponse)

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

instance
  Prelude.NFData
    GetDownloadUrlForLayerResponse