{-# 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.CloudFormation.ListTypes
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns summary information about extension that have been registered
-- with CloudFormation.
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListTypes
  ( -- * Creating a Request
    ListTypes (..),
    newListTypes,

    -- * Request Lenses
    listTypes_filters,
    listTypes_visibility,
    listTypes_nextToken,
    listTypes_deprecatedStatus,
    listTypes_type,
    listTypes_maxResults,
    listTypes_provisioningType,

    -- * Destructuring the Response
    ListTypesResponse (..),
    newListTypesResponse,

    -- * Response Lenses
    listTypesResponse_typeSummaries,
    listTypesResponse_nextToken,
    listTypesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListTypes' smart constructor.
data ListTypes = ListTypes'
  { -- | Filter criteria to use in determining which extensions to return.
    --
    -- If you specify a filter, CloudFormation ignores any specified
    -- @Visibility@ value when returning the list of types.
    ListTypes -> Maybe TypeFilters
filters :: Prelude.Maybe TypeFilters,
    -- | The scope at which the extensions are visible and usable in
    -- CloudFormation operations.
    --
    -- Valid values include:
    --
    -- -   @PRIVATE@: Extensions that are visible and usable within this
    --     account and region. This includes:
    --
    --     -   Private extensions you have registered in this account and
    --         region.
    --
    --     -   Public extensions that you have activated in this account and
    --         region.
    --
    -- -   @PUBLIC@: Extensions that are publicly visible and available to be
    --     activated within any Amazon account. This includes extensions from
    --     Amazon, as well as third-party publishers.
    --
    -- The default is @PRIVATE@.
    ListTypes -> Maybe Visibility
visibility :: Prelude.Maybe Visibility,
    -- | If the previous paginated request didn\'t return all of the remaining
    -- results, the response object\'s @NextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call this action again and
    -- assign that token to the request object\'s @NextToken@ parameter. If
    -- there are no remaining results, the previous response object\'s
    -- @NextToken@ parameter is set to @null@.
    ListTypes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The deprecation status of the extension that you want to get summary
    -- information about.
    --
    -- Valid values include:
    --
    -- -   @LIVE@: The extension is registered for use in CloudFormation
    --     operations.
    --
    -- -   @DEPRECATED@: The extension has been deregistered and can no longer
    --     be used in CloudFormation operations.
    ListTypes -> Maybe DeprecatedStatus
deprecatedStatus :: Prelude.Maybe DeprecatedStatus,
    -- | The type of extension.
    ListTypes -> Maybe RegistryType
type' :: Prelude.Maybe RegistryType,
    -- | The maximum number of results to be returned with a single call. If the
    -- number of available results exceeds this maximum, the response includes
    -- a @NextToken@ value that you can assign to the @NextToken@ request
    -- parameter to get the next set of results.
    ListTypes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | For resource types, the provisioning behavior of the resource type.
    -- CloudFormation determines the provisioning type during registration,
    -- based on the types of handlers in the schema handler package submitted.
    --
    -- Valid values include:
    --
    -- -   @FULLY_MUTABLE@: The resource type includes an update handler to
    --     process updates to the type during stack update operations.
    --
    -- -   @IMMUTABLE@: The resource type does not include an update handler,
    --     so the type cannot be updated and must instead be replaced during
    --     stack update operations.
    --
    -- -   @NON_PROVISIONABLE@: The resource type does not include create,
    --     read, and delete handlers, and therefore cannot actually be
    --     provisioned.
    --
    -- The default is @FULLY_MUTABLE@.
    ListTypes -> Maybe ProvisioningType
provisioningType :: Prelude.Maybe ProvisioningType
  }
  deriving (ListTypes -> ListTypes -> Bool
(ListTypes -> ListTypes -> Bool)
-> (ListTypes -> ListTypes -> Bool) -> Eq ListTypes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTypes -> ListTypes -> Bool
$c/= :: ListTypes -> ListTypes -> Bool
== :: ListTypes -> ListTypes -> Bool
$c== :: ListTypes -> ListTypes -> Bool
Prelude.Eq, ReadPrec [ListTypes]
ReadPrec ListTypes
Int -> ReadS ListTypes
ReadS [ListTypes]
(Int -> ReadS ListTypes)
-> ReadS [ListTypes]
-> ReadPrec ListTypes
-> ReadPrec [ListTypes]
-> Read ListTypes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTypes]
$creadListPrec :: ReadPrec [ListTypes]
readPrec :: ReadPrec ListTypes
$creadPrec :: ReadPrec ListTypes
readList :: ReadS [ListTypes]
$creadList :: ReadS [ListTypes]
readsPrec :: Int -> ReadS ListTypes
$creadsPrec :: Int -> ReadS ListTypes
Prelude.Read, Int -> ListTypes -> ShowS
[ListTypes] -> ShowS
ListTypes -> String
(Int -> ListTypes -> ShowS)
-> (ListTypes -> String)
-> ([ListTypes] -> ShowS)
-> Show ListTypes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTypes] -> ShowS
$cshowList :: [ListTypes] -> ShowS
show :: ListTypes -> String
$cshow :: ListTypes -> String
showsPrec :: Int -> ListTypes -> ShowS
$cshowsPrec :: Int -> ListTypes -> ShowS
Prelude.Show, (forall x. ListTypes -> Rep ListTypes x)
-> (forall x. Rep ListTypes x -> ListTypes) -> Generic ListTypes
forall x. Rep ListTypes x -> ListTypes
forall x. ListTypes -> Rep ListTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTypes x -> ListTypes
$cfrom :: forall x. ListTypes -> Rep ListTypes x
Prelude.Generic)

