{-# 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.Lambda.ListLayerVersions
-- 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)
--
-- Lists the versions of an
-- <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html Lambda layer>.
-- Versions that have been deleted aren\'t listed. Specify a
-- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html runtime identifier>
-- to list only versions that indicate that they\'re compatible with that
-- runtime. Specify a compatible architecture to include only layer
-- versions that are compatible with that architecture.
--
-- This operation returns paginated results.
module Amazonka.Lambda.ListLayerVersions
  ( -- * Creating a Request
    ListLayerVersions (..),
    newListLayerVersions,

    -- * Request Lenses
    listLayerVersions_compatibleRuntime,
    listLayerVersions_marker,
    listLayerVersions_maxItems,
    listLayerVersions_compatibleArchitecture,
    listLayerVersions_layerName,

    -- * Destructuring the Response
    ListLayerVersionsResponse (..),
    newListLayerVersionsResponse,

    -- * Response Lenses
    listLayerVersionsResponse_layerVersions,
    listLayerVersionsResponse_nextMarker,
    listLayerVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Lambda.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:/ 'newListLayerVersions' smart constructor.
data ListLayerVersions = ListLayerVersions'
  { -- | A runtime identifier. For example, @go1.x@.
    ListLayerVersions -> Maybe Runtime
compatibleRuntime :: Prelude.Maybe Runtime,
    -- | A pagination token returned by a previous call.
    ListLayerVersions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of versions to return.
    ListLayerVersions -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The compatible
    -- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architecture>.
    ListLayerVersions -> Maybe Architecture
compatibleArchitecture :: Prelude.Maybe Architecture,
    -- | The name or Amazon Resource Name (ARN) of the layer.
    ListLayerVersions -> Text
layerName :: Prelude.Text
  }
  deriving (ListLayerVersions -> ListLayerVersions -> Bool
(ListLayerVersions -> ListLayerVersions -> Bool)
-> (ListLayerVersions -> ListLayerVersions -> Bool)
-> Eq ListLayerVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLayerVersions -> ListLayerVersions -> Bool
$c/= :: ListLayerVersions -> ListLayerVersions -> Bool
== :: ListLayerVersions -> ListLayerVersions -> Bool
$c== :: ListLayerVersions -> ListLayerVersions -> Bool
Prelude.Eq, ReadPrec [ListLayerVersions]
ReadPrec ListLayerVersions
Int -> ReadS ListLayerVersions
ReadS [ListLayerVersions]
(Int -> ReadS ListLayerVersions)
-> ReadS [ListLayerVersions]
-> ReadPrec ListLayerVersions
-> ReadPrec [ListLayerVersions]
-> Read ListLayerVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLayerVersions]
$creadListPrec :: ReadPrec [ListLayerVersions]
readPrec :: ReadPrec ListLayerVersions
$creadPrec :: ReadPrec ListLayerVersions
readList :: ReadS [ListLayerVersions]
$creadList :: ReadS [ListLayerVersions]
readsPrec :: Int -> ReadS ListLayerVersions
$creadsPrec :: Int -> ReadS ListLayerVersions
Prelude.Read, Int -> ListLayerVersions -> ShowS
[ListLayerVersions] -> ShowS
ListLayerVersions -> String
(Int -> ListLayerVersions -> ShowS)
-> (ListLayerVersions -> String)
-> ([ListLayerVersions] -> ShowS)
-> Show ListLayerVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLayerVersions] -> ShowS
$cshowList :: [ListLayerVersions] -> ShowS
show :: ListLayerVersions -> String
$cshow :: ListLayerVersions -> String
showsPrec :: Int -> ListLayerVersions -> ShowS
$cshowsPrec :: Int -> ListLayerVersions -> ShowS
Prelude.Show, (forall x. ListLayerVersions -> Rep ListLayerVersions x)
-> (forall x. Rep ListLayerVersions x -> ListLayerVersions)
-> Generic ListLayerVersions
forall x. Rep ListLayerVersions x -> ListLayerVersions
forall x. ListLayerVersions -> Rep ListLayerVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLayerVersions x -> ListLayerVersions
$cfrom :: forall x. ListLayerVersions -> Rep ListLayerVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListLayerVersions' 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:
--
-- 'compatibleRuntime', 'listLayerVersions_compatibleRuntime' - A runtime identifier. For example, @go1.x@.
--
-- 'marker', 'listLayerVersions_marker' - A pagination token returned by a previous call.
--
-- 'maxItems', 'listLayerVersions_maxItems' - The maximum number of versions to return.
--
-- 'compatibleArchitecture', 'listLayerVersions_compatibleArchitecture' - The compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architecture>.
--
-- 'layerName', 'listLayerVersions_layerName' - The name or Amazon Resource Name (ARN) of the layer.
newListLayerVersions ::
  -- | 'layerName'
  Prelude.Text ->
  ListLayerVersions
newListLayerVersions :: Text -> ListLayerVersions
newListLayerVersions Text
pLayerName_ =
  ListLayerVersions' :: Maybe Runtime
-> Maybe Text
-> Maybe Natural
-> Maybe Architecture
-> Text
-> ListLayerVersions
ListLayerVersions'
    { $sel:compatibleRuntime:ListLayerVersions' :: Maybe Runtime
compatibleRuntime =
        Maybe Runtime
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListLayerVersions' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListLayerVersions' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleArchitecture:ListLayerVersions' :: Maybe Architecture
compatibleArchitecture = Maybe Architecture
forall a. Maybe a
Prelude.Nothing,
      $sel:layerName:ListLayerVersions' :: Text
layerName = Text
pLayerName_
    }

-- | A runtime identifier. For example, @go1.x@.
listLayerVersions_compatibleRuntime :: Lens.Lens' ListLayerVersions (Prelude.Maybe Runtime)
listLayerVersions_compatibleRuntime :: (Maybe Runtime -> f (Maybe Runtime))
-> ListLayerVersions -> f ListLayerVersions
listLayerVersions_compatibleRuntime = (ListLayerVersions -> Maybe Runtime)
-> (ListLayerVersions -> Maybe Runtime -> ListLayerVersions)
-> Lens
     ListLayerVersions ListLayerVersions (Maybe Runtime) (Maybe Runtime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersions' {Maybe Runtime
compatibleRuntime :: Maybe Runtime
$sel:compatibleRuntime:ListLayerVersions' :: ListLayerVersions -> Maybe Runtime
compatibleRuntime} -> Maybe Runtime
compatibleRuntime) (\s :: ListLayerVersions
s@ListLayerVersions' {} Maybe Runtime
a -> ListLayerVersions
s {$sel:compatibleRuntime:ListLayerVersions' :: Maybe Runtime
compatibleRuntime = Maybe Runtime
a} :: ListLayerVersions)

-- | A pagination token returned by a previous call.
listLayerVersions_marker :: Lens.Lens' ListLayerVersions (Prelude.Maybe Prelude.Text)
listLayerVersions_marker :: (Maybe Text -> f (Maybe Text))
-> ListLayerVersions -> f ListLayerVersions
listLayerVersions_marker = (ListLayerVersions -> Maybe Text)
-> (ListLayerVersions -> Maybe Text -> ListLayerVersions)
-> Lens
     ListLayerVersions ListLayerVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersions' {Maybe Text
marker :: Maybe Text
$sel:marker:ListLayerVersions' :: ListLayerVersions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListLayerVersions
s@ListLayerVersions' {} Maybe Text
a -> ListLayerVersions
s {$sel:marker:ListLayerVersions' :: Maybe Text
marker = Maybe Text
a} :: ListLayerVersions)

