{-# 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.Greengrass.ListSubscriptionDefinitions
-- 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)
--
-- Retrieves a list of subscription definitions.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListSubscriptionDefinitions
  ( -- * Creating a Request
    ListSubscriptionDefinitions (..),
    newListSubscriptionDefinitions,

    -- * Request Lenses
    listSubscriptionDefinitions_nextToken,
    listSubscriptionDefinitions_maxResults,

    -- * Destructuring the Response
    ListSubscriptionDefinitionsResponse (..),
    newListSubscriptionDefinitionsResponse,

    -- * Response Lenses
    listSubscriptionDefinitionsResponse_nextToken,
    listSubscriptionDefinitionsResponse_definitions,
    listSubscriptionDefinitionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types
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:/ 'newListSubscriptionDefinitions' smart constructor.
data ListSubscriptionDefinitions = ListSubscriptionDefinitions'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListSubscriptionDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListSubscriptionDefinitions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text
  }
  deriving (ListSubscriptionDefinitions -> ListSubscriptionDefinitions -> Bool
(ListSubscriptionDefinitions
 -> ListSubscriptionDefinitions -> Bool)
-> (ListSubscriptionDefinitions
    -> ListSubscriptionDefinitions -> Bool)
-> Eq ListSubscriptionDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSubscriptionDefinitions -> ListSubscriptionDefinitions -> Bool
$c/= :: ListSubscriptionDefinitions -> ListSubscriptionDefinitions -> Bool
== :: ListSubscriptionDefinitions -> ListSubscriptionDefinitions -> Bool
$c== :: ListSubscriptionDefinitions -> ListSubscriptionDefinitions -> Bool
Prelude.Eq, ReadPrec [ListSubscriptionDefinitions]
ReadPrec ListSubscriptionDefinitions
Int -> ReadS ListSubscriptionDefinitions
ReadS [ListSubscriptionDefinitions]
(Int -> ReadS ListSubscriptionDefinitions)
-> ReadS [ListSubscriptionDefinitions]
-> ReadPrec ListSubscriptionDefinitions
-> ReadPrec [ListSubscriptionDefinitions]
-> Read ListSubscriptionDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSubscriptionDefinitions]
$creadListPrec :: ReadPrec [ListSubscriptionDefinitions]
readPrec :: ReadPrec ListSubscriptionDefinitions
$creadPrec :: ReadPrec ListSubscriptionDefinitions
readList :: ReadS [ListSubscriptionDefinitions]
$creadList :: ReadS [ListSubscriptionDefinitions]
readsPrec :: Int -> ReadS ListSubscriptionDefinitions
$creadsPrec :: Int -> ReadS ListSubscriptionDefinitions
Prelude.Read, Int -> ListSubscriptionDefinitions -> ShowS
[ListSubscriptionDefinitions] -> ShowS
ListSubscriptionDefinitions -> String
(Int -> ListSubscriptionDefinitions -> ShowS)
-> (ListSubscriptionDefinitions -> String)
-> ([ListSubscriptionDefinitions] -> ShowS)
-> Show ListSubscriptionDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSubscriptionDefinitions] -> ShowS
$cshowList :: [ListSubscriptionDefinitions] -> ShowS
show :: ListSubscriptionDefinitions -> String
$cshow :: ListSubscriptionDefinitions -> String
showsPrec :: Int -> ListSubscriptionDefinitions -> ShowS
$cshowsPrec :: Int -> ListSubscriptionDefinitions -> ShowS
Prelude.Show, (forall x.
 ListSubscriptionDefinitions -> Rep ListSubscriptionDefinitions x)
-> (forall x.
    Rep ListSubscriptionDefinitions x -> ListSubscriptionDefinitions)
-> Generic ListSubscriptionDefinitions
forall x.
Rep ListSubscriptionDefinitions x -> ListSubscriptionDefinitions
forall x.
ListSubscriptionDefinitions -> Rep ListSubscriptionDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSubscriptionDefinitions x -> ListSubscriptionDefinitions
$cfrom :: forall x.
ListSubscriptionDefinitions -> Rep ListSubscriptionDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListSubscriptionDefinitions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listSubscriptionDefinitions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listSubscriptionDefinitions_maxResults' - The maximum number of results to be returned per request.
newListSubscriptionDefinitions ::
  ListSubscriptionDefinitions
newListSubscriptionDefinitions :: ListSubscriptionDefinitions
newListSubscriptionDefinitions =
  ListSubscriptionDefinitions' :: Maybe Text -> Maybe Text -> ListSubscriptionDefinitions
ListSubscriptionDefinitions'
    { $sel:nextToken:ListSubscriptionDefinitions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSubscriptionDefinitions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listSubscriptionDefinitions_nextToken :: Lens.Lens' ListSubscriptionDefinitions (Prelude.Maybe Prelude.Text)
listSubscriptionDefinitions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSubscriptionDefinitions -> f ListSubscriptionDefinitions
listSubscriptionDefinitions_nextToken = (ListSubscriptionDefinitions -> Maybe Text)
-> (ListSubscriptionDefinitions
    -> Maybe Text -> ListSubscriptionDefinitions)
-> Lens
     ListSubscriptionDefinitions
     ListSubscriptionDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscriptionDefinitions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSubscriptionDefinitions' :: ListSubscriptionDefinitions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSubscriptionDefinitions
s@ListSubscriptionDefinitions' {} Maybe Text
a -> ListSubscriptionDefinitions
s {$sel:nextToken:ListSubscriptionDefinitions' :: Maybe Text
nextToken = Maybe Text
a} :: ListSubscriptionDefinitions)

-- | The maximum number of results to be returned per request.
listSubscriptionDefinitions_maxResults :: Lens.Lens' ListSubscriptionDefinitions (Prelude.Maybe Prelude.Text)
listSubscriptionDefinitions_maxResults :: (Maybe Text -> f (Maybe Text))
-> ListSubscriptionDefinitions -> f ListSubscriptionDefinitions
listSubscriptionDefinitions_maxResults = (ListSubscriptionDefinitions -> Maybe Text)
-> (ListSubscriptionDefinitions
    -> Maybe Text -> ListSubscriptionDefinitions)
-> Lens
     ListSubscriptionDefinitions
     ListSubscriptionDefinitions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscriptionDefinitions' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListSubscriptionDefinitions' :: ListSubscriptionDefinitions -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListSubscriptionDefinitions
s@ListSubscriptionDefinitions' {} Maybe Text
a -> ListSubscriptionDefinitions
s {$sel:maxResults:ListSubscriptionDefinitions' :: Maybe Text
maxResults = Maybe Text
a} :: ListSubscriptionDefinitions)

instance Core.AWSPager ListSubscriptionDefinitions where
  page :: ListSubscriptionDefinitions
-> AWSResponse ListSubscriptionDefinitions
-> Maybe ListSubscriptionDefinitions
page ListSubscriptionDefinitions
rq AWSResponse ListSubscriptionDefinitions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSubscriptionDefinitions
ListSubscriptionDefinitionsResponse
rs
            ListSubscriptionDefinitionsResponse
-> Getting (First Text) ListSubscriptionDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSubscriptionDefinitionsResponse
-> Const (First Text) ListSubscriptionDefinitionsResponse
Lens' ListSubscriptionDefinitionsResponse (Maybe Text)
listSubscriptionDefinitionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSubscriptionDefinitionsResponse
 -> Const (First Text) ListSubscriptionDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSubscriptionDefinitionsResponse 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 ListSubscriptionDefinitions
forall a. Maybe a
Prelude.Nothing
    | Maybe [DefinitionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSubscriptionDefinitions
ListSubscriptionDefinitionsResponse
rs
            ListSubscriptionDefinitionsResponse
-> Getting
     (First [DefinitionInformation])
     ListSubscriptionDefinitionsResponse
     [DefinitionInformation]
-> Maybe [DefinitionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DefinitionInformation]
 -> Const
      (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
-> ListSubscriptionDefinitionsResponse
-> Const
     (First [DefinitionInformation]) ListSubscriptionDefinitionsResponse
Lens'
  ListSubscriptionDefinitionsResponse (Maybe [DefinitionInformation])
listSubscriptionDefinitionsResponse_definitions
              ((Maybe [DefinitionInformation]
  -> Const
       (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
 -> ListSubscriptionDefinitionsResponse
 -> Const
      (First [DefinitionInformation])
      ListSubscriptionDefinitionsResponse)
-> (([DefinitionInformation]
     -> Const (First [DefinitionInformation]) [DefinitionInformation])
    -> Maybe [DefinitionInformation]
    -> Const
         (First [DefinitionInformation]) (Maybe [DefinitionInformation]))
-> Getting
     (First [DefinitionInformation])
     ListSubscriptionDefinitionsResponse
     [DefinitionInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DefinitionInformation]
 -> Const (First [DefinitionInformation]) [DefinitionInformation])
-> Maybe [DefinitionInformation]
-> Const
     (First [DefinitionInformation]) (Maybe [DefinitionInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListSubscriptionDefinitions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListSubscriptionDefinitions -> Maybe ListSubscriptionDefinitions
forall a. a -> Maybe a
Prelude.Just (ListSubscriptionDefinitions -> Maybe ListSubscriptionDefinitions)
-> ListSubscriptionDefinitions -> Maybe ListSubscriptionDefinitions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListSubscriptionDefinitions
rq
          ListSubscriptionDefinitions
-> (ListSubscriptionDefinitions -> ListSubscriptionDefinitions)
-> ListSubscriptionDefinitions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListSubscriptionDefinitions
-> Identity ListSubscriptionDefinitions
Lens
  ListSubscriptionDefinitions
  ListSubscriptionDefinitions
  (Maybe Text)
  (Maybe Text)
listSubscriptionDefinitions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListSubscriptionDefinitions
 -> Identity ListSubscriptionDefinitions)
-> Maybe Text
-> ListSubscriptionDefinitions
-> ListSubscriptionDefinitions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSubscriptionDefinitions
ListSubscriptionDefinitionsResponse
rs
          ListSubscriptionDefinitionsResponse
-> Getting (First Text) ListSubscriptionDefinitionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSubscriptionDefinitionsResponse
-> Const (First Text) ListSubscriptionDefinitionsResponse
Lens' ListSubscriptionDefinitionsResponse (Maybe Text)
listSubscriptionDefinitionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSubscriptionDefinitionsResponse
 -> Const (First Text) ListSubscriptionDefinitionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSubscriptionDefinitionsResponse 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 ListSubscriptionDefinitions where
  type
    AWSResponse ListSubscriptionDefinitions =
      ListSubscriptionDefinitionsResponse
  request :: ListSubscriptionDefinitions -> Request ListSubscriptionDefinitions
request = Service
-> ListSubscriptionDefinitions
-> Request ListSubscriptionDefinitions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListSubscriptionDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSubscriptionDefinitions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListSubscriptionDefinitions))
-> Logger
-> Service
-> Proxy ListSubscriptionDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSubscriptionDefinitions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [DefinitionInformation]
-> Int
-> ListSubscriptionDefinitionsResponse
ListSubscriptionDefinitionsResponse'
            (Maybe Text
 -> Maybe [DefinitionInformation]
 -> Int
 -> ListSubscriptionDefinitionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DefinitionInformation]
      -> Int -> ListSubscriptionDefinitionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [DefinitionInformation]
   -> Int -> ListSubscriptionDefinitionsResponse)
-> Either String (Maybe [DefinitionInformation])
-> Either String (Int -> ListSubscriptionDefinitionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [DefinitionInformation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Definitions" Either String (Maybe (Maybe [DefinitionInformation]))
-> Maybe [DefinitionInformation]
-> Either String (Maybe [DefinitionInformation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DefinitionInformation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListSubscriptionDefinitionsResponse)
-> Either String Int
-> Either String ListSubscriptionDefinitionsResponse
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 ListSubscriptionDefinitions

instance Prelude.NFData ListSubscriptionDefinitions

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

instance Core.ToPath ListSubscriptionDefinitions where
  toPath :: ListSubscriptionDefinitions -> ByteString
toPath =
    ByteString -> ListSubscriptionDefinitions -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/greengrass/definition/subscriptions"

instance Core.ToQuery ListSubscriptionDefinitions where
  toQuery :: ListSubscriptionDefinitions -> QueryString
toQuery ListSubscriptionDefinitions' {Maybe Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListSubscriptionDefinitions' :: ListSubscriptionDefinitions -> Maybe Text
$sel:nextToken:ListSubscriptionDefinitions' :: ListSubscriptionDefinitions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newListSubscriptionDefinitionsResponse' smart constructor.
data ListSubscriptionDefinitionsResponse = ListSubscriptionDefinitionsResponse'
  { -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListSubscriptionDefinitionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about a definition.
    ListSubscriptionDefinitionsResponse
-> Maybe [DefinitionInformation]
definitions :: Prelude.Maybe [DefinitionInformation],
    -- | The response's http status code.
    ListSubscriptionDefinitionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSubscriptionDefinitionsResponse
-> ListSubscriptionDefinitionsResponse -> Bool
(ListSubscriptionDefinitionsResponse
 -> ListSubscriptionDefinitionsResponse -> Bool)
-> (ListSubscriptionDefinitionsResponse
    -> ListSubscriptionDefinitionsResponse -> Bool)
-> Eq ListSubscriptionDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSubscriptionDefinitionsResponse
-> ListSubscriptionDefinitionsResponse -> Bool
$c/= :: ListSubscriptionDefinitionsResponse
-> ListSubscriptionDefinitionsResponse -> Bool
== :: ListSubscriptionDefinitionsResponse
-> ListSubscriptionDefinitionsResponse -> Bool
$c== :: ListSubscriptionDefinitionsResponse
-> ListSubscriptionDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [ListSubscriptionDefinitionsResponse]
ReadPrec ListSubscriptionDefinitionsResponse
Int -> ReadS ListSubscriptionDefinitionsResponse
ReadS [ListSubscriptionDefinitionsResponse]
(Int -> ReadS ListSubscriptionDefinitionsResponse)
-> ReadS [ListSubscriptionDefinitionsResponse]
-> ReadPrec ListSubscriptionDefinitionsResponse
-> ReadPrec [ListSubscriptionDefinitionsResponse]
-> Read ListSubscriptionDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSubscriptionDefinitionsResponse]
$creadListPrec :: ReadPrec [ListSubscriptionDefinitionsResponse]
readPrec :: ReadPrec ListSubscriptionDefinitionsResponse
$creadPrec :: ReadPrec ListSubscriptionDefinitionsResponse
readList :: ReadS [ListSubscriptionDefinitionsResponse]
$creadList :: ReadS [ListSubscriptionDefinitionsResponse]
readsPrec :: Int -> ReadS ListSubscriptionDefinitionsResponse
$creadsPrec :: Int -> ReadS ListSubscriptionDefinitionsResponse
Prelude.Read, Int -> ListSubscriptionDefinitionsResponse -> ShowS
[ListSubscriptionDefinitionsResponse] -> ShowS
ListSubscriptionDefinitionsResponse -> String
(Int -> ListSubscriptionDefinitionsResponse -> ShowS)
-> (ListSubscriptionDefinitionsResponse -> String)
-> ([ListSubscriptionDefinitionsResponse] -> ShowS)
-> Show ListSubscriptionDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSubscriptionDefinitionsResponse] -> ShowS
$cshowList :: [ListSubscriptionDefinitionsResponse] -> ShowS
show :: ListSubscriptionDefinitionsResponse -> String
$cshow :: ListSubscriptionDefinitionsResponse -> String
showsPrec :: Int -> ListSubscriptionDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> ListSubscriptionDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 ListSubscriptionDefinitionsResponse
 -> Rep ListSubscriptionDefinitionsResponse x)
-> (forall x.
    Rep ListSubscriptionDefinitionsResponse x
    -> ListSubscriptionDefinitionsResponse)
-> Generic ListSubscriptionDefinitionsResponse
forall x.
Rep ListSubscriptionDefinitionsResponse x
-> ListSubscriptionDefinitionsResponse
forall x.
ListSubscriptionDefinitionsResponse
-> Rep ListSubscriptionDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSubscriptionDefinitionsResponse x
-> ListSubscriptionDefinitionsResponse
$cfrom :: forall x.
ListSubscriptionDefinitionsResponse
-> Rep ListSubscriptionDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSubscriptionDefinitionsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listSubscriptionDefinitionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'definitions', 'listSubscriptionDefinitionsResponse_definitions' - Information about a definition.
--
-- 'httpStatus', 'listSubscriptionDefinitionsResponse_httpStatus' - The response's http status code.
newListSubscriptionDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSubscriptionDefinitionsResponse
newListSubscriptionDefinitionsResponse :: Int -> ListSubscriptionDefinitionsResponse
newListSubscriptionDefinitionsResponse Int
pHttpStatus_ =
  ListSubscriptionDefinitionsResponse' :: Maybe Text
-> Maybe [DefinitionInformation]
-> Int
-> ListSubscriptionDefinitionsResponse
ListSubscriptionDefinitionsResponse'
    { $sel:nextToken:ListSubscriptionDefinitionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:definitions:ListSubscriptionDefinitionsResponse' :: Maybe [DefinitionInformation]
definitions = Maybe [DefinitionInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSubscriptionDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
listSubscriptionDefinitionsResponse_nextToken :: Lens.Lens' ListSubscriptionDefinitionsResponse (Prelude.Maybe Prelude.Text)
listSubscriptionDefinitionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSubscriptionDefinitionsResponse
-> f ListSubscriptionDefinitionsResponse
listSubscriptionDefinitionsResponse_nextToken = (ListSubscriptionDefinitionsResponse -> Maybe Text)
-> (ListSubscriptionDefinitionsResponse
    -> Maybe Text -> ListSubscriptionDefinitionsResponse)
-> Lens' ListSubscriptionDefinitionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscriptionDefinitionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSubscriptionDefinitionsResponse' :: ListSubscriptionDefinitionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSubscriptionDefinitionsResponse
s@ListSubscriptionDefinitionsResponse' {} Maybe Text
a -> ListSubscriptionDefinitionsResponse
s {$sel:nextToken:ListSubscriptionDefinitionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSubscriptionDefinitionsResponse)

-- | Information about a definition.
listSubscriptionDefinitionsResponse_definitions :: Lens.Lens' ListSubscriptionDefinitionsResponse (Prelude.Maybe [DefinitionInformation])
listSubscriptionDefinitionsResponse_definitions :: (Maybe [DefinitionInformation]
 -> f (Maybe [DefinitionInformation]))
-> ListSubscriptionDefinitionsResponse
-> f ListSubscriptionDefinitionsResponse
listSubscriptionDefinitionsResponse_definitions = (ListSubscriptionDefinitionsResponse
 -> Maybe [DefinitionInformation])
-> (ListSubscriptionDefinitionsResponse
    -> Maybe [DefinitionInformation]
    -> ListSubscriptionDefinitionsResponse)
-> Lens'
     ListSubscriptionDefinitionsResponse (Maybe [DefinitionInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscriptionDefinitionsResponse' {Maybe [DefinitionInformation]
definitions :: Maybe [DefinitionInformation]
$sel:definitions:ListSubscriptionDefinitionsResponse' :: ListSubscriptionDefinitionsResponse
-> Maybe [DefinitionInformation]
definitions} -> Maybe [DefinitionInformation]
definitions) (\s :: ListSubscriptionDefinitionsResponse
s@ListSubscriptionDefinitionsResponse' {} Maybe [DefinitionInformation]
a -> ListSubscriptionDefinitionsResponse
s {$sel:definitions:ListSubscriptionDefinitionsResponse' :: Maybe [DefinitionInformation]
definitions = Maybe [DefinitionInformation]
a} :: ListSubscriptionDefinitionsResponse) ((Maybe [DefinitionInformation]
  -> f (Maybe [DefinitionInformation]))
 -> ListSubscriptionDefinitionsResponse
 -> f ListSubscriptionDefinitionsResponse)
-> ((Maybe [DefinitionInformation]
     -> f (Maybe [DefinitionInformation]))
    -> Maybe [DefinitionInformation]
    -> f (Maybe [DefinitionInformation]))
-> (Maybe [DefinitionInformation]
    -> f (Maybe [DefinitionInformation]))
-> ListSubscriptionDefinitionsResponse
-> f ListSubscriptionDefinitionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
-> Iso
     (Maybe [DefinitionInformation])
     (Maybe [DefinitionInformation])
     (Maybe [DefinitionInformation])
     (Maybe [DefinitionInformation])
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
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
  [DefinitionInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListSubscriptionDefinitionsResponse