{-# 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.SSOAdmin.ListPermissionSets
-- 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)
--
-- Lists the PermissionSets in an SSO instance.
--
-- This operation returns paginated results.
module Amazonka.SSOAdmin.ListPermissionSets
  ( -- * Creating a Request
    ListPermissionSets (..),
    newListPermissionSets,

    -- * Request Lenses
    listPermissionSets_nextToken,
    listPermissionSets_maxResults,
    listPermissionSets_instanceArn,

    -- * Destructuring the Response
    ListPermissionSetsResponse (..),
    newListPermissionSetsResponse,

    -- * Response Lenses
    listPermissionSetsResponse_permissionSets,
    listPermissionSetsResponse_nextToken,
    listPermissionSetsResponse_httpStatus,
  )
where

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
import Amazonka.SSOAdmin.Types

-- | /See:/ 'newListPermissionSets' smart constructor.
data ListPermissionSets = ListPermissionSets'
  { -- | The pagination token for the list API. Initially the value is null. Use
    -- the output of previous API calls to make subsequent calls.
    ListPermissionSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to display for the assignment.
    ListPermissionSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the SSO instance under which the operation will be executed.
    -- For more information about ARNs, see
    -- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
    -- in the /Amazon Web Services General Reference/.
    ListPermissionSets -> Text
instanceArn :: Prelude.Text
  }
  deriving (ListPermissionSets -> ListPermissionSets -> Bool
(ListPermissionSets -> ListPermissionSets -> Bool)
-> (ListPermissionSets -> ListPermissionSets -> Bool)
-> Eq ListPermissionSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPermissionSets -> ListPermissionSets -> Bool
$c/= :: ListPermissionSets -> ListPermissionSets -> Bool
== :: ListPermissionSets -> ListPermissionSets -> Bool
$c== :: ListPermissionSets -> ListPermissionSets -> Bool
Prelude.Eq, ReadPrec [ListPermissionSets]
ReadPrec ListPermissionSets
Int -> ReadS ListPermissionSets
ReadS [ListPermissionSets]
(Int -> ReadS ListPermissionSets)
-> ReadS [ListPermissionSets]
-> ReadPrec ListPermissionSets
-> ReadPrec [ListPermissionSets]
-> Read ListPermissionSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPermissionSets]
$creadListPrec :: ReadPrec [ListPermissionSets]
readPrec :: ReadPrec ListPermissionSets
$creadPrec :: ReadPrec ListPermissionSets
readList :: ReadS [ListPermissionSets]
$creadList :: ReadS [ListPermissionSets]
readsPrec :: Int -> ReadS ListPermissionSets
$creadsPrec :: Int -> ReadS ListPermissionSets
Prelude.Read, Int -> ListPermissionSets -> ShowS
[ListPermissionSets] -> ShowS
ListPermissionSets -> String
(Int -> ListPermissionSets -> ShowS)
-> (ListPermissionSets -> String)
-> ([ListPermissionSets] -> ShowS)
-> Show ListPermissionSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPermissionSets] -> ShowS
$cshowList :: [ListPermissionSets] -> ShowS
show :: ListPermissionSets -> String
$cshow :: ListPermissionSets -> String
showsPrec :: Int -> ListPermissionSets -> ShowS
$cshowsPrec :: Int -> ListPermissionSets -> ShowS
Prelude.Show, (forall x. ListPermissionSets -> Rep ListPermissionSets x)
-> (forall x. Rep ListPermissionSets x -> ListPermissionSets)
-> Generic ListPermissionSets
forall x. Rep ListPermissionSets x -> ListPermissionSets
forall x. ListPermissionSets -> Rep ListPermissionSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPermissionSets x -> ListPermissionSets
$cfrom :: forall x. ListPermissionSets -> Rep ListPermissionSets x
Prelude.Generic)

-- |
-- Create a value of 'ListPermissionSets' 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', 'listPermissionSets_nextToken' - The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
--
-- 'maxResults', 'listPermissionSets_maxResults' - The maximum number of results to display for the assignment.
--
-- 'instanceArn', 'listPermissionSets_instanceArn' - The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
newListPermissionSets ::
  -- | 'instanceArn'
  Prelude.Text ->
  ListPermissionSets
