{-# 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.SageMaker.ListApps
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists apps.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListApps
  ( -- * Creating a Request
    ListApps (..),
    newListApps,

    -- * Request Lenses
    listApps_domainIdEquals,
    listApps_maxResults,
    listApps_nextToken,
    listApps_sortBy,
    listApps_sortOrder,
    listApps_spaceNameEquals,
    listApps_userProfileNameEquals,

    -- * Destructuring the Response
    ListAppsResponse (..),
    newListAppsResponse,

    -- * Response Lenses
    listAppsResponse_apps,
    listAppsResponse_nextToken,
    listAppsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListApps' smart constructor.
data ListApps = ListApps'
  { -- | A parameter to search for the domain ID.
    ListApps -> Maybe Text
domainIdEquals :: Prelude.Maybe Prelude.Text,
    -- | Returns a list up to a specified limit.
    ListApps -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous response was truncated, you will receive this token. Use
    -- it in your next request to receive the next set of results.
    ListApps -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The parameter by which to sort the results. The default is CreationTime.
    ListApps -> Maybe AppSortKey
sortBy :: Prelude.Maybe AppSortKey,
    -- | The sort order for the results. The default is Ascending.
    ListApps -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | A parameter to search by space name. If @UserProfileNameEquals@ is set,
    -- then this value cannot be set.
    ListApps -> Maybe Text
spaceNameEquals :: Prelude.Maybe Prelude.Text,
    -- | A parameter to search by user profile name. If @SpaceNameEquals@ is set,
    -- then this value cannot be set.
    ListApps -> Maybe Text
userProfileNameEquals :: Prelude.Maybe Prelude.Text
  }
  deriving (ListApps -> ListApps -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApps -> ListApps -> Bool
$c/= :: ListApps -> ListApps -> Bool
== :: ListApps -> ListApps -> Bool
$c== :: ListApps -> ListApps -> Bool
Prelude.Eq, ReadPrec [ListApps]
ReadPrec ListApps
Int -> ReadS ListApps
ReadS [ListApps]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApps]
$creadListPrec :: ReadPrec [ListApps]
readPrec :: ReadPrec ListApps
$creadPrec :: ReadPrec ListApps
readList :: ReadS [ListApps]
$creadList :: ReadS [ListApps]
readsPrec :: Int -> ReadS ListApps
$creadsPrec :: Int -> ReadS ListApps
Prelude.Read, Int -> ListApps -> ShowS
[ListApps] -> ShowS
ListApps -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApps] -> ShowS
$cshowList :: [ListApps] -> ShowS
show :: ListApps -> String
$cshow :: ListApps -> String
showsPrec :: Int -> ListApps -> ShowS
$cshowsPrec :: Int -> ListApps -> ShowS
Prelude.Show, forall x. Rep ListApps x -> ListApps
forall x. ListApps -> Rep ListApps x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListApps x -> ListApps
$cfrom :: forall x. ListApps -> Rep ListApps x
Prelude.Generic)

-- |
-- Create a value of 'ListApps' 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:
--
-- 'domainIdEquals', 'listApps_domainIdEquals' - A parameter to search for the domain ID.
--
-- 'maxResults', 'listApps_maxResults' - Returns a list up to a specified limit.
--
-- 'nextToken', 'listApps_nextToken' - If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
--
-- 'sortBy', 'listApps_sortBy' - The parameter by which to sort the results. The default is CreationTime.
--
-- 'sortOrder', 'listApps_sortOrder' - The sort order for the results. The default is Ascending.
--
-- 'spaceNameEquals', 'listApps_spaceNameEquals' - A parameter to search by space name. If @UserProfileNameEquals@ is set,
-- then this value cannot be set.
--
-- 'userProfileNameEquals', 'listApps_userProfileNameEquals' - A parameter to search by user profile name. If @SpaceNameEquals@ is set,
-- then this value cannot be set.
newListApps ::
  ListApps
newListApps :: ListApps
newListApps =
  ListApps'
    { $sel:domainIdEquals:ListApps' :: Maybe Text
domainIdEquals = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListApps' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListApps' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListApps' :: Maybe AppSortKey
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListApps' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:spaceNameEquals:ListApps' :: Maybe Text
spaceNameEquals = forall a. Maybe a
Prelude.Nothing,
      $sel:userProfileNameEquals:ListApps' :: Maybe Text
userProfileNameEquals = forall a. Maybe a
Prelude.Nothing
    }

-- | A parameter to search for the domain ID.
listApps_domainIdEquals :: Lens.Lens' ListApps (Prelude.Maybe Prelude.Text)
listApps_domainIdEquals :: Lens' ListApps (Maybe Text)
listApps_domainIdEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe Text
domainIdEquals :: Maybe Text
$sel:domainIdEquals:ListApps' :: ListApps -> Maybe Text
domainIdEquals} -> Maybe Text
domainIdEquals) (\s :: ListApps
s@ListApps' {} Maybe Text
a -> ListApps
s {$sel:domainIdEquals:ListApps' :: Maybe Text
domainIdEquals = Maybe Text
a} :: ListApps)

-- | Returns a list up to a specified limit.
listApps_maxResults :: Lens.Lens' ListApps (Prelude.Maybe Prelude.Natural)
listApps_maxResults :: Lens' ListApps (Maybe Natural)
listApps_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListApps' :: ListApps -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListApps
s@ListApps' {} Maybe Natural
a -> ListApps
s {$sel:maxResults:ListApps' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListApps)

-- | If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
listApps_nextToken :: Lens.Lens' ListApps (Prelude.Maybe Prelude.Text)
listApps_nextToken :: Lens' ListApps (Maybe Text)
listApps_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListApps' :: ListApps -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListApps
s@ListApps' {} Maybe Text
a -> ListApps
s {$sel:nextToken:ListApps' :: Maybe Text
nextToken = Maybe Text
a} :: ListApps)

-- | The parameter by which to sort the results. The default is CreationTime.
listApps_sortBy :: Lens.Lens' ListApps (Prelude.Maybe AppSortKey)
listApps_sortBy :: Lens' ListApps (Maybe AppSortKey)
listApps_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe AppSortKey
sortBy :: Maybe AppSortKey
$sel:sortBy:ListApps' :: ListApps -> Maybe AppSortKey
sortBy} -> Maybe AppSortKey
sortBy) (\s :: ListApps
s@ListApps' {} Maybe AppSortKey
a -> ListApps
s {$sel:sortBy:ListApps' :: Maybe AppSortKey
sortBy = Maybe AppSortKey
a} :: ListApps)

-- | The sort order for the results. The default is Ascending.
listApps_sortOrder :: Lens.Lens' ListApps (Prelude.Maybe SortOrder)
listApps_sortOrder :: Lens' ListApps (Maybe SortOrder)
listApps_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListApps' :: ListApps -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListApps
s@ListApps' {} Maybe SortOrder
a -> ListApps
s {$sel:sortOrder:ListApps' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListApps)

-- | A parameter to search by space name. If @UserProfileNameEquals@ is set,
-- then this value cannot be set.
listApps_spaceNameEquals :: Lens.Lens' ListApps (Prelude.Maybe Prelude.Text)
listApps_spaceNameEquals :: Lens' ListApps (Maybe Text)
listApps_spaceNameEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe Text
spaceNameEquals :: Maybe Text
$sel:spaceNameEquals:ListApps' :: ListApps -> Maybe Text
spaceNameEquals} -> Maybe Text
spaceNameEquals) (\s :: ListApps
s@ListApps' {} Maybe Text
a -> ListApps
s {$sel:spaceNameEquals:ListApps' :: Maybe Text
spaceNameEquals = Maybe Text
a} :: ListApps)

-- | A parameter to search by user profile name. If @SpaceNameEquals@ is set,
-- then this value cannot be set.
listApps_userProfileNameEquals :: Lens.Lens' ListApps (Prelude.Maybe Prelude.Text)
listApps_userProfileNameEquals :: Lens' ListApps (Maybe Text)
listApps_userProfileNameEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApps' {Maybe Text
userProfileNameEquals :: Maybe Text
$sel:userProfileNameEquals:ListApps' :: ListApps -> Maybe Text
userProfileNameEquals} -> Maybe Text
userProfileNameEquals) (\s :: ListApps
s@ListApps' {} Maybe Text
a -> ListApps
s {$sel:userProfileNameEquals:ListApps' :: Maybe Text
userProfileNameEquals = Maybe Text
a} :: ListApps)

instance Core.AWSPager ListApps where
  page :: ListApps -> AWSResponse ListApps -> Maybe ListApps
page ListApps
rq AWSResponse ListApps
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListApps
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAppsResponse (Maybe Text)
listAppsResponse_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 ListApps
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAppsResponse (Maybe [AppDetails])
listAppsResponse_apps
            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.$ ListApps
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListApps (Maybe Text)
listApps_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListApps
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAppsResponse (Maybe Text)
listAppsResponse_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 ListApps where
  type AWSResponse ListApps = ListAppsResponse
  request :: (Service -> Service) -> ListApps -> Request ListApps
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 ListApps
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListApps)))
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 [AppDetails] -> Maybe Text -> Int -> ListAppsResponse
ListAppsResponse'
            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
"Apps" 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 ListApps where
  hashWithSalt :: Int -> ListApps -> Int
hashWithSalt Int
_salt ListApps' {Maybe Natural
Maybe Text
Maybe AppSortKey
Maybe SortOrder
userProfileNameEquals :: Maybe Text
spaceNameEquals :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe AppSortKey
nextToken :: Maybe Text
maxResults :: Maybe Natural
domainIdEquals :: Maybe Text
$sel:userProfileNameEquals:ListApps' :: ListApps -> Maybe Text
$sel:spaceNameEquals:ListApps' :: ListApps -> Maybe Text
$sel:sortOrder:ListApps' :: ListApps -> Maybe SortOrder
$sel:sortBy:ListApps' :: ListApps -> Maybe AppSortKey
$sel:nextToken:ListApps' :: ListApps -> Maybe Text
$sel:maxResults:ListApps' :: ListApps -> Maybe Natural
$sel:domainIdEquals:ListApps' :: ListApps -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainIdEquals
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppSortKey
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
spaceNameEquals
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userProfileNameEquals

instance Prelude.NFData ListApps where
  rnf :: ListApps -> ()
rnf ListApps' {Maybe Natural
Maybe Text
Maybe AppSortKey
Maybe SortOrder
userProfileNameEquals :: Maybe Text
spaceNameEquals :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe AppSortKey
nextToken :: Maybe Text
maxResults :: Maybe Natural
domainIdEquals :: Maybe Text
$sel:userProfileNameEquals:ListApps' :: ListApps -> Maybe Text
$sel:spaceNameEquals:ListApps' :: ListApps -> Maybe Text
$sel:sortOrder:ListApps' :: ListApps -> Maybe SortOrder
$sel:sortBy:ListApps' :: ListApps -> Maybe AppSortKey
$sel:nextToken:ListApps' :: ListApps -> Maybe Text
$sel:maxResults:ListApps' :: ListApps -> Maybe Natural
$sel:domainIdEquals:ListApps' :: ListApps -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainIdEquals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
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 AppSortKey
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sortOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
spaceNameEquals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userProfileNameEquals

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

instance Data.ToJSON ListApps where
  toJSON :: ListApps -> Value
toJSON ListApps' {Maybe Natural
Maybe Text
Maybe AppSortKey
Maybe SortOrder
userProfileNameEquals :: Maybe Text
spaceNameEquals :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe AppSortKey
nextToken :: Maybe Text
maxResults :: Maybe Natural
domainIdEquals :: Maybe Text
$sel:userProfileNameEquals:ListApps' :: ListApps -> Maybe Text
$sel:spaceNameEquals:ListApps' :: ListApps -> Maybe Text
$sel:sortOrder:ListApps' :: ListApps -> Maybe SortOrder
$sel:sortBy:ListApps' :: ListApps -> Maybe AppSortKey
$sel:nextToken:ListApps' :: ListApps -> Maybe Text
$sel:maxResults:ListApps' :: ListApps -> Maybe Natural
$sel:domainIdEquals:ListApps' :: ListApps -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DomainIdEquals" 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
domainIdEquals,
            (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 Natural
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
"SortBy" 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 AppSortKey
sortBy,
            (Key
"SortOrder" 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
sortOrder,
            (Key
"SpaceNameEquals" 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
spaceNameEquals,
            (Key
"UserProfileNameEquals" 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
userProfileNameEquals
          ]
      )

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

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

-- | /See:/ 'newListAppsResponse' smart constructor.
data ListAppsResponse = ListAppsResponse'
  { -- | The list of apps.
    ListAppsResponse -> Maybe [AppDetails]
apps :: Prelude.Maybe [AppDetails],
    -- | If the previous response was truncated, you will receive this token. Use
    -- it in your next request to receive the next set of results.
    ListAppsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAppsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAppsResponse -> ListAppsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppsResponse -> ListAppsResponse -> Bool
$c/= :: ListAppsResponse -> ListAppsResponse -> Bool
== :: ListAppsResponse -> ListAppsResponse -> Bool
$c== :: ListAppsResponse -> ListAppsResponse -> Bool
Prelude.Eq, ReadPrec [ListAppsResponse]
ReadPrec ListAppsResponse
Int -> ReadS ListAppsResponse
ReadS [ListAppsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppsResponse]
$creadListPrec :: ReadPrec [ListAppsResponse]
readPrec :: ReadPrec ListAppsResponse
$creadPrec :: ReadPrec ListAppsResponse
readList :: ReadS [ListAppsResponse]
$creadList :: ReadS [ListAppsResponse]
readsPrec :: Int -> ReadS ListAppsResponse
$creadsPrec :: Int -> ReadS ListAppsResponse
Prelude.Read, Int -> ListAppsResponse -> ShowS
[ListAppsResponse] -> ShowS
ListAppsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppsResponse] -> ShowS
$cshowList :: [ListAppsResponse] -> ShowS
show :: ListAppsResponse -> String
$cshow :: ListAppsResponse -> String
showsPrec :: Int -> ListAppsResponse -> ShowS
$cshowsPrec :: Int -> ListAppsResponse -> ShowS
Prelude.Show, forall x. Rep ListAppsResponse x -> ListAppsResponse
forall x. ListAppsResponse -> Rep ListAppsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppsResponse x -> ListAppsResponse
$cfrom :: forall x. ListAppsResponse -> Rep ListAppsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAppsResponse' 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:
--
-- 'apps', 'listAppsResponse_apps' - The list of apps.
--
-- 'nextToken', 'listAppsResponse_nextToken' - If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
--
-- 'httpStatus', 'listAppsResponse_httpStatus' - The response's http status code.
newListAppsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAppsResponse
newListAppsResponse :: Int -> ListAppsResponse
newListAppsResponse Int
pHttpStatus_ =
  ListAppsResponse'
    { $sel:apps:ListAppsResponse' :: Maybe [AppDetails]
apps = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAppsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAppsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of apps.
listAppsResponse_apps :: Lens.Lens' ListAppsResponse (Prelude.Maybe [AppDetails])
listAppsResponse_apps :: Lens' ListAppsResponse (Maybe [AppDetails])
listAppsResponse_apps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsResponse' {Maybe [AppDetails]
apps :: Maybe [AppDetails]
$sel:apps:ListAppsResponse' :: ListAppsResponse -> Maybe [AppDetails]
apps} -> Maybe [AppDetails]
apps) (\s :: ListAppsResponse
s@ListAppsResponse' {} Maybe [AppDetails]
a -> ListAppsResponse
s {$sel:apps:ListAppsResponse' :: Maybe [AppDetails]
apps = Maybe [AppDetails]
a} :: ListAppsResponse) 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

-- | If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
listAppsResponse_nextToken :: Lens.Lens' ListAppsResponse (Prelude.Maybe Prelude.Text)
listAppsResponse_nextToken :: Lens' ListAppsResponse (Maybe Text)
listAppsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppsResponse' :: ListAppsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppsResponse
s@ListAppsResponse' {} Maybe Text
a -> ListAppsResponse
s {$sel:nextToken:ListAppsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppsResponse)

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

instance Prelude.NFData ListAppsResponse where
  rnf :: ListAppsResponse -> ()
rnf ListAppsResponse' {Int
Maybe [AppDetails]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
apps :: Maybe [AppDetails]
$sel:httpStatus:ListAppsResponse' :: ListAppsResponse -> Int
$sel:nextToken:ListAppsResponse' :: ListAppsResponse -> Maybe Text
$sel:apps:ListAppsResponse' :: ListAppsResponse -> Maybe [AppDetails]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AppDetails]
apps
      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