-- |
-- Create a value of 'ListTypes' 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:
--
-- 'filters', 'listTypes_filters' - Filter criteria to use in determining which extensions to return.
--
-- If you specify a filter, CloudFormation ignores any specified
-- @Visibility@ value when returning the list of types.
--
-- 'visibility', 'listTypes_visibility' - The scope at which the extensions are visible and usable in
-- CloudFormation operations.
--
-- Valid values include:
--
-- -   @PRIVATE@: Extensions that are visible and usable within this
--     account and region. This includes:
--
--     -   Private extensions you have registered in this account and
--         region.
--
--     -   Public extensions that you have activated in this account and
--         region.
--
-- -   @PUBLIC@: Extensions that are publicly visible and available to be
--     activated within any Amazon account. This includes extensions from
--     Amazon, as well as third-party publishers.
--
-- The default is @PRIVATE@.
--
-- 'nextToken', 'listTypes_nextToken' - If the previous paginated request didn\'t return all of the remaining
-- results, the response object\'s @NextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call this action again and
-- assign that token to the request object\'s @NextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- @NextToken@ parameter is set to @null@.
--
-- 'deprecatedStatus', 'listTypes_deprecatedStatus' - The deprecation status of the extension that you want to get summary
-- information about.
--
-- Valid values include:
--
-- -   @LIVE@: The extension is registered for use in CloudFormation
--     operations.
--
-- -   @DEPRECATED@: The extension has been deregistered and can no longer
--     be used in CloudFormation operations.
--
-- 'type'', 'listTypes_type' - The type of extension.
--
-- 'maxResults', 'listTypes_maxResults' - The maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
--
-- 'provisioningType', 'listTypes_provisioningType' - For resource types, the provisioning behavior of the resource type.
-- CloudFormation determines the provisioning type during registration,
-- based on the types of handlers in the schema handler package submitted.
--
-- Valid values include:
--
-- -   @FULLY_MUTABLE@: The resource type includes an update handler to
--     process updates to the type during stack update operations.
--
-- -   @IMMUTABLE@: The resource type does not include an update handler,
--     so the type cannot be updated and must instead be replaced during
--     stack update operations.
--
-- -   @NON_PROVISIONABLE@: The resource type does not include create,
--     read, and delete handlers, and therefore cannot actually be
--     provisioned.
--
-- The default is @FULLY_MUTABLE@.
newListTypes ::
  ListTypes
newListTypes :: ListTypes
newListTypes =
  ListTypes' :: Maybe TypeFilters
-> Maybe Visibility
-> Maybe Text
-> Maybe DeprecatedStatus
-> Maybe RegistryType
-> Maybe Natural
-> Maybe ProvisioningType
-> ListTypes
ListTypes'
    { $sel:filters:ListTypes' :: Maybe TypeFilters
filters = Maybe TypeFilters
forall a. Maybe a
Prelude.Nothing,
      $sel:visibility:ListTypes' :: Maybe Visibility
visibility = Maybe Visibility
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTypes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deprecatedStatus:ListTypes' :: Maybe DeprecatedStatus
deprecatedStatus = Maybe DeprecatedStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ListTypes' :: Maybe RegistryType
type' = Maybe RegistryType
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTypes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningType:ListTypes' :: Maybe ProvisioningType
provisioningType = Maybe ProvisioningType
forall a. Maybe a
Prelude.Nothing
    }

-- | Filter criteria to use in determining which extensions to return.
--
-- If you specify a filter, CloudFormation ignores any specified
-- @Visibility@ value when returning the list of types.
listTypes_filters :: Lens.Lens' ListTypes (Prelude.Maybe TypeFilters)
listTypes_filters :: (Maybe TypeFilters -> f (Maybe TypeFilters))
-> ListTypes -> f ListTypes
listTypes_filters = (ListTypes -> Maybe TypeFilters)
-> (ListTypes -> Maybe TypeFilters -> ListTypes)
-> Lens ListTypes ListTypes (Maybe TypeFilters) (Maybe TypeFilters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe TypeFilters
filters :: Maybe TypeFilters
$sel:filters:ListTypes' :: ListTypes -> Maybe TypeFilters
filters} -> Maybe TypeFilters
filters) (\s :: ListTypes
s@ListTypes' {} Maybe TypeFilters
a -> ListTypes
s {$sel:filters:ListTypes' :: Maybe TypeFilters
filters = Maybe TypeFilters
a} :: ListTypes)

-- | The scope at which the extensions are visible and usable in
-- CloudFormation operations.
--
-- Valid values include:
--
-- -   @PRIVATE@: Extensions that are visible and usable within this
--     account and region. This includes:
--
--     -   Private extensions you have registered in this account and
--         region.
--
--     -   Public extensions that you have activated in this account and
--         region.
--
-- -   @PUBLIC@: Extensions that are publicly visible and available to be
--     activated within any Amazon account. This includes extensions from
--     Amazon, as well as third-party publishers.
--
-- The default is @PRIVATE@.
listTypes_visibility :: Lens.Lens' ListTypes (Prelude.Maybe Visibility)
listTypes_visibility :: (Maybe Visibility -> f (Maybe Visibility))
-> ListTypes -> f ListTypes
listTypes_visibility = (ListTypes -> Maybe Visibility)
-> (ListTypes -> Maybe Visibility -> ListTypes)
-> Lens ListTypes ListTypes (Maybe Visibility) (Maybe Visibility)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe Visibility
visibility :: Maybe Visibility
$sel:visibility:ListTypes' :: ListTypes -> Maybe Visibility
visibility} -> Maybe Visibility
visibility) (\s :: ListTypes
s@ListTypes' {} Maybe Visibility
a -> ListTypes
s {$sel:visibility:ListTypes' :: Maybe Visibility
visibility = Maybe Visibility
a} :: ListTypes)

-- | If the previous paginated request didn\'t return all of the remaining
-- results, the response object\'s @NextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call this action again and
-- assign that token to the request object\'s @NextToken@ parameter. If
-- there are no remaining results, the previous response object\'s
-- @NextToken@ parameter is set to @null@.
listTypes_nextToken :: Lens.Lens' ListTypes (Prelude.Maybe Prelude.Text)
listTypes_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListTypes -> f ListTypes
listTypes_nextToken = (ListTypes -> Maybe Text)
-> (ListTypes -> Maybe Text -> ListTypes)
-> Lens ListTypes ListTypes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTypes' :: ListTypes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTypes
s@ListTypes' {} Maybe Text
a -> ListTypes
s {$sel:nextToken:ListTypes' :: Maybe Text
nextToken = Maybe Text
a} :: ListTypes)

-- | The deprecation status of the extension that you want to get summary
-- information about.
--
-- Valid values include:
--
-- -   @LIVE@: The extension is registered for use in CloudFormation
--     operations.
--
-- -   @DEPRECATED@: The extension has been deregistered and can no longer
--     be used in CloudFormation operations.
listTypes_deprecatedStatus :: Lens.Lens' ListTypes (Prelude.Maybe DeprecatedStatus)
listTypes_deprecatedStatus :: (Maybe DeprecatedStatus -> f (Maybe DeprecatedStatus))
-> ListTypes -> f ListTypes
listTypes_deprecatedStatus = (ListTypes -> Maybe DeprecatedStatus)
-> (ListTypes -> Maybe DeprecatedStatus -> ListTypes)
-> Lens
     ListTypes
     ListTypes
     (Maybe DeprecatedStatus)
     (Maybe DeprecatedStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe DeprecatedStatus
deprecatedStatus :: Maybe DeprecatedStatus
$sel:deprecatedStatus:ListTypes' :: ListTypes -> Maybe DeprecatedStatus
deprecatedStatus} -> Maybe DeprecatedStatus
deprecatedStatus) (\s :: ListTypes
s@ListTypes' {} Maybe DeprecatedStatus
a -> ListTypes
s {$sel:deprecatedStatus:ListTypes' :: Maybe DeprecatedStatus
deprecatedStatus = Maybe DeprecatedStatus
a} :: ListTypes)

-- | The type of extension.
listTypes_type :: Lens.Lens' ListTypes (Prelude.Maybe RegistryType)
listTypes_type :: (Maybe RegistryType -> f (Maybe RegistryType))
-> ListTypes -> f ListTypes
listTypes_type = (ListTypes -> Maybe RegistryType)
-> (ListTypes -> Maybe RegistryType -> ListTypes)
-> Lens
     ListTypes ListTypes (Maybe RegistryType) (Maybe RegistryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe RegistryType
type' :: Maybe RegistryType
$sel:type':ListTypes' :: ListTypes -> Maybe RegistryType
type'} -> Maybe RegistryType
type') (\s :: ListTypes
s@ListTypes' {} Maybe RegistryType
a -> ListTypes
s {$sel:type':ListTypes' :: Maybe RegistryType
type' = Maybe RegistryType
a} :: ListTypes)

-- | The maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
listTypes_maxResults :: Lens.Lens' ListTypes (Prelude.Maybe Prelude.Natural)
listTypes_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListTypes -> f ListTypes
listTypes_maxResults = (ListTypes -> Maybe Natural)
-> (ListTypes -> Maybe Natural -> ListTypes)
-> Lens ListTypes ListTypes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTypes' :: ListTypes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTypes
s@ListTypes' {} Maybe Natural
a -> ListTypes
s {$sel:maxResults:ListTypes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTypes)

-- | For resource types, the provisioning behavior of the resource type.
-- CloudFormation determines the provisioning type during registration,
-- based on the types of handlers in the schema handler package submitted.
--
-- Valid values include:
--
-- -   @FULLY_MUTABLE@: The resource type includes an update handler to
--     process updates to the type during stack update operations.
--
-- -   @IMMUTABLE@: The resource type does not include an update handler,
--     so the type cannot be updated and must instead be replaced during
--     stack update operations.
--
-- -   @NON_PROVISIONABLE@: The resource type does not include create,
--     read, and delete handlers, and therefore cannot actually be
--     provisioned.
--
-- The default is @FULLY_MUTABLE@.
listTypes_provisioningType :: Lens.Lens' ListTypes (Prelude.Maybe ProvisioningType)
listTypes_provisioningType :: (Maybe ProvisioningType -> f (Maybe ProvisioningType))
-> ListTypes -> f ListTypes
listTypes_provisioningType = (ListTypes -> Maybe ProvisioningType)
-> (ListTypes -> Maybe ProvisioningType -> ListTypes)
-> Lens
     ListTypes
     ListTypes
     (Maybe ProvisioningType)
     (Maybe ProvisioningType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypes' {Maybe ProvisioningType
provisioningType :: Maybe ProvisioningType
$sel:provisioningType:ListTypes' :: ListTypes -> Maybe ProvisioningType
provisioningType} -> Maybe ProvisioningType
provisioningType) (\s :: ListTypes
s@ListTypes' {} Maybe ProvisioningType
a -> ListTypes
s {$sel:provisioningType:ListTypes' :: Maybe ProvisioningType
provisioningType = Maybe ProvisioningType
a} :: ListTypes)

instance Core.AWSPager ListTypes where
  page :: ListTypes -> AWSResponse ListTypes -> Maybe ListTypes
page ListTypes
rq AWSResponse ListTypes
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTypes
ListTypesResponse
rs
            ListTypesResponse
-> Getting (First Text) ListTypesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTypesResponse -> Const (First Text) ListTypesResponse
Lens' ListTypesResponse (Maybe Text)
listTypesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTypesResponse -> Const (First Text) ListTypesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTypesResponse 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 ListTypes
forall a. Maybe a
Prelude.Nothing
    | Maybe [TypeSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTypes
ListTypesResponse
rs
            ListTypesResponse
-> Getting (First [TypeSummary]) ListTypesResponse [TypeSummary]
-> Maybe [TypeSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [TypeSummary]
 -> Const (First [TypeSummary]) (Maybe [TypeSummary]))
-> ListTypesResponse
-> Const (First [TypeSummary]) ListTypesResponse
Lens' ListTypesResponse (Maybe [TypeSummary])
listTypesResponse_typeSummaries ((Maybe [TypeSummary]
  -> Const (First [TypeSummary]) (Maybe [TypeSummary]))
 -> ListTypesResponse
 -> Const (First [TypeSummary]) ListTypesResponse)
-> (([TypeSummary] -> Const (First [TypeSummary]) [TypeSummary])
    -> Maybe [TypeSummary]
    -> Const (First [TypeSummary]) (Maybe [TypeSummary]))
-> Getting (First [TypeSummary]) ListTypesResponse [TypeSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TypeSummary] -> Const (First [TypeSummary]) [TypeSummary])
-> Maybe [TypeSummary]
-> Const (First [TypeSummary]) (Maybe [TypeSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTypes
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTypes -> Maybe ListTypes
forall a. a -> Maybe a
Prelude.Just (ListTypes -> Maybe ListTypes) -> ListTypes -> Maybe ListTypes
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTypes
rq
          ListTypes -> (ListTypes -> ListTypes) -> ListTypes
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTypes -> Identity ListTypes
Lens ListTypes ListTypes (Maybe Text) (Maybe Text)
listTypes_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTypes -> Identity ListTypes)
-> Maybe Text -> ListTypes -> ListTypes
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTypes
ListTypesResponse
rs
          ListTypesResponse
-> Getting (First Text) ListTypesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTypesResponse -> Const (First Text) ListTypesResponse
Lens' ListTypesResponse (Maybe Text)
listTypesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTypesResponse -> Const (First Text) ListTypesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTypesResponse 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 ListTypes where
  type AWSResponse ListTypes = ListTypesResponse
  request :: ListTypes -> Request ListTypes
request = Service -> ListTypes -> Request ListTypes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTypes)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListTypes))
-> Logger
-> Service
-> Proxy ListTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTypes)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListTypesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [TypeSummary] -> Maybe Text -> Int -> ListTypesResponse
ListTypesResponse'
            (Maybe [TypeSummary] -> Maybe Text -> Int -> ListTypesResponse)
-> Either String (Maybe [TypeSummary])
-> Either String (Maybe Text -> Int -> ListTypesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TypeSummaries" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [TypeSummary]))
-> Either String (Maybe [TypeSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [TypeSummary])
-> [Node] -> Either String (Maybe [TypeSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [TypeSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Maybe Text -> Int -> ListTypesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListTypesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either String (Int -> ListTypesResponse)
-> Either String Int -> Either String ListTypesResponse
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 ListTypes

instance Prelude.NFData ListTypes

instance Core.ToHeaders ListTypes where
  toHeaders :: ListTypes -> ResponseHeaders
toHeaders = ResponseHeaders -> ListTypes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListTypes where
  toQuery :: ListTypes -> QueryString
toQuery ListTypes' {Maybe Natural
Maybe Text
Maybe DeprecatedStatus
Maybe ProvisioningType
Maybe RegistryType
Maybe TypeFilters
Maybe Visibility
provisioningType :: Maybe ProvisioningType
maxResults :: Maybe Natural
type' :: Maybe RegistryType
deprecatedStatus :: Maybe DeprecatedStatus
nextToken :: Maybe Text
visibility :: Maybe Visibility
filters :: Maybe TypeFilters
$sel:provisioningType:ListTypes' :: ListTypes -> Maybe ProvisioningType
$sel:maxResults:ListTypes' :: ListTypes -> Maybe Natural
$sel:type':ListTypes' :: ListTypes -> Maybe RegistryType
$sel:deprecatedStatus:ListTypes' :: ListTypes -> Maybe DeprecatedStatus
$sel:nextToken:ListTypes' :: ListTypes -> Maybe Text
$sel:visibility:ListTypes' :: ListTypes -> Maybe Visibility
$sel:filters:ListTypes' :: ListTypes -> Maybe TypeFilters
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListTypes" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"Filters" ByteString -> Maybe TypeFilters -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TypeFilters
filters,
        ByteString
"Visibility" ByteString -> Maybe Visibility -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Visibility
visibility,
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"DeprecatedStatus" ByteString -> Maybe DeprecatedStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe DeprecatedStatus
deprecatedStatus,
        ByteString
"Type" ByteString -> Maybe RegistryType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RegistryType
type',
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"ProvisioningType" ByteString -> Maybe ProvisioningType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ProvisioningType
provisioningType
      ]

-- | /See:/ 'newListTypesResponse' smart constructor.
data ListTypesResponse = ListTypesResponse'
  { -- | A list of @TypeSummary@ structures that contain information about the
    -- specified extensions.
    ListTypesResponse -> Maybe [TypeSummary]
typeSummaries :: Prelude.Maybe [TypeSummary],
    -- | If the request doesn\'t return all of the remaining results, @NextToken@
    -- is set to a token. To retrieve the next set of results, call this action
    -- again and assign that token to the request object\'s @NextToken@
    -- parameter. If the request returns all results, @NextToken@ is set to
    -- @null@.
    ListTypesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListTypesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTypesResponse -> ListTypesResponse -> Bool
(ListTypesResponse -> ListTypesResponse -> Bool)
-> (ListTypesResponse -> ListTypesResponse -> Bool)
-> Eq ListTypesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTypesResponse -> ListTypesResponse -> Bool
$c/= :: ListTypesResponse -> ListTypesResponse -> Bool
== :: ListTypesResponse -> ListTypesResponse -> Bool
$c== :: ListTypesResponse -> ListTypesResponse -> Bool
Prelude.Eq, ReadPrec [ListTypesResponse]
ReadPrec ListTypesResponse
Int -> ReadS ListTypesResponse
ReadS [ListTypesResponse]
(Int -> ReadS ListTypesResponse)
-> ReadS [ListTypesResponse]
-> ReadPrec ListTypesResponse
-> ReadPrec [ListTypesResponse]
-> Read ListTypesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTypesResponse]
$creadListPrec :: ReadPrec [ListTypesResponse]
readPrec :: ReadPrec ListTypesResponse
$creadPrec :: ReadPrec ListTypesResponse
readList :: ReadS [ListTypesResponse]
$creadList :: ReadS [ListTypesResponse]
readsPrec :: Int -> ReadS ListTypesResponse
$creadsPrec :: Int -> ReadS ListTypesResponse
Prelude.Read, Int -> ListTypesResponse -> ShowS
[ListTypesResponse] -> ShowS
ListTypesResponse -> String
(Int -> ListTypesResponse -> ShowS)
-> (ListTypesResponse -> String)
-> ([ListTypesResponse] -> ShowS)
-> Show ListTypesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTypesResponse] -> ShowS
$cshowList :: [ListTypesResponse] -> ShowS
show :: ListTypesResponse -> String
$cshow :: ListTypesResponse -> String
showsPrec :: Int -> ListTypesResponse -> ShowS
$cshowsPrec :: Int -> ListTypesResponse -> ShowS
Prelude.Show, (forall x. ListTypesResponse -> Rep ListTypesResponse x)
-> (forall x. Rep ListTypesResponse x -> ListTypesResponse)
-> Generic ListTypesResponse
forall x. Rep ListTypesResponse x -> ListTypesResponse
forall x. ListTypesResponse -> Rep ListTypesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTypesResponse x -> ListTypesResponse
$cfrom :: forall x. ListTypesResponse -> Rep ListTypesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTypesResponse' 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:
--
-- 'typeSummaries', 'listTypesResponse_typeSummaries' - A list of @TypeSummary@ structures that contain information about the
-- specified extensions.
--
-- 'nextToken', 'listTypesResponse_nextToken' - If the request doesn\'t return all of the remaining results, @NextToken@
-- is set to a token. To retrieve the next set of results, call this action
-- again and assign that token to the request object\'s @NextToken@
-- parameter. If the request returns all results, @NextToken@ is set to
-- @null@.
--
-- 'httpStatus', 'listTypesResponse_httpStatus' - The response's http status code.
newListTypesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTypesResponse
newListTypesResponse :: Int -> ListTypesResponse
newListTypesResponse Int
pHttpStatus_ =
  ListTypesResponse' :: Maybe [TypeSummary] -> Maybe Text -> Int -> ListTypesResponse
ListTypesResponse'
    { $sel:typeSummaries:ListTypesResponse' :: Maybe [TypeSummary]
typeSummaries = Maybe [TypeSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTypesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTypesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of @TypeSummary@ structures that contain information about the
-- specified extensions.
listTypesResponse_typeSummaries :: Lens.Lens' ListTypesResponse (Prelude.Maybe [TypeSummary])
listTypesResponse_typeSummaries :: (Maybe [TypeSummary] -> f (Maybe [TypeSummary]))
-> ListTypesResponse -> f ListTypesResponse
listTypesResponse_typeSummaries = (ListTypesResponse -> Maybe [TypeSummary])
-> (ListTypesResponse -> Maybe [TypeSummary] -> ListTypesResponse)
-> Lens' ListTypesResponse (Maybe [TypeSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypesResponse' {Maybe [TypeSummary]
typeSummaries :: Maybe [TypeSummary]
$sel:typeSummaries:ListTypesResponse' :: ListTypesResponse -> Maybe [TypeSummary]
typeSummaries} -> Maybe [TypeSummary]
typeSummaries) (\s :: ListTypesResponse
s@ListTypesResponse' {} Maybe [TypeSummary]
a -> ListTypesResponse
s {$sel:typeSummaries:ListTypesResponse' :: Maybe [TypeSummary]
typeSummaries = Maybe [TypeSummary]
a} :: ListTypesResponse) ((Maybe [TypeSummary] -> f (Maybe [TypeSummary]))
 -> ListTypesResponse -> f ListTypesResponse)
-> ((Maybe [TypeSummary] -> f (Maybe [TypeSummary]))
    -> Maybe [TypeSummary] -> f (Maybe [TypeSummary]))
-> (Maybe [TypeSummary] -> f (Maybe [TypeSummary]))
-> ListTypesResponse
-> f ListTypesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TypeSummary] [TypeSummary] [TypeSummary] [TypeSummary]
-> Iso
     (Maybe [TypeSummary])
     (Maybe [TypeSummary])
     (Maybe [TypeSummary])
     (Maybe [TypeSummary])
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 [TypeSummary] [TypeSummary] [TypeSummary] [TypeSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the request doesn\'t return all of the remaining results, @NextToken@
-- is set to a token. To retrieve the next set of results, call this action
-- again and assign that token to the request object\'s @NextToken@
-- parameter. If the request returns all results, @NextToken@ is set to
-- @null@.
listTypesResponse_nextToken :: Lens.Lens' ListTypesResponse (Prelude.Maybe Prelude.Text)
listTypesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTypesResponse -> f ListTypesResponse
listTypesResponse_nextToken = (ListTypesResponse -> Maybe Text)
-> (ListTypesResponse -> Maybe Text -> ListTypesResponse)
-> Lens' ListTypesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTypesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTypesResponse' :: ListTypesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTypesResponse
s@ListTypesResponse' {} Maybe Text
a -> ListTypesResponse
s {$sel:nextToken:ListTypesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTypesResponse)

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

instance Prelude.NFData ListTypesResponse