{-# 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.ListLayers
-- 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
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html Lambda layers>
-- and shows information about the latest version of each. Specify a
-- <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html runtime identifier>
-- to list only layers that indicate that they\'re compatible with that
-- runtime. Specify a compatible architecture to include only layers that
-- are compatible with that
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architecture>.
--
-- This operation returns paginated results.
module Amazonka.Lambda.ListLayers
  ( -- * Creating a Request
    ListLayers (..),
    newListLayers,

    -- * Request Lenses
    listLayers_compatibleRuntime,
    listLayers_marker,
    listLayers_maxItems,
    listLayers_compatibleArchitecture,

    -- * Destructuring the Response
    ListLayersResponse (..),
    newListLayersResponse,

    -- * Response Lenses
    listLayersResponse_nextMarker,
    listLayersResponse_layers,
    listLayersResponse_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:/ 'newListLayers' smart constructor.
data ListLayers = ListLayers'
  { -- | A runtime identifier. For example, @go1.x@.
    ListLayers -> Maybe Runtime
compatibleRuntime :: Prelude.Maybe Runtime,
    -- | A pagination token returned by a previous call.
    ListLayers -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of layers to return.
    ListLayers -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The compatible
    -- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architecture>.
    ListLayers -> Maybe Architecture
compatibleArchitecture :: Prelude.Maybe Architecture
  }
  deriving (ListLayers -> ListLayers -> Bool
(ListLayers -> ListLayers -> Bool)
-> (ListLayers -> ListLayers -> Bool) -> Eq ListLayers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLayers -> ListLayers -> Bool
$c/= :: ListLayers -> ListLayers -> Bool
== :: ListLayers -> ListLayers -> Bool
$c== :: ListLayers -> ListLayers -> Bool
Prelude.Eq, ReadPrec [ListLayers]
ReadPrec ListLayers
Int -> ReadS ListLayers
ReadS [ListLayers]
(Int -> ReadS ListLayers)
-> ReadS [ListLayers]
-> ReadPrec ListLayers
-> ReadPrec [ListLayers]
-> Read ListLayers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLayers]
$creadListPrec :: ReadPrec [ListLayers]
readPrec :: ReadPrec ListLayers
$creadPrec :: ReadPrec ListLayers
readList :: ReadS [ListLayers]
$creadList :: ReadS [ListLayers]
readsPrec :: Int -> ReadS ListLayers
$creadsPrec :: Int -> ReadS ListLayers
Prelude.Read, Int -> ListLayers -> ShowS
[ListLayers] -> ShowS
ListLayers -> String
(Int -> ListLayers -> ShowS)
-> (ListLayers -> String)
-> ([ListLayers] -> ShowS)
-> Show ListLayers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLayers] -> ShowS
$cshowList :: [ListLayers] -> ShowS
show :: ListLayers -> String
$cshow :: ListLayers -> String
showsPrec :: Int -> ListLayers -> ShowS
$cshowsPrec :: Int -> ListLayers -> ShowS
Prelude.Show, (forall x. ListLayers -> Rep ListLayers x)
-> (forall x. Rep ListLayers x -> ListLayers) -> Generic ListLayers
forall x. Rep ListLayers x -> ListLayers
forall x. ListLayers -> Rep ListLayers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLayers x -> ListLayers
$cfrom :: forall x. ListLayers -> Rep ListLayers x
Prelude.Generic)

-- |
-- Create a value of 'ListLayers' 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', 'listLayers_compatibleRuntime' - A runtime identifier. For example, @go1.x@.
--
-- 'marker', 'listLayers_marker' - A pagination token returned by a previous call.
--
-- 'maxItems', 'listLayers_maxItems' - The maximum number of layers to return.
--
-- 'compatibleArchitecture', 'listLayers_compatibleArchitecture' - The compatible
-- <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html instruction set architecture>.
newListLayers ::
  ListLayers
newListLayers :: ListLayers
newListLayers =
  ListLayers' :: Maybe Runtime
-> Maybe Text -> Maybe Natural -> Maybe Architecture -> ListLayers
ListLayers'
    { $sel:compatibleRuntime:ListLayers' :: Maybe Runtime
compatibleRuntime = Maybe Runtime
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListLayers' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListLayers' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleArchitecture:ListLayers' :: Maybe Architecture
compatibleArchitecture = Maybe Architecture
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

instance Core.AWSPager ListLayers where
  page :: ListLayers -> AWSResponse ListLayers -> Maybe ListLayers
page ListLayers
rq AWSResponse ListLayers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLayers
ListLayersResponse
rs
            ListLayersResponse
-> Getting (First Text) ListLayersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLayersResponse -> Const (First Text) ListLayersResponse
Lens' ListLayersResponse (Maybe Text)
listLayersResponse_nextMarker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLayersResponse -> Const (First Text) ListLayersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLayersResponse 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 ListLayers
forall a. Maybe a
Prelude.Nothing
    | Maybe [LayersListItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListLayers
ListLayersResponse
rs
            ListLayersResponse
-> Getting
     (First [LayersListItem]) ListLayersResponse [LayersListItem]
-> Maybe [LayersListItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [LayersListItem]
 -> Const (First [LayersListItem]) (Maybe [LayersListItem]))
-> ListLayersResponse
-> Const (First [LayersListItem]) ListLayersResponse
Lens' ListLayersResponse (Maybe [LayersListItem])
listLayersResponse_layers ((Maybe [LayersListItem]
  -> Const (First [LayersListItem]) (Maybe [LayersListItem]))
 -> ListLayersResponse
 -> Const (First [LayersListItem]) ListLayersResponse)
-> (([LayersListItem]
     -> Const (First [LayersListItem]) [LayersListItem])
    -> Maybe [LayersListItem]
    -> Const (First [LayersListItem]) (Maybe [LayersListItem]))
-> Getting
     (First [LayersListItem]) ListLayersResponse [LayersListItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([LayersListItem]
 -> Const (First [LayersListItem]) [LayersListItem])
-> Maybe [LayersListItem]
-> Const (First [LayersListItem]) (Maybe [LayersListItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListLayers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListLayers -> Maybe ListLayers
forall a. a -> Maybe a
Prelude.Just (ListLayers -> Maybe ListLayers) -> ListLayers -> Maybe ListLayers
forall a b. (a -> b) -> a -> b
Prelude.$
        ListLayers
rq
          ListLayers -> (ListLayers -> ListLayers) -> ListLayers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListLayers -> Identity ListLayers
Lens ListLayers ListLayers (Maybe Text) (Maybe Text)
listLayers_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListLayers -> Identity ListLayers)
-> Maybe Text -> ListLayers -> ListLayers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListLayers
ListLayersResponse
rs
          ListLayersResponse
-> Getting (First Text) ListLayersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListLayersResponse -> Const (First Text) ListLayersResponse
Lens' ListLayersResponse (Maybe Text)
listLayersResponse_nextMarker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListLayersResponse -> Const (First Text) ListLayersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListLayersResponse 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 ListLayers where
  type AWSResponse ListLayers = ListLayersResponse
  request :: ListLayers -> Request ListLayers
request = Service -> ListLayers -> Request ListLayers
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListLayers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLayers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListLayers))
-> Logger
-> Service
-> Proxy ListLayers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLayers)))
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 [LayersListItem] -> Int -> ListLayersResponse
ListLayersResponse'
            (Maybe Text -> Maybe [LayersListItem] -> Int -> ListLayersResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [LayersListItem] -> Int -> ListLayersResponse)
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
"NextMarker")
            Either String (Maybe [LayersListItem] -> Int -> ListLayersResponse)
-> Either String (Maybe [LayersListItem])
-> Either String (Int -> ListLayersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [LayersListItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Layers" Either String (Maybe (Maybe [LayersListItem]))
-> Maybe [LayersListItem] -> Either String (Maybe [LayersListItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LayersListItem]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListLayersResponse)
-> Either String Int -> Either String ListLayersResponse
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 ListLayers

instance Prelude.NFData ListLayers

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

instance Core.ToPath ListLayers where
  toPath :: ListLayers -> ByteString
toPath = ByteString -> ListLayers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2018-10-31/layers"

instance Core.ToQuery ListLayers where
  toQuery :: ListLayers -> QueryString
toQuery ListLayers' {Maybe Natural
Maybe Text
Maybe Architecture
Maybe Runtime
compatibleArchitecture :: Maybe Architecture
maxItems :: Maybe Natural
marker :: Maybe Text
compatibleRuntime :: Maybe Runtime
$sel:compatibleArchitecture:ListLayers' :: ListLayers -> Maybe Architecture
$sel:maxItems:ListLayers' :: ListLayers -> Maybe Natural
$sel:marker:ListLayers' :: ListLayers -> Maybe Text
$sel:compatibleRuntime:ListLayers' :: ListLayers -> 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:/ 'newListLayersResponse' smart constructor.
data ListLayersResponse = ListLayersResponse'
  { -- | A pagination token returned when the response doesn\'t contain all
    -- layers.
    ListLayersResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | A list of function layers.
    ListLayersResponse -> Maybe [LayersListItem]
layers :: Prelude.Maybe [LayersListItem],
    -- | The response's http status code.
    ListLayersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLayersResponse -> ListLayersResponse -> Bool
(ListLayersResponse -> ListLayersResponse -> Bool)
-> (ListLayersResponse -> ListLayersResponse -> Bool)
-> Eq ListLayersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLayersResponse -> ListLayersResponse -> Bool
$c/= :: ListLayersResponse -> ListLayersResponse -> Bool
== :: ListLayersResponse -> ListLayersResponse -> Bool
$c== :: ListLayersResponse -> ListLayersResponse -> Bool
Prelude.Eq, ReadPrec [ListLayersResponse]
ReadPrec ListLayersResponse
Int -> ReadS ListLayersResponse
ReadS [ListLayersResponse]
(Int -> ReadS ListLayersResponse)
-> ReadS [ListLayersResponse]
-> ReadPrec ListLayersResponse
-> ReadPrec [ListLayersResponse]
-> Read ListLayersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLayersResponse]
$creadListPrec :: ReadPrec [ListLayersResponse]
readPrec :: ReadPrec ListLayersResponse
$creadPrec :: ReadPrec ListLayersResponse
readList :: ReadS [ListLayersResponse]
$creadList :: ReadS [ListLayersResponse]
readsPrec :: Int -> ReadS ListLayersResponse
$creadsPrec :: Int -> ReadS ListLayersResponse
Prelude.Read, Int -> ListLayersResponse -> ShowS
[ListLayersResponse] -> ShowS
ListLayersResponse -> String
(Int -> ListLayersResponse -> ShowS)
-> (ListLayersResponse -> String)
-> ([ListLayersResponse] -> ShowS)
-> Show ListLayersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLayersResponse] -> ShowS
$cshowList :: [ListLayersResponse] -> ShowS
show :: ListLayersResponse -> String
$cshow :: ListLayersResponse -> String
showsPrec :: Int -> ListLayersResponse -> ShowS
$cshowsPrec :: Int -> ListLayersResponse -> ShowS
Prelude.Show, (forall x. ListLayersResponse -> Rep ListLayersResponse x)
-> (forall x. Rep ListLayersResponse x -> ListLayersResponse)
-> Generic ListLayersResponse
forall x. Rep ListLayersResponse x -> ListLayersResponse
forall x. ListLayersResponse -> Rep ListLayersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLayersResponse x -> ListLayersResponse
$cfrom :: forall x. ListLayersResponse -> Rep ListLayersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLayersResponse' 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:
--
-- 'nextMarker', 'listLayersResponse_nextMarker' - A pagination token returned when the response doesn\'t contain all
-- layers.
--
-- 'layers', 'listLayersResponse_layers' - A list of function layers.
--
-- 'httpStatus', 'listLayersResponse_httpStatus' - The response's http status code.
newListLayersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLayersResponse
newListLayersResponse :: Int -> ListLayersResponse
newListLayersResponse Int
pHttpStatus_ =
  ListLayersResponse' :: Maybe Text -> Maybe [LayersListItem] -> Int -> ListLayersResponse
ListLayersResponse'
    { $sel:nextMarker:ListLayersResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:layers:ListLayersResponse' :: Maybe [LayersListItem]
layers = Maybe [LayersListItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLayersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

instance Prelude.NFData ListLayersResponse