{-# 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.DeviceFarm.ListInstanceProfiles
-- 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)
--
-- Returns information about all the instance profiles in an AWS account.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.ListInstanceProfiles
  ( -- * Creating a Request
    ListInstanceProfiles (..),
    newListInstanceProfiles,

    -- * Request Lenses
    listInstanceProfiles_nextToken,
    listInstanceProfiles_maxResults,

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

    -- * Response Lenses
    listInstanceProfilesResponse_nextToken,
    listInstanceProfilesResponse_instanceProfiles,
    listInstanceProfilesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListInstanceProfiles' smart constructor.
data ListInstanceProfiles = ListInstanceProfiles'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListInstanceProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An integer that specifies the maximum number of items you want to return
    -- in the API response.
    ListInstanceProfiles -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListInstanceProfiles -> ListInstanceProfiles -> Bool
(ListInstanceProfiles -> ListInstanceProfiles -> Bool)
-> (ListInstanceProfiles -> ListInstanceProfiles -> Bool)
-> Eq ListInstanceProfiles
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]
(Int -> ReadS ListInstanceProfiles)
-> ReadS [ListInstanceProfiles]
-> ReadPrec ListInstanceProfiles
-> ReadPrec [ListInstanceProfiles]
-> Read 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
(Int -> ListInstanceProfiles -> ShowS)
-> (ListInstanceProfiles -> String)
-> ([ListInstanceProfiles] -> ShowS)
-> Show ListInstanceProfiles
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. ListInstanceProfiles -> Rep ListInstanceProfiles x)
-> (forall x. Rep ListInstanceProfiles x -> ListInstanceProfiles)
-> Generic ListInstanceProfiles
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:
--
-- 'nextToken', 'listInstanceProfiles_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'maxResults', 'listInstanceProfiles_maxResults' - An integer that specifies the maximum number of items you want to return
-- in the API response.
newListInstanceProfiles ::
  ListInstanceProfiles
newListInstanceProfiles :: ListInstanceProfiles
newListInstanceProfiles =
  ListInstanceProfiles' :: Maybe Text -> Maybe Int -> ListInstanceProfiles
ListInstanceProfiles'
    { $sel:nextToken:ListInstanceProfiles' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListInstanceProfiles' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listInstanceProfiles_nextToken :: Lens.Lens' ListInstanceProfiles (Prelude.Maybe Prelude.Text)
listInstanceProfiles_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInstanceProfiles -> f ListInstanceProfiles
listInstanceProfiles_nextToken = (ListInstanceProfiles -> Maybe Text)
-> (ListInstanceProfiles -> Maybe Text -> ListInstanceProfiles)
-> Lens
     ListInstanceProfiles ListInstanceProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstanceProfiles
s@ListInstanceProfiles' {} Maybe Text
a -> ListInstanceProfiles
s {$sel:nextToken:ListInstanceProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstanceProfiles)

-- | An integer that specifies the maximum number of items you want to return
-- in the API response.
listInstanceProfiles_maxResults :: Lens.Lens' ListInstanceProfiles (Prelude.Maybe Prelude.Int)
listInstanceProfiles_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListInstanceProfiles -> f ListInstanceProfiles
listInstanceProfiles_maxResults = (ListInstanceProfiles -> Maybe Int)
-> (ListInstanceProfiles -> Maybe Int -> ListInstanceProfiles)
-> Lens
     ListInstanceProfiles ListInstanceProfiles (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfiles' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListInstanceProfiles
s@ListInstanceProfiles' {} Maybe Int
a -> ListInstanceProfiles
s {$sel:maxResults:ListInstanceProfiles' :: Maybe Int
maxResults = Maybe Int
a} :: ListInstanceProfiles)

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

instance Prelude.NFData ListInstanceProfiles

instance Core.ToHeaders ListInstanceProfiles where
  toHeaders :: ListInstanceProfiles -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListInstanceProfiles -> 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
"DeviceFarm_20150623.ListInstanceProfiles" ::
                          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 ListInstanceProfiles where
  toJSON :: ListInstanceProfiles -> Value
toJSON ListInstanceProfiles' {Maybe Int
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:maxResults:ListInstanceProfiles' :: ListInstanceProfiles -> Maybe Int
$sel:nextToken:ListInstanceProfiles' :: ListInstanceProfiles -> 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 -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newListInstanceProfilesResponse' smart constructor.
data ListInstanceProfilesResponse = ListInstanceProfilesResponse'
  { -- | An identifier that can be used in the next call to this operation to
    -- return the next set of items in the list.
    ListInstanceProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An object that contains information about your instance profiles.
    ListInstanceProfilesResponse -> Maybe [InstanceProfile]
instanceProfiles :: Prelude.Maybe [InstanceProfile],
    -- | The response's http status code.
    ListInstanceProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListInstanceProfilesResponse
-> ListInstanceProfilesResponse -> Bool
(ListInstanceProfilesResponse
 -> ListInstanceProfilesResponse -> Bool)
-> (ListInstanceProfilesResponse
    -> ListInstanceProfilesResponse -> Bool)
-> Eq ListInstanceProfilesResponse
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]
(Int -> ReadS ListInstanceProfilesResponse)
-> ReadS [ListInstanceProfilesResponse]
-> ReadPrec ListInstanceProfilesResponse
-> ReadPrec [ListInstanceProfilesResponse]
-> Read 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
(Int -> ListInstanceProfilesResponse -> ShowS)
-> (ListInstanceProfilesResponse -> String)
-> ([ListInstanceProfilesResponse] -> ShowS)
-> Show ListInstanceProfilesResponse
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.
 ListInstanceProfilesResponse -> Rep ListInstanceProfilesResponse x)
-> (forall x.
    Rep ListInstanceProfilesResponse x -> ListInstanceProfilesResponse)
-> Generic ListInstanceProfilesResponse
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:
--
-- 'nextToken', 'listInstanceProfilesResponse_nextToken' - An identifier that can be used in the next call to this operation to
-- return the next set of items in the list.
--
-- 'instanceProfiles', 'listInstanceProfilesResponse_instanceProfiles' - An object that contains information about your instance profiles.
--
-- 'httpStatus', 'listInstanceProfilesResponse_httpStatus' - The response's http status code.
newListInstanceProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInstanceProfilesResponse
newListInstanceProfilesResponse :: Int -> ListInstanceProfilesResponse
newListInstanceProfilesResponse Int
pHttpStatus_ =
  ListInstanceProfilesResponse' :: Maybe Text
-> Maybe [InstanceProfile] -> Int -> ListInstanceProfilesResponse
ListInstanceProfilesResponse'
    { $sel:nextToken:ListInstanceProfilesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceProfiles:ListInstanceProfilesResponse' :: Maybe [InstanceProfile]
instanceProfiles = Maybe [InstanceProfile]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInstanceProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An identifier that can be used in the next call to this operation to
-- return the next set of items in the list.
listInstanceProfilesResponse_nextToken :: Lens.Lens' ListInstanceProfilesResponse (Prelude.Maybe Prelude.Text)
listInstanceProfilesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInstanceProfilesResponse -> f ListInstanceProfilesResponse
listInstanceProfilesResponse_nextToken = (ListInstanceProfilesResponse -> Maybe Text)
-> (ListInstanceProfilesResponse
    -> Maybe Text -> ListInstanceProfilesResponse)
-> Lens' ListInstanceProfilesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstanceProfilesResponse
s@ListInstanceProfilesResponse' {} Maybe Text
a -> ListInstanceProfilesResponse
s {$sel:nextToken:ListInstanceProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstanceProfilesResponse)

-- | An object that contains information about your instance profiles.
listInstanceProfilesResponse_instanceProfiles :: Lens.Lens' ListInstanceProfilesResponse (Prelude.Maybe [InstanceProfile])
listInstanceProfilesResponse_instanceProfiles :: (Maybe [InstanceProfile] -> f (Maybe [InstanceProfile]))
-> ListInstanceProfilesResponse -> f ListInstanceProfilesResponse
listInstanceProfilesResponse_instanceProfiles = (ListInstanceProfilesResponse -> Maybe [InstanceProfile])
-> (ListInstanceProfilesResponse
    -> Maybe [InstanceProfile] -> ListInstanceProfilesResponse)
-> Lens' ListInstanceProfilesResponse (Maybe [InstanceProfile])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceProfilesResponse' {Maybe [InstanceProfile]
instanceProfiles :: Maybe [InstanceProfile]
$sel:instanceProfiles:ListInstanceProfilesResponse' :: ListInstanceProfilesResponse -> Maybe [InstanceProfile]
instanceProfiles} -> Maybe [InstanceProfile]
instanceProfiles) (\s :: ListInstanceProfilesResponse
s@ListInstanceProfilesResponse' {} Maybe [InstanceProfile]
a -> ListInstanceProfilesResponse
s {$sel:instanceProfiles:ListInstanceProfilesResponse' :: Maybe [InstanceProfile]
instanceProfiles = Maybe [InstanceProfile]
a} :: ListInstanceProfilesResponse) ((Maybe [InstanceProfile] -> f (Maybe [InstanceProfile]))
 -> ListInstanceProfilesResponse -> f ListInstanceProfilesResponse)
-> ((Maybe [InstanceProfile] -> f (Maybe [InstanceProfile]))
    -> Maybe [InstanceProfile] -> f (Maybe [InstanceProfile]))
-> (Maybe [InstanceProfile] -> f (Maybe [InstanceProfile]))
-> ListInstanceProfilesResponse
-> f ListInstanceProfilesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstanceProfile]
  [InstanceProfile]
  [InstanceProfile]
  [InstanceProfile]
-> Iso
     (Maybe [InstanceProfile])
     (Maybe [InstanceProfile])
     (Maybe [InstanceProfile])
     (Maybe [InstanceProfile])
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
  [InstanceProfile]
  [InstanceProfile]
  [InstanceProfile]
  [InstanceProfile]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listInstanceProfilesResponse_httpStatus :: Lens.Lens' ListInstanceProfilesResponse Prelude.Int
listInstanceProfilesResponse_httpStatus :: (Int -> f Int)
-> ListInstanceProfilesResponse -> f ListInstanceProfilesResponse
listInstanceProfilesResponse_httpStatus = (ListInstanceProfilesResponse -> Int)
-> (ListInstanceProfilesResponse
    -> Int -> ListInstanceProfilesResponse)
-> Lens
     ListInstanceProfilesResponse ListInstanceProfilesResponse Int Int
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)

instance Prelude.NFData ListInstanceProfilesResponse