-- | The maximum number of versions to return.
listLayerVersions_maxItems :: Lens.Lens' ListLayerVersions (Prelude.Maybe Prelude.Natural)
listLayerVersions_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> ListLayerVersions -> f ListLayerVersions
listLayerVersions_maxItems = (ListLayerVersions -> Maybe Natural)
-> (ListLayerVersions -> Maybe Natural -> ListLayerVersions)
-> Lens
     ListLayerVersions ListLayerVersions (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersions' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListLayerVersions' :: ListLayerVersions -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListLayerVersions
s@ListLayerVersions' {} Maybe Natural
a -> ListLayerVersions
s {$sel:maxItems:ListLayerVersions' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListLayerVersions)

-- | The compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architecture>.
listLayerVersions_compatibleArchitecture :: Lens.Lens' ListLayerVersions (Prelude.Maybe Architecture)
listLayerVersions_compatibleArchitecture :: (Maybe Architecture -> f (Maybe Architecture))
-> ListLayerVersions -> f ListLayerVersions
listLayerVersions_compatibleArchitecture = (ListLayerVersions -> Maybe Architecture)
-> (ListLayerVersions -> Maybe Architecture -> ListLayerVersions)
-> Lens
     ListLayerVersions
     ListLayerVersions
     (Maybe Architecture)
     (Maybe Architecture)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersions' {Maybe Architecture
compatibleArchitecture :: Maybe Architecture
$sel:compatibleArchitecture:ListLayerVersions' :: ListLayerVersions -> Maybe Architecture
compatibleArchitecture} -> Maybe Architecture
compatibleArchitecture) (\s :: ListLayerVersions
s@ListLayerVersions' {} Maybe Architecture
a -> ListLayerVersions
s {$sel:compatibleArchitecture:ListLayerVersions' :: Maybe Architecture
compatibleArchitecture = Maybe Architecture
a} :: ListLayerVersions)

-- | The name or Amazon Resource Name (ARN) of the layer.
listLayerVersions_layerName :: Lens.Lens' ListLayerVersions Prelude.Text
listLayerVersions_layerName :: (Text -> f Text) -> ListLayerVersions -> f ListLayerVersions
listLayerVersions_layerName = (ListLayerVersions -> Text)
-> (ListLayerVersions -> Text -> ListLayerVersions)
-> Lens ListLayerVersions ListLayerVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersions' {Text
layerName :: Text
$sel:layerName:ListLayerVersions' :: ListLayerVersions -> Text
layerName} -> Text
layerName) (\s :: ListLayerVersions
s@ListLayerVersions' {} Text
a -> ListLayerVersions
s {$sel:layerName:ListLayerVersions' :: Text
layerName = Text
a} :: ListLayerVersions)

instance Core.AWSPager ListLayerVersions where
  page :: ListLayerVersions
-> AWSResponse ListLayerVersions -> Maybe ListLayerVersions
page ListLayerVersions
rq AWSResponse ListLayerVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLayerVersions
ListLayerVersionsResponse
rs
            ListLayerVersionsResponse
