{-# 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.MigrationHub.ListApplicationStates
-- 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 all the migration statuses for your applications. If you use the
-- optional @ApplicationIds@ parameter, only the migration statuses for
-- those applications will be returned.
--
-- This operation returns paginated results.
module Amazonka.MigrationHub.ListApplicationStates
  ( -- * Creating a Request
    ListApplicationStates (..),
    newListApplicationStates,

    -- * Request Lenses
    listApplicationStates_nextToken,
    listApplicationStates_applicationIds,
    listApplicationStates_maxResults,

    -- * Destructuring the Response
    ListApplicationStatesResponse (..),
    newListApplicationStatesResponse,

    -- * Response Lenses
    listApplicationStatesResponse_applicationStateList,
    listApplicationStatesResponse_nextToken,
    listApplicationStatesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListApplicationStates' smart constructor.
data ListApplicationStates = ListApplicationStates'
  { -- | If a @NextToken@ was returned by a previous call, there are more results
    -- available. To retrieve the next page of results, make the call again
    -- using the returned token in @NextToken@.
    ListApplicationStates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The configurationIds from the Application Discovery Service that
    -- uniquely identifies your applications.
    ListApplicationStates -> Maybe (NonEmpty Text)
applicationIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | Maximum number of results to be returned per page.
    ListApplicationStates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListApplicationStates -> ListApplicationStates -> Bool
(ListApplicationStates -> ListApplicationStates -> Bool)
-> (ListApplicationStates -> ListApplicationStates -> Bool)
-> Eq ListApplicationStates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationStates -> ListApplicationStates -> Bool
$c/= :: ListApplicationStates -> ListApplicationStates -> Bool
== :: ListApplicationStates -> ListApplicationStates -> Bool
$c== :: ListApplicationStates -> ListApplicationStates -> Bool
Prelude.Eq, ReadPrec [ListApplicationStates]
ReadPrec ListApplicationStates
Int -> ReadS ListApplicationStates
ReadS [ListApplicationStates]
(Int -> ReadS ListApplicationStates)
-> ReadS [ListApplicationStates]
-> ReadPrec ListApplicationStates
-> ReadPrec [ListApplicationStates]
-> Read ListApplicationStates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationStates]
$creadListPrec :: ReadPrec [ListApplicationStates]
readPrec :: ReadPrec ListApplicationStates
$creadPrec :: ReadPrec ListApplicationStates
readList :: ReadS [ListApplicationStates]
$creadList :: ReadS [ListApplicationStates]
readsPrec :: Int -> ReadS ListApplicationStates
$creadsPrec :: Int -> ReadS ListApplicationStates
Prelude.Read, Int -> ListApplicationStates -> ShowS
[ListApplicationStates] -> ShowS
ListApplicationStates -> String
(Int -> ListApplicationStates -> ShowS)
-> (ListApplicationStates -> String)
-> ([ListApplicationStates] -> ShowS)
-> Show ListApplicationStates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationStates] -> ShowS
$cshowList :: [ListApplicationStates] -> ShowS
show :: ListApplicationStates -> String
$cshow :: ListApplicationStates -> String
showsPrec :: Int -> ListApplicationStates -> ShowS
$cshowsPrec :: Int -> ListApplicationStates -> ShowS
Prelude.Show, (forall x. ListApplicationStates -> Rep ListApplicationStates x)
-> (forall x. Rep ListApplicationStates x -> ListApplicationStates)
-> Generic ListApplicationStates
forall x. Rep ListApplicationStates x -> ListApplicationStates
forall x. ListApplicationStates -> Rep ListApplicationStates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListApplicationStates x -> ListApplicationStates
$cfrom :: forall x. ListApplicationStates -> Rep ListApplicationStates x
Prelude.Generic)

-- |
-- Create a value of 'ListApplicationStates' 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', 'listApplicationStates_nextToken' - If a @NextToken@ was returned by a previous call, there are more results
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
--
-- 'applicationIds', 'listApplicationStates_applicationIds' - The configurationIds from the Application Discovery Service that
-- uniquely identifies your applications.
--
-- 'maxResults', 'listApplicationStates_maxResults' - Maximum number of results to be returned per page.
newListApplicationStates ::
  ListApplicationStates
newListApplicationStates :: ListApplicationStates
newListApplicationStates =
  ListApplicationStates' :: Maybe Text
-> Maybe (NonEmpty Text) -> Maybe Natural -> ListApplicationStates
ListApplicationStates'
    { $sel:nextToken:ListApplicationStates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationIds:ListApplicationStates' :: Maybe (NonEmpty Text)
applicationIds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListApplicationStates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | If a @NextToken@ was returned by a previous call, there are more results
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
listApplicationStates_nextToken :: Lens.Lens' ListApplicationStates (Prelude.Maybe Prelude.Text)
listApplicationStates_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApplicationStates -> f ListApplicationStates
listApplicationStates_nextToken = (ListApplicationStates -> Maybe Text)
-> (ListApplicationStates -> Maybe Text -> ListApplicationStates)
-> Lens
     ListApplicationStates
     ListApplicationStates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationStates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApplicationStates' :: ListApplicationStates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApplicationStates
s@ListApplicationStates' {} Maybe Text
a -> ListApplicationStates
s {$sel:nextToken:ListApplicationStates' :: Maybe Text
nextToken = Maybe Text
a} :: ListApplicationStates)

-- | The configurationIds from the Application Discovery Service that
-- uniquely identifies your applications.
listApplicationStates_applicationIds :: Lens.Lens' ListApplicationStates (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listApplicationStates_applicationIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListApplicationStates -> f ListApplicationStates
listApplicationStates_applicationIds = (ListApplicationStates -> Maybe (NonEmpty Text))
-> (ListApplicationStates
    -> Maybe (NonEmpty Text) -> ListApplicationStates)
-> Lens
     ListApplicationStates
     ListApplicationStates
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationStates' {Maybe (NonEmpty Text)
applicationIds :: Maybe (NonEmpty Text)
$sel:applicationIds:ListApplicationStates' :: ListApplicationStates -> Maybe (NonEmpty Text)
applicationIds} -> Maybe (NonEmpty Text)
applicationIds) (\s :: ListApplicationStates
s@ListApplicationStates' {} Maybe (NonEmpty Text)
a -> ListApplicationStates
s {$sel:applicationIds:ListApplicationStates' :: Maybe (NonEmpty Text)
applicationIds = Maybe (NonEmpty Text)
a} :: ListApplicationStates) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListApplicationStates -> f ListApplicationStates)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListApplicationStates
-> f ListApplicationStates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Maximum number of results to be returned per page.
listApplicationStates_maxResults :: Lens.Lens' ListApplicationStates (Prelude.Maybe Prelude.Natural)
listApplicationStates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListApplicationStates -> f ListApplicationStates
listApplicationStates_maxResults = (ListApplicationStates -> Maybe Natural)
-> (ListApplicationStates
    -> Maybe Natural -> ListApplicationStates)
-> Lens
     ListApplicationStates
     ListApplicationStates
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationStates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListApplicationStates' :: ListApplicationStates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListApplicationStates
s@ListApplicationStates' {} Maybe Natural
a -> ListApplicationStates
s {$sel:maxResults:ListApplicationStates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListApplicationStates)

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

instance Prelude.NFData ListApplicationStates

instance Core.ToHeaders ListApplicationStates where
  toHeaders :: ListApplicationStates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListApplicationStates -> 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
"AWSMigrationHub.ListApplicationStates" ::
                          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 ListApplicationStates where
  toJSON :: ListApplicationStates -> Value
toJSON ListApplicationStates' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
maxResults :: Maybe Natural
applicationIds :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
$sel:maxResults:ListApplicationStates' :: ListApplicationStates -> Maybe Natural
$sel:applicationIds:ListApplicationStates' :: ListApplicationStates -> Maybe (NonEmpty Text)
$sel:nextToken:ListApplicationStates' :: ListApplicationStates -> 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
"ApplicationIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
applicationIds,
            (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
          ]
      )

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

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

-- | /See:/ 'newListApplicationStatesResponse' smart constructor.
data ListApplicationStatesResponse = ListApplicationStatesResponse'
  { -- | A list of Applications that exist in Application Discovery Service.
    ListApplicationStatesResponse -> Maybe [ApplicationState]
applicationStateList :: Prelude.Maybe [ApplicationState],
    -- | If a @NextToken@ was returned by a previous call, there are more results
    -- available. To retrieve the next page of results, make the call again
    -- using the returned token in @NextToken@.
    ListApplicationStatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListApplicationStatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListApplicationStatesResponse
-> ListApplicationStatesResponse -> Bool
(ListApplicationStatesResponse
 -> ListApplicationStatesResponse -> Bool)
-> (ListApplicationStatesResponse
    -> ListApplicationStatesResponse -> Bool)
-> Eq ListApplicationStatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationStatesResponse
-> ListApplicationStatesResponse -> Bool
$c/= :: ListApplicationStatesResponse
-> ListApplicationStatesResponse -> Bool
== :: ListApplicationStatesResponse
-> ListApplicationStatesResponse -> Bool
$c== :: ListApplicationStatesResponse
-> ListApplicationStatesResponse -> Bool
Prelude.Eq, ReadPrec [ListApplicationStatesResponse]
ReadPrec ListApplicationStatesResponse
Int -> ReadS ListApplicationStatesResponse
ReadS [ListApplicationStatesResponse]
(Int -> ReadS ListApplicationStatesResponse)
-> ReadS [ListApplicationStatesResponse]
-> ReadPrec ListApplicationStatesResponse
-> ReadPrec [ListApplicationStatesResponse]
-> Read ListApplicationStatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationStatesResponse]
$creadListPrec :: ReadPrec [ListApplicationStatesResponse]
readPrec :: ReadPrec ListApplicationStatesResponse
$creadPrec :: ReadPrec ListApplicationStatesResponse
readList :: ReadS [ListApplicationStatesResponse]
$creadList :: ReadS [ListApplicationStatesResponse]
readsPrec :: Int -> ReadS ListApplicationStatesResponse
$creadsPrec :: Int -> ReadS ListApplicationStatesResponse
Prelude.Read, Int -> ListApplicationStatesResponse -> ShowS
[ListApplicationStatesResponse] -> ShowS
ListApplicationStatesResponse -> String
(Int -> ListApplicationStatesResponse -> ShowS)
-> (ListApplicationStatesResponse -> String)
-> ([ListApplicationStatesResponse] -> ShowS)
-> Show ListApplicationStatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationStatesResponse] -> ShowS
$cshowList :: [ListApplicationStatesResponse] -> ShowS
show :: ListApplicationStatesResponse -> String
$cshow :: ListApplicationStatesResponse -> String
showsPrec :: Int -> ListApplicationStatesResponse -> ShowS
$cshowsPrec :: Int -> ListApplicationStatesResponse -> ShowS
Prelude.Show, (forall x.
 ListApplicationStatesResponse
 -> Rep ListApplicationStatesResponse x)
-> (forall x.
    Rep ListApplicationStatesResponse x
    -> ListApplicationStatesResponse)
-> Generic ListApplicationStatesResponse
forall x.
Rep ListApplicationStatesResponse x
-> ListApplicationStatesResponse
forall x.
ListApplicationStatesResponse
-> Rep ListApplicationStatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApplicationStatesResponse x
-> ListApplicationStatesResponse
$cfrom :: forall x.
ListApplicationStatesResponse
-> Rep ListApplicationStatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListApplicationStatesResponse' 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:
--
-- 'applicationStateList', 'listApplicationStatesResponse_applicationStateList' - A list of Applications that exist in Application Discovery Service.
--
-- 'nextToken', 'listApplicationStatesResponse_nextToken' - If a @NextToken@ was returned by a previous call, there are more results
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
--
-- 'httpStatus', 'listApplicationStatesResponse_httpStatus' - The response's http status code.
newListApplicationStatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListApplicationStatesResponse
newListApplicationStatesResponse :: Int -> ListApplicationStatesResponse
newListApplicationStatesResponse Int
pHttpStatus_ =
  ListApplicationStatesResponse' :: Maybe [ApplicationState]
-> Maybe Text -> Int -> ListApplicationStatesResponse
ListApplicationStatesResponse'
    { $sel:applicationStateList:ListApplicationStatesResponse' :: Maybe [ApplicationState]
applicationStateList =
        Maybe [ApplicationState]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListApplicationStatesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListApplicationStatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of Applications that exist in Application Discovery Service.
listApplicationStatesResponse_applicationStateList :: Lens.Lens' ListApplicationStatesResponse (Prelude.Maybe [ApplicationState])
listApplicationStatesResponse_applicationStateList :: (Maybe [ApplicationState] -> f (Maybe [ApplicationState]))
-> ListApplicationStatesResponse -> f ListApplicationStatesResponse
listApplicationStatesResponse_applicationStateList = (ListApplicationStatesResponse -> Maybe [ApplicationState])
-> (ListApplicationStatesResponse
    -> Maybe [ApplicationState] -> ListApplicationStatesResponse)
-> Lens' ListApplicationStatesResponse (Maybe [ApplicationState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationStatesResponse' {Maybe [ApplicationState]
applicationStateList :: Maybe [ApplicationState]
$sel:applicationStateList:ListApplicationStatesResponse' :: ListApplicationStatesResponse -> Maybe [ApplicationState]
applicationStateList} -> Maybe [ApplicationState]
applicationStateList) (\s :: ListApplicationStatesResponse
s@ListApplicationStatesResponse' {} Maybe [ApplicationState]
a -> ListApplicationStatesResponse
s {$sel:applicationStateList:ListApplicationStatesResponse' :: Maybe [ApplicationState]
applicationStateList = Maybe [ApplicationState]
a} :: ListApplicationStatesResponse) ((Maybe [ApplicationState] -> f (Maybe [ApplicationState]))
 -> ListApplicationStatesResponse
 -> f ListApplicationStatesResponse)
-> ((Maybe [ApplicationState] -> f (Maybe [ApplicationState]))
    -> Maybe [ApplicationState] -> f (Maybe [ApplicationState]))
-> (Maybe [ApplicationState] -> f (Maybe [ApplicationState]))
-> ListApplicationStatesResponse
-> f ListApplicationStatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ApplicationState]
  [ApplicationState]
  [ApplicationState]
  [ApplicationState]
-> Iso
     (Maybe [ApplicationState])
     (Maybe [ApplicationState])
     (Maybe [ApplicationState])
     (Maybe [ApplicationState])
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
  [ApplicationState]
  [ApplicationState]
  [ApplicationState]
  [ApplicationState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If a @NextToken@ was returned by a previous call, there are more results
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
listApplicationStatesResponse_nextToken :: Lens.Lens' ListApplicationStatesResponse (Prelude.Maybe Prelude.Text)
listApplicationStatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListApplicationStatesResponse -> f ListApplicationStatesResponse
listApplicationStatesResponse_nextToken = (ListApplicationStatesResponse -> Maybe Text)
-> (ListApplicationStatesResponse
    -> Maybe Text -> ListApplicationStatesResponse)
-> Lens' ListApplicationStatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationStatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApplicationStatesResponse' :: ListApplicationStatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApplicationStatesResponse
s@ListApplicationStatesResponse' {} Maybe Text
a -> ListApplicationStatesResponse
s {$sel:nextToken:ListApplicationStatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListApplicationStatesResponse)

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

instance Prelude.NFData ListApplicationStatesResponse