newListPermissionSets :: Text -> ListPermissionSets
newListPermissionSets Text
pInstanceArn_ =
  ListPermissionSets' :: Maybe Text -> Maybe Natural -> Text -> ListPermissionSets
ListPermissionSets'
    { $sel:nextToken:ListPermissionSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPermissionSets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceArn:ListPermissionSets' :: Text
instanceArn = Text
pInstanceArn_
    }

-- | The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
listPermissionSets_nextToken :: Lens.Lens' ListPermissionSets (Prelude.Maybe Prelude.Text)
listPermissionSets_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPermissionSets -> f ListPermissionSets
listPermissionSets_nextToken = (ListPermissionSets -> Maybe Text)
-> (ListPermissionSets -> Maybe Text -> ListPermissionSets)
-> Lens
     ListPermissionSets ListPermissionSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPermissionSets' :: ListPermissionSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPermissionSets
s@ListPermissionSets' {} Maybe Text
a -> ListPermissionSets
s {$sel:nextToken:ListPermissionSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListPermissionSets)

-- | The maximum number of results to display for the assignment.
listPermissionSets_maxResults :: Lens.Lens' ListPermissionSets (Prelude.Maybe Prelude.Natural)
listPermissionSets_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPermissionSets -> f ListPermissionSets
listPermissionSets_maxResults = (ListPermissionSets -> Maybe Natural)
-> (ListPermissionSets -> Maybe Natural -> ListPermissionSets)
-> Lens
     ListPermissionSets
     ListPermissionSets
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPermissionSets' :: ListPermissionSets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPermissionSets
s@ListPermissionSets' {} Maybe Natural
a -> ListPermissionSets
s {$sel:maxResults:ListPermissionSets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPermissionSets)

-- | The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
listPermissionSets_instanceArn :: Lens.Lens' ListPermissionSets Prelude.Text
listPermissionSets_instanceArn :: (Text -> f Text) -> ListPermissionSets -> f ListPermissionSets
listPermissionSets_instanceArn = (ListPermissionSets -> Text)
-> (ListPermissionSets -> Text -> ListPermissionSets)
-> Lens ListPermissionSets ListPermissionSets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSets' {Text
instanceArn :: Text
$sel:instanceArn:ListPermissionSets' :: ListPermissionSets -> Text
instanceArn} -> Text
instanceArn) (\s :: ListPermissionSets
s@ListPermissionSets' {} Text
a -> ListPermissionSets
s {$sel:instanceArn:ListPermissionSets' :: Text
instanceArn = Text
a} :: ListPermissionSets)

instance Core.AWSPager ListPermissionSets where
  page :: ListPermissionSets
-> AWSResponse ListPermissionSets -> Maybe ListPermissionSets
page ListPermissionSets
rq AWSResponse ListPermissionSets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPermissionSets
ListPermissionSetsResponse
rs
            ListPermissionSetsResponse
-> Getting (First Text) ListPermissionSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPermissionSetsResponse
-> Const (First Text) ListPermissionSetsResponse
Lens' ListPermissionSetsResponse (Maybe Text)
listPermissionSetsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPermissionSetsResponse
 -> Const (First Text) ListPermissionSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPermissionSetsResponse 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 ListPermissionSets
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPermissionSets
ListPermissionSetsResponse
rs
            ListPermissionSetsResponse
-> Getting (First [Text]) ListPermissionSetsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListPermissionSetsResponse
-> Const (First [Text]) ListPermissionSetsResponse
Lens' ListPermissionSetsResponse (Maybe [Text])
listPermissionSetsResponse_permissionSets
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListPermissionSetsResponse
 -> Const (First [Text]) ListPermissionSetsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListPermissionSetsResponse [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 ListPermissionSets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPermissionSets -> Maybe ListPermissionSets
forall a. a -> Maybe a
Prelude.Just (ListPermissionSets -> Maybe ListPermissionSets)
-> ListPermissionSets -> Maybe ListPermissionSets
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPermissionSets
rq
          ListPermissionSets
-> (ListPermissionSets -> ListPermissionSets) -> ListPermissionSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPermissionSets -> Identity ListPermissionSets
Lens
  ListPermissionSets ListPermissionSets (Maybe Text) (Maybe Text)
listPermissionSets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPermissionSets -> Identity ListPermissionSets)
-> Maybe Text -> ListPermissionSets -> ListPermissionSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPermissionSets
ListPermissionSetsResponse
rs
          ListPermissionSetsResponse
-> Getting (First Text) ListPermissionSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPermissionSetsResponse
-> Const (First Text) ListPermissionSetsResponse
Lens' ListPermissionSetsResponse (Maybe Text)
listPermissionSetsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPermissionSetsResponse
 -> Const (First Text) ListPermissionSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPermissionSetsResponse 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 ListPermissionSets where
  type
    AWSResponse ListPermissionSets =
      ListPermissionSetsResponse
  request :: ListPermissionSets -> Request ListPermissionSets
request = Service -> ListPermissionSets -> Request ListPermissionSets
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPermissionSets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPermissionSets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPermissionSets))
-> Logger
-> Service
-> Proxy ListPermissionSets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPermissionSets)))
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 Text -> Int -> ListPermissionSetsResponse
ListPermissionSetsResponse'
            (Maybe [Text] -> Maybe Text -> Int -> ListPermissionSetsResponse)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> Int -> ListPermissionSetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PermissionSets" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListPermissionSetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListPermissionSetsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListPermissionSetsResponse)
-> Either String Int -> Either String ListPermissionSetsResponse
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 ListPermissionSets

instance Prelude.NFData ListPermissionSets

instance Core.ToHeaders ListPermissionSets where
  toHeaders :: ListPermissionSets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPermissionSets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SWBExternalService.ListPermissionSets" ::
                          Prelude.ByteString
                      ),
            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.ToJSON ListPermissionSets where
  toJSON :: ListPermissionSets -> Value
toJSON ListPermissionSets' {Maybe Natural
Maybe Text
Text
instanceArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:instanceArn:ListPermissionSets' :: ListPermissionSets -> Text
$sel:maxResults:ListPermissionSets' :: ListPermissionSets -> Maybe Natural
$sel:nextToken:ListPermissionSets' :: ListPermissionSets -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceArn)
          ]
      )

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

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

-- | /See:/ 'newListPermissionSetsResponse' smart constructor.
data ListPermissionSetsResponse = ListPermissionSetsResponse'
  { -- | Defines the level of access on an Amazon Web Services account.
    ListPermissionSetsResponse -> Maybe [Text]
permissionSets :: Prelude.Maybe [Prelude.Text],
    -- | The pagination token for the list API. Initially the value is null. Use
    -- the output of previous API calls to make subsequent calls.
    ListPermissionSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPermissionSetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPermissionSetsResponse -> ListPermissionSetsResponse -> Bool
(ListPermissionSetsResponse -> ListPermissionSetsResponse -> Bool)
-> (ListPermissionSetsResponse
    -> ListPermissionSetsResponse -> Bool)
-> Eq ListPermissionSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPermissionSetsResponse -> ListPermissionSetsResponse -> Bool
$c/= :: ListPermissionSetsResponse -> ListPermissionSetsResponse -> Bool
== :: ListPermissionSetsResponse -> ListPermissionSetsResponse -> Bool
$c== :: ListPermissionSetsResponse -> ListPermissionSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListPermissionSetsResponse]
ReadPrec ListPermissionSetsResponse
Int -> ReadS ListPermissionSetsResponse
ReadS [ListPermissionSetsResponse]
(Int -> ReadS ListPermissionSetsResponse)
-> ReadS [ListPermissionSetsResponse]
-> ReadPrec ListPermissionSetsResponse
-> ReadPrec [ListPermissionSetsResponse]
-> Read ListPermissionSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPermissionSetsResponse]
$creadListPrec :: ReadPrec [ListPermissionSetsResponse]
readPrec :: ReadPrec ListPermissionSetsResponse
$creadPrec :: ReadPrec ListPermissionSetsResponse
readList :: ReadS [ListPermissionSetsResponse]
$creadList :: ReadS [ListPermissionSetsResponse]
readsPrec :: Int -> ReadS ListPermissionSetsResponse
$creadsPrec :: Int -> ReadS ListPermissionSetsResponse
Prelude.Read, Int -> ListPermissionSetsResponse -> ShowS
[ListPermissionSetsResponse] -> ShowS
ListPermissionSetsResponse -> String
(Int -> ListPermissionSetsResponse -> ShowS)
-> (ListPermissionSetsResponse -> String)
-> ([ListPermissionSetsResponse] -> ShowS)
-> Show ListPermissionSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPermissionSetsResponse] -> ShowS
$cshowList :: [ListPermissionSetsResponse] -> ShowS
show :: ListPermissionSetsResponse -> String
$cshow :: ListPermissionSetsResponse -> String
showsPrec :: Int -> ListPermissionSetsResponse -> ShowS
$cshowsPrec :: Int -> ListPermissionSetsResponse -> ShowS
Prelude.Show, (forall x.
 ListPermissionSetsResponse -> Rep ListPermissionSetsResponse x)
-> (forall x.
    Rep ListPermissionSetsResponse x -> ListPermissionSetsResponse)
-> Generic ListPermissionSetsResponse
forall x.
Rep ListPermissionSetsResponse x -> ListPermissionSetsResponse
forall x.
ListPermissionSetsResponse -> Rep ListPermissionSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPermissionSetsResponse x -> ListPermissionSetsResponse
$cfrom :: forall x.
ListPermissionSetsResponse -> Rep ListPermissionSetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPermissionSetsResponse' 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:
--
-- 'permissionSets', 'listPermissionSetsResponse_permissionSets' - Defines the level of access on an Amazon Web Services account.
--
-- 'nextToken', 'listPermissionSetsResponse_nextToken' - The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
--
-- 'httpStatus', 'listPermissionSetsResponse_httpStatus' - The response's http status code.
newListPermissionSetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPermissionSetsResponse
newListPermissionSetsResponse :: Int -> ListPermissionSetsResponse
newListPermissionSetsResponse Int
pHttpStatus_ =
  ListPermissionSetsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListPermissionSetsResponse
ListPermissionSetsResponse'
    { $sel:permissionSets:ListPermissionSetsResponse' :: Maybe [Text]
permissionSets =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPermissionSetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPermissionSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Defines the level of access on an Amazon Web Services account.
listPermissionSetsResponse_permissionSets :: Lens.Lens' ListPermissionSetsResponse (Prelude.Maybe [Prelude.Text])
listPermissionSetsResponse_permissionSets :: (Maybe [Text] -> f (Maybe [Text]))
-> ListPermissionSetsResponse -> f ListPermissionSetsResponse
listPermissionSetsResponse_permissionSets = (ListPermissionSetsResponse -> Maybe [Text])
-> (ListPermissionSetsResponse
    -> Maybe [Text] -> ListPermissionSetsResponse)
-> Lens' ListPermissionSetsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetsResponse' {Maybe [Text]
permissionSets :: Maybe [Text]
$sel:permissionSets:ListPermissionSetsResponse' :: ListPermissionSetsResponse -> Maybe [Text]
permissionSets} -> Maybe [Text]
permissionSets) (\s :: ListPermissionSetsResponse
s@ListPermissionSetsResponse' {} Maybe [Text]
a -> ListPermissionSetsResponse
s {$sel:permissionSets:ListPermissionSetsResponse' :: Maybe [Text]
permissionSets = Maybe [Text]
a} :: ListPermissionSetsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListPermissionSetsResponse -> f ListPermissionSetsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListPermissionSetsResponse
-> f ListPermissionSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token for the list API. Initially the value is null. Use
-- the output of previous API calls to make subsequent calls.
listPermissionSetsResponse_nextToken :: Lens.Lens' ListPermissionSetsResponse (Prelude.Maybe Prelude.Text)
listPermissionSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPermissionSetsResponse -> f ListPermissionSetsResponse
listPermissionSetsResponse_nextToken = (ListPermissionSetsResponse -> Maybe Text)
-> (ListPermissionSetsResponse
    -> Maybe Text -> ListPermissionSetsResponse)
-> Lens' ListPermissionSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPermissionSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPermissionSetsResponse' :: ListPermissionSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPermissionSetsResponse
s@ListPermissionSetsResponse' {} Maybe Text
a -> ListPermissionSetsResponse
s {$sel:nextToken:ListPermissionSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPermissionSetsResponse)

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

instance Prelude.NFData ListPermissionSetsResponse