-> Getting (First Text) ListLayerVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLayerVersionsResponse
-> Const (First Text) ListLayerVersionsResponse
Lens' ListLayerVersionsResponse (Maybe Text)
listLayerVersionsResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLayerVersionsResponse
 -> Const (First Text) ListLayerVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLayerVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListLayerVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [LayerVersionsListItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLayerVersions
ListLayerVersionsResponse
rs
            ListLayerVersionsResponse
-> Getting
     (First [LayerVersionsListItem])
     ListLayerVersionsResponse
     [LayerVersionsListItem]
-> Maybe [LayerVersionsListItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [LayerVersionsListItem]
 -> Const
      (First [LayerVersionsListItem]) (Maybe [LayerVersionsListItem]))
-> ListLayerVersionsResponse
-> Const (First [LayerVersionsListItem]) ListLayerVersionsResponse
Lens' ListLayerVersionsResponse (Maybe [LayerVersionsListItem])
listLayerVersionsResponse_layerVersions
              ((Maybe [LayerVersionsListItem]
  -> Const
       (First [LayerVersionsListItem]) (Maybe [LayerVersionsListItem]))
 -> ListLayerVersionsResponse
 -> Const (First [LayerVersionsListItem]) ListLayerVersionsResponse)
-> (([LayerVersionsListItem]
     -> Const (First [LayerVersionsListItem]) [LayerVersionsListItem])
    -> Maybe [LayerVersionsListItem]
    -> Const
         (First [LayerVersionsListItem]) (Maybe [LayerVersionsListItem]))
-> Getting
     (First [LayerVersionsListItem])
     ListLayerVersionsResponse
     [LayerVersionsListItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([LayerVersionsListItem]
 -> Const (First [LayerVersionsListItem]) [LayerVersionsListItem])
-> Maybe [LayerVersionsListItem]
-> Const
     (First [LayerVersionsListItem]) (Maybe [LayerVersionsListItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListLayerVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListLayerVersions -> Maybe ListLayerVersions
forall a. a -> Maybe a
Prelude.Just (ListLayerVersions -> Maybe ListLayerVersions)
-> ListLayerVersions -> Maybe ListLayerVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListLayerVersions
rq
          ListLayerVersions
-> (ListLayerVersions -> ListLayerVersions) -> ListLayerVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListLayerVersions -> Identity ListLayerVersions
Lens ListLayerVersions ListLayerVersions (Maybe Text) (Maybe Text)
listLayerVersions_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListLayerVersions -> Identity ListLayerVersions)
-> Maybe Text -> ListLayerVersions -> ListLayerVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLayerVersions
ListLayerVersionsResponse
rs
          ListLayerVersionsResponse
-> Getting (First Text) ListLayerVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLayerVersionsResponse
-> Const (First Text) ListLayerVersionsResponse
Lens' ListLayerVersionsResponse (Maybe Text)
listLayerVersionsResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLayerVersionsResponse
 -> Const (First Text) ListLayerVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLayerVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListLayerVersions where
  type
    AWSResponse ListLayerVersions =
      ListLayerVersionsResponse
  request :: ListLayerVersions -> Request ListLayerVersions
request = Service -> ListLayerVersions -> Request ListLayerVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListLayerVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListLayerVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListLayerVersions))
-> Logger
-> Service
-> Proxy ListLayerVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListLayerVersions)))
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 [LayerVersionsListItem]
-> Maybe Text -> Int -> ListLayerVersionsResponse
ListLayerVersionsResponse'
            (Maybe [LayerVersionsListItem]
 -> Maybe Text -> Int -> ListLayerVersionsResponse)
-> Either String (Maybe [LayerVersionsListItem])
-> Either String (Maybe Text -> Int -> ListLayerVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [LayerVersionsListItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LayerVersions" Either String (Maybe (Maybe [LayerVersionsListItem]))
-> Maybe [LayerVersionsListItem]
-> Either String (Maybe [LayerVersionsListItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LayerVersionsListItem]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListLayerVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListLayerVersionsResponse)
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
"NextMarker")
            Either String (Int -> ListLayerVersionsResponse)
-> Either String Int -> Either String ListLayerVersionsResponse
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 ListLayerVersions

instance Prelude.NFData ListLayerVersions

instance Core.ToHeaders ListLayerVersions where
  toHeaders :: ListLayerVersions -> ResponseHeaders
toHeaders = ResponseHeaders -> ListLayerVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListLayerVersions where
  toPath :: ListLayerVersions -> ByteString
toPath ListLayerVersions' {Maybe Natural
Maybe Text
Maybe Architecture
Maybe Runtime
Text
layerName :: Text
compatibleArchitecture :: Maybe Architecture
maxItems :: Maybe Natural
marker :: Maybe Text
compatibleRuntime :: Maybe Runtime
$sel:layerName:ListLayerVersions' :: ListLayerVersions -> Text
$sel:compatibleArchitecture:ListLayerVersions' :: ListLayerVersions -> Maybe Architecture
$sel:maxItems:ListLayerVersions' :: ListLayerVersions -> Maybe Natural
$sel:marker:ListLayerVersions' :: ListLayerVersions -> Maybe Text
$sel:compatibleRuntime:ListLayerVersions' :: ListLayerVersions -> Maybe Runtime
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2018-10-31/layers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
layerName,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListLayerVersions where
  toQuery :: ListLayerVersions -> QueryString
toQuery ListLayerVersions' {Maybe Natural
Maybe Text
Maybe Architecture
Maybe Runtime
Text
layerName :: Text
compatibleArchitecture :: Maybe Architecture
maxItems :: Maybe Natural
marker :: Maybe Text
compatibleRuntime :: Maybe Runtime
$sel:layerName:ListLayerVersions' :: ListLayerVersions -> Text
$sel:compatibleArchitecture:ListLayerVersions' :: ListLayerVersions -> Maybe Architecture
$sel:maxItems:ListLayerVersions' :: ListLayerVersions -> Maybe Natural
$sel:marker:ListLayerVersions' :: ListLayerVersions -> Maybe Text
$sel:compatibleRuntime:ListLayerVersions' :: ListLayerVersions -> Maybe Runtime
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"CompatibleRuntime" ByteString -> Maybe Runtime -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Runtime
compatibleRuntime,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems,
        ByteString
"CompatibleArchitecture"
          ByteString -> Maybe Architecture -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Architecture
compatibleArchitecture
      ]

-- | /See:/ 'newListLayerVersionsResponse' smart constructor.
data ListLayerVersionsResponse = ListLayerVersionsResponse'
  { -- | A list of versions.
    ListLayerVersionsResponse -> Maybe [LayerVersionsListItem]
layerVersions :: Prelude.Maybe [LayerVersionsListItem],
    -- | A pagination token returned when the response doesn\'t contain all
    -- versions.
    ListLayerVersionsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListLayerVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool
(ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool)
-> (ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool)
-> Eq ListLayerVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool
$c/= :: ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool
== :: ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool
$c== :: ListLayerVersionsResponse -> ListLayerVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListLayerVersionsResponse]
ReadPrec ListLayerVersionsResponse
Int -> ReadS ListLayerVersionsResponse
ReadS [ListLayerVersionsResponse]
(Int -> ReadS ListLayerVersionsResponse)
-> ReadS [ListLayerVersionsResponse]
-> ReadPrec ListLayerVersionsResponse
-> ReadPrec [ListLayerVersionsResponse]
-> Read ListLayerVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLayerVersionsResponse]
$creadListPrec :: ReadPrec [ListLayerVersionsResponse]
readPrec :: ReadPrec ListLayerVersionsResponse
$creadPrec :: ReadPrec ListLayerVersionsResponse
readList :: ReadS [ListLayerVersionsResponse]
$creadList :: ReadS [ListLayerVersionsResponse]
readsPrec :: Int -> ReadS ListLayerVersionsResponse
$creadsPrec :: Int -> ReadS ListLayerVersionsResponse
Prelude.Read, Int -> ListLayerVersionsResponse -> ShowS
[ListLayerVersionsResponse] -> ShowS
ListLayerVersionsResponse -> String
(Int -> ListLayerVersionsResponse -> ShowS)
-> (ListLayerVersionsResponse -> String)
-> ([ListLayerVersionsResponse] -> ShowS)
-> Show ListLayerVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLayerVersionsResponse] -> ShowS
$cshowList :: [ListLayerVersionsResponse] -> ShowS
show :: ListLayerVersionsResponse -> String
$cshow :: ListLayerVersionsResponse -> String
showsPrec :: Int -> ListLayerVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListLayerVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListLayerVersionsResponse -> Rep ListLayerVersionsResponse x)
-> (forall x.
    Rep ListLayerVersionsResponse x -> ListLayerVersionsResponse)
-> Generic ListLayerVersionsResponse
forall x.
Rep ListLayerVersionsResponse x -> ListLayerVersionsResponse
forall x.
ListLayerVersionsResponse -> Rep ListLayerVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLayerVersionsResponse x -> ListLayerVersionsResponse
$cfrom :: forall x.
ListLayerVersionsResponse -> Rep ListLayerVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLayerVersionsResponse' 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:
--
-- 'layerVersions', 'listLayerVersionsResponse_layerVersions' - A list of versions.
--
-- 'nextMarker', 'listLayerVersionsResponse_nextMarker' - A pagination token returned when the response doesn\'t contain all
-- versions.
--
-- 'httpStatus', 'listLayerVersionsResponse_httpStatus' - The response's http status code.
newListLayerVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLayerVersionsResponse
newListLayerVersionsResponse :: Int -> ListLayerVersionsResponse
newListLayerVersionsResponse Int
pHttpStatus_ =
  ListLayerVersionsResponse' :: Maybe [LayerVersionsListItem]
-> Maybe Text -> Int -> ListLayerVersionsResponse
ListLayerVersionsResponse'
    { $sel:layerVersions:ListLayerVersionsResponse' :: Maybe [LayerVersionsListItem]
layerVersions =
        Maybe [LayerVersionsListItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListLayerVersionsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLayerVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of versions.
listLayerVersionsResponse_layerVersions :: Lens.Lens' ListLayerVersionsResponse (Prelude.Maybe [LayerVersionsListItem])
listLayerVersionsResponse_layerVersions :: (Maybe [LayerVersionsListItem]
 -> f (Maybe [LayerVersionsListItem]))
-> ListLayerVersionsResponse -> f ListLayerVersionsResponse
listLayerVersionsResponse_layerVersions = (ListLayerVersionsResponse -> Maybe [LayerVersionsListItem])
-> (ListLayerVersionsResponse
    -> Maybe [LayerVersionsListItem] -> ListLayerVersionsResponse)
-> Lens' ListLayerVersionsResponse (Maybe [LayerVersionsListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersionsResponse' {Maybe [LayerVersionsListItem]
layerVersions :: Maybe [LayerVersionsListItem]
$sel:layerVersions:ListLayerVersionsResponse' :: ListLayerVersionsResponse -> Maybe [LayerVersionsListItem]
layerVersions} -> Maybe [LayerVersionsListItem]
layerVersions) (\s :: ListLayerVersionsResponse
s@ListLayerVersionsResponse' {} Maybe [LayerVersionsListItem]
a -> ListLayerVersionsResponse
s {$sel:layerVersions:ListLayerVersionsResponse' :: Maybe [LayerVersionsListItem]
layerVersions = Maybe [LayerVersionsListItem]
a} :: ListLayerVersionsResponse) ((Maybe [LayerVersionsListItem]
  -> f (Maybe [LayerVersionsListItem]))
 -> ListLayerVersionsResponse -> f ListLayerVersionsResponse)
-> ((Maybe [LayerVersionsListItem]
     -> f (Maybe [LayerVersionsListItem]))
    -> Maybe [LayerVersionsListItem]
    -> f (Maybe [LayerVersionsListItem]))
-> (Maybe [LayerVersionsListItem]
    -> f (Maybe [LayerVersionsListItem]))
-> ListLayerVersionsResponse
-> f ListLayerVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LayerVersionsListItem]
  [LayerVersionsListItem]
  [LayerVersionsListItem]
  [LayerVersionsListItem]
-> Iso
     (Maybe [LayerVersionsListItem])
     (Maybe [LayerVersionsListItem])
     (Maybe [LayerVersionsListItem])
     (Maybe [LayerVersionsListItem])
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
  [LayerVersionsListItem]
  [LayerVersionsListItem]
  [LayerVersionsListItem]
  [LayerVersionsListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A pagination token returned when the response doesn\'t contain all
-- versions.
listLayerVersionsResponse_nextMarker :: Lens.Lens' ListLayerVersionsResponse (Prelude.Maybe Prelude.Text)
listLayerVersionsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListLayerVersionsResponse -> f ListLayerVersionsResponse
listLayerVersionsResponse_nextMarker = (ListLayerVersionsResponse -> Maybe Text)
-> (ListLayerVersionsResponse
    -> Maybe Text -> ListLayerVersionsResponse)
-> Lens' ListLayerVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLayerVersionsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListLayerVersionsResponse' :: ListLayerVersionsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListLayerVersionsResponse
s@ListLayerVersionsResponse' {} Maybe Text
a -> ListLayerVersionsResponse
s {$sel:nextMarker:ListLayerVersionsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListLayerVersionsResponse)

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

instance Prelude.NFData ListLayerVersionsResponse