{-# 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.ApiGatewayV2.GetDeployments
-- 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)
--
-- Gets the Deployments for an API.
--
-- This operation returns paginated results.
module Amazonka.ApiGatewayV2.GetDeployments
  ( -- * Creating a Request
    GetDeployments (..),
    newGetDeployments,

    -- * Request Lenses
    getDeployments_nextToken,
    getDeployments_maxResults,
    getDeployments_apiId,

    -- * Destructuring the Response
    GetDeploymentsResponse (..),
    newGetDeploymentsResponse,

    -- * Response Lenses
    getDeploymentsResponse_items,
    getDeploymentsResponse_nextToken,
    getDeploymentsResponse_httpStatus,
  )
where

import Amazonka.ApiGatewayV2.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

-- | /See:/ 'newGetDeployments' smart constructor.
data GetDeployments = GetDeployments'
  { -- | The next page of elements from this collection. Not valid for the last
    -- element of the collection.
    GetDeployments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of elements to be returned for this resource.
    GetDeployments -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    GetDeployments -> Text
apiId :: Prelude.Text
  }
  deriving (GetDeployments -> GetDeployments -> Bool
(GetDeployments -> GetDeployments -> Bool)
-> (GetDeployments -> GetDeployments -> Bool) -> Eq GetDeployments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeployments -> GetDeployments -> Bool
$c/= :: GetDeployments -> GetDeployments -> Bool
== :: GetDeployments -> GetDeployments -> Bool
$c== :: GetDeployments -> GetDeployments -> Bool
Prelude.Eq, ReadPrec [GetDeployments]
ReadPrec GetDeployments
Int -> ReadS GetDeployments
ReadS [GetDeployments]
(Int -> ReadS GetDeployments)
-> ReadS [GetDeployments]
-> ReadPrec GetDeployments
-> ReadPrec [GetDeployments]
-> Read GetDeployments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeployments]
$creadListPrec :: ReadPrec [GetDeployments]
readPrec :: ReadPrec GetDeployments
$creadPrec :: ReadPrec GetDeployments
readList :: ReadS [GetDeployments]
$creadList :: ReadS [GetDeployments]
readsPrec :: Int -> ReadS GetDeployments
$creadsPrec :: Int -> ReadS GetDeployments
Prelude.Read, Int -> GetDeployments -> ShowS
[GetDeployments] -> ShowS
GetDeployments -> String
(Int -> GetDeployments -> ShowS)
-> (GetDeployments -> String)
-> ([GetDeployments] -> ShowS)
-> Show GetDeployments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeployments] -> ShowS
$cshowList :: [GetDeployments] -> ShowS
show :: GetDeployments -> String
$cshow :: GetDeployments -> String
showsPrec :: Int -> GetDeployments -> ShowS
$cshowsPrec :: Int -> GetDeployments -> ShowS
Prelude.Show, (forall x. GetDeployments -> Rep GetDeployments x)
-> (forall x. Rep GetDeployments x -> GetDeployments)
-> Generic GetDeployments
forall x. Rep GetDeployments x -> GetDeployments
forall x. GetDeployments -> Rep GetDeployments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeployments x -> GetDeployments
$cfrom :: forall x. GetDeployments -> Rep GetDeployments x
Prelude.Generic)

-- |
-- Create a value of 'GetDeployments' 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', 'getDeployments_nextToken' - The next page of elements from this collection. Not valid for the last
-- element of the collection.
--
-- 'maxResults', 'getDeployments_maxResults' - The maximum number of elements to be returned for this resource.
--
-- 'apiId', 'getDeployments_apiId' - The API identifier.
newGetDeployments ::
  -- | 'apiId'
  Prelude.Text ->
  GetDeployments
newGetDeployments :: Text -> GetDeployments
newGetDeployments Text
pApiId_ =
  GetDeployments' :: Maybe Text -> Maybe Text -> Text -> GetDeployments
GetDeployments'
    { $sel:nextToken:GetDeployments' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetDeployments' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:GetDeployments' :: Text
apiId = Text
pApiId_
    }

-- | The next page of elements from this collection. Not valid for the last
-- element of the collection.
getDeployments_nextToken :: Lens.Lens' GetDeployments (Prelude.Maybe Prelude.Text)
getDeployments_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetDeployments -> f GetDeployments
getDeployments_nextToken = (GetDeployments -> Maybe Text)
-> (GetDeployments -> Maybe Text -> GetDeployments)
-> Lens GetDeployments GetDeployments (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployments' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetDeployments' :: GetDeployments -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetDeployments
s@GetDeployments' {} Maybe Text
a -> GetDeployments
s {$sel:nextToken:GetDeployments' :: Maybe Text
nextToken = Maybe Text
a} :: GetDeployments)

-- | The maximum number of elements to be returned for this resource.
getDeployments_maxResults :: Lens.Lens' GetDeployments (Prelude.Maybe Prelude.Text)
getDeployments_maxResults :: (Maybe Text -> f (Maybe Text))
-> GetDeployments -> f GetDeployments
getDeployments_maxResults = (GetDeployments -> Maybe Text)
-> (GetDeployments -> Maybe Text -> GetDeployments)
-> Lens GetDeployments GetDeployments (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployments' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:GetDeployments' :: GetDeployments -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: GetDeployments
s@GetDeployments' {} Maybe Text
a -> GetDeployments
s {$sel:maxResults:GetDeployments' :: Maybe Text
maxResults = Maybe Text
a} :: GetDeployments)

-- | The API identifier.
getDeployments_apiId :: Lens.Lens' GetDeployments Prelude.Text
getDeployments_apiId :: (Text -> f Text) -> GetDeployments -> f GetDeployments
getDeployments_apiId = (GetDeployments -> Text)
-> (GetDeployments -> Text -> GetDeployments)
-> Lens GetDeployments GetDeployments Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployments' {Text
apiId :: Text
$sel:apiId:GetDeployments' :: GetDeployments -> Text
apiId} -> Text
apiId) (\s :: GetDeployments
s@GetDeployments' {} Text
a -> GetDeployments
s {$sel:apiId:GetDeployments' :: Text
apiId = Text
a} :: GetDeployments)

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

instance Prelude.NFData GetDeployments

instance Core.ToHeaders GetDeployments where
  toHeaders :: GetDeployments -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDeployments -> 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 GetDeployments where
  toPath :: GetDeployments -> ByteString
toPath GetDeployments' {Maybe Text
Text
apiId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:apiId:GetDeployments' :: GetDeployments -> Text
$sel:maxResults:GetDeployments' :: GetDeployments -> Maybe Text
$sel:nextToken:GetDeployments' :: GetDeployments -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/deployments"]

instance Core.ToQuery GetDeployments where
  toQuery :: GetDeployments -> QueryString
toQuery GetDeployments' {Maybe Text
Text
apiId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:apiId:GetDeployments' :: GetDeployments -> Text
$sel:maxResults:GetDeployments' :: GetDeployments -> Maybe Text
$sel:nextToken:GetDeployments' :: GetDeployments -> 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
"maxResults" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newGetDeploymentsResponse' smart constructor.
data GetDeploymentsResponse = GetDeploymentsResponse'
  { -- | The elements from this collection.
    GetDeploymentsResponse -> Maybe [Deployment]
items :: Prelude.Maybe [Deployment],
    -- | The next page of elements from this collection. Not valid for the last
    -- element of the collection.
    GetDeploymentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetDeploymentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDeploymentsResponse -> GetDeploymentsResponse -> Bool
(GetDeploymentsResponse -> GetDeploymentsResponse -> Bool)
-> (GetDeploymentsResponse -> GetDeploymentsResponse -> Bool)
-> Eq GetDeploymentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeploymentsResponse -> GetDeploymentsResponse -> Bool
$c/= :: GetDeploymentsResponse -> GetDeploymentsResponse -> Bool
== :: GetDeploymentsResponse -> GetDeploymentsResponse -> Bool
$c== :: GetDeploymentsResponse -> GetDeploymentsResponse -> Bool
Prelude.Eq, ReadPrec [GetDeploymentsResponse]
ReadPrec GetDeploymentsResponse
Int -> ReadS GetDeploymentsResponse
ReadS [GetDeploymentsResponse]
(Int -> ReadS GetDeploymentsResponse)
-> ReadS [GetDeploymentsResponse]
-> ReadPrec GetDeploymentsResponse
-> ReadPrec [GetDeploymentsResponse]
-> Read GetDeploymentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeploymentsResponse]
$creadListPrec :: ReadPrec [GetDeploymentsResponse]
readPrec :: ReadPrec GetDeploymentsResponse
$creadPrec :: ReadPrec GetDeploymentsResponse
readList :: ReadS [GetDeploymentsResponse]
$creadList :: ReadS [GetDeploymentsResponse]
readsPrec :: Int -> ReadS GetDeploymentsResponse
$creadsPrec :: Int -> ReadS GetDeploymentsResponse
Prelude.Read, Int -> GetDeploymentsResponse -> ShowS
[GetDeploymentsResponse] -> ShowS
GetDeploymentsResponse -> String
(Int -> GetDeploymentsResponse -> ShowS)
-> (GetDeploymentsResponse -> String)
-> ([GetDeploymentsResponse] -> ShowS)
-> Show GetDeploymentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeploymentsResponse] -> ShowS
$cshowList :: [GetDeploymentsResponse] -> ShowS
show :: GetDeploymentsResponse -> String
$cshow :: GetDeploymentsResponse -> String
showsPrec :: Int -> GetDeploymentsResponse -> ShowS
$cshowsPrec :: Int -> GetDeploymentsResponse -> ShowS
Prelude.Show, (forall x. GetDeploymentsResponse -> Rep GetDeploymentsResponse x)
-> (forall x.
    Rep GetDeploymentsResponse x -> GetDeploymentsResponse)
-> Generic GetDeploymentsResponse
forall x. Rep GetDeploymentsResponse x -> GetDeploymentsResponse
forall x. GetDeploymentsResponse -> Rep GetDeploymentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeploymentsResponse x -> GetDeploymentsResponse
$cfrom :: forall x. GetDeploymentsResponse -> Rep GetDeploymentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDeploymentsResponse' 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:
--
-- 'items', 'getDeploymentsResponse_items' - The elements from this collection.
--
-- 'nextToken', 'getDeploymentsResponse_nextToken' - The next page of elements from this collection. Not valid for the last
-- element of the collection.
--
-- 'httpStatus', 'getDeploymentsResponse_httpStatus' - The response's http status code.
newGetDeploymentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDeploymentsResponse
newGetDeploymentsResponse :: Int -> GetDeploymentsResponse
newGetDeploymentsResponse Int
pHttpStatus_ =
  GetDeploymentsResponse' :: Maybe [Deployment] -> Maybe Text -> Int -> GetDeploymentsResponse
GetDeploymentsResponse'
    { $sel:items:GetDeploymentsResponse' :: Maybe [Deployment]
items = Maybe [Deployment]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetDeploymentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDeploymentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The elements from this collection.
getDeploymentsResponse_items :: Lens.Lens' GetDeploymentsResponse (Prelude.Maybe [Deployment])
getDeploymentsResponse_items :: (Maybe [Deployment] -> f (Maybe [Deployment]))
-> GetDeploymentsResponse -> f GetDeploymentsResponse
getDeploymentsResponse_items = (GetDeploymentsResponse -> Maybe [Deployment])
-> (GetDeploymentsResponse
    -> Maybe [Deployment] -> GetDeploymentsResponse)
-> Lens' GetDeploymentsResponse (Maybe [Deployment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentsResponse' {Maybe [Deployment]
items :: Maybe [Deployment]
$sel:items:GetDeploymentsResponse' :: GetDeploymentsResponse -> Maybe [Deployment]
items} -> Maybe [Deployment]
items) (\s :: GetDeploymentsResponse
s@GetDeploymentsResponse' {} Maybe [Deployment]
a -> GetDeploymentsResponse
s {$sel:items:GetDeploymentsResponse' :: Maybe [Deployment]
items = Maybe [Deployment]
a} :: GetDeploymentsResponse) ((Maybe [Deployment] -> f (Maybe [Deployment]))
 -> GetDeploymentsResponse -> f GetDeploymentsResponse)
-> ((Maybe [Deployment] -> f (Maybe [Deployment]))
    -> Maybe [Deployment] -> f (Maybe [Deployment]))
-> (Maybe [Deployment] -> f (Maybe [Deployment]))
-> GetDeploymentsResponse
-> f GetDeploymentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Deployment] [Deployment] [Deployment] [Deployment]
-> Iso
     (Maybe [Deployment])
     (Maybe [Deployment])
     (Maybe [Deployment])
     (Maybe [Deployment])
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 [Deployment] [Deployment] [Deployment] [Deployment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The next page of elements from this collection. Not valid for the last
-- element of the collection.
getDeploymentsResponse_nextToken :: Lens.Lens' GetDeploymentsResponse (Prelude.Maybe Prelude.Text)
getDeploymentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetDeploymentsResponse -> f GetDeploymentsResponse
getDeploymentsResponse_nextToken = (GetDeploymentsResponse -> Maybe Text)
-> (GetDeploymentsResponse -> Maybe Text -> GetDeploymentsResponse)
-> Lens' GetDeploymentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetDeploymentsResponse' :: GetDeploymentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetDeploymentsResponse
s@GetDeploymentsResponse' {} Maybe Text
a -> GetDeploymentsResponse
s {$sel:nextToken:GetDeploymentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetDeploymentsResponse)

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

instance Prelude.NFData GetDeploymentsResponse