{-# 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.EC2.DescribePrincipalIdFormat
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the ID format settings for the root user and all IAM roles and
-- IAM users that have explicitly specified a longer ID (17-character ID)
-- preference.
--
-- By default, all IAM roles and IAM users default to the same ID settings
-- as the root user, unless they explicitly override the settings. This
-- request is useful for identifying those IAM users and IAM roles that
-- have overridden the default ID settings.
--
-- The following resource types support longer IDs: @bundle@ |
-- @conversion-task@ | @customer-gateway@ | @dhcp-options@ |
-- @elastic-ip-allocation@ | @elastic-ip-association@ | @export-task@ |
-- @flow-log@ | @image@ | @import-task@ | @instance@ | @internet-gateway@ |
-- @network-acl@ | @network-acl-association@ | @network-interface@ |
-- @network-interface-attachment@ | @prefix-list@ | @reservation@ |
-- @route-table@ | @route-table-association@ | @security-group@ |
-- @snapshot@ | @subnet@ | @subnet-cidr-block-association@ | @volume@ |
-- @vpc@ | @vpc-cidr-block-association@ | @vpc-endpoint@ |
-- @vpc-peering-connection@ | @vpn-connection@ | @vpn-gateway@.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribePrincipalIdFormat
  ( -- * Creating a Request
    DescribePrincipalIdFormat (..),
    newDescribePrincipalIdFormat,

    -- * Request Lenses
    describePrincipalIdFormat_dryRun,
    describePrincipalIdFormat_maxResults,
    describePrincipalIdFormat_nextToken,
    describePrincipalIdFormat_resources,

    -- * Destructuring the Response
    DescribePrincipalIdFormatResponse (..),
    newDescribePrincipalIdFormatResponse,

    -- * Response Lenses
    describePrincipalIdFormatResponse_nextToken,
    describePrincipalIdFormatResponse_principals,
    describePrincipalIdFormatResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribePrincipalIdFormat' smart constructor.
data DescribePrincipalIdFormat = DescribePrincipalIdFormat'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribePrincipalIdFormat -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of results to return in a single call. To retrieve
    -- the remaining results, make another call with the returned NextToken
    -- value.
    DescribePrincipalIdFormat -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to request the next page of results.
    DescribePrincipalIdFormat -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The type of resource: @bundle@ | @conversion-task@ | @customer-gateway@
    -- | @dhcp-options@ | @elastic-ip-allocation@ | @elastic-ip-association@ |
    -- @export-task@ | @flow-log@ | @image@ | @import-task@ | @instance@ |
    -- @internet-gateway@ | @network-acl@ | @network-acl-association@ |
    -- @network-interface@ | @network-interface-attachment@ | @prefix-list@ |
    -- @reservation@ | @route-table@ | @route-table-association@ |
    -- @security-group@ | @snapshot@ | @subnet@ |
    -- @subnet-cidr-block-association@ | @volume@ | @vpc@ |
    -- @vpc-cidr-block-association@ | @vpc-endpoint@ | @vpc-peering-connection@
    -- | @vpn-connection@ | @vpn-gateway@
    DescribePrincipalIdFormat -> Maybe [Text]
resources :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribePrincipalIdFormat -> DescribePrincipalIdFormat -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePrincipalIdFormat -> DescribePrincipalIdFormat -> Bool
$c/= :: DescribePrincipalIdFormat -> DescribePrincipalIdFormat -> Bool
== :: DescribePrincipalIdFormat -> DescribePrincipalIdFormat -> Bool
$c== :: DescribePrincipalIdFormat -> DescribePrincipalIdFormat -> Bool
Prelude.Eq, ReadPrec [DescribePrincipalIdFormat]
ReadPrec DescribePrincipalIdFormat
Int -> ReadS DescribePrincipalIdFormat
ReadS [DescribePrincipalIdFormat]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePrincipalIdFormat]
$creadListPrec :: ReadPrec [DescribePrincipalIdFormat]
readPrec :: ReadPrec DescribePrincipalIdFormat
$creadPrec :: ReadPrec DescribePrincipalIdFormat
readList :: ReadS [DescribePrincipalIdFormat]
$creadList :: ReadS [DescribePrincipalIdFormat]
readsPrec :: Int -> ReadS DescribePrincipalIdFormat
$creadsPrec :: Int -> ReadS DescribePrincipalIdFormat
Prelude.Read, Int -> DescribePrincipalIdFormat -> ShowS
[DescribePrincipalIdFormat] -> ShowS
DescribePrincipalIdFormat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePrincipalIdFormat] -> ShowS
$cshowList :: [DescribePrincipalIdFormat] -> ShowS
show :: DescribePrincipalIdFormat -> String
$cshow :: DescribePrincipalIdFormat -> String
showsPrec :: Int -> DescribePrincipalIdFormat -> ShowS
$cshowsPrec :: Int -> DescribePrincipalIdFormat -> ShowS
Prelude.Show, forall x.
Rep DescribePrincipalIdFormat x -> DescribePrincipalIdFormat
forall x.
DescribePrincipalIdFormat -> Rep DescribePrincipalIdFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePrincipalIdFormat x -> DescribePrincipalIdFormat
$cfrom :: forall x.
DescribePrincipalIdFormat -> Rep DescribePrincipalIdFormat x
Prelude.Generic)

-- |
-- Create a value of 'DescribePrincipalIdFormat' 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:
--
-- 'dryRun', 'describePrincipalIdFormat_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'maxResults', 'describePrincipalIdFormat_maxResults' - The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned NextToken
-- value.
--
-- 'nextToken', 'describePrincipalIdFormat_nextToken' - The token to request the next page of results.
--
-- 'resources', 'describePrincipalIdFormat_resources' - The type of resource: @bundle@ | @conversion-task@ | @customer-gateway@
-- | @dhcp-options@ | @elastic-ip-allocation@ | @elastic-ip-association@ |
-- @export-task@ | @flow-log@ | @image@ | @import-task@ | @instance@ |
-- @internet-gateway@ | @network-acl@ | @network-acl-association@ |
-- @network-interface@ | @network-interface-attachment@ | @prefix-list@ |
-- @reservation@ | @route-table@ | @route-table-association@ |
-- @security-group@ | @snapshot@ | @subnet@ |
-- @subnet-cidr-block-association@ | @volume@ | @vpc@ |
-- @vpc-cidr-block-association@ | @vpc-endpoint@ | @vpc-peering-connection@
-- | @vpn-connection@ | @vpn-gateway@
newDescribePrincipalIdFormat ::
  DescribePrincipalIdFormat
newDescribePrincipalIdFormat :: DescribePrincipalIdFormat
newDescribePrincipalIdFormat =
  DescribePrincipalIdFormat'
    { $sel:dryRun:DescribePrincipalIdFormat' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribePrincipalIdFormat' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribePrincipalIdFormat' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resources:DescribePrincipalIdFormat' :: Maybe [Text]
resources = forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describePrincipalIdFormat_dryRun :: Lens.Lens' DescribePrincipalIdFormat (Prelude.Maybe Prelude.Bool)
describePrincipalIdFormat_dryRun :: Lens' DescribePrincipalIdFormat (Maybe Bool)
describePrincipalIdFormat_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalIdFormat' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribePrincipalIdFormat
s@DescribePrincipalIdFormat' {} Maybe Bool
a -> DescribePrincipalIdFormat
s {$sel:dryRun:DescribePrincipalIdFormat' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribePrincipalIdFormat)

-- | The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned NextToken
-- value.
describePrincipalIdFormat_maxResults :: Lens.Lens' DescribePrincipalIdFormat (Prelude.Maybe Prelude.Natural)
describePrincipalIdFormat_maxResults :: Lens' DescribePrincipalIdFormat (Maybe Natural)
describePrincipalIdFormat_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalIdFormat' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribePrincipalIdFormat
s@DescribePrincipalIdFormat' {} Maybe Natural
a -> DescribePrincipalIdFormat
s {$sel:maxResults:DescribePrincipalIdFormat' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribePrincipalIdFormat)

-- | The token to request the next page of results.
describePrincipalIdFormat_nextToken :: Lens.Lens' DescribePrincipalIdFormat (Prelude.Maybe Prelude.Text)
describePrincipalIdFormat_nextToken :: Lens' DescribePrincipalIdFormat (Maybe Text)
describePrincipalIdFormat_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalIdFormat' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribePrincipalIdFormat
s@DescribePrincipalIdFormat' {} Maybe Text
a -> DescribePrincipalIdFormat
s {$sel:nextToken:DescribePrincipalIdFormat' :: Maybe Text
nextToken = Maybe Text
a} :: DescribePrincipalIdFormat)

-- | The type of resource: @bundle@ | @conversion-task@ | @customer-gateway@
-- | @dhcp-options@ | @elastic-ip-allocation@ | @elastic-ip-association@ |
-- @export-task@ | @flow-log@ | @image@ | @import-task@ | @instance@ |
-- @internet-gateway@ | @network-acl@ | @network-acl-association@ |
-- @network-interface@ | @network-interface-attachment@ | @prefix-list@ |
-- @reservation@ | @route-table@ | @route-table-association@ |
-- @security-group@ | @snapshot@ | @subnet@ |
-- @subnet-cidr-block-association@ | @volume@ | @vpc@ |
-- @vpc-cidr-block-association@ | @vpc-endpoint@ | @vpc-peering-connection@
-- | @vpn-connection@ | @vpn-gateway@
describePrincipalIdFormat_resources :: Lens.Lens' DescribePrincipalIdFormat (Prelude.Maybe [Prelude.Text])
describePrincipalIdFormat_resources :: Lens' DescribePrincipalIdFormat (Maybe [Text])
describePrincipalIdFormat_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalIdFormat' {Maybe [Text]
resources :: Maybe [Text]
$sel:resources:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe [Text]
resources} -> Maybe [Text]
resources) (\s :: DescribePrincipalIdFormat
s@DescribePrincipalIdFormat' {} Maybe [Text]
a -> DescribePrincipalIdFormat
s {$sel:resources:DescribePrincipalIdFormat' :: Maybe [Text]
resources = Maybe [Text]
a} :: DescribePrincipalIdFormat) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager DescribePrincipalIdFormat where
  page :: DescribePrincipalIdFormat
-> AWSResponse DescribePrincipalIdFormat
-> Maybe DescribePrincipalIdFormat
page DescribePrincipalIdFormat
rq AWSResponse DescribePrincipalIdFormat
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribePrincipalIdFormat
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribePrincipalIdFormatResponse (Maybe Text)
describePrincipalIdFormatResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribePrincipalIdFormat
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribePrincipalIdFormatResponse (Maybe [PrincipalIdFormat])
describePrincipalIdFormatResponse_principals
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribePrincipalIdFormat
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribePrincipalIdFormat (Maybe Text)
describePrincipalIdFormat_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribePrincipalIdFormat
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribePrincipalIdFormatResponse (Maybe Text)
describePrincipalIdFormatResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribePrincipalIdFormat where
  type
    AWSResponse DescribePrincipalIdFormat =
      DescribePrincipalIdFormatResponse
  request :: (Service -> Service)
-> DescribePrincipalIdFormat -> Request DescribePrincipalIdFormat
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribePrincipalIdFormat
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribePrincipalIdFormat)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [PrincipalIdFormat]
-> Int
-> DescribePrincipalIdFormatResponse
DescribePrincipalIdFormatResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"principalSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribePrincipalIdFormat where
  hashWithSalt :: Int -> DescribePrincipalIdFormat -> Int
hashWithSalt Int
_salt DescribePrincipalIdFormat' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
resources :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:resources:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe [Text]
$sel:nextToken:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Text
$sel:maxResults:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Natural
$sel:dryRun:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
resources

instance Prelude.NFData DescribePrincipalIdFormat where
  rnf :: DescribePrincipalIdFormat -> ()
rnf DescribePrincipalIdFormat' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
resources :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:resources:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe [Text]
$sel:nextToken:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Text
$sel:maxResults:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Natural
$sel:dryRun:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
resources

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

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

instance Data.ToQuery DescribePrincipalIdFormat where
  toQuery :: DescribePrincipalIdFormat -> QueryString
toQuery DescribePrincipalIdFormat' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
resources :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
dryRun :: Maybe Bool
$sel:resources:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe [Text]
$sel:nextToken:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Text
$sel:maxResults:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Natural
$sel:dryRun:DescribePrincipalIdFormat' :: DescribePrincipalIdFormat -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribePrincipalIdFormat" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Resource" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resources)
      ]

-- | /See:/ 'newDescribePrincipalIdFormatResponse' smart constructor.
data DescribePrincipalIdFormatResponse = DescribePrincipalIdFormatResponse'
  { -- | The token to use to retrieve the next page of results. This value is
    -- null when there are no more results to return.
    DescribePrincipalIdFormatResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the ID format settings for the ARN.
    DescribePrincipalIdFormatResponse -> Maybe [PrincipalIdFormat]
principals :: Prelude.Maybe [PrincipalIdFormat],
    -- | The response's http status code.
    DescribePrincipalIdFormatResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribePrincipalIdFormatResponse
-> DescribePrincipalIdFormatResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePrincipalIdFormatResponse
-> DescribePrincipalIdFormatResponse -> Bool
$c/= :: DescribePrincipalIdFormatResponse
-> DescribePrincipalIdFormatResponse -> Bool
== :: DescribePrincipalIdFormatResponse
-> DescribePrincipalIdFormatResponse -> Bool
$c== :: DescribePrincipalIdFormatResponse
-> DescribePrincipalIdFormatResponse -> Bool
Prelude.Eq, ReadPrec [DescribePrincipalIdFormatResponse]
ReadPrec DescribePrincipalIdFormatResponse
Int -> ReadS DescribePrincipalIdFormatResponse
ReadS [DescribePrincipalIdFormatResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePrincipalIdFormatResponse]
$creadListPrec :: ReadPrec [DescribePrincipalIdFormatResponse]
readPrec :: ReadPrec DescribePrincipalIdFormatResponse
$creadPrec :: ReadPrec DescribePrincipalIdFormatResponse
readList :: ReadS [DescribePrincipalIdFormatResponse]
$creadList :: ReadS [DescribePrincipalIdFormatResponse]
readsPrec :: Int -> ReadS DescribePrincipalIdFormatResponse
$creadsPrec :: Int -> ReadS DescribePrincipalIdFormatResponse
Prelude.Read, Int -> DescribePrincipalIdFormatResponse -> ShowS
[DescribePrincipalIdFormatResponse] -> ShowS
DescribePrincipalIdFormatResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePrincipalIdFormatResponse] -> ShowS
$cshowList :: [DescribePrincipalIdFormatResponse] -> ShowS
show :: DescribePrincipalIdFormatResponse -> String
$cshow :: DescribePrincipalIdFormatResponse -> String
showsPrec :: Int -> DescribePrincipalIdFormatResponse -> ShowS
$cshowsPrec :: Int -> DescribePrincipalIdFormatResponse -> ShowS
Prelude.Show, forall x.
Rep DescribePrincipalIdFormatResponse x
-> DescribePrincipalIdFormatResponse
forall x.
DescribePrincipalIdFormatResponse
-> Rep DescribePrincipalIdFormatResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePrincipalIdFormatResponse x
-> DescribePrincipalIdFormatResponse
$cfrom :: forall x.
DescribePrincipalIdFormatResponse
-> Rep DescribePrincipalIdFormatResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribePrincipalIdFormatResponse' 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', 'describePrincipalIdFormatResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
--
-- 'principals', 'describePrincipalIdFormatResponse_principals' - Information about the ID format settings for the ARN.
--
-- 'httpStatus', 'describePrincipalIdFormatResponse_httpStatus' - The response's http status code.
newDescribePrincipalIdFormatResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribePrincipalIdFormatResponse
newDescribePrincipalIdFormatResponse :: Int -> DescribePrincipalIdFormatResponse
newDescribePrincipalIdFormatResponse Int
pHttpStatus_ =
  DescribePrincipalIdFormatResponse'
    { $sel:nextToken:DescribePrincipalIdFormatResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:principals:DescribePrincipalIdFormatResponse' :: Maybe [PrincipalIdFormat]
principals = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribePrincipalIdFormatResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
describePrincipalIdFormatResponse_nextToken :: Lens.Lens' DescribePrincipalIdFormatResponse (Prelude.Maybe Prelude.Text)
describePrincipalIdFormatResponse_nextToken :: Lens' DescribePrincipalIdFormatResponse (Maybe Text)
describePrincipalIdFormatResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalIdFormatResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribePrincipalIdFormatResponse' :: DescribePrincipalIdFormatResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribePrincipalIdFormatResponse
s@DescribePrincipalIdFormatResponse' {} Maybe Text
a -> DescribePrincipalIdFormatResponse
s {$sel:nextToken:DescribePrincipalIdFormatResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribePrincipalIdFormatResponse)

-- | Information about the ID format settings for the ARN.
describePrincipalIdFormatResponse_principals :: Lens.Lens' DescribePrincipalIdFormatResponse (Prelude.Maybe [PrincipalIdFormat])
describePrincipalIdFormatResponse_principals :: Lens' DescribePrincipalIdFormatResponse (Maybe [PrincipalIdFormat])
describePrincipalIdFormatResponse_principals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalIdFormatResponse' {Maybe [PrincipalIdFormat]
principals :: Maybe [PrincipalIdFormat]
$sel:principals:DescribePrincipalIdFormatResponse' :: DescribePrincipalIdFormatResponse -> Maybe [PrincipalIdFormat]
principals} -> Maybe [PrincipalIdFormat]
principals) (\s :: DescribePrincipalIdFormatResponse
s@DescribePrincipalIdFormatResponse' {} Maybe [PrincipalIdFormat]
a -> DescribePrincipalIdFormatResponse
s {$sel:principals:DescribePrincipalIdFormatResponse' :: Maybe [PrincipalIdFormat]
principals = Maybe [PrincipalIdFormat]
a} :: DescribePrincipalIdFormatResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribePrincipalIdFormatResponse
  where
  rnf :: DescribePrincipalIdFormatResponse -> ()
rnf DescribePrincipalIdFormatResponse' {Int
Maybe [PrincipalIdFormat]
Maybe Text
httpStatus :: Int
principals :: Maybe [PrincipalIdFormat]
nextToken :: Maybe Text
$sel:httpStatus:DescribePrincipalIdFormatResponse' :: DescribePrincipalIdFormatResponse -> Int
$sel:principals:DescribePrincipalIdFormatResponse' :: DescribePrincipalIdFormatResponse -> Maybe [PrincipalIdFormat]
$sel:nextToken:DescribePrincipalIdFormatResponse' :: DescribePrincipalIdFormatResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PrincipalIdFormat]
principals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus