{-# 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.ListInstanceProfiles
-- 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 path prefix. If
-- there are none, the operation returns an empty list. For more
-- information about instance profiles, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html About instance profiles>.
--
-- IAM resource-listing operations return a subset of the available
-- attributes for the resource. For example, this operation does not return
-- tags, even though they are an attribute of the returned object. To view
-- all of the information for an instance profile, see GetInstanceProfile.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListInstanceProfiles
  ( -- * Creating a Request
    ListInstanceProfiles (..),
    newListInstanceProfiles,

    -- * Request Lenses
    listInstanceProfiles_marker,
    listInstanceProfiles_maxItems,
    listInstanceProfiles_pathPrefix,

    -- * Destructuring the Response
    ListInstanceProfilesResponse (..),
    newListInstanceProfilesResponse,

    -- * Response Lenses
    listInstanceProfilesResponse_isTruncated,
    listInstanceProfilesResponse_marker,
    listInstanceProfilesResponse_httpStatus,
    listInstanceProfilesResponse_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:/ 'newListInstanceProfiles' smart constructor.
data ListInstanceProfiles = ListInstanceProfiles'
  { -- | 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.
    ListInstanceProfiles -> 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.
    ListInstanceProfiles -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The path prefix for filtering the results. For example, the prefix
    -- @\/application_abc\/component_xyz\/@ gets all instance profiles whose
    -- path starts with @\/application_abc\/component_xyz\/@.
    --
    -- This parameter is optional. If it is not included, it defaults to a
    -- slash (\/), listing all instance profiles. This parameter allows
    -- (through its <http://wikipedia.org/wiki/regex regex pattern>) a string
    -- of characters consisting of either a forward slash (\/) by itself or a
    -- string that must begin and end with forward slashes. In addition, it can
    -- contain any ASCII character from the ! (@\\u0021@) through the DEL
    -- character (@\\u007F@), including most punctuation characters, digits,
    -- and upper and lowercased letters.
    ListInstanceProfiles -> Maybe Text
pathPrefix :: Prelude.Maybe Prelude.Text
  }
  deriving (ListInstanceProfiles -> ListInstanceProfiles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceProfiles -> ListInstanceProfiles -> Bool
$c/= :: ListInstanceProfiles -> ListInstanceProfiles -> Bool
== :: ListInstanceProfiles -> ListInstanceProfiles -> Bool
$c== :: ListInstanceProfiles -> ListInstanceProfiles -> Bool
Prelude.Eq, ReadPrec [ListInstanceProfiles]
ReadPrec ListInstanceProfiles
Int -> ReadS ListInstanceProfiles
ReadS [ListInstanceProfiles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceProfiles]
$creadListPrec :: ReadPrec [ListInstanceProfiles]
readPrec :: ReadPrec ListInstanceProfiles
$creadPrec :: ReadPrec ListInstanceProfiles
readList :: ReadS [ListInstanceProfiles]
$creadList :: ReadS [ListInstanceProfiles]
readsPrec :: Int -> ReadS ListInstanceProfiles
$creadsPrec :: Int -> ReadS ListInstanceProfiles
Prelude.Read, Int -> ListInstanceProfiles -> ShowS
[ListInstanceProfiles] -> ShowS
ListInstanceProfiles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceProfiles] -> ShowS
$cshowList :: [ListInstanceProfiles] -> ShowS
show :: ListInstanceProfiles -> String
$cshow :: ListInstanceProfiles -> String
showsPrec :: Int -> ListInstanceProfiles -> ShowS
$cshowsPrec :: Int -> ListInstanceProfiles -> ShowS
Prelude.Show, forall x. Rep ListInstanceProfiles x -> ListInstanceProfiles
forall x. ListInstanceProfiles -> Rep ListInstanceProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInstanceProfiles x -> ListInstanceProfiles
$cfrom :: forall x. ListInstanceProfiles -> Rep ListInstanceProfiles x
Prelude.Generic)

-- |
-- Create a value of 'ListInstanceProfiles' 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', 'listInstanceProfiles_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', 'listInstanceProfiles_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.
--
-- 'pathPrefix', 'listInstanceProfiles_pathPrefix' - The path prefix for filtering the results. For example, the prefix
-- @\/application_abc\/component_xyz\/@ gets all instance profiles whose
-- path starts with @\/application_abc\/component_xyz\/@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all instance profiles. This parameter allows
-- (through its <http://wikipedia.org/wiki/regex regex pattern>) a string
-- of characters consisting of either a forward slash (\/) by itself or a
-- string that must begin and end with forward slashes. In addition, it can
-- contain any ASCII character from the ! (@\\u0021@) through the DEL
-- character (@\\u007F@), including most punctuation characters, digits,
-- and upper and lowercased letters.
newListInstanceProfiles ::
  ListInstanceProfiles
newListInstanceProfiles :: ListInstanceProfiles
newListInstanceProfiles =
  ListInstanceProfiles'
    { $sel:marker:ListInstanceProfiles' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListInstanceProfiles' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:pathPrefix:ListInstanceProfiles' :: Maybe Text
pathPrefix = forall a. Maybe a
Prelude.Nothing
    }

-- | 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.
listInstanceProfiles_marker :: Lens.Lens' ListInstanceProfiles (Prelude.Maybe Prelude.Text)
listInstanceProfiles_marker :: Lens' ListInstanceProfiles (Maybe Text)
listInstanceProfiles_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfiles' {Maybe Text
marker :: Maybe Text
$sel:marker:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListInstanceProfiles
s@ListInstanceProfiles' {} Maybe Text
a -> ListInstanceProfiles
s {$sel:marker:ListInstanceProfiles' :: Maybe Text
marker = Maybe Text
a} :: ListInstanceProfiles)

-- | 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.
listInstanceProfiles_maxItems :: Lens.Lens' ListInstanceProfiles (Prelude.Maybe Prelude.Natural)
listInstanceProfiles_maxItems :: Lens' ListInstanceProfiles (Maybe Natural)
listInstanceProfiles_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfiles' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListInstanceProfiles
s@ListInstanceProfiles' {} Maybe Natural
a -> ListInstanceProfiles
s {$sel:maxItems:ListInstanceProfiles' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListInstanceProfiles)

-- | The path prefix for filtering the results. For example, the prefix
-- @\/application_abc\/component_xyz\/@ gets all instance profiles whose
-- path starts with @\/application_abc\/component_xyz\/@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all instance profiles. This parameter allows
-- (through its <http://wikipedia.org/wiki/regex regex pattern>) a string
-- of characters consisting of either a forward slash (\/) by itself or a
-- string that must begin and end with forward slashes. In addition, it can
-- contain any ASCII character from the ! (@\\u0021@) through the DEL
-- character (@\\u007F@), including most punctuation characters, digits,
-- and upper and lowercased letters.
listInstanceProfiles_pathPrefix :: Lens.Lens' ListInstanceProfiles (Prelude.Maybe Prelude.Text)
listInstanceProfiles_pathPrefix :: Lens' ListInstanceProfiles (Maybe Text)
listInstanceProfiles_pathPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfiles' {Maybe Text
pathPrefix :: Maybe Text
$sel:pathPrefix:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
pathPrefix} -> Maybe Text
pathPrefix) (\s :: ListInstanceProfiles
s@ListInstanceProfiles' {} Maybe Text
a -> ListInstanceProfiles
s {$sel:pathPrefix:ListInstanceProfiles' :: Maybe Text
pathPrefix = Maybe Text
a} :: ListInstanceProfiles)

instance Core.AWSPager ListInstanceProfiles where
  page :: ListInstanceProfiles
-> AWSResponse ListInstanceProfiles -> Maybe ListInstanceProfiles
page ListInstanceProfiles
rq AWSResponse ListInstanceProfiles
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInstanceProfiles
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceProfilesResponse (Maybe Bool)
listInstanceProfilesResponse_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 ListInstanceProfiles
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceProfilesResponse (Maybe Text)
listInstanceProfilesResponse_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.$ ListInstanceProfiles
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListInstanceProfiles (Maybe Text)
listInstanceProfiles_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInstanceProfiles
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceProfilesResponse (Maybe Text)
listInstanceProfilesResponse_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 ListInstanceProfiles where
  type
    AWSResponse ListInstanceProfiles =
      ListInstanceProfilesResponse
  request :: (Service -> Service)
-> ListInstanceProfiles -> Request ListInstanceProfiles
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 ListInstanceProfiles
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListInstanceProfiles)))
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
"ListInstanceProfilesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Maybe Text
-> Int
-> [InstanceProfile]
-> ListInstanceProfilesResponse
ListInstanceProfilesResponse'
            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 ListInstanceProfiles where
  hashWithSalt :: Int -> ListInstanceProfiles -> Int
hashWithSalt Int
_salt ListInstanceProfiles' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
$sel:maxItems:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Natural
$sel:marker:ListInstanceProfiles' :: ListInstanceProfiles -> 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` Maybe Text
pathPrefix

instance Prelude.NFData ListInstanceProfiles where
  rnf :: ListInstanceProfiles -> ()
rnf ListInstanceProfiles' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
$sel:maxItems:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Natural
$sel:marker:ListInstanceProfiles' :: ListInstanceProfiles -> 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 Maybe Text
pathPrefix

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

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

instance Data.ToQuery ListInstanceProfiles where
  toQuery :: ListInstanceProfiles -> QueryString
toQuery ListInstanceProfiles' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
$sel:maxItems:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Natural
$sel:marker:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListInstanceProfiles" :: 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
"PathPrefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
pathPrefix
      ]

-- | Contains the response to a successful ListInstanceProfiles request.
--
-- /See:/ 'newListInstanceProfilesResponse' smart constructor.
data ListInstanceProfilesResponse = ListInstanceProfilesResponse'
  { -- | 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.
    ListInstanceProfilesResponse -> 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.
    ListInstanceProfilesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListInstanceProfilesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of instance profiles.
    ListInstanceProfilesResponse -> [InstanceProfile]
instanceProfiles :: [InstanceProfile]
  }
  deriving (ListInstanceProfilesResponse
-> ListInstanceProfilesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceProfilesResponse
-> ListInstanceProfilesResponse -> Bool
$c/= :: ListInstanceProfilesResponse
-> ListInstanceProfilesResponse -> Bool
== :: ListInstanceProfilesResponse
-> ListInstanceProfilesResponse -> Bool
$c== :: ListInstanceProfilesResponse
-> ListInstanceProfilesResponse -> Bool
Prelude.Eq, ReadPrec [ListInstanceProfilesResponse]
ReadPrec ListInstanceProfilesResponse
Int -> ReadS ListInstanceProfilesResponse
ReadS [ListInstanceProfilesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceProfilesResponse]
$creadListPrec :: ReadPrec [ListInstanceProfilesResponse]
readPrec :: ReadPrec ListInstanceProfilesResponse
$creadPrec :: ReadPrec ListInstanceProfilesResponse
readList :: ReadS [ListInstanceProfilesResponse]
$creadList :: ReadS [ListInstanceProfilesResponse]
readsPrec :: Int -> ReadS ListInstanceProfilesResponse
$creadsPrec :: Int -> ReadS ListInstanceProfilesResponse
Prelude.Read, Int -> ListInstanceProfilesResponse -> ShowS
[ListInstanceProfilesResponse] -> ShowS
ListInstanceProfilesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceProfilesResponse] -> ShowS
$cshowList :: [ListInstanceProfilesResponse] -> ShowS
show :: ListInstanceProfilesResponse -> String
$cshow :: ListInstanceProfilesResponse -> String
showsPrec :: Int -> ListInstanceProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListInstanceProfilesResponse -> ShowS
Prelude.Show, forall x.
Rep ListInstanceProfilesResponse x -> ListInstanceProfilesResponse
forall x.
ListInstanceProfilesResponse -> Rep ListInstanceProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstanceProfilesResponse x -> ListInstanceProfilesResponse
$cfrom :: forall x.
ListInstanceProfilesResponse -> Rep ListInstanceProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListInstanceProfilesResponse' 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', 'listInstanceProfilesResponse_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', 'listInstanceProfilesResponse_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', 'listInstanceProfilesResponse_httpStatus' - The response's http status code.
--
-- 'instanceProfiles', 'listInstanceProfilesResponse_instanceProfiles' - A list of instance profiles.
newListInstanceProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInstanceProfilesResponse
newListInstanceProfilesResponse :: Int -> ListInstanceProfilesResponse
newListInstanceProfilesResponse Int
pHttpStatus_ =
  ListInstanceProfilesResponse'
    { $sel:isTruncated:ListInstanceProfilesResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListInstanceProfilesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInstanceProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:instanceProfiles:ListInstanceProfilesResponse' :: [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.
listInstanceProfilesResponse_isTruncated :: Lens.Lens' ListInstanceProfilesResponse (Prelude.Maybe Prelude.Bool)
listInstanceProfilesResponse_isTruncated :: Lens' ListInstanceProfilesResponse (Maybe Bool)
listInstanceProfilesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListInstanceProfilesResponse
s@ListInstanceProfilesResponse' {} Maybe Bool
a -> ListInstanceProfilesResponse
s {$sel:isTruncated:ListInstanceProfilesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListInstanceProfilesResponse)

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

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

-- | A list of instance profiles.
listInstanceProfilesResponse_instanceProfiles :: Lens.Lens' ListInstanceProfilesResponse [InstanceProfile]
listInstanceProfilesResponse_instanceProfiles :: Lens' ListInstanceProfilesResponse [InstanceProfile]
listInstanceProfilesResponse_instanceProfiles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesResponse' {[InstanceProfile]
instanceProfiles :: [InstanceProfile]
$sel:instanceProfiles:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> [InstanceProfile]
instanceProfiles} -> [InstanceProfile]
instanceProfiles) (\s :: ListInstanceProfilesResponse
s@ListInstanceProfilesResponse' {} [InstanceProfile]
a -> ListInstanceProfilesResponse
s {$sel:instanceProfiles:ListInstanceProfilesResponse' :: [InstanceProfile]
instanceProfiles = [InstanceProfile]
a} :: ListInstanceProfilesResponse) 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 ListInstanceProfilesResponse where
  rnf :: ListInstanceProfilesResponse -> ()
rnf ListInstanceProfilesResponse' {Int
[InstanceProfile]
Maybe Bool
Maybe Text
instanceProfiles :: [InstanceProfile]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:instanceProfiles:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> [InstanceProfile]
$sel:httpStatus:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> Int
$sel:marker:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> Maybe Text
$sel:isTruncated:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> 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