{-# 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.MigrationHubStrategy.ListApplicationComponents
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves a list of all the application components (processes).
--
-- This operation returns paginated results.
module Amazonka.MigrationHubStrategy.ListApplicationComponents
  ( -- * Creating a Request
    ListApplicationComponents (..),
    newListApplicationComponents,

    -- * Request Lenses
    listApplicationComponents_applicationComponentCriteria,
    listApplicationComponents_filterValue,
    listApplicationComponents_groupIdFilter,
    listApplicationComponents_maxResults,
    listApplicationComponents_nextToken,
    listApplicationComponents_sort,

    -- * Destructuring the Response
    ListApplicationComponentsResponse (..),
    newListApplicationComponentsResponse,

    -- * Response Lenses
    listApplicationComponentsResponse_applicationComponentInfos,
    listApplicationComponentsResponse_nextToken,
    listApplicationComponentsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListApplicationComponents' smart constructor.
data ListApplicationComponents = ListApplicationComponents'
  { -- | Criteria for filtering the list of application components.
    ListApplicationComponents -> Maybe ApplicationComponentCriteria
applicationComponentCriteria :: Prelude.Maybe ApplicationComponentCriteria,
    -- | Specify the value based on the application component criteria type. For
    -- example, if @applicationComponentCriteria@ is set to @SERVER_ID@ and
    -- @filterValue@ is set to @server1@, then ListApplicationComponents
    -- returns all the application components running on server1.
    ListApplicationComponents -> Maybe Text
filterValue :: Prelude.Maybe Prelude.Text,
    -- | The group ID specified in to filter on.
    ListApplicationComponents -> Maybe [Group]
groupIdFilter :: Prelude.Maybe [Group],
    -- | The maximum number of items to include in the response. The maximum
    -- value is 100.
    ListApplicationComponents -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token from a previous call that you use to retrieve the next set of
    -- results. For example, if a previous call to this action returned 100
    -- items, but you set @maxResults@ to 10. You\'ll receive a set of 10
    -- results along with a token. You then use the returned token to retrieve
    -- the next set of 10.
    ListApplicationComponents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to sort by ascending (@ASC@) or descending (@DESC@)
    -- order.
    ListApplicationComponents -> Maybe SortOrder
sort :: Prelude.Maybe SortOrder
  }
  deriving (ListApplicationComponents -> ListApplicationComponents -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationComponents -> ListApplicationComponents -> Bool
$c/= :: ListApplicationComponents -> ListApplicationComponents -> Bool
== :: ListApplicationComponents -> ListApplicationComponents -> Bool
$c== :: ListApplicationComponents -> ListApplicationComponents -> Bool
Prelude.Eq, ReadPrec [ListApplicationComponents]
ReadPrec ListApplicationComponents
Int -> ReadS ListApplicationComponents
ReadS [ListApplicationComponents]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationComponents]
$creadListPrec :: ReadPrec [ListApplicationComponents]
readPrec :: ReadPrec ListApplicationComponents
$creadPrec :: ReadPrec ListApplicationComponents
readList :: ReadS [ListApplicationComponents]
$creadList :: ReadS [ListApplicationComponents]
readsPrec :: Int -> ReadS ListApplicationComponents
$creadsPrec :: Int -> ReadS ListApplicationComponents
Prelude.Read, Int -> ListApplicationComponents -> ShowS
[ListApplicationComponents] -> ShowS
ListApplicationComponents -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationComponents] -> ShowS
$cshowList :: [ListApplicationComponents] -> ShowS
show :: ListApplicationComponents -> String
$cshow :: ListApplicationComponents -> String
showsPrec :: Int -> ListApplicationComponents -> ShowS
$cshowsPrec :: Int -> ListApplicationComponents -> ShowS
Prelude.Show, forall x.
Rep ListApplicationComponents x -> ListApplicationComponents
forall x.
ListApplicationComponents -> Rep ListApplicationComponents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApplicationComponents x -> ListApplicationComponents
$cfrom :: forall x.
ListApplicationComponents -> Rep ListApplicationComponents x
Prelude.Generic)

-- |
-- Create a value of 'ListApplicationComponents' 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:
--
-- 'applicationComponentCriteria', 'listApplicationComponents_applicationComponentCriteria' - Criteria for filtering the list of application components.
--
-- 'filterValue', 'listApplicationComponents_filterValue' - Specify the value based on the application component criteria type. For
-- example, if @applicationComponentCriteria@ is set to @SERVER_ID@ and
-- @filterValue@ is set to @server1@, then ListApplicationComponents
-- returns all the application components running on server1.
--
-- 'groupIdFilter', 'listApplicationComponents_groupIdFilter' - The group ID specified in to filter on.
--
-- 'maxResults', 'listApplicationComponents_maxResults' - The maximum number of items to include in the response. The maximum
-- value is 100.
--
-- 'nextToken', 'listApplicationComponents_nextToken' - The token from a previous call that you use to retrieve the next set of
-- results. For example, if a previous call to this action returned 100
-- items, but you set @maxResults@ to 10. You\'ll receive a set of 10
-- results along with a token. You then use the returned token to retrieve
-- the next set of 10.
--
-- 'sort', 'listApplicationComponents_sort' - Specifies whether to sort by ascending (@ASC@) or descending (@DESC@)
-- order.
newListApplicationComponents ::
  ListApplicationComponents
newListApplicationComponents :: ListApplicationComponents
newListApplicationComponents =
  ListApplicationComponents'
    { $sel:applicationComponentCriteria:ListApplicationComponents' :: Maybe ApplicationComponentCriteria
applicationComponentCriteria =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filterValue:ListApplicationComponents' :: Maybe Text
filterValue = forall a. Maybe a
Prelude.Nothing,
      $sel:groupIdFilter:ListApplicationComponents' :: Maybe [Group]
groupIdFilter = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListApplicationComponents' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListApplicationComponents' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sort:ListApplicationComponents' :: Maybe SortOrder
sort = forall a. Maybe a
Prelude.Nothing
    }

-- | Criteria for filtering the list of application components.
listApplicationComponents_applicationComponentCriteria :: Lens.Lens' ListApplicationComponents (Prelude.Maybe ApplicationComponentCriteria)
listApplicationComponents_applicationComponentCriteria :: Lens'
  ListApplicationComponents (Maybe ApplicationComponentCriteria)
listApplicationComponents_applicationComponentCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponents' {Maybe ApplicationComponentCriteria
applicationComponentCriteria :: Maybe ApplicationComponentCriteria
$sel:applicationComponentCriteria:ListApplicationComponents' :: ListApplicationComponents -> Maybe ApplicationComponentCriteria
applicationComponentCriteria} -> Maybe ApplicationComponentCriteria
applicationComponentCriteria) (\s :: ListApplicationComponents
s@ListApplicationComponents' {} Maybe ApplicationComponentCriteria
a -> ListApplicationComponents
s {$sel:applicationComponentCriteria:ListApplicationComponents' :: Maybe ApplicationComponentCriteria
applicationComponentCriteria = Maybe ApplicationComponentCriteria
a} :: ListApplicationComponents)

-- | Specify the value based on the application component criteria type. For
-- example, if @applicationComponentCriteria@ is set to @SERVER_ID@ and
-- @filterValue@ is set to @server1@, then ListApplicationComponents
-- returns all the application components running on server1.
listApplicationComponents_filterValue :: Lens.Lens' ListApplicationComponents (Prelude.Maybe Prelude.Text)
listApplicationComponents_filterValue :: Lens' ListApplicationComponents (Maybe Text)
listApplicationComponents_filterValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponents' {Maybe Text
filterValue :: Maybe Text
$sel:filterValue:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
filterValue} -> Maybe Text
filterValue) (\s :: ListApplicationComponents
s@ListApplicationComponents' {} Maybe Text
a -> ListApplicationComponents
s {$sel:filterValue:ListApplicationComponents' :: Maybe Text
filterValue = Maybe Text
a} :: ListApplicationComponents)

-- | The group ID specified in to filter on.
listApplicationComponents_groupIdFilter :: Lens.Lens' ListApplicationComponents (Prelude.Maybe [Group])
listApplicationComponents_groupIdFilter :: Lens' ListApplicationComponents (Maybe [Group])
listApplicationComponents_groupIdFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponents' {Maybe [Group]
groupIdFilter :: Maybe [Group]
$sel:groupIdFilter:ListApplicationComponents' :: ListApplicationComponents -> Maybe [Group]
groupIdFilter} -> Maybe [Group]
groupIdFilter) (\s :: ListApplicationComponents
s@ListApplicationComponents' {} Maybe [Group]
a -> ListApplicationComponents
s {$sel:groupIdFilter:ListApplicationComponents' :: Maybe [Group]
groupIdFilter = Maybe [Group]
a} :: ListApplicationComponents) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of items to include in the response. The maximum
-- value is 100.
listApplicationComponents_maxResults :: Lens.Lens' ListApplicationComponents (Prelude.Maybe Prelude.Int)
listApplicationComponents_maxResults :: Lens' ListApplicationComponents (Maybe Int)
listApplicationComponents_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponents' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListApplicationComponents' :: ListApplicationComponents -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListApplicationComponents
s@ListApplicationComponents' {} Maybe Int
a -> ListApplicationComponents
s {$sel:maxResults:ListApplicationComponents' :: Maybe Int
maxResults = Maybe Int
a} :: ListApplicationComponents)

-- | The token from a previous call that you use to retrieve the next set of
-- results. For example, if a previous call to this action returned 100
-- items, but you set @maxResults@ to 10. You\'ll receive a set of 10
-- results along with a token. You then use the returned token to retrieve
-- the next set of 10.
listApplicationComponents_nextToken :: Lens.Lens' ListApplicationComponents (Prelude.Maybe Prelude.Text)
listApplicationComponents_nextToken :: Lens' ListApplicationComponents (Maybe Text)
listApplicationComponents_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApplicationComponents
s@ListApplicationComponents' {} Maybe Text
a -> ListApplicationComponents
s {$sel:nextToken:ListApplicationComponents' :: Maybe Text
nextToken = Maybe Text
a} :: ListApplicationComponents)

-- | Specifies whether to sort by ascending (@ASC@) or descending (@DESC@)
-- order.
listApplicationComponents_sort :: Lens.Lens' ListApplicationComponents (Prelude.Maybe SortOrder)
listApplicationComponents_sort :: Lens' ListApplicationComponents (Maybe SortOrder)
listApplicationComponents_sort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponents' {Maybe SortOrder
sort :: Maybe SortOrder
$sel:sort:ListApplicationComponents' :: ListApplicationComponents -> Maybe SortOrder
sort} -> Maybe SortOrder
sort) (\s :: ListApplicationComponents
s@ListApplicationComponents' {} Maybe SortOrder
a -> ListApplicationComponents
s {$sel:sort:ListApplicationComponents' :: Maybe SortOrder
sort = Maybe SortOrder
a} :: ListApplicationComponents)

instance Core.AWSPager ListApplicationComponents where
  page :: ListApplicationComponents
-> AWSResponse ListApplicationComponents
-> Maybe ListApplicationComponents
page ListApplicationComponents
rq AWSResponse ListApplicationComponents
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApplicationComponents
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListApplicationComponentsResponse (Maybe Text)
listApplicationComponentsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApplicationComponents
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListApplicationComponentsResponse
  (Maybe [ApplicationComponentDetail])
listApplicationComponentsResponse_applicationComponentInfos
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListApplicationComponents
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListApplicationComponents (Maybe Text)
listApplicationComponents_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListApplicationComponents
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListApplicationComponentsResponse (Maybe Text)
listApplicationComponentsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListApplicationComponents where
  type
    AWSResponse ListApplicationComponents =
      ListApplicationComponentsResponse
  request :: (Service -> Service)
-> ListApplicationComponents -> Request ListApplicationComponents
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListApplicationComponents
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListApplicationComponents)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [ApplicationComponentDetail]
-> Maybe Text -> Int -> ListApplicationComponentsResponse
ListApplicationComponentsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"applicationComponentInfos"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListApplicationComponents where
  hashWithSalt :: Int -> ListApplicationComponents -> Int
hashWithSalt Int
_salt ListApplicationComponents' {Maybe Int
Maybe [Group]
Maybe Text
Maybe ApplicationComponentCriteria
Maybe SortOrder
sort :: Maybe SortOrder
nextToken :: Maybe Text
maxResults :: Maybe Int
groupIdFilter :: Maybe [Group]
filterValue :: Maybe Text
applicationComponentCriteria :: Maybe ApplicationComponentCriteria
$sel:sort:ListApplicationComponents' :: ListApplicationComponents -> Maybe SortOrder
$sel:nextToken:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
$sel:maxResults:ListApplicationComponents' :: ListApplicationComponents -> Maybe Int
$sel:groupIdFilter:ListApplicationComponents' :: ListApplicationComponents -> Maybe [Group]
$sel:filterValue:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
$sel:applicationComponentCriteria:ListApplicationComponents' :: ListApplicationComponents -> Maybe ApplicationComponentCriteria
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApplicationComponentCriteria
applicationComponentCriteria
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
filterValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Group]
groupIdFilter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sort

instance Prelude.NFData ListApplicationComponents where
  rnf :: ListApplicationComponents -> ()
rnf ListApplicationComponents' {Maybe Int
Maybe [Group]
Maybe Text
Maybe ApplicationComponentCriteria
Maybe SortOrder
sort :: Maybe SortOrder
nextToken :: Maybe Text
maxResults :: Maybe Int
groupIdFilter :: Maybe [Group]
filterValue :: Maybe Text
applicationComponentCriteria :: Maybe ApplicationComponentCriteria
$sel:sort:ListApplicationComponents' :: ListApplicationComponents -> Maybe SortOrder
$sel:nextToken:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
$sel:maxResults:ListApplicationComponents' :: ListApplicationComponents -> Maybe Int
$sel:groupIdFilter:ListApplicationComponents' :: ListApplicationComponents -> Maybe [Group]
$sel:filterValue:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
$sel:applicationComponentCriteria:ListApplicationComponents' :: ListApplicationComponents -> Maybe ApplicationComponentCriteria
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ApplicationComponentCriteria
applicationComponentCriteria
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
filterValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Group]
groupIdFilter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sort

instance Data.ToHeaders ListApplicationComponents where
  toHeaders :: ListApplicationComponents -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListApplicationComponents where
  toJSON :: ListApplicationComponents -> Value
toJSON ListApplicationComponents' {Maybe Int
Maybe [Group]
Maybe Text
Maybe ApplicationComponentCriteria
Maybe SortOrder
sort :: Maybe SortOrder
nextToken :: Maybe Text
maxResults :: Maybe Int
groupIdFilter :: Maybe [Group]
filterValue :: Maybe Text
applicationComponentCriteria :: Maybe ApplicationComponentCriteria
$sel:sort:ListApplicationComponents' :: ListApplicationComponents -> Maybe SortOrder
$sel:nextToken:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
$sel:maxResults:ListApplicationComponents' :: ListApplicationComponents -> Maybe Int
$sel:groupIdFilter:ListApplicationComponents' :: ListApplicationComponents -> Maybe [Group]
$sel:filterValue:ListApplicationComponents' :: ListApplicationComponents -> Maybe Text
$sel:applicationComponentCriteria:ListApplicationComponents' :: ListApplicationComponents -> Maybe ApplicationComponentCriteria
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"applicationComponentCriteria" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ApplicationComponentCriteria
applicationComponentCriteria,
            (Key
"filterValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
filterValue,
            (Key
"groupIdFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Group]
groupIdFilter,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"sort" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sort
          ]
      )

instance Data.ToPath ListApplicationComponents where
  toPath :: ListApplicationComponents -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/list-applicationcomponents"

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

-- | /See:/ 'newListApplicationComponentsResponse' smart constructor.
data ListApplicationComponentsResponse = ListApplicationComponentsResponse'
  { -- | The list of application components with detailed information about each
    -- component.
    ListApplicationComponentsResponse
-> Maybe [ApplicationComponentDetail]
applicationComponentInfos :: Prelude.Maybe [ApplicationComponentDetail],
    -- | The token you use to retrieve the next set of results, or null if there
    -- are no more results.
    ListApplicationComponentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListApplicationComponentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListApplicationComponentsResponse
-> ListApplicationComponentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationComponentsResponse
-> ListApplicationComponentsResponse -> Bool
$c/= :: ListApplicationComponentsResponse
-> ListApplicationComponentsResponse -> Bool
== :: ListApplicationComponentsResponse
-> ListApplicationComponentsResponse -> Bool
$c== :: ListApplicationComponentsResponse
-> ListApplicationComponentsResponse -> Bool
Prelude.Eq, ReadPrec [ListApplicationComponentsResponse]
ReadPrec ListApplicationComponentsResponse
Int -> ReadS ListApplicationComponentsResponse
ReadS [ListApplicationComponentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationComponentsResponse]
$creadListPrec :: ReadPrec [ListApplicationComponentsResponse]
readPrec :: ReadPrec ListApplicationComponentsResponse
$creadPrec :: ReadPrec ListApplicationComponentsResponse
readList :: ReadS [ListApplicationComponentsResponse]
$creadList :: ReadS [ListApplicationComponentsResponse]
readsPrec :: Int -> ReadS ListApplicationComponentsResponse
$creadsPrec :: Int -> ReadS ListApplicationComponentsResponse
Prelude.Read, Int -> ListApplicationComponentsResponse -> ShowS
[ListApplicationComponentsResponse] -> ShowS
ListApplicationComponentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationComponentsResponse] -> ShowS
$cshowList :: [ListApplicationComponentsResponse] -> ShowS
show :: ListApplicationComponentsResponse -> String
$cshow :: ListApplicationComponentsResponse -> String
showsPrec :: Int -> ListApplicationComponentsResponse -> ShowS
$cshowsPrec :: Int -> ListApplicationComponentsResponse -> ShowS
Prelude.Show, forall x.
Rep ListApplicationComponentsResponse x
-> ListApplicationComponentsResponse
forall x.
ListApplicationComponentsResponse
-> Rep ListApplicationComponentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApplicationComponentsResponse x
-> ListApplicationComponentsResponse
$cfrom :: forall x.
ListApplicationComponentsResponse
-> Rep ListApplicationComponentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListApplicationComponentsResponse' 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:
--
-- 'applicationComponentInfos', 'listApplicationComponentsResponse_applicationComponentInfos' - The list of application components with detailed information about each
-- component.
--
-- 'nextToken', 'listApplicationComponentsResponse_nextToken' - The token you use to retrieve the next set of results, or null if there
-- are no more results.
--
-- 'httpStatus', 'listApplicationComponentsResponse_httpStatus' - The response's http status code.
newListApplicationComponentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListApplicationComponentsResponse
newListApplicationComponentsResponse :: Int -> ListApplicationComponentsResponse
newListApplicationComponentsResponse Int
pHttpStatus_ =
  ListApplicationComponentsResponse'
    { $sel:applicationComponentInfos:ListApplicationComponentsResponse' :: Maybe [ApplicationComponentDetail]
applicationComponentInfos =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListApplicationComponentsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListApplicationComponentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of application components with detailed information about each
-- component.
listApplicationComponentsResponse_applicationComponentInfos :: Lens.Lens' ListApplicationComponentsResponse (Prelude.Maybe [ApplicationComponentDetail])
listApplicationComponentsResponse_applicationComponentInfos :: Lens'
  ListApplicationComponentsResponse
  (Maybe [ApplicationComponentDetail])
listApplicationComponentsResponse_applicationComponentInfos = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponentsResponse' {Maybe [ApplicationComponentDetail]
applicationComponentInfos :: Maybe [ApplicationComponentDetail]
$sel:applicationComponentInfos:ListApplicationComponentsResponse' :: ListApplicationComponentsResponse
-> Maybe [ApplicationComponentDetail]
applicationComponentInfos} -> Maybe [ApplicationComponentDetail]
applicationComponentInfos) (\s :: ListApplicationComponentsResponse
s@ListApplicationComponentsResponse' {} Maybe [ApplicationComponentDetail]
a -> ListApplicationComponentsResponse
s {$sel:applicationComponentInfos:ListApplicationComponentsResponse' :: Maybe [ApplicationComponentDetail]
applicationComponentInfos = Maybe [ApplicationComponentDetail]
a} :: ListApplicationComponentsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token you use to retrieve the next set of results, or null if there
-- are no more results.
listApplicationComponentsResponse_nextToken :: Lens.Lens' ListApplicationComponentsResponse (Prelude.Maybe Prelude.Text)
listApplicationComponentsResponse_nextToken :: Lens' ListApplicationComponentsResponse (Maybe Text)
listApplicationComponentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationComponentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApplicationComponentsResponse' :: ListApplicationComponentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApplicationComponentsResponse
s@ListApplicationComponentsResponse' {} Maybe Text
a -> ListApplicationComponentsResponse
s {$sel:nextToken:ListApplicationComponentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListApplicationComponentsResponse)

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

instance
  Prelude.NFData
    ListApplicationComponentsResponse
  where
  rnf :: ListApplicationComponentsResponse -> ()
rnf ListApplicationComponentsResponse' {Int
Maybe [ApplicationComponentDetail]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
applicationComponentInfos :: Maybe [ApplicationComponentDetail]
$sel:httpStatus:ListApplicationComponentsResponse' :: ListApplicationComponentsResponse -> Int
$sel:nextToken:ListApplicationComponentsResponse' :: ListApplicationComponentsResponse -> Maybe Text
$sel:applicationComponentInfos:ListApplicationComponentsResponse' :: ListApplicationComponentsResponse
-> Maybe [ApplicationComponentDetail]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ApplicationComponentDetail]
applicationComponentInfos
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus