{-# 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.Amplify.ListBackendEnvironments
-- 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 backend environments for an Amplify app.
module Amazonka.Amplify.ListBackendEnvironments
  ( -- * Creating a Request
    ListBackendEnvironments (..),
    newListBackendEnvironments,

    -- * Request Lenses
    listBackendEnvironments_nextToken,
    listBackendEnvironments_environmentName,
    listBackendEnvironments_maxResults,
    listBackendEnvironments_appId,

    -- * Destructuring the Response
    ListBackendEnvironmentsResponse (..),
    newListBackendEnvironmentsResponse,

    -- * Response Lenses
    listBackendEnvironmentsResponse_nextToken,
    listBackendEnvironmentsResponse_httpStatus,
    listBackendEnvironmentsResponse_backendEnvironments,
  )
where

import Amazonka.Amplify.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The request structure for the list backend environments request.
--
-- /See:/ 'newListBackendEnvironments' smart constructor.
data ListBackendEnvironments = ListBackendEnvironments'
  { -- | A pagination token. Set to null to start listing backend environments
    -- from the start. If a non-null pagination token is returned in a result,
    -- pass its value in here to list more backend environments.
    ListBackendEnvironments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the backend environment
    ListBackendEnvironments -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to list in a single response.
    ListBackendEnvironments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique ID for an Amplify app.
    ListBackendEnvironments -> Text
appId :: Prelude.Text
  }
  deriving (ListBackendEnvironments -> ListBackendEnvironments -> Bool
(ListBackendEnvironments -> ListBackendEnvironments -> Bool)
-> (ListBackendEnvironments -> ListBackendEnvironments -> Bool)
-> Eq ListBackendEnvironments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBackendEnvironments -> ListBackendEnvironments -> Bool
$c/= :: ListBackendEnvironments -> ListBackendEnvironments -> Bool
== :: ListBackendEnvironments -> ListBackendEnvironments -> Bool
$c== :: ListBackendEnvironments -> ListBackendEnvironments -> Bool
Prelude.Eq, ReadPrec [ListBackendEnvironments]
ReadPrec ListBackendEnvironments
Int -> ReadS ListBackendEnvironments
ReadS [ListBackendEnvironments]
(Int -> ReadS ListBackendEnvironments)
-> ReadS [ListBackendEnvironments]
-> ReadPrec ListBackendEnvironments
-> ReadPrec [ListBackendEnvironments]
-> Read ListBackendEnvironments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBackendEnvironments]
$creadListPrec :: ReadPrec [ListBackendEnvironments]
readPrec :: ReadPrec ListBackendEnvironments
$creadPrec :: ReadPrec ListBackendEnvironments
readList :: ReadS [ListBackendEnvironments]
$creadList :: ReadS [ListBackendEnvironments]
readsPrec :: Int -> ReadS ListBackendEnvironments
$creadsPrec :: Int -> ReadS ListBackendEnvironments
Prelude.Read, Int -> ListBackendEnvironments -> ShowS
[ListBackendEnvironments] -> ShowS
ListBackendEnvironments -> String
(Int -> ListBackendEnvironments -> ShowS)
-> (ListBackendEnvironments -> String)
-> ([ListBackendEnvironments] -> ShowS)
-> Show ListBackendEnvironments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBackendEnvironments] -> ShowS
$cshowList :: [ListBackendEnvironments] -> ShowS
show :: ListBackendEnvironments -> String
$cshow :: ListBackendEnvironments -> String
showsPrec :: Int -> ListBackendEnvironments -> ShowS
$cshowsPrec :: Int -> ListBackendEnvironments -> ShowS
Prelude.Show, (forall x.
 ListBackendEnvironments -> Rep ListBackendEnvironments x)
-> (forall x.
    Rep ListBackendEnvironments x -> ListBackendEnvironments)
-> Generic ListBackendEnvironments
forall x. Rep ListBackendEnvironments x -> ListBackendEnvironments
forall x. ListBackendEnvironments -> Rep ListBackendEnvironments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBackendEnvironments x -> ListBackendEnvironments
$cfrom :: forall x. ListBackendEnvironments -> Rep ListBackendEnvironments x
Prelude.Generic)

-- |
-- Create a value of 'ListBackendEnvironments' 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:
--
-- 'nextToken', 'listBackendEnvironments_nextToken' - A pagination token. Set to null to start listing backend environments
-- from the start. If a non-null pagination token is returned in a result,
-- pass its value in here to list more backend environments.
--
-- 'environmentName', 'listBackendEnvironments_environmentName' - The name of the backend environment
--
-- 'maxResults', 'listBackendEnvironments_maxResults' - The maximum number of records to list in a single response.
--
-- 'appId', 'listBackendEnvironments_appId' - The unique ID for an Amplify app.
newListBackendEnvironments ::
  -- | 'appId'
  Prelude.Text ->
  ListBackendEnvironments
newListBackendEnvironments :: Text -> ListBackendEnvironments
newListBackendEnvironments Text
pAppId_ =
  ListBackendEnvironments' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> ListBackendEnvironments
ListBackendEnvironments'
    { $sel:nextToken:ListBackendEnvironments' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentName:ListBackendEnvironments' :: Maybe Text
environmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListBackendEnvironments' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:ListBackendEnvironments' :: Text
appId = Text
pAppId_
    }

-- | A pagination token. Set to null to start listing backend environments
-- from the start. If a non-null pagination token is returned in a result,
-- pass its value in here to list more backend environments.
listBackendEnvironments_nextToken :: Lens.Lens' ListBackendEnvironments (Prelude.Maybe Prelude.Text)
listBackendEnvironments_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBackendEnvironments -> f ListBackendEnvironments
listBackendEnvironments_nextToken = (ListBackendEnvironments -> Maybe Text)
-> (ListBackendEnvironments
    -> Maybe Text -> ListBackendEnvironments)
-> Lens
     ListBackendEnvironments
     ListBackendEnvironments
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackendEnvironments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBackendEnvironments
s@ListBackendEnvironments' {} Maybe Text
a -> ListBackendEnvironments
s {$sel:nextToken:ListBackendEnvironments' :: Maybe Text
nextToken = Maybe Text
a} :: ListBackendEnvironments)

-- | The name of the backend environment
listBackendEnvironments_environmentName :: Lens.Lens' ListBackendEnvironments (Prelude.Maybe Prelude.Text)
listBackendEnvironments_environmentName :: (Maybe Text -> f (Maybe Text))
-> ListBackendEnvironments -> f ListBackendEnvironments
listBackendEnvironments_environmentName = (ListBackendEnvironments -> Maybe Text)
-> (ListBackendEnvironments
    -> Maybe Text -> ListBackendEnvironments)
-> Lens
     ListBackendEnvironments
     ListBackendEnvironments
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackendEnvironments' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: ListBackendEnvironments
s@ListBackendEnvironments' {} Maybe Text
a -> ListBackendEnvironments
s {$sel:environmentName:ListBackendEnvironments' :: Maybe Text
environmentName = Maybe Text
a} :: ListBackendEnvironments)

-- | The maximum number of records to list in a single response.
listBackendEnvironments_maxResults :: Lens.Lens' ListBackendEnvironments (Prelude.Maybe Prelude.Natural)
listBackendEnvironments_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListBackendEnvironments -> f ListBackendEnvironments
listBackendEnvironments_maxResults = (ListBackendEnvironments -> Maybe Natural)
-> (ListBackendEnvironments
    -> Maybe Natural -> ListBackendEnvironments)
-> Lens
     ListBackendEnvironments
     ListBackendEnvironments
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackendEnvironments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListBackendEnvironments
s@ListBackendEnvironments' {} Maybe Natural
a -> ListBackendEnvironments
s {$sel:maxResults:ListBackendEnvironments' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListBackendEnvironments)

-- | The unique ID for an Amplify app.
listBackendEnvironments_appId :: Lens.Lens' ListBackendEnvironments Prelude.Text
listBackendEnvironments_appId :: (Text -> f Text)
-> ListBackendEnvironments -> f ListBackendEnvironments
listBackendEnvironments_appId = (ListBackendEnvironments -> Text)
-> (ListBackendEnvironments -> Text -> ListBackendEnvironments)
-> Lens ListBackendEnvironments ListBackendEnvironments Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackendEnvironments' {Text
appId :: Text
$sel:appId:ListBackendEnvironments' :: ListBackendEnvironments -> Text
appId} -> Text
appId) (\s :: ListBackendEnvironments
s@ListBackendEnvironments' {} Text
a -> ListBackendEnvironments
s {$sel:appId:ListBackendEnvironments' :: Text
appId = Text
a} :: ListBackendEnvironments)

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

instance Prelude.Hashable ListBackendEnvironments

instance Prelude.NFData ListBackendEnvironments

instance Core.ToHeaders ListBackendEnvironments where
  toHeaders :: ListBackendEnvironments -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListBackendEnvironments -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListBackendEnvironments where
  toPath :: ListBackendEnvironments -> ByteString
toPath ListBackendEnvironments' {Maybe Natural
Maybe Text
Text
appId :: Text
maxResults :: Maybe Natural
environmentName :: Maybe Text
nextToken :: Maybe Text
$sel:appId:ListBackendEnvironments' :: ListBackendEnvironments -> Text
$sel:maxResults:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Natural
$sel:environmentName:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Text
$sel:nextToken:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/apps/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId, ByteString
"/backendenvironments"]

instance Core.ToQuery ListBackendEnvironments where
  toQuery :: ListBackendEnvironments -> QueryString
toQuery ListBackendEnvironments' {Maybe Natural
Maybe Text
Text
appId :: Text
maxResults :: Maybe Natural
environmentName :: Maybe Text
nextToken :: Maybe Text
$sel:appId:ListBackendEnvironments' :: ListBackendEnvironments -> Text
$sel:maxResults:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Natural
$sel:environmentName:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Text
$sel:nextToken:ListBackendEnvironments' :: ListBackendEnvironments -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"environmentName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentName,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | The result structure for the list backend environments result.
--
-- /See:/ 'newListBackendEnvironmentsResponse' smart constructor.
data ListBackendEnvironmentsResponse = ListBackendEnvironmentsResponse'
  { -- | A pagination token. If a non-null pagination token is returned in a
    -- result, pass its value in another request to retrieve more entries.
    ListBackendEnvironmentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListBackendEnvironmentsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of backend environments for an Amplify app.
    ListBackendEnvironmentsResponse -> [BackendEnvironment]
backendEnvironments :: [BackendEnvironment]
  }
  deriving (ListBackendEnvironmentsResponse
-> ListBackendEnvironmentsResponse -> Bool
(ListBackendEnvironmentsResponse
 -> ListBackendEnvironmentsResponse -> Bool)
-> (ListBackendEnvironmentsResponse
    -> ListBackendEnvironmentsResponse -> Bool)
-> Eq ListBackendEnvironmentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBackendEnvironmentsResponse
-> ListBackendEnvironmentsResponse -> Bool
$c/= :: ListBackendEnvironmentsResponse
-> ListBackendEnvironmentsResponse -> Bool
== :: ListBackendEnvironmentsResponse
-> ListBackendEnvironmentsResponse -> Bool
$c== :: ListBackendEnvironmentsResponse
-> ListBackendEnvironmentsResponse -> Bool
Prelude.Eq, ReadPrec [ListBackendEnvironmentsResponse]
ReadPrec ListBackendEnvironmentsResponse
Int -> ReadS ListBackendEnvironmentsResponse
ReadS [ListBackendEnvironmentsResponse]
(Int -> ReadS ListBackendEnvironmentsResponse)
-> ReadS [ListBackendEnvironmentsResponse]
-> ReadPrec ListBackendEnvironmentsResponse
-> ReadPrec [ListBackendEnvironmentsResponse]
-> Read ListBackendEnvironmentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBackendEnvironmentsResponse]
$creadListPrec :: ReadPrec [ListBackendEnvironmentsResponse]
readPrec :: ReadPrec ListBackendEnvironmentsResponse
$creadPrec :: ReadPrec ListBackendEnvironmentsResponse
readList :: ReadS [ListBackendEnvironmentsResponse]
$creadList :: ReadS [ListBackendEnvironmentsResponse]
readsPrec :: Int -> ReadS ListBackendEnvironmentsResponse
$creadsPrec :: Int -> ReadS ListBackendEnvironmentsResponse
Prelude.Read, Int -> ListBackendEnvironmentsResponse -> ShowS
[ListBackendEnvironmentsResponse] -> ShowS
ListBackendEnvironmentsResponse -> String
(Int -> ListBackendEnvironmentsResponse -> ShowS)
-> (ListBackendEnvironmentsResponse -> String)
-> ([ListBackendEnvironmentsResponse] -> ShowS)
-> Show ListBackendEnvironmentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBackendEnvironmentsResponse] -> ShowS
$cshowList :: [ListBackendEnvironmentsResponse] -> ShowS
show :: ListBackendEnvironmentsResponse -> String
$cshow :: ListBackendEnvironmentsResponse -> String
showsPrec :: Int -> ListBackendEnvironmentsResponse -> ShowS
$cshowsPrec :: Int -> ListBackendEnvironmentsResponse -> ShowS
Prelude.Show, (forall x.
 ListBackendEnvironmentsResponse
 -> Rep ListBackendEnvironmentsResponse x)
-> (forall x.
    Rep ListBackendEnvironmentsResponse x
    -> ListBackendEnvironmentsResponse)
-> Generic ListBackendEnvironmentsResponse
forall x.
Rep ListBackendEnvironmentsResponse x
-> ListBackendEnvironmentsResponse
forall x.
ListBackendEnvironmentsResponse
-> Rep ListBackendEnvironmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBackendEnvironmentsResponse x
-> ListBackendEnvironmentsResponse
$cfrom :: forall x.
ListBackendEnvironmentsResponse
-> Rep ListBackendEnvironmentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBackendEnvironmentsResponse' 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:
--
-- 'nextToken', 'listBackendEnvironmentsResponse_nextToken' - A pagination token. If a non-null pagination token is returned in a
-- result, pass its value in another request to retrieve more entries.
--
-- 'httpStatus', 'listBackendEnvironmentsResponse_httpStatus' - The response's http status code.
--
-- 'backendEnvironments', 'listBackendEnvironmentsResponse_backendEnvironments' - The list of backend environments for an Amplify app.
newListBackendEnvironmentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBackendEnvironmentsResponse
newListBackendEnvironmentsResponse :: Int -> ListBackendEnvironmentsResponse
newListBackendEnvironmentsResponse Int
pHttpStatus_ =
  ListBackendEnvironmentsResponse' :: Maybe Text
-> Int -> [BackendEnvironment] -> ListBackendEnvironmentsResponse
ListBackendEnvironmentsResponse'
    { $sel:nextToken:ListBackendEnvironmentsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBackendEnvironmentsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:backendEnvironments:ListBackendEnvironmentsResponse' :: [BackendEnvironment]
backendEnvironments = [BackendEnvironment]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token. If a non-null pagination token is returned in a
-- result, pass its value in another request to retrieve more entries.
listBackendEnvironmentsResponse_nextToken :: Lens.Lens' ListBackendEnvironmentsResponse (Prelude.Maybe Prelude.Text)
listBackendEnvironmentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBackendEnvironmentsResponse
-> f ListBackendEnvironmentsResponse
listBackendEnvironmentsResponse_nextToken = (ListBackendEnvironmentsResponse -> Maybe Text)
-> (ListBackendEnvironmentsResponse
    -> Maybe Text -> ListBackendEnvironmentsResponse)
-> Lens
     ListBackendEnvironmentsResponse
     ListBackendEnvironmentsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackendEnvironmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBackendEnvironmentsResponse' :: ListBackendEnvironmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBackendEnvironmentsResponse
s@ListBackendEnvironmentsResponse' {} Maybe Text
a -> ListBackendEnvironmentsResponse
s {$sel:nextToken:ListBackendEnvironmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBackendEnvironmentsResponse)

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

-- | The list of backend environments for an Amplify app.
listBackendEnvironmentsResponse_backendEnvironments :: Lens.Lens' ListBackendEnvironmentsResponse [BackendEnvironment]
listBackendEnvironmentsResponse_backendEnvironments :: ([BackendEnvironment] -> f [BackendEnvironment])
-> ListBackendEnvironmentsResponse
-> f ListBackendEnvironmentsResponse
listBackendEnvironmentsResponse_backendEnvironments = (ListBackendEnvironmentsResponse -> [BackendEnvironment])
-> (ListBackendEnvironmentsResponse
    -> [BackendEnvironment] -> ListBackendEnvironmentsResponse)
-> Lens
     ListBackendEnvironmentsResponse
     ListBackendEnvironmentsResponse
     [BackendEnvironment]
     [BackendEnvironment]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackendEnvironmentsResponse' {[BackendEnvironment]
backendEnvironments :: [BackendEnvironment]
$sel:backendEnvironments:ListBackendEnvironmentsResponse' :: ListBackendEnvironmentsResponse -> [BackendEnvironment]
backendEnvironments} -> [BackendEnvironment]
backendEnvironments) (\s :: ListBackendEnvironmentsResponse
s@ListBackendEnvironmentsResponse' {} [BackendEnvironment]
a -> ListBackendEnvironmentsResponse
s {$sel:backendEnvironments:ListBackendEnvironmentsResponse' :: [BackendEnvironment]
backendEnvironments = [BackendEnvironment]
a} :: ListBackendEnvironmentsResponse) (([BackendEnvironment] -> f [BackendEnvironment])
 -> ListBackendEnvironmentsResponse
 -> f ListBackendEnvironmentsResponse)
-> (([BackendEnvironment] -> f [BackendEnvironment])
    -> [BackendEnvironment] -> f [BackendEnvironment])
-> ([BackendEnvironment] -> f [BackendEnvironment])
-> ListBackendEnvironmentsResponse
-> f ListBackendEnvironmentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BackendEnvironment] -> f [BackendEnvironment])
-> [BackendEnvironment] -> f [BackendEnvironment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListBackendEnvironmentsResponse