{-# 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.MarketplaceCatalog.ListChangeSets
-- 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)
--
-- Returns the list of change sets owned by the account being used to make
-- the call. You can filter this list by providing any combination of
-- @entityId@, @ChangeSetName@, and status. If you provide more than one
-- filter, the API operation applies a logical AND between the filters.
--
-- You can describe a change during the 60-day request history retention
-- period for API calls.
module Amazonka.MarketplaceCatalog.ListChangeSets
  ( -- * Creating a Request
    ListChangeSets (..),
    newListChangeSets,

    -- * Request Lenses
    listChangeSets_nextToken,
    listChangeSets_filterList,
    listChangeSets_sort,
    listChangeSets_maxResults,
    listChangeSets_catalog,

    -- * Destructuring the Response
    ListChangeSetsResponse (..),
    newListChangeSetsResponse,

    -- * Response Lenses
    listChangeSetsResponse_nextToken,
    listChangeSetsResponse_changeSetSummaryList,
    listChangeSetsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListChangeSets' smart constructor.
data ListChangeSets = ListChangeSets'
  { -- | The token value retrieved from a previous call to access the next page
    -- of results.
    ListChangeSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of filter objects.
    ListChangeSets -> Maybe (NonEmpty Filter)
filterList :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | An object that contains two attributes, @SortBy@ and @SortOrder@.
    ListChangeSets -> Maybe Sort
sort :: Prelude.Maybe Sort,
    -- | The maximum number of results returned by a single call. This value must
    -- be provided in the next call to retrieve the next set of results. By
    -- default, this value is 20.
    ListChangeSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The catalog related to the request. Fixed value: @AWSMarketplace@
    ListChangeSets -> Text
catalog :: Prelude.Text
  }
  deriving (ListChangeSets -> ListChangeSets -> Bool
(ListChangeSets -> ListChangeSets -> Bool)
-> (ListChangeSets -> ListChangeSets -> Bool) -> Eq ListChangeSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChangeSets -> ListChangeSets -> Bool
$c/= :: ListChangeSets -> ListChangeSets -> Bool
== :: ListChangeSets -> ListChangeSets -> Bool
$c== :: ListChangeSets -> ListChangeSets -> Bool
Prelude.Eq, ReadPrec [ListChangeSets]
ReadPrec ListChangeSets
Int -> ReadS ListChangeSets
ReadS [ListChangeSets]
(Int -> ReadS ListChangeSets)
-> ReadS [ListChangeSets]
-> ReadPrec ListChangeSets
-> ReadPrec [ListChangeSets]
-> Read ListChangeSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListChangeSets]
$creadListPrec :: ReadPrec [ListChangeSets]
readPrec :: ReadPrec ListChangeSets
$creadPrec :: ReadPrec ListChangeSets
readList :: ReadS [ListChangeSets]
$creadList :: ReadS [ListChangeSets]
readsPrec :: Int -> ReadS ListChangeSets
$creadsPrec :: Int -> ReadS ListChangeSets
Prelude.Read, Int -> ListChangeSets -> ShowS
[ListChangeSets] -> ShowS
ListChangeSets -> String
(Int -> ListChangeSets -> ShowS)
-> (ListChangeSets -> String)
-> ([ListChangeSets] -> ShowS)
-> Show ListChangeSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChangeSets] -> ShowS
$cshowList :: [ListChangeSets] -> ShowS
show :: ListChangeSets -> String
$cshow :: ListChangeSets -> String
showsPrec :: Int -> ListChangeSets -> ShowS
$cshowsPrec :: Int -> ListChangeSets -> ShowS
Prelude.Show, (forall x. ListChangeSets -> Rep ListChangeSets x)
-> (forall x. Rep ListChangeSets x -> ListChangeSets)
-> Generic ListChangeSets
forall x. Rep ListChangeSets x -> ListChangeSets
forall x. ListChangeSets -> Rep ListChangeSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChangeSets x -> ListChangeSets
$cfrom :: forall x. ListChangeSets -> Rep ListChangeSets x
Prelude.Generic)

-- |
-- Create a value of 'ListChangeSets' 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', 'listChangeSets_nextToken' - The token value retrieved from a previous call to access the next page
-- of results.
--
-- 'filterList', 'listChangeSets_filterList' - An array of filter objects.
--
-- 'sort', 'listChangeSets_sort' - An object that contains two attributes, @SortBy@ and @SortOrder@.
--
-- 'maxResults', 'listChangeSets_maxResults' - The maximum number of results returned by a single call. This value must
-- be provided in the next call to retrieve the next set of results. By
-- default, this value is 20.
--
-- 'catalog', 'listChangeSets_catalog' - The catalog related to the request. Fixed value: @AWSMarketplace@
newListChangeSets ::
  -- | 'catalog'
  Prelude.Text ->
  ListChangeSets
newListChangeSets :: Text -> ListChangeSets
newListChangeSets Text
pCatalog_ =
  ListChangeSets' :: Maybe Text
-> Maybe (NonEmpty Filter)
-> Maybe Sort
-> Maybe Natural
-> Text
-> ListChangeSets
ListChangeSets'
    { $sel:nextToken:ListChangeSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filterList:ListChangeSets' :: Maybe (NonEmpty Filter)
filterList = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:sort:ListChangeSets' :: Maybe Sort
sort = Maybe Sort
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListChangeSets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:catalog:ListChangeSets' :: Text
catalog = Text
pCatalog_
    }

-- | The token value retrieved from a previous call to access the next page
-- of results.
listChangeSets_nextToken :: Lens.Lens' ListChangeSets (Prelude.Maybe Prelude.Text)
listChangeSets_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChangeSets -> f ListChangeSets
listChangeSets_nextToken = (ListChangeSets -> Maybe Text)
-> (ListChangeSets -> Maybe Text -> ListChangeSets)
-> Lens ListChangeSets ListChangeSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListChangeSets' :: ListChangeSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListChangeSets
s@ListChangeSets' {} Maybe Text
a -> ListChangeSets
s {$sel:nextToken:ListChangeSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListChangeSets)

-- | An array of filter objects.
listChangeSets_filterList :: Lens.Lens' ListChangeSets (Prelude.Maybe (Prelude.NonEmpty Filter))
listChangeSets_filterList :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListChangeSets -> f ListChangeSets
listChangeSets_filterList = (ListChangeSets -> Maybe (NonEmpty Filter))
-> (ListChangeSets -> Maybe (NonEmpty Filter) -> ListChangeSets)
-> Lens
     ListChangeSets
     ListChangeSets
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Maybe (NonEmpty Filter)
filterList :: Maybe (NonEmpty Filter)
$sel:filterList:ListChangeSets' :: ListChangeSets -> Maybe (NonEmpty Filter)
filterList} -> Maybe (NonEmpty Filter)
filterList) (\s :: ListChangeSets
s@ListChangeSets' {} Maybe (NonEmpty Filter)
a -> ListChangeSets
s {$sel:filterList:ListChangeSets' :: Maybe (NonEmpty Filter)
filterList = Maybe (NonEmpty Filter)
a} :: ListChangeSets) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListChangeSets -> f ListChangeSets)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListChangeSets
-> f ListChangeSets
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
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
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object that contains two attributes, @SortBy@ and @SortOrder@.
listChangeSets_sort :: Lens.Lens' ListChangeSets (Prelude.Maybe Sort)
listChangeSets_sort :: (Maybe Sort -> f (Maybe Sort))
-> ListChangeSets -> f ListChangeSets
listChangeSets_sort = (ListChangeSets -> Maybe Sort)
-> (ListChangeSets -> Maybe Sort -> ListChangeSets)
-> Lens ListChangeSets ListChangeSets (Maybe Sort) (Maybe Sort)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Maybe Sort
sort :: Maybe Sort
$sel:sort:ListChangeSets' :: ListChangeSets -> Maybe Sort
sort} -> Maybe Sort
sort) (\s :: ListChangeSets
s@ListChangeSets' {} Maybe Sort
a -> ListChangeSets
s {$sel:sort:ListChangeSets' :: Maybe Sort
sort = Maybe Sort
a} :: ListChangeSets)

-- | The maximum number of results returned by a single call. This value must
-- be provided in the next call to retrieve the next set of results. By
-- default, this value is 20.
listChangeSets_maxResults :: Lens.Lens' ListChangeSets (Prelude.Maybe Prelude.Natural)
listChangeSets_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListChangeSets -> f ListChangeSets
listChangeSets_maxResults = (ListChangeSets -> Maybe Natural)
-> (ListChangeSets -> Maybe Natural -> ListChangeSets)
-> Lens
     ListChangeSets ListChangeSets (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListChangeSets' :: ListChangeSets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListChangeSets
s@ListChangeSets' {} Maybe Natural
a -> ListChangeSets
s {$sel:maxResults:ListChangeSets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListChangeSets)

-- | The catalog related to the request. Fixed value: @AWSMarketplace@
listChangeSets_catalog :: Lens.Lens' ListChangeSets Prelude.Text
listChangeSets_catalog :: (Text -> f Text) -> ListChangeSets -> f ListChangeSets
listChangeSets_catalog = (ListChangeSets -> Text)
-> (ListChangeSets -> Text -> ListChangeSets)
-> Lens ListChangeSets ListChangeSets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Text
catalog :: Text
$sel:catalog:ListChangeSets' :: ListChangeSets -> Text
catalog} -> Text
catalog) (\s :: ListChangeSets
s@ListChangeSets' {} Text
a -> ListChangeSets
s {$sel:catalog:ListChangeSets' :: Text
catalog = Text
a} :: ListChangeSets)

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

instance Prelude.NFData ListChangeSets

instance Core.ToHeaders ListChangeSets where
  toHeaders :: ListChangeSets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListChangeSets -> 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.ToJSON ListChangeSets where
  toJSON :: ListChangeSets -> Value
toJSON ListChangeSets' {Maybe Natural
Maybe (NonEmpty Filter)
Maybe Text
Maybe Sort
Text
catalog :: Text
maxResults :: Maybe Natural
sort :: Maybe Sort
filterList :: Maybe (NonEmpty Filter)
nextToken :: Maybe Text
$sel:catalog:ListChangeSets' :: ListChangeSets -> Text
$sel:maxResults:ListChangeSets' :: ListChangeSets -> Maybe Natural
$sel:sort:ListChangeSets' :: ListChangeSets -> Maybe Sort
$sel:filterList:ListChangeSets' :: ListChangeSets -> Maybe (NonEmpty Filter)
$sel:nextToken:ListChangeSets' :: ListChangeSets -> 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,
            (Text
"FilterList" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filterList,
            (Text
"Sort" Text -> Sort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sort -> Pair) -> Maybe Sort -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Sort
sort,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Catalog" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
catalog)
          ]
      )

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

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

-- | /See:/ 'newListChangeSetsResponse' smart constructor.
data ListChangeSetsResponse = ListChangeSetsResponse'
  { -- | The value of the next token, if it exists. Null if there are no more
    -- results.
    ListChangeSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Array of @ChangeSetSummaryListItem@ objects.
    ListChangeSetsResponse -> Maybe [ChangeSetSummaryListItem]
changeSetSummaryList :: Prelude.Maybe [ChangeSetSummaryListItem],
    -- | The response's http status code.
    ListChangeSetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
(ListChangeSetsResponse -> ListChangeSetsResponse -> Bool)
-> (ListChangeSetsResponse -> ListChangeSetsResponse -> Bool)
-> Eq ListChangeSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
$c/= :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
== :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
$c== :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListChangeSetsResponse]
ReadPrec ListChangeSetsResponse
Int -> ReadS ListChangeSetsResponse
ReadS [ListChangeSetsResponse]
(Int -> ReadS ListChangeSetsResponse)
-> ReadS [ListChangeSetsResponse]
-> ReadPrec ListChangeSetsResponse
-> ReadPrec [ListChangeSetsResponse]
-> Read ListChangeSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListChangeSetsResponse]
$creadListPrec :: ReadPrec [ListChangeSetsResponse]
readPrec :: ReadPrec ListChangeSetsResponse
$creadPrec :: ReadPrec ListChangeSetsResponse
readList :: ReadS [ListChangeSetsResponse]
$creadList :: ReadS [ListChangeSetsResponse]
readsPrec :: Int -> ReadS ListChangeSetsResponse
$creadsPrec :: Int -> ReadS ListChangeSetsResponse
Prelude.Read, Int -> ListChangeSetsResponse -> ShowS
[ListChangeSetsResponse] -> ShowS
ListChangeSetsResponse -> String
(Int -> ListChangeSetsResponse -> ShowS)
-> (ListChangeSetsResponse -> String)
-> ([ListChangeSetsResponse] -> ShowS)
-> Show ListChangeSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChangeSetsResponse] -> ShowS
$cshowList :: [ListChangeSetsResponse] -> ShowS
show :: ListChangeSetsResponse -> String
$cshow :: ListChangeSetsResponse -> String
showsPrec :: Int -> ListChangeSetsResponse -> ShowS
$cshowsPrec :: Int -> ListChangeSetsResponse -> ShowS
Prelude.Show, (forall x. ListChangeSetsResponse -> Rep ListChangeSetsResponse x)
-> (forall x.
    Rep ListChangeSetsResponse x -> ListChangeSetsResponse)
-> Generic ListChangeSetsResponse
forall x. Rep ListChangeSetsResponse x -> ListChangeSetsResponse
forall x. ListChangeSetsResponse -> Rep ListChangeSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChangeSetsResponse x -> ListChangeSetsResponse
$cfrom :: forall x. ListChangeSetsResponse -> Rep ListChangeSetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListChangeSetsResponse' 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', 'listChangeSetsResponse_nextToken' - The value of the next token, if it exists. Null if there are no more
-- results.
--
-- 'changeSetSummaryList', 'listChangeSetsResponse_changeSetSummaryList' - Array of @ChangeSetSummaryListItem@ objects.
--
-- 'httpStatus', 'listChangeSetsResponse_httpStatus' - The response's http status code.
newListChangeSetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListChangeSetsResponse
newListChangeSetsResponse :: Int -> ListChangeSetsResponse
newListChangeSetsResponse Int
pHttpStatus_ =
  ListChangeSetsResponse' :: Maybe Text
-> Maybe [ChangeSetSummaryListItem]
-> Int
-> ListChangeSetsResponse
ListChangeSetsResponse'
    { $sel:nextToken:ListChangeSetsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:changeSetSummaryList:ListChangeSetsResponse' :: Maybe [ChangeSetSummaryListItem]
changeSetSummaryList = Maybe [ChangeSetSummaryListItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListChangeSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The value of the next token, if it exists. Null if there are no more
-- results.
listChangeSetsResponse_nextToken :: Lens.Lens' ListChangeSetsResponse (Prelude.Maybe Prelude.Text)
listChangeSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChangeSetsResponse -> f ListChangeSetsResponse
listChangeSetsResponse_nextToken = (ListChangeSetsResponse -> Maybe Text)
-> (ListChangeSetsResponse -> Maybe Text -> ListChangeSetsResponse)
-> Lens
     ListChangeSetsResponse
     ListChangeSetsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListChangeSetsResponse' :: ListChangeSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListChangeSetsResponse
s@ListChangeSetsResponse' {} Maybe Text
a -> ListChangeSetsResponse
s {$sel:nextToken:ListChangeSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListChangeSetsResponse)

-- | Array of @ChangeSetSummaryListItem@ objects.
listChangeSetsResponse_changeSetSummaryList :: Lens.Lens' ListChangeSetsResponse (Prelude.Maybe [ChangeSetSummaryListItem])
listChangeSetsResponse_changeSetSummaryList :: (Maybe [ChangeSetSummaryListItem]
 -> f (Maybe [ChangeSetSummaryListItem]))
-> ListChangeSetsResponse -> f ListChangeSetsResponse
listChangeSetsResponse_changeSetSummaryList = (ListChangeSetsResponse -> Maybe [ChangeSetSummaryListItem])
-> (ListChangeSetsResponse
    -> Maybe [ChangeSetSummaryListItem] -> ListChangeSetsResponse)
-> Lens
     ListChangeSetsResponse
     ListChangeSetsResponse
     (Maybe [ChangeSetSummaryListItem])
     (Maybe [ChangeSetSummaryListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSetsResponse' {Maybe [ChangeSetSummaryListItem]
changeSetSummaryList :: Maybe [ChangeSetSummaryListItem]
$sel:changeSetSummaryList:ListChangeSetsResponse' :: ListChangeSetsResponse -> Maybe [ChangeSetSummaryListItem]
changeSetSummaryList} -> Maybe [ChangeSetSummaryListItem]
changeSetSummaryList) (\s :: ListChangeSetsResponse
s@ListChangeSetsResponse' {} Maybe [ChangeSetSummaryListItem]
a -> ListChangeSetsResponse
s {$sel:changeSetSummaryList:ListChangeSetsResponse' :: Maybe [ChangeSetSummaryListItem]
changeSetSummaryList = Maybe [ChangeSetSummaryListItem]
a} :: ListChangeSetsResponse) ((Maybe [ChangeSetSummaryListItem]
  -> f (Maybe [ChangeSetSummaryListItem]))
 -> ListChangeSetsResponse -> f ListChangeSetsResponse)
-> ((Maybe [ChangeSetSummaryListItem]
     -> f (Maybe [ChangeSetSummaryListItem]))
    -> Maybe [ChangeSetSummaryListItem]
    -> f (Maybe [ChangeSetSummaryListItem]))
-> (Maybe [ChangeSetSummaryListItem]
    -> f (Maybe [ChangeSetSummaryListItem]))
-> ListChangeSetsResponse
-> f ListChangeSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ChangeSetSummaryListItem]
  [ChangeSetSummaryListItem]
  [ChangeSetSummaryListItem]
  [ChangeSetSummaryListItem]
-> Iso
     (Maybe [ChangeSetSummaryListItem])
     (Maybe [ChangeSetSummaryListItem])
     (Maybe [ChangeSetSummaryListItem])
     (Maybe [ChangeSetSummaryListItem])
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
  [ChangeSetSummaryListItem]
  [ChangeSetSummaryListItem]
  [ChangeSetSummaryListItem]
  [ChangeSetSummaryListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListChangeSetsResponse