{-# 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.IAM.ListInstanceProfilesForRole
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the instance profiles that have the specified associated IAM role.
-- If there are none, the operation returns an empty list. For more
-- information about instance profiles, go to
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html About instance profiles>.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListInstanceProfilesForRole
  ( -- * Creating a Request
    ListInstanceProfilesForRole (..),
    newListInstanceProfilesForRole,

    -- * Request Lenses
    listInstanceProfilesForRole_marker,
    listInstanceProfilesForRole_maxItems,
    listInstanceProfilesForRole_roleName,

    -- * Destructuring the Response
    ListInstanceProfilesForRoleResponse (..),
    newListInstanceProfilesForRoleResponse,

    -- * Response Lenses
    listInstanceProfilesForRoleResponse_isTruncated,
    listInstanceProfilesForRoleResponse_marker,
    listInstanceProfilesForRoleResponse_httpStatus,
    listInstanceProfilesForRoleResponse_instanceProfiles,
  )
where

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

-- | /See:/ 'newListInstanceProfilesForRole' smart constructor.
data ListInstanceProfilesForRole = ListInstanceProfilesForRole'
  { -- | Use this parameter only when paginating results and only after you
    -- receive a response indicating that the results are truncated. Set it to
    -- the value of the @Marker@ element in the response that you received to
    -- indicate where the next call should start.
    ListInstanceProfilesForRole -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this only when paginating results to indicate the maximum number of
    -- items you want in the response. If additional items exist beyond the
    -- maximum you specify, the @IsTruncated@ response element is @true@.
    --
    -- If you do not include this parameter, the number of items defaults to
    -- 100. Note that IAM might return fewer results, even when there are more
    -- results available. In that case, the @IsTruncated@ response element
    -- returns @true@, and @Marker@ contains a value to include in the
    -- subsequent call that tells the service where to continue from.
    ListInstanceProfilesForRole -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The name of the role to list instance profiles for.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of upper and lowercase alphanumeric characters with no
    -- spaces. You can also include any of the following characters: _+=,.\@-
    ListInstanceProfilesForRole -> Text
roleName :: Prelude.Text
  }
  deriving (ListInstanceProfilesForRole -> ListInstanceProfilesForRole -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceProfilesForRole -> ListInstanceProfilesForRole -> Bool
$c/= :: ListInstanceProfilesForRole -> ListInstanceProfilesForRole -> Bool
== :: ListInstanceProfilesForRole -> ListInstanceProfilesForRole -> Bool
$c== :: ListInstanceProfilesForRole -> ListInstanceProfilesForRole -> Bool
Prelude.Eq, ReadPrec [ListInstanceProfilesForRole]
ReadPrec ListInstanceProfilesForRole
Int -> ReadS ListInstanceProfilesForRole
ReadS [ListInstanceProfilesForRole]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceProfilesForRole]
$creadListPrec :: ReadPrec [ListInstanceProfilesForRole]
readPrec :: ReadPrec ListInstanceProfilesForRole
$creadPrec :: ReadPrec ListInstanceProfilesForRole
readList :: ReadS [ListInstanceProfilesForRole]
$creadList :: ReadS [ListInstanceProfilesForRole]
readsPrec :: Int -> ReadS ListInstanceProfilesForRole
$creadsPrec :: Int -> ReadS ListInstanceProfilesForRole
Prelude.Read, Int -> ListInstanceProfilesForRole -> ShowS
[ListInstanceProfilesForRole] -> ShowS
ListInstanceProfilesForRole -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceProfilesForRole] -> ShowS
$cshowList :: [ListInstanceProfilesForRole] -> ShowS
show :: ListInstanceProfilesForRole -> String
$cshow :: ListInstanceProfilesForRole -> String
showsPrec :: Int -> ListInstanceProfilesForRole -> ShowS
$cshowsPrec :: Int -> ListInstanceProfilesForRole -> ShowS
Prelude.Show, forall x.
Rep ListInstanceProfilesForRole x -> ListInstanceProfilesForRole
forall x.
ListInstanceProfilesForRole -> Rep ListInstanceProfilesForRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstanceProfilesForRole x -> ListInstanceProfilesForRole
$cfrom :: forall x.
ListInstanceProfilesForRole -> Rep ListInstanceProfilesForRole x
Prelude.Generic)

-- |
-- Create a value of 'ListInstanceProfilesForRole' 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:
--
-- 'marker', 'listInstanceProfilesForRole_marker' - Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
--
-- 'maxItems', 'listInstanceProfilesForRole_maxItems' - Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
--
-- 'roleName', 'listInstanceProfilesForRole_roleName' - The name of the role to list instance profiles for.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
newListInstanceProfilesForRole ::
  -- | 'roleName'
  Prelude.Text ->
  ListInstanceProfilesForRole
newListInstanceProfilesForRole :: Text -> ListInstanceProfilesForRole
newListInstanceProfilesForRole Text
pRoleName_ =
  ListInstanceProfilesForRole'
    { $sel:marker:ListInstanceProfilesForRole' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListInstanceProfilesForRole' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:roleName:ListInstanceProfilesForRole' :: Text
roleName = Text
pRoleName_
    }

-- | Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
listInstanceProfilesForRole_marker :: Lens.Lens' ListInstanceProfilesForRole (Prelude.Maybe Prelude.Text)
listInstanceProfilesForRole_marker :: Lens' ListInstanceProfilesForRole (Maybe Text)
listInstanceProfilesForRole_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesForRole' {Maybe Text
marker :: Maybe Text
$sel:marker:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListInstanceProfilesForRole
s@ListInstanceProfilesForRole' {} Maybe Text
a -> ListInstanceProfilesForRole
s {$sel:marker:ListInstanceProfilesForRole' :: Maybe Text
marker = Maybe Text
a} :: ListInstanceProfilesForRole)

-- | Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
listInstanceProfilesForRole_maxItems :: Lens.Lens' ListInstanceProfilesForRole (Prelude.Maybe Prelude.Natural)
listInstanceProfilesForRole_maxItems :: Lens' ListInstanceProfilesForRole (Maybe Natural)
listInstanceProfilesForRole_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesForRole' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListInstanceProfilesForRole
s@ListInstanceProfilesForRole' {} Maybe Natural
a -> ListInstanceProfilesForRole
s {$sel:maxItems:ListInstanceProfilesForRole' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListInstanceProfilesForRole)

-- | The name of the role to list instance profiles for.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
listInstanceProfilesForRole_roleName :: Lens.Lens' ListInstanceProfilesForRole Prelude.Text
listInstanceProfilesForRole_roleName :: Lens' ListInstanceProfilesForRole Text
listInstanceProfilesForRole_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesForRole' {Text
roleName :: Text
$sel:roleName:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Text
roleName} -> Text
roleName) (\s :: ListInstanceProfilesForRole
s@ListInstanceProfilesForRole' {} Text
a -> ListInstanceProfilesForRole
s {$sel:roleName:ListInstanceProfilesForRole' :: Text
roleName = Text
a} :: ListInstanceProfilesForRole)

instance Core.AWSPager ListInstanceProfilesForRole where
  page :: ListInstanceProfilesForRole
-> AWSResponse ListInstanceProfilesForRole
-> Maybe ListInstanceProfilesForRole
page ListInstanceProfilesForRole
rq AWSResponse ListInstanceProfilesForRole
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInstanceProfilesForRole
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceProfilesForRoleResponse (Maybe Bool)
listInstanceProfilesForRoleResponse_isTruncated
            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. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListInstanceProfilesForRole
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceProfilesForRoleResponse (Maybe Text)
listInstanceProfilesForRoleResponse_marker
            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.$ ListInstanceProfilesForRole
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListInstanceProfilesForRole (Maybe Text)
listInstanceProfilesForRole_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInstanceProfilesForRole
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceProfilesForRoleResponse (Maybe Text)
listInstanceProfilesForRoleResponse_marker
          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 ListInstanceProfilesForRole where
  type
    AWSResponse ListInstanceProfilesForRole =
      ListInstanceProfilesForRoleResponse
  request :: (Service -> Service)
-> ListInstanceProfilesForRole
-> Request ListInstanceProfilesForRole
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 ListInstanceProfilesForRole
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListInstanceProfilesForRole)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListInstanceProfilesForRoleResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Maybe Text
-> Int
-> [InstanceProfile]
-> ListInstanceProfilesForRoleResponse
ListInstanceProfilesForRoleResponse'
            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
"IsTruncated")
            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
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"InstanceProfiles"
                            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 a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListInstanceProfilesForRole where
  hashWithSalt :: Int -> ListInstanceProfilesForRole -> Int
hashWithSalt Int
_salt ListInstanceProfilesForRole' {Maybe Natural
Maybe Text
Text
roleName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:roleName:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Text
$sel:maxItems:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Natural
$sel:marker:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleName

instance Prelude.NFData ListInstanceProfilesForRole where
  rnf :: ListInstanceProfilesForRole -> ()
rnf ListInstanceProfilesForRole' {Maybe Natural
Maybe Text
Text
roleName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:roleName:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Text
$sel:maxItems:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Natural
$sel:marker:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleName

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

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

instance Data.ToQuery ListInstanceProfilesForRole where
  toQuery :: ListInstanceProfilesForRole -> QueryString
toQuery ListInstanceProfilesForRole' {Maybe Natural
Maybe Text
Text
roleName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:roleName:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Text
$sel:maxItems:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Natural
$sel:marker:ListInstanceProfilesForRole' :: ListInstanceProfilesForRole -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"ListInstanceProfilesForRole" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxItems,
        ByteString
"RoleName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
roleName
      ]

-- | Contains the response to a successful ListInstanceProfilesForRole
-- request.
--
-- /See:/ 'newListInstanceProfilesForRoleResponse' smart constructor.
data ListInstanceProfilesForRoleResponse = ListInstanceProfilesForRoleResponse'
  { -- | A flag that indicates whether there are more items to return. If your
    -- results were truncated, you can make a subsequent pagination request
    -- using the @Marker@ request parameter to retrieve more items. Note that
    -- IAM might return fewer than the @MaxItems@ number of results even when
    -- there are more results available. We recommend that you check
    -- @IsTruncated@ after every call to ensure that you receive all your
    -- results.
    ListInstanceProfilesForRoleResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListInstanceProfilesForRoleResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListInstanceProfilesForRoleResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of instance profiles.
    ListInstanceProfilesForRoleResponse -> [InstanceProfile]
instanceProfiles :: [InstanceProfile]
  }
  deriving (ListInstanceProfilesForRoleResponse
-> ListInstanceProfilesForRoleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceProfilesForRoleResponse
-> ListInstanceProfilesForRoleResponse -> Bool
$c/= :: ListInstanceProfilesForRoleResponse
-> ListInstanceProfilesForRoleResponse -> Bool
== :: ListInstanceProfilesForRoleResponse
-> ListInstanceProfilesForRoleResponse -> Bool
$c== :: ListInstanceProfilesForRoleResponse
-> ListInstanceProfilesForRoleResponse -> Bool
Prelude.Eq, ReadPrec [ListInstanceProfilesForRoleResponse]
ReadPrec ListInstanceProfilesForRoleResponse
Int -> ReadS ListInstanceProfilesForRoleResponse
ReadS [ListInstanceProfilesForRoleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceProfilesForRoleResponse]
$creadListPrec :: ReadPrec [ListInstanceProfilesForRoleResponse]
readPrec :: ReadPrec ListInstanceProfilesForRoleResponse
$creadPrec :: ReadPrec ListInstanceProfilesForRoleResponse
readList :: ReadS [ListInstanceProfilesForRoleResponse]
$creadList :: ReadS [ListInstanceProfilesForRoleResponse]
readsPrec :: Int -> ReadS ListInstanceProfilesForRoleResponse
$creadsPrec :: Int -> ReadS ListInstanceProfilesForRoleResponse
Prelude.Read, Int -> ListInstanceProfilesForRoleResponse -> ShowS
[ListInstanceProfilesForRoleResponse] -> ShowS
ListInstanceProfilesForRoleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceProfilesForRoleResponse] -> ShowS
$cshowList :: [ListInstanceProfilesForRoleResponse] -> ShowS
show :: ListInstanceProfilesForRoleResponse -> String
$cshow :: ListInstanceProfilesForRoleResponse -> String
showsPrec :: Int -> ListInstanceProfilesForRoleResponse -> ShowS
$cshowsPrec :: Int -> ListInstanceProfilesForRoleResponse -> ShowS
Prelude.Show, forall x.
Rep ListInstanceProfilesForRoleResponse x
-> ListInstanceProfilesForRoleResponse
forall x.
ListInstanceProfilesForRoleResponse
-> Rep ListInstanceProfilesForRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstanceProfilesForRoleResponse x
-> ListInstanceProfilesForRoleResponse
$cfrom :: forall x.
ListInstanceProfilesForRoleResponse
-> Rep ListInstanceProfilesForRoleResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListInstanceProfilesForRoleResponse' 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:
--
-- 'isTruncated', 'listInstanceProfilesForRoleResponse_isTruncated' - A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
--
-- 'marker', 'listInstanceProfilesForRoleResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'httpStatus', 'listInstanceProfilesForRoleResponse_httpStatus' - The response's http status code.
--
-- 'instanceProfiles', 'listInstanceProfilesForRoleResponse_instanceProfiles' - A list of instance profiles.
newListInstanceProfilesForRoleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInstanceProfilesForRoleResponse
newListInstanceProfilesForRoleResponse :: Int -> ListInstanceProfilesForRoleResponse
newListInstanceProfilesForRoleResponse Int
pHttpStatus_ =
  ListInstanceProfilesForRoleResponse'
    { $sel:isTruncated:ListInstanceProfilesForRoleResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListInstanceProfilesForRoleResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInstanceProfilesForRoleResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:instanceProfiles:ListInstanceProfilesForRoleResponse' :: [InstanceProfile]
instanceProfiles = forall a. Monoid a => a
Prelude.mempty
    }

-- | A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
listInstanceProfilesForRoleResponse_isTruncated :: Lens.Lens' ListInstanceProfilesForRoleResponse (Prelude.Maybe Prelude.Bool)
listInstanceProfilesForRoleResponse_isTruncated :: Lens' ListInstanceProfilesForRoleResponse (Maybe Bool)
listInstanceProfilesForRoleResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesForRoleResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListInstanceProfilesForRoleResponse
s@ListInstanceProfilesForRoleResponse' {} Maybe Bool
a -> ListInstanceProfilesForRoleResponse
s {$sel:isTruncated:ListInstanceProfilesForRoleResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListInstanceProfilesForRoleResponse)

-- | When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
listInstanceProfilesForRoleResponse_marker :: Lens.Lens' ListInstanceProfilesForRoleResponse (Prelude.Maybe Prelude.Text)
listInstanceProfilesForRoleResponse_marker :: Lens' ListInstanceProfilesForRoleResponse (Maybe Text)
listInstanceProfilesForRoleResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesForRoleResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListInstanceProfilesForRoleResponse
s@ListInstanceProfilesForRoleResponse' {} Maybe Text
a -> ListInstanceProfilesForRoleResponse
s {$sel:marker:ListInstanceProfilesForRoleResponse' :: Maybe Text
marker = Maybe Text
a} :: ListInstanceProfilesForRoleResponse)

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

-- | A list of instance profiles.
listInstanceProfilesForRoleResponse_instanceProfiles :: Lens.Lens' ListInstanceProfilesForRoleResponse [InstanceProfile]
listInstanceProfilesForRoleResponse_instanceProfiles :: Lens' ListInstanceProfilesForRoleResponse [InstanceProfile]
listInstanceProfilesForRoleResponse_instanceProfiles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesForRoleResponse' {[InstanceProfile]
instanceProfiles :: [InstanceProfile]
$sel:instanceProfiles:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> [InstanceProfile]
instanceProfiles} -> [InstanceProfile]
instanceProfiles) (\s :: ListInstanceProfilesForRoleResponse
s@ListInstanceProfilesForRoleResponse' {} [InstanceProfile]
a -> ListInstanceProfilesForRoleResponse
s {$sel:instanceProfiles:ListInstanceProfilesForRoleResponse' :: [InstanceProfile]
instanceProfiles = [InstanceProfile]
a} :: ListInstanceProfilesForRoleResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListInstanceProfilesForRoleResponse
  where
  rnf :: ListInstanceProfilesForRoleResponse -> ()
rnf ListInstanceProfilesForRoleResponse' {Int
[InstanceProfile]
Maybe Bool
Maybe Text
instanceProfiles :: [InstanceProfile]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:instanceProfiles:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> [InstanceProfile]
$sel:httpStatus:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> Int
$sel:marker:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> Maybe Text
$sel:isTruncated:ListInstanceProfilesForRoleResponse' :: ListInstanceProfilesForRoleResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [InstanceProfile]
instanceProfiles