{-# 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.SWF.ListActivityTypes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about all activities registered in the specified
-- domain that match the specified name and registration status. The result
-- includes information like creation date, current status of the activity,
-- etc. The results may be split into multiple pages. To retrieve
-- subsequent pages, make the call again using the @nextPageToken@ returned
-- by the initial call.
--
-- __Access Control__
--
-- You can use IAM policies to control this action\'s access to Amazon SWF
-- resources as follows:
--
-- -   Use a @Resource@ element with the domain name to limit the action to
--     only specified domains.
--
-- -   Use an @Action@ element to allow or deny permission to call this
--     action.
--
-- -   You cannot use an IAM policy to constrain this action\'s parameters.
--
-- If the caller doesn\'t have sufficient permissions to invoke the action,
-- or the parameter values fall outside the specified constraints, the
-- action fails. The associated event attribute\'s @cause@ parameter is set
-- to @OPERATION_NOT_PERMITTED@. For details and example IAM policies, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html Using IAM to Manage Access to Amazon SWF Workflows>
-- in the /Amazon SWF Developer Guide/.
--
-- This operation returns paginated results.
module Amazonka.SWF.ListActivityTypes
  ( -- * Creating a Request
    ListActivityTypes (..),
    newListActivityTypes,

    -- * Request Lenses
    listActivityTypes_maximumPageSize,
    listActivityTypes_name,
    listActivityTypes_nextPageToken,
    listActivityTypes_reverseOrder,
    listActivityTypes_domain,
    listActivityTypes_registrationStatus,

    -- * Destructuring the Response
    ListActivityTypesResponse (..),
    newListActivityTypesResponse,

    -- * Response Lenses
    listActivityTypesResponse_nextPageToken,
    listActivityTypesResponse_httpStatus,
    listActivityTypesResponse_typeInfos,
  )
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.SWF.Types

-- | /See:/ 'newListActivityTypes' smart constructor.
data ListActivityTypes = ListActivityTypes'
  { -- | The maximum number of results that are returned per call. Use
    -- @nextPageToken@ to obtain further pages of results.
    ListActivityTypes -> Maybe Natural
maximumPageSize :: Prelude.Maybe Prelude.Natural,
    -- | If specified, only lists the activity types that have this name.
    ListActivityTypes -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | If @NextPageToken@ is returned there are more results available. The
    -- value of @NextPageToken@ is a unique pagination token for each page.
    -- Make the call again using the returned token to retrieve the next page.
    -- Keep all other arguments unchanged. Each pagination token expires after
    -- 60 seconds. Using an expired pagination token will return a @400@ error:
    -- \"@Specified token has exceeded its maximum lifetime@\".
    --
    -- The configured @maximumPageSize@ determines how many results can be
    -- returned in a single call.
    ListActivityTypes -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | When set to @true@, returns the results in reverse order. By default,
    -- the results are returned in ascending alphabetical order by @name@ of
    -- the activity types.
    ListActivityTypes -> Maybe Bool
reverseOrder :: Prelude.Maybe Prelude.Bool,
    -- | The name of the domain in which the activity types have been registered.
    ListActivityTypes -> Text
domain :: Prelude.Text,
    -- | Specifies the registration status of the activity types to list.
    ListActivityTypes -> RegistrationStatus
registrationStatus :: RegistrationStatus
  }
  deriving (ListActivityTypes -> ListActivityTypes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListActivityTypes -> ListActivityTypes -> Bool
$c/= :: ListActivityTypes -> ListActivityTypes -> Bool
== :: ListActivityTypes -> ListActivityTypes -> Bool
$c== :: ListActivityTypes -> ListActivityTypes -> Bool
Prelude.Eq, ReadPrec [ListActivityTypes]
ReadPrec ListActivityTypes
Int -> ReadS ListActivityTypes
ReadS [ListActivityTypes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListActivityTypes]
$creadListPrec :: ReadPrec [ListActivityTypes]
readPrec :: ReadPrec ListActivityTypes
$creadPrec :: ReadPrec ListActivityTypes
readList :: ReadS [ListActivityTypes]
$creadList :: ReadS [ListActivityTypes]
readsPrec :: Int -> ReadS ListActivityTypes
$creadsPrec :: Int -> ReadS ListActivityTypes
Prelude.Read, Int -> ListActivityTypes -> ShowS
[ListActivityTypes] -> ShowS
ListActivityTypes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListActivityTypes] -> ShowS
$cshowList :: [ListActivityTypes] -> ShowS
show :: ListActivityTypes -> String
$cshow :: ListActivityTypes -> String
showsPrec :: Int -> ListActivityTypes -> ShowS
$cshowsPrec :: Int -> ListActivityTypes -> ShowS
Prelude.Show, forall x. Rep ListActivityTypes x -> ListActivityTypes
forall x. ListActivityTypes -> Rep ListActivityTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListActivityTypes x -> ListActivityTypes
$cfrom :: forall x. ListActivityTypes -> Rep ListActivityTypes x
Prelude.Generic)

-- |
-- Create a value of 'ListActivityTypes' 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:
--
-- 'maximumPageSize', 'listActivityTypes_maximumPageSize' - The maximum number of results that are returned per call. Use
-- @nextPageToken@ to obtain further pages of results.
--
-- 'name', 'listActivityTypes_name' - If specified, only lists the activity types that have this name.
--
-- 'nextPageToken', 'listActivityTypes_nextPageToken' - If @NextPageToken@ is returned there are more results available. The
-- value of @NextPageToken@ is a unique pagination token for each page.
-- Make the call again using the returned token to retrieve the next page.
-- Keep all other arguments unchanged. Each pagination token expires after
-- 60 seconds. Using an expired pagination token will return a @400@ error:
-- \"@Specified token has exceeded its maximum lifetime@\".
--
-- The configured @maximumPageSize@ determines how many results can be
-- returned in a single call.
--
-- 'reverseOrder', 'listActivityTypes_reverseOrder' - When set to @true@, returns the results in reverse order. By default,
-- the results are returned in ascending alphabetical order by @name@ of
-- the activity types.
--
-- 'domain', 'listActivityTypes_domain' - The name of the domain in which the activity types have been registered.
--
-- 'registrationStatus', 'listActivityTypes_registrationStatus' - Specifies the registration status of the activity types to list.
newListActivityTypes ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'registrationStatus'
  RegistrationStatus ->
  ListActivityTypes
newListActivityTypes :: Text -> RegistrationStatus -> ListActivityTypes
newListActivityTypes Text
pDomain_ RegistrationStatus
pRegistrationStatus_ =
  ListActivityTypes'
    { $sel:maximumPageSize:ListActivityTypes' :: Maybe Natural
maximumPageSize =
        forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListActivityTypes' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:nextPageToken:ListActivityTypes' :: Maybe Text
nextPageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:reverseOrder:ListActivityTypes' :: Maybe Bool
reverseOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:domain:ListActivityTypes' :: Text
domain = Text
pDomain_,
      $sel:registrationStatus:ListActivityTypes' :: RegistrationStatus
registrationStatus = RegistrationStatus
pRegistrationStatus_
    }

-- | The maximum number of results that are returned per call. Use
-- @nextPageToken@ to obtain further pages of results.
listActivityTypes_maximumPageSize :: Lens.Lens' ListActivityTypes (Prelude.Maybe Prelude.Natural)
listActivityTypes_maximumPageSize :: Lens' ListActivityTypes (Maybe Natural)
listActivityTypes_maximumPageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypes' {Maybe Natural
maximumPageSize :: Maybe Natural
$sel:maximumPageSize:ListActivityTypes' :: ListActivityTypes -> Maybe Natural
maximumPageSize} -> Maybe Natural
maximumPageSize) (\s :: ListActivityTypes
s@ListActivityTypes' {} Maybe Natural
a -> ListActivityTypes
s {$sel:maximumPageSize:ListActivityTypes' :: Maybe Natural
maximumPageSize = Maybe Natural
a} :: ListActivityTypes)

-- | If specified, only lists the activity types that have this name.
listActivityTypes_name :: Lens.Lens' ListActivityTypes (Prelude.Maybe Prelude.Text)
listActivityTypes_name :: Lens' ListActivityTypes (Maybe Text)
listActivityTypes_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypes' {Maybe Text
name :: Maybe Text
$sel:name:ListActivityTypes' :: ListActivityTypes -> Maybe Text
name} -> Maybe Text
name) (\s :: ListActivityTypes
s@ListActivityTypes' {} Maybe Text
a -> ListActivityTypes
s {$sel:name:ListActivityTypes' :: Maybe Text
name = Maybe Text
a} :: ListActivityTypes)

-- | If @NextPageToken@ is returned there are more results available. The
-- value of @NextPageToken@ is a unique pagination token for each page.
-- Make the call again using the returned token to retrieve the next page.
-- Keep all other arguments unchanged. Each pagination token expires after
-- 60 seconds. Using an expired pagination token will return a @400@ error:
-- \"@Specified token has exceeded its maximum lifetime@\".
--
-- The configured @maximumPageSize@ determines how many results can be
-- returned in a single call.
listActivityTypes_nextPageToken :: Lens.Lens' ListActivityTypes (Prelude.Maybe Prelude.Text)
listActivityTypes_nextPageToken :: Lens' ListActivityTypes (Maybe Text)
listActivityTypes_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypes' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListActivityTypes' :: ListActivityTypes -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListActivityTypes
s@ListActivityTypes' {} Maybe Text
a -> ListActivityTypes
s {$sel:nextPageToken:ListActivityTypes' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListActivityTypes)

-- | When set to @true@, returns the results in reverse order. By default,
-- the results are returned in ascending alphabetical order by @name@ of
-- the activity types.
listActivityTypes_reverseOrder :: Lens.Lens' ListActivityTypes (Prelude.Maybe Prelude.Bool)
listActivityTypes_reverseOrder :: Lens' ListActivityTypes (Maybe Bool)
listActivityTypes_reverseOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypes' {Maybe Bool
reverseOrder :: Maybe Bool
$sel:reverseOrder:ListActivityTypes' :: ListActivityTypes -> Maybe Bool
reverseOrder} -> Maybe Bool
reverseOrder) (\s :: ListActivityTypes
s@ListActivityTypes' {} Maybe Bool
a -> ListActivityTypes
s {$sel:reverseOrder:ListActivityTypes' :: Maybe Bool
reverseOrder = Maybe Bool
a} :: ListActivityTypes)

-- | The name of the domain in which the activity types have been registered.
listActivityTypes_domain :: Lens.Lens' ListActivityTypes Prelude.Text
listActivityTypes_domain :: Lens' ListActivityTypes Text
listActivityTypes_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypes' {Text
domain :: Text
$sel:domain:ListActivityTypes' :: ListActivityTypes -> Text
domain} -> Text
domain) (\s :: ListActivityTypes
s@ListActivityTypes' {} Text
a -> ListActivityTypes
s {$sel:domain:ListActivityTypes' :: Text
domain = Text
a} :: ListActivityTypes)

-- | Specifies the registration status of the activity types to list.
listActivityTypes_registrationStatus :: Lens.Lens' ListActivityTypes RegistrationStatus
listActivityTypes_registrationStatus :: Lens' ListActivityTypes RegistrationStatus
listActivityTypes_registrationStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypes' {RegistrationStatus
registrationStatus :: RegistrationStatus
$sel:registrationStatus:ListActivityTypes' :: ListActivityTypes -> RegistrationStatus
registrationStatus} -> RegistrationStatus
registrationStatus) (\s :: ListActivityTypes
s@ListActivityTypes' {} RegistrationStatus
a -> ListActivityTypes
s {$sel:registrationStatus:ListActivityTypes' :: RegistrationStatus
registrationStatus = RegistrationStatus
a} :: ListActivityTypes)

instance Core.AWSPager ListActivityTypes where
  page :: ListActivityTypes
-> AWSResponse ListActivityTypes -> Maybe ListActivityTypes
page ListActivityTypes
rq AWSResponse ListActivityTypes
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListActivityTypes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListActivityTypesResponse (Maybe Text)
listActivityTypesResponse_nextPageToken
            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 ListActivityTypes
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListActivityTypesResponse [ActivityTypeInfo]
listActivityTypesResponse_typeInfos) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListActivityTypes
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListActivityTypes (Maybe Text)
listActivityTypes_nextPageToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListActivityTypes
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListActivityTypesResponse (Maybe Text)
listActivityTypesResponse_nextPageToken
          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 ListActivityTypes where
  type
    AWSResponse ListActivityTypes =
      ListActivityTypesResponse
  request :: (Service -> Service)
-> ListActivityTypes -> Request ListActivityTypes
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 ListActivityTypes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListActivityTypes)))
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 Text
-> Int -> [ActivityTypeInfo] -> ListActivityTypesResponse
ListActivityTypesResponse'
            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
"nextPageToken")
            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))
            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
"typeInfos" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListActivityTypes where
  hashWithSalt :: Int -> ListActivityTypes -> Int
hashWithSalt Int
_salt ListActivityTypes' {Maybe Bool
Maybe Natural
Maybe Text
Text
RegistrationStatus
registrationStatus :: RegistrationStatus
domain :: Text
reverseOrder :: Maybe Bool
nextPageToken :: Maybe Text
name :: Maybe Text
maximumPageSize :: Maybe Natural
$sel:registrationStatus:ListActivityTypes' :: ListActivityTypes -> RegistrationStatus
$sel:domain:ListActivityTypes' :: ListActivityTypes -> Text
$sel:reverseOrder:ListActivityTypes' :: ListActivityTypes -> Maybe Bool
$sel:nextPageToken:ListActivityTypes' :: ListActivityTypes -> Maybe Text
$sel:name:ListActivityTypes' :: ListActivityTypes -> Maybe Text
$sel:maximumPageSize:ListActivityTypes' :: ListActivityTypes -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximumPageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextPageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
reverseOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RegistrationStatus
registrationStatus

instance Prelude.NFData ListActivityTypes where
  rnf :: ListActivityTypes -> ()
rnf ListActivityTypes' {Maybe Bool
Maybe Natural
Maybe Text
Text
RegistrationStatus
registrationStatus :: RegistrationStatus
domain :: Text
reverseOrder :: Maybe Bool
nextPageToken :: Maybe Text
name :: Maybe Text
maximumPageSize :: Maybe Natural
$sel:registrationStatus:ListActivityTypes' :: ListActivityTypes -> RegistrationStatus
$sel:domain:ListActivityTypes' :: ListActivityTypes -> Text
$sel:reverseOrder:ListActivityTypes' :: ListActivityTypes -> Maybe Bool
$sel:nextPageToken:ListActivityTypes' :: ListActivityTypes -> Maybe Text
$sel:name:ListActivityTypes' :: ListActivityTypes -> Maybe Text
$sel:maximumPageSize:ListActivityTypes' :: ListActivityTypes -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maximumPageSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
reverseOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RegistrationStatus
registrationStatus

instance Data.ToHeaders ListActivityTypes where
  toHeaders :: ListActivityTypes -> 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
"SimpleWorkflowService.ListActivityTypes" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListActivityTypes where
  toJSON :: ListActivityTypes -> Value
toJSON ListActivityTypes' {Maybe Bool
Maybe Natural
Maybe Text
Text
RegistrationStatus
registrationStatus :: RegistrationStatus
domain :: Text
reverseOrder :: Maybe Bool
nextPageToken :: Maybe Text
name :: Maybe Text
maximumPageSize :: Maybe Natural
$sel:registrationStatus:ListActivityTypes' :: ListActivityTypes -> RegistrationStatus
$sel:domain:ListActivityTypes' :: ListActivityTypes -> Text
$sel:reverseOrder:ListActivityTypes' :: ListActivityTypes -> Maybe Bool
$sel:nextPageToken:ListActivityTypes' :: ListActivityTypes -> Maybe Text
$sel:name:ListActivityTypes' :: ListActivityTypes -> Maybe Text
$sel:maximumPageSize:ListActivityTypes' :: ListActivityTypes -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"maximumPageSize" 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
maximumPageSize,
            (Key
"name" 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
name,
            (Key
"nextPageToken" 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
nextPageToken,
            (Key
"reverseOrder" 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 Bool
reverseOrder,
            forall a. a -> Maybe a
Prelude.Just (Key
"domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domain),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"registrationStatus" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RegistrationStatus
registrationStatus)
          ]
      )

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

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

-- | Contains a paginated list of activity type information structures.
--
-- /See:/ 'newListActivityTypesResponse' smart constructor.
data ListActivityTypesResponse = ListActivityTypesResponse'
  { -- | If a @NextPageToken@ 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 @nextPageToken@. Keep all other
    -- arguments unchanged.
    --
    -- The configured @maximumPageSize@ determines how many results can be
    -- returned in a single call.
    ListActivityTypesResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListActivityTypesResponse -> Int
httpStatus :: Prelude.Int,
    -- | List of activity type information.
    ListActivityTypesResponse -> [ActivityTypeInfo]
typeInfos :: [ActivityTypeInfo]
  }
  deriving (ListActivityTypesResponse -> ListActivityTypesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListActivityTypesResponse -> ListActivityTypesResponse -> Bool
$c/= :: ListActivityTypesResponse -> ListActivityTypesResponse -> Bool
== :: ListActivityTypesResponse -> ListActivityTypesResponse -> Bool
$c== :: ListActivityTypesResponse -> ListActivityTypesResponse -> Bool
Prelude.Eq, ReadPrec [ListActivityTypesResponse]
ReadPrec ListActivityTypesResponse
Int -> ReadS ListActivityTypesResponse
ReadS [ListActivityTypesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListActivityTypesResponse]
$creadListPrec :: ReadPrec [ListActivityTypesResponse]
readPrec :: ReadPrec ListActivityTypesResponse
$creadPrec :: ReadPrec ListActivityTypesResponse
readList :: ReadS [ListActivityTypesResponse]
$creadList :: ReadS [ListActivityTypesResponse]
readsPrec :: Int -> ReadS ListActivityTypesResponse
$creadsPrec :: Int -> ReadS ListActivityTypesResponse
Prelude.Read, Int -> ListActivityTypesResponse -> ShowS
[ListActivityTypesResponse] -> ShowS
ListActivityTypesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListActivityTypesResponse] -> ShowS
$cshowList :: [ListActivityTypesResponse] -> ShowS
show :: ListActivityTypesResponse -> String
$cshow :: ListActivityTypesResponse -> String
showsPrec :: Int -> ListActivityTypesResponse -> ShowS
$cshowsPrec :: Int -> ListActivityTypesResponse -> ShowS
Prelude.Show, forall x.
Rep ListActivityTypesResponse x -> ListActivityTypesResponse
forall x.
ListActivityTypesResponse -> Rep ListActivityTypesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListActivityTypesResponse x -> ListActivityTypesResponse
$cfrom :: forall x.
ListActivityTypesResponse -> Rep ListActivityTypesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListActivityTypesResponse' 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:
--
-- 'nextPageToken', 'listActivityTypesResponse_nextPageToken' - If a @NextPageToken@ 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 @nextPageToken@. Keep all other
-- arguments unchanged.
--
-- The configured @maximumPageSize@ determines how many results can be
-- returned in a single call.
--
-- 'httpStatus', 'listActivityTypesResponse_httpStatus' - The response's http status code.
--
-- 'typeInfos', 'listActivityTypesResponse_typeInfos' - List of activity type information.
newListActivityTypesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListActivityTypesResponse
newListActivityTypesResponse :: Int -> ListActivityTypesResponse
newListActivityTypesResponse Int
pHttpStatus_ =
  ListActivityTypesResponse'
    { $sel:nextPageToken:ListActivityTypesResponse' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListActivityTypesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:typeInfos:ListActivityTypesResponse' :: [ActivityTypeInfo]
typeInfos = forall a. Monoid a => a
Prelude.mempty
    }

-- | If a @NextPageToken@ 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 @nextPageToken@. Keep all other
-- arguments unchanged.
--
-- The configured @maximumPageSize@ determines how many results can be
-- returned in a single call.
listActivityTypesResponse_nextPageToken :: Lens.Lens' ListActivityTypesResponse (Prelude.Maybe Prelude.Text)
listActivityTypesResponse_nextPageToken :: Lens' ListActivityTypesResponse (Maybe Text)
listActivityTypesResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypesResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListActivityTypesResponse' :: ListActivityTypesResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListActivityTypesResponse
s@ListActivityTypesResponse' {} Maybe Text
a -> ListActivityTypesResponse
s {$sel:nextPageToken:ListActivityTypesResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListActivityTypesResponse)

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

-- | List of activity type information.
listActivityTypesResponse_typeInfos :: Lens.Lens' ListActivityTypesResponse [ActivityTypeInfo]
listActivityTypesResponse_typeInfos :: Lens' ListActivityTypesResponse [ActivityTypeInfo]
listActivityTypesResponse_typeInfos = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListActivityTypesResponse' {[ActivityTypeInfo]
typeInfos :: [ActivityTypeInfo]
$sel:typeInfos:ListActivityTypesResponse' :: ListActivityTypesResponse -> [ActivityTypeInfo]
typeInfos} -> [ActivityTypeInfo]
typeInfos) (\s :: ListActivityTypesResponse
s@ListActivityTypesResponse' {} [ActivityTypeInfo]
a -> ListActivityTypesResponse
s {$sel:typeInfos:ListActivityTypesResponse' :: [ActivityTypeInfo]
typeInfos = [ActivityTypeInfo]
a} :: ListActivityTypesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListActivityTypesResponse where
  rnf :: ListActivityTypesResponse -> ()
rnf ListActivityTypesResponse' {Int
[ActivityTypeInfo]
Maybe Text
typeInfos :: [ActivityTypeInfo]
httpStatus :: Int
nextPageToken :: Maybe Text
$sel:typeInfos:ListActivityTypesResponse' :: ListActivityTypesResponse -> [ActivityTypeInfo]
$sel:httpStatus:ListActivityTypesResponse' :: ListActivityTypesResponse -> Int
$sel:nextPageToken:ListActivityTypesResponse' :: ListActivityTypesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ActivityTypeInfo]
typeInfos