{-# 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.CodeDeploy.ListDeploymentGroups
-- 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 deployment groups for an application registered with the IAM
-- user or AWS account.
--
-- This operation returns paginated results.
module Amazonka.CodeDeploy.ListDeploymentGroups
  ( -- * Creating a Request
    ListDeploymentGroups (..),
    newListDeploymentGroups,

    -- * Request Lenses
    listDeploymentGroups_nextToken,
    listDeploymentGroups_applicationName,

    -- * Destructuring the Response
    ListDeploymentGroupsResponse (..),
    newListDeploymentGroupsResponse,

    -- * Response Lenses
    listDeploymentGroupsResponse_nextToken,
    listDeploymentGroupsResponse_applicationName,
    listDeploymentGroupsResponse_deploymentGroups,
    listDeploymentGroupsResponse_httpStatus,
  )
where

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

-- | Represents the input of a @ListDeploymentGroups@ operation.
--
-- /See:/ 'newListDeploymentGroups' smart constructor.
data ListDeploymentGroups = ListDeploymentGroups'
  { -- | An identifier returned from the previous list deployment groups call. It
    -- can be used to return the next set of deployment groups in the list.
    ListDeploymentGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of an AWS CodeDeploy application associated with the IAM user
    -- or AWS account.
    ListDeploymentGroups -> Text
applicationName :: Prelude.Text
  }
  deriving (ListDeploymentGroups -> ListDeploymentGroups -> Bool
(ListDeploymentGroups -> ListDeploymentGroups -> Bool)
-> (ListDeploymentGroups -> ListDeploymentGroups -> Bool)
-> Eq ListDeploymentGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentGroups -> ListDeploymentGroups -> Bool
$c/= :: ListDeploymentGroups -> ListDeploymentGroups -> Bool
== :: ListDeploymentGroups -> ListDeploymentGroups -> Bool
$c== :: ListDeploymentGroups -> ListDeploymentGroups -> Bool
Prelude.Eq, ReadPrec [ListDeploymentGroups]
ReadPrec ListDeploymentGroups
Int -> ReadS ListDeploymentGroups
ReadS [ListDeploymentGroups]
(Int -> ReadS ListDeploymentGroups)
-> ReadS [ListDeploymentGroups]
-> ReadPrec ListDeploymentGroups
-> ReadPrec [ListDeploymentGroups]
-> Read ListDeploymentGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentGroups]
$creadListPrec :: ReadPrec [ListDeploymentGroups]
readPrec :: ReadPrec ListDeploymentGroups
$creadPrec :: ReadPrec ListDeploymentGroups
readList :: ReadS [ListDeploymentGroups]
$creadList :: ReadS [ListDeploymentGroups]
readsPrec :: Int -> ReadS ListDeploymentGroups
$creadsPrec :: Int -> ReadS ListDeploymentGroups
Prelude.Read, Int -> ListDeploymentGroups -> ShowS
[ListDeploymentGroups] -> ShowS
ListDeploymentGroups -> String
(Int -> ListDeploymentGroups -> ShowS)
-> (ListDeploymentGroups -> String)
-> ([ListDeploymentGroups] -> ShowS)
-> Show ListDeploymentGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentGroups] -> ShowS
$cshowList :: [ListDeploymentGroups] -> ShowS
show :: ListDeploymentGroups -> String
$cshow :: ListDeploymentGroups -> String
showsPrec :: Int -> ListDeploymentGroups -> ShowS
$cshowsPrec :: Int -> ListDeploymentGroups -> ShowS
Prelude.Show, (forall x. ListDeploymentGroups -> Rep ListDeploymentGroups x)
-> (forall x. Rep ListDeploymentGroups x -> ListDeploymentGroups)
-> Generic ListDeploymentGroups
forall x. Rep ListDeploymentGroups x -> ListDeploymentGroups
forall x. ListDeploymentGroups -> Rep ListDeploymentGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeploymentGroups x -> ListDeploymentGroups
$cfrom :: forall x. ListDeploymentGroups -> Rep ListDeploymentGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListDeploymentGroups' 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', 'listDeploymentGroups_nextToken' - An identifier returned from the previous list deployment groups call. It
-- can be used to return the next set of deployment groups in the list.
--
-- 'applicationName', 'listDeploymentGroups_applicationName' - The name of an AWS CodeDeploy application associated with the IAM user
-- or AWS account.
newListDeploymentGroups ::
  -- | 'applicationName'
  Prelude.Text ->
  ListDeploymentGroups
newListDeploymentGroups :: Text -> ListDeploymentGroups
newListDeploymentGroups Text
pApplicationName_ =
  ListDeploymentGroups' :: Maybe Text -> Text -> ListDeploymentGroups
ListDeploymentGroups'
    { $sel:nextToken:ListDeploymentGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationName:ListDeploymentGroups' :: Text
applicationName = Text
pApplicationName_
    }

-- | An identifier returned from the previous list deployment groups call. It
-- can be used to return the next set of deployment groups in the list.
listDeploymentGroups_nextToken :: Lens.Lens' ListDeploymentGroups (Prelude.Maybe Prelude.Text)
listDeploymentGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentGroups -> f ListDeploymentGroups
listDeploymentGroups_nextToken = (ListDeploymentGroups -> Maybe Text)
-> (ListDeploymentGroups -> Maybe Text -> ListDeploymentGroups)
-> Lens
     ListDeploymentGroups ListDeploymentGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentGroups' :: ListDeploymentGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentGroups
s@ListDeploymentGroups' {} Maybe Text
a -> ListDeploymentGroups
s {$sel:nextToken:ListDeploymentGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentGroups)

-- | The name of an AWS CodeDeploy application associated with the IAM user
-- or AWS account.
listDeploymentGroups_applicationName :: Lens.Lens' ListDeploymentGroups Prelude.Text
listDeploymentGroups_applicationName :: (Text -> f Text) -> ListDeploymentGroups -> f ListDeploymentGroups
listDeploymentGroups_applicationName = (ListDeploymentGroups -> Text)
-> (ListDeploymentGroups -> Text -> ListDeploymentGroups)
-> Lens ListDeploymentGroups ListDeploymentGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentGroups' {Text
applicationName :: Text
$sel:applicationName:ListDeploymentGroups' :: ListDeploymentGroups -> Text
applicationName} -> Text
applicationName) (\s :: ListDeploymentGroups
s@ListDeploymentGroups' {} Text
a -> ListDeploymentGroups
s {$sel:applicationName:ListDeploymentGroups' :: Text
applicationName = Text
a} :: ListDeploymentGroups)

instance Core.AWSPager ListDeploymentGroups where
  page :: ListDeploymentGroups
-> AWSResponse ListDeploymentGroups -> Maybe ListDeploymentGroups
page ListDeploymentGroups
rq AWSResponse ListDeploymentGroups
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDeploymentGroups
ListDeploymentGroupsResponse
rs
            ListDeploymentGroupsResponse
-> Getting (First Text) ListDeploymentGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDeploymentGroupsResponse
-> Const (First Text) ListDeploymentGroupsResponse
Lens' ListDeploymentGroupsResponse (Maybe Text)
listDeploymentGroupsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDeploymentGroupsResponse
 -> Const (First Text) ListDeploymentGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDeploymentGroupsResponse 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 ListDeploymentGroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDeploymentGroups
ListDeploymentGroupsResponse
rs
            ListDeploymentGroupsResponse
-> Getting (First [Text]) ListDeploymentGroupsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListDeploymentGroupsResponse
-> Const (First [Text]) ListDeploymentGroupsResponse
Lens' ListDeploymentGroupsResponse (Maybe [Text])
listDeploymentGroupsResponse_deploymentGroups
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListDeploymentGroupsResponse
 -> Const (First [Text]) ListDeploymentGroupsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListDeploymentGroupsResponse [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 ListDeploymentGroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDeploymentGroups -> Maybe ListDeploymentGroups
forall a. a -> Maybe a
Prelude.Just (ListDeploymentGroups -> Maybe ListDeploymentGroups)
-> ListDeploymentGroups -> Maybe ListDeploymentGroups
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDeploymentGroups
rq
          ListDeploymentGroups
-> (ListDeploymentGroups -> ListDeploymentGroups)
-> ListDeploymentGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDeploymentGroups -> Identity ListDeploymentGroups
Lens
  ListDeploymentGroups ListDeploymentGroups (Maybe Text) (Maybe Text)
listDeploymentGroups_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDeploymentGroups -> Identity ListDeploymentGroups)
-> Maybe Text -> ListDeploymentGroups -> ListDeploymentGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDeploymentGroups
ListDeploymentGroupsResponse
rs
          ListDeploymentGroupsResponse
-> Getting (First Text) ListDeploymentGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDeploymentGroupsResponse
-> Const (First Text) ListDeploymentGroupsResponse
Lens' ListDeploymentGroupsResponse (Maybe Text)
listDeploymentGroupsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDeploymentGroupsResponse
 -> Const (First Text) ListDeploymentGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDeploymentGroupsResponse 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 ListDeploymentGroups where
  type
    AWSResponse ListDeploymentGroups =
      ListDeploymentGroupsResponse
  request :: ListDeploymentGroups -> Request ListDeploymentGroups
request = Service -> ListDeploymentGroups -> Request ListDeploymentGroups
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDeploymentGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDeploymentGroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDeploymentGroups))
-> Logger
-> Service
-> Proxy ListDeploymentGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDeploymentGroups)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Int
-> ListDeploymentGroupsResponse
ListDeploymentGroupsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Int
 -> ListDeploymentGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe [Text] -> Int -> ListDeploymentGroupsResponse)
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
  (Maybe Text -> Maybe [Text] -> Int -> ListDeploymentGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Int -> ListDeploymentGroupsResponse)
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
"applicationName")
            Either String (Maybe [Text] -> Int -> ListDeploymentGroupsResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListDeploymentGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"deploymentGroups"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListDeploymentGroupsResponse)
-> Either String Int -> Either String ListDeploymentGroupsResponse
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 ListDeploymentGroups

instance Prelude.NFData ListDeploymentGroups

instance Core.ToHeaders ListDeploymentGroups where
  toHeaders :: ListDeploymentGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDeploymentGroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeDeploy_20141006.ListDeploymentGroups" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListDeploymentGroups where
  toJSON :: ListDeploymentGroups -> Value
toJSON ListDeploymentGroups' {Maybe Text
Text
applicationName :: Text
nextToken :: Maybe Text
$sel:applicationName:ListDeploymentGroups' :: ListDeploymentGroups -> Text
$sel:nextToken:ListDeploymentGroups' :: ListDeploymentGroups -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"applicationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
applicationName)
          ]
      )

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

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

-- | Represents the output of a @ListDeploymentGroups@ operation.
--
-- /See:/ 'newListDeploymentGroupsResponse' smart constructor.
data ListDeploymentGroupsResponse = ListDeploymentGroupsResponse'
  { -- | If a large amount of information is returned, an identifier is also
    -- returned. It can be used in a subsequent list deployment groups call to
    -- return the next set of deployment groups in the list.
    ListDeploymentGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The application name.
    ListDeploymentGroupsResponse -> Maybe Text
applicationName :: Prelude.Maybe Prelude.Text,
    -- | A list of deployment group names.
    ListDeploymentGroupsResponse -> Maybe [Text]
deploymentGroups :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListDeploymentGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDeploymentGroupsResponse
-> ListDeploymentGroupsResponse -> Bool
(ListDeploymentGroupsResponse
 -> ListDeploymentGroupsResponse -> Bool)
-> (ListDeploymentGroupsResponse
    -> ListDeploymentGroupsResponse -> Bool)
-> Eq ListDeploymentGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeploymentGroupsResponse
-> ListDeploymentGroupsResponse -> Bool
$c/= :: ListDeploymentGroupsResponse
-> ListDeploymentGroupsResponse -> Bool
== :: ListDeploymentGroupsResponse
-> ListDeploymentGroupsResponse -> Bool
$c== :: ListDeploymentGroupsResponse
-> ListDeploymentGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListDeploymentGroupsResponse]
ReadPrec ListDeploymentGroupsResponse
Int -> ReadS ListDeploymentGroupsResponse
ReadS [ListDeploymentGroupsResponse]
(Int -> ReadS ListDeploymentGroupsResponse)
-> ReadS [ListDeploymentGroupsResponse]
-> ReadPrec ListDeploymentGroupsResponse
-> ReadPrec [ListDeploymentGroupsResponse]
-> Read ListDeploymentGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeploymentGroupsResponse]
$creadListPrec :: ReadPrec [ListDeploymentGroupsResponse]
readPrec :: ReadPrec ListDeploymentGroupsResponse
$creadPrec :: ReadPrec ListDeploymentGroupsResponse
readList :: ReadS [ListDeploymentGroupsResponse]
$creadList :: ReadS [ListDeploymentGroupsResponse]
readsPrec :: Int -> ReadS ListDeploymentGroupsResponse
$creadsPrec :: Int -> ReadS ListDeploymentGroupsResponse
Prelude.Read, Int -> ListDeploymentGroupsResponse -> ShowS
[ListDeploymentGroupsResponse] -> ShowS
ListDeploymentGroupsResponse -> String
(Int -> ListDeploymentGroupsResponse -> ShowS)
-> (ListDeploymentGroupsResponse -> String)
-> ([ListDeploymentGroupsResponse] -> ShowS)
-> Show ListDeploymentGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeploymentGroupsResponse] -> ShowS
$cshowList :: [ListDeploymentGroupsResponse] -> ShowS
show :: ListDeploymentGroupsResponse -> String
$cshow :: ListDeploymentGroupsResponse -> String
showsPrec :: Int -> ListDeploymentGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListDeploymentGroupsResponse -> ShowS
Prelude.Show, (forall x.
 ListDeploymentGroupsResponse -> Rep ListDeploymentGroupsResponse x)
-> (forall x.
    Rep ListDeploymentGroupsResponse x -> ListDeploymentGroupsResponse)
-> Generic ListDeploymentGroupsResponse
forall x.
Rep ListDeploymentGroupsResponse x -> ListDeploymentGroupsResponse
forall x.
ListDeploymentGroupsResponse -> Rep ListDeploymentGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeploymentGroupsResponse x -> ListDeploymentGroupsResponse
$cfrom :: forall x.
ListDeploymentGroupsResponse -> Rep ListDeploymentGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDeploymentGroupsResponse' 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', 'listDeploymentGroupsResponse_nextToken' - If a large amount of information is returned, an identifier is also
-- returned. It can be used in a subsequent list deployment groups call to
-- return the next set of deployment groups in the list.
--
-- 'applicationName', 'listDeploymentGroupsResponse_applicationName' - The application name.
--
-- 'deploymentGroups', 'listDeploymentGroupsResponse_deploymentGroups' - A list of deployment group names.
--
-- 'httpStatus', 'listDeploymentGroupsResponse_httpStatus' - The response's http status code.
newListDeploymentGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDeploymentGroupsResponse
newListDeploymentGroupsResponse :: Int -> ListDeploymentGroupsResponse
newListDeploymentGroupsResponse Int
pHttpStatus_ =
  ListDeploymentGroupsResponse' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Int
-> ListDeploymentGroupsResponse
ListDeploymentGroupsResponse'
    { $sel:nextToken:ListDeploymentGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationName:ListDeploymentGroupsResponse' :: Maybe Text
applicationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentGroups:ListDeploymentGroupsResponse' :: Maybe [Text]
deploymentGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDeploymentGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If a large amount of information is returned, an identifier is also
-- returned. It can be used in a subsequent list deployment groups call to
-- return the next set of deployment groups in the list.
listDeploymentGroupsResponse_nextToken :: Lens.Lens' ListDeploymentGroupsResponse (Prelude.Maybe Prelude.Text)
listDeploymentGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentGroupsResponse -> f ListDeploymentGroupsResponse
listDeploymentGroupsResponse_nextToken = (ListDeploymentGroupsResponse -> Maybe Text)
-> (ListDeploymentGroupsResponse
    -> Maybe Text -> ListDeploymentGroupsResponse)
-> Lens' ListDeploymentGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeploymentGroupsResponse' :: ListDeploymentGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeploymentGroupsResponse
s@ListDeploymentGroupsResponse' {} Maybe Text
a -> ListDeploymentGroupsResponse
s {$sel:nextToken:ListDeploymentGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeploymentGroupsResponse)

-- | The application name.
listDeploymentGroupsResponse_applicationName :: Lens.Lens' ListDeploymentGroupsResponse (Prelude.Maybe Prelude.Text)
listDeploymentGroupsResponse_applicationName :: (Maybe Text -> f (Maybe Text))
-> ListDeploymentGroupsResponse -> f ListDeploymentGroupsResponse
listDeploymentGroupsResponse_applicationName = (ListDeploymentGroupsResponse -> Maybe Text)
-> (ListDeploymentGroupsResponse
    -> Maybe Text -> ListDeploymentGroupsResponse)
-> Lens' ListDeploymentGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentGroupsResponse' {Maybe Text
applicationName :: Maybe Text
$sel:applicationName:ListDeploymentGroupsResponse' :: ListDeploymentGroupsResponse -> Maybe Text
applicationName} -> Maybe Text
applicationName) (\s :: ListDeploymentGroupsResponse
s@ListDeploymentGroupsResponse' {} Maybe Text
a -> ListDeploymentGroupsResponse
s {$sel:applicationName:ListDeploymentGroupsResponse' :: Maybe Text
applicationName = Maybe Text
a} :: ListDeploymentGroupsResponse)

-- | A list of deployment group names.
listDeploymentGroupsResponse_deploymentGroups :: Lens.Lens' ListDeploymentGroupsResponse (Prelude.Maybe [Prelude.Text])
listDeploymentGroupsResponse_deploymentGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> ListDeploymentGroupsResponse -> f ListDeploymentGroupsResponse
listDeploymentGroupsResponse_deploymentGroups = (ListDeploymentGroupsResponse -> Maybe [Text])
-> (ListDeploymentGroupsResponse
    -> Maybe [Text] -> ListDeploymentGroupsResponse)
-> Lens' ListDeploymentGroupsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeploymentGroupsResponse' {Maybe [Text]
deploymentGroups :: Maybe [Text]
$sel:deploymentGroups:ListDeploymentGroupsResponse' :: ListDeploymentGroupsResponse -> Maybe [Text]
deploymentGroups} -> Maybe [Text]
deploymentGroups) (\s :: ListDeploymentGroupsResponse
s@ListDeploymentGroupsResponse' {} Maybe [Text]
a -> ListDeploymentGroupsResponse
s {$sel:deploymentGroups:ListDeploymentGroupsResponse' :: Maybe [Text]
deploymentGroups = Maybe [Text]
a} :: ListDeploymentGroupsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListDeploymentGroupsResponse -> f ListDeploymentGroupsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListDeploymentGroupsResponse
-> f ListDeploymentGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListDeploymentGroupsResponse