{-# 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.DescribeIamInstanceProfileAssociations
-- 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 your IAM instance profile associations.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeIamInstanceProfileAssociations
  ( -- * Creating a Request
    DescribeIamInstanceProfileAssociations (..),
    newDescribeIamInstanceProfileAssociations,

    -- * Request Lenses
    describeIamInstanceProfileAssociations_associationIds,
    describeIamInstanceProfileAssociations_filters,
    describeIamInstanceProfileAssociations_maxResults,
    describeIamInstanceProfileAssociations_nextToken,

    -- * Destructuring the Response
    DescribeIamInstanceProfileAssociationsResponse (..),
    newDescribeIamInstanceProfileAssociationsResponse,

    -- * Response Lenses
    describeIamInstanceProfileAssociationsResponse_iamInstanceProfileAssociations,
    describeIamInstanceProfileAssociationsResponse_nextToken,
    describeIamInstanceProfileAssociationsResponse_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:/ 'newDescribeIamInstanceProfileAssociations' smart constructor.
data DescribeIamInstanceProfileAssociations = DescribeIamInstanceProfileAssociations'
  { -- | The IAM instance profile associations.
    DescribeIamInstanceProfileAssociations -> Maybe [Text]
associationIds :: Prelude.Maybe [Prelude.Text],
    -- | The filters.
    --
    -- -   @instance-id@ - The ID of the instance.
    --
    -- -   @state@ - The state of the association (@associating@ | @associated@
    --     | @disassociating@).
    DescribeIamInstanceProfileAssociations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return in a single call. To retrieve
    -- the remaining results, make another call with the returned @NextToken@
    -- value.
    DescribeIamInstanceProfileAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to request the next page of results.
    DescribeIamInstanceProfileAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeIamInstanceProfileAssociations
-> DescribeIamInstanceProfileAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeIamInstanceProfileAssociations
-> DescribeIamInstanceProfileAssociations -> Bool
$c/= :: DescribeIamInstanceProfileAssociations
-> DescribeIamInstanceProfileAssociations -> Bool
== :: DescribeIamInstanceProfileAssociations
-> DescribeIamInstanceProfileAssociations -> Bool
$c== :: DescribeIamInstanceProfileAssociations
-> DescribeIamInstanceProfileAssociations -> Bool
Prelude.Eq, ReadPrec [DescribeIamInstanceProfileAssociations]
ReadPrec DescribeIamInstanceProfileAssociations
Int -> ReadS DescribeIamInstanceProfileAssociations
ReadS [DescribeIamInstanceProfileAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeIamInstanceProfileAssociations]
$creadListPrec :: ReadPrec [DescribeIamInstanceProfileAssociations]
readPrec :: ReadPrec DescribeIamInstanceProfileAssociations
$creadPrec :: ReadPrec DescribeIamInstanceProfileAssociations
readList :: ReadS [DescribeIamInstanceProfileAssociations]
$creadList :: ReadS [DescribeIamInstanceProfileAssociations]
readsPrec :: Int -> ReadS DescribeIamInstanceProfileAssociations
$creadsPrec :: Int -> ReadS DescribeIamInstanceProfileAssociations
Prelude.Read, Int -> DescribeIamInstanceProfileAssociations -> ShowS
[DescribeIamInstanceProfileAssociations] -> ShowS
DescribeIamInstanceProfileAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeIamInstanceProfileAssociations] -> ShowS
$cshowList :: [DescribeIamInstanceProfileAssociations] -> ShowS
show :: DescribeIamInstanceProfileAssociations -> String
$cshow :: DescribeIamInstanceProfileAssociations -> String
showsPrec :: Int -> DescribeIamInstanceProfileAssociations -> ShowS
$cshowsPrec :: Int -> DescribeIamInstanceProfileAssociations -> ShowS
Prelude.Show, forall x.
Rep DescribeIamInstanceProfileAssociations x
-> DescribeIamInstanceProfileAssociations
forall x.
DescribeIamInstanceProfileAssociations
-> Rep DescribeIamInstanceProfileAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeIamInstanceProfileAssociations x
-> DescribeIamInstanceProfileAssociations
$cfrom :: forall x.
DescribeIamInstanceProfileAssociations
-> Rep DescribeIamInstanceProfileAssociations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeIamInstanceProfileAssociations' 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:
--
-- 'associationIds', 'describeIamInstanceProfileAssociations_associationIds' - The IAM instance profile associations.
--
-- 'filters', 'describeIamInstanceProfileAssociations_filters' - The filters.
--
-- -   @instance-id@ - The ID of the instance.
--
-- -   @state@ - The state of the association (@associating@ | @associated@
--     | @disassociating@).
--
-- 'maxResults', 'describeIamInstanceProfileAssociations_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', 'describeIamInstanceProfileAssociations_nextToken' - The token to request the next page of results.
newDescribeIamInstanceProfileAssociations ::
  DescribeIamInstanceProfileAssociations
newDescribeIamInstanceProfileAssociations :: DescribeIamInstanceProfileAssociations
newDescribeIamInstanceProfileAssociations =
  DescribeIamInstanceProfileAssociations'
    { $sel:associationIds:DescribeIamInstanceProfileAssociations' :: Maybe [Text]
associationIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeIamInstanceProfileAssociations' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeIamInstanceProfileAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeIamInstanceProfileAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The IAM instance profile associations.
describeIamInstanceProfileAssociations_associationIds :: Lens.Lens' DescribeIamInstanceProfileAssociations (Prelude.Maybe [Prelude.Text])
describeIamInstanceProfileAssociations_associationIds :: Lens' DescribeIamInstanceProfileAssociations (Maybe [Text])
describeIamInstanceProfileAssociations_associationIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIamInstanceProfileAssociations' {Maybe [Text]
associationIds :: Maybe [Text]
$sel:associationIds:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Text]
associationIds} -> Maybe [Text]
associationIds) (\s :: DescribeIamInstanceProfileAssociations
s@DescribeIamInstanceProfileAssociations' {} Maybe [Text]
a -> DescribeIamInstanceProfileAssociations
s {$sel:associationIds:DescribeIamInstanceProfileAssociations' :: Maybe [Text]
associationIds = Maybe [Text]
a} :: DescribeIamInstanceProfileAssociations) 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 filters.
--
-- -   @instance-id@ - The ID of the instance.
--
-- -   @state@ - The state of the association (@associating@ | @associated@
--     | @disassociating@).
describeIamInstanceProfileAssociations_filters :: Lens.Lens' DescribeIamInstanceProfileAssociations (Prelude.Maybe [Filter])
describeIamInstanceProfileAssociations_filters :: Lens' DescribeIamInstanceProfileAssociations (Maybe [Filter])
describeIamInstanceProfileAssociations_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIamInstanceProfileAssociations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeIamInstanceProfileAssociations
s@DescribeIamInstanceProfileAssociations' {} Maybe [Filter]
a -> DescribeIamInstanceProfileAssociations
s {$sel:filters:DescribeIamInstanceProfileAssociations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeIamInstanceProfileAssociations) 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 maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned @NextToken@
-- value.
describeIamInstanceProfileAssociations_maxResults :: Lens.Lens' DescribeIamInstanceProfileAssociations (Prelude.Maybe Prelude.Natural)
describeIamInstanceProfileAssociations_maxResults :: Lens' DescribeIamInstanceProfileAssociations (Maybe Natural)
describeIamInstanceProfileAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIamInstanceProfileAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeIamInstanceProfileAssociations
s@DescribeIamInstanceProfileAssociations' {} Maybe Natural
a -> DescribeIamInstanceProfileAssociations
s {$sel:maxResults:DescribeIamInstanceProfileAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeIamInstanceProfileAssociations)

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

instance
  Core.AWSPager
    DescribeIamInstanceProfileAssociations
  where
  page :: DescribeIamInstanceProfileAssociations
-> AWSResponse DescribeIamInstanceProfileAssociations
-> Maybe DescribeIamInstanceProfileAssociations
page DescribeIamInstanceProfileAssociations
rq AWSResponse DescribeIamInstanceProfileAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeIamInstanceProfileAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeIamInstanceProfileAssociationsResponse (Maybe Text)
describeIamInstanceProfileAssociationsResponse_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 DescribeIamInstanceProfileAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeIamInstanceProfileAssociationsResponse
  (Maybe [IamInstanceProfileAssociation])
describeIamInstanceProfileAssociationsResponse_iamInstanceProfileAssociations
            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.$ DescribeIamInstanceProfileAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeIamInstanceProfileAssociations (Maybe Text)
describeIamInstanceProfileAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeIamInstanceProfileAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeIamInstanceProfileAssociationsResponse (Maybe Text)
describeIamInstanceProfileAssociationsResponse_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
    DescribeIamInstanceProfileAssociations
  where
  type
    AWSResponse
      DescribeIamInstanceProfileAssociations =
      DescribeIamInstanceProfileAssociationsResponse
  request :: (Service -> Service)
-> DescribeIamInstanceProfileAssociations
-> Request DescribeIamInstanceProfileAssociations
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 DescribeIamInstanceProfileAssociations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeIamInstanceProfileAssociations)))
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 [IamInstanceProfileAssociation]
-> Maybe Text
-> Int
-> DescribeIamInstanceProfileAssociationsResponse
DescribeIamInstanceProfileAssociationsResponse'
            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
"iamInstanceProfileAssociationSet"
                            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.<*> ([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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeIamInstanceProfileAssociations
  where
  hashWithSalt :: Int -> DescribeIamInstanceProfileAssociations -> Int
hashWithSalt
    Int
_salt
    DescribeIamInstanceProfileAssociations' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
associationIds :: Maybe [Text]
$sel:nextToken:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Text
$sel:maxResults:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Natural
$sel:filters:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Filter]
$sel:associationIds:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
associationIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance
  Prelude.NFData
    DescribeIamInstanceProfileAssociations
  where
  rnf :: DescribeIamInstanceProfileAssociations -> ()
rnf DescribeIamInstanceProfileAssociations' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
associationIds :: Maybe [Text]
$sel:nextToken:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Text
$sel:maxResults:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Natural
$sel:filters:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Filter]
$sel:associationIds:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
associationIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      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

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

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

instance
  Data.ToQuery
    DescribeIamInstanceProfileAssociations
  where
  toQuery :: DescribeIamInstanceProfileAssociations -> QueryString
toQuery DescribeIamInstanceProfileAssociations' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
associationIds :: Maybe [Text]
$sel:nextToken:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Text
$sel:maxResults:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe Natural
$sel:filters:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Filter]
$sel:associationIds:DescribeIamInstanceProfileAssociations' :: DescribeIamInstanceProfileAssociations -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeIamInstanceProfileAssociations" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AssociationId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
associationIds
          ),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        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
      ]

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

-- |
-- Create a value of 'DescribeIamInstanceProfileAssociationsResponse' 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:
--
-- 'iamInstanceProfileAssociations', 'describeIamInstanceProfileAssociationsResponse_iamInstanceProfileAssociations' - Information about the IAM instance profile associations.
--
-- 'nextToken', 'describeIamInstanceProfileAssociationsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeIamInstanceProfileAssociationsResponse_httpStatus' - The response's http status code.
newDescribeIamInstanceProfileAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeIamInstanceProfileAssociationsResponse
newDescribeIamInstanceProfileAssociationsResponse :: Int -> DescribeIamInstanceProfileAssociationsResponse
newDescribeIamInstanceProfileAssociationsResponse
  Int
pHttpStatus_ =
    DescribeIamInstanceProfileAssociationsResponse'
      { $sel:iamInstanceProfileAssociations:DescribeIamInstanceProfileAssociationsResponse' :: Maybe [IamInstanceProfileAssociation]
iamInstanceProfileAssociations =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeIamInstanceProfileAssociationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeIamInstanceProfileAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the IAM instance profile associations.
describeIamInstanceProfileAssociationsResponse_iamInstanceProfileAssociations :: Lens.Lens' DescribeIamInstanceProfileAssociationsResponse (Prelude.Maybe [IamInstanceProfileAssociation])
describeIamInstanceProfileAssociationsResponse_iamInstanceProfileAssociations :: Lens'
  DescribeIamInstanceProfileAssociationsResponse
  (Maybe [IamInstanceProfileAssociation])
describeIamInstanceProfileAssociationsResponse_iamInstanceProfileAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIamInstanceProfileAssociationsResponse' {Maybe [IamInstanceProfileAssociation]
iamInstanceProfileAssociations :: Maybe [IamInstanceProfileAssociation]
$sel:iamInstanceProfileAssociations:DescribeIamInstanceProfileAssociationsResponse' :: DescribeIamInstanceProfileAssociationsResponse
-> Maybe [IamInstanceProfileAssociation]
iamInstanceProfileAssociations} -> Maybe [IamInstanceProfileAssociation]
iamInstanceProfileAssociations) (\s :: DescribeIamInstanceProfileAssociationsResponse
s@DescribeIamInstanceProfileAssociationsResponse' {} Maybe [IamInstanceProfileAssociation]
a -> DescribeIamInstanceProfileAssociationsResponse
s {$sel:iamInstanceProfileAssociations:DescribeIamInstanceProfileAssociationsResponse' :: Maybe [IamInstanceProfileAssociation]
iamInstanceProfileAssociations = Maybe [IamInstanceProfileAssociation]
a} :: DescribeIamInstanceProfileAssociationsResponse) 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeIamInstanceProfileAssociationsResponse_nextToken :: Lens.Lens' DescribeIamInstanceProfileAssociationsResponse (Prelude.Maybe Prelude.Text)
describeIamInstanceProfileAssociationsResponse_nextToken :: Lens' DescribeIamInstanceProfileAssociationsResponse (Maybe Text)
describeIamInstanceProfileAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeIamInstanceProfileAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeIamInstanceProfileAssociationsResponse' :: DescribeIamInstanceProfileAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeIamInstanceProfileAssociationsResponse
s@DescribeIamInstanceProfileAssociationsResponse' {} Maybe Text
a -> DescribeIamInstanceProfileAssociationsResponse
s {$sel:nextToken:DescribeIamInstanceProfileAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeIamInstanceProfileAssociationsResponse)

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

instance
  Prelude.NFData
    DescribeIamInstanceProfileAssociationsResponse
  where
  rnf :: DescribeIamInstanceProfileAssociationsResponse -> ()
rnf
    DescribeIamInstanceProfileAssociationsResponse' {Int
Maybe [IamInstanceProfileAssociation]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
iamInstanceProfileAssociations :: Maybe [IamInstanceProfileAssociation]
$sel:httpStatus:DescribeIamInstanceProfileAssociationsResponse' :: DescribeIamInstanceProfileAssociationsResponse -> Int
$sel:nextToken:DescribeIamInstanceProfileAssociationsResponse' :: DescribeIamInstanceProfileAssociationsResponse -> Maybe Text
$sel:iamInstanceProfileAssociations:DescribeIamInstanceProfileAssociationsResponse' :: DescribeIamInstanceProfileAssociationsResponse
-> Maybe [IamInstanceProfileAssociation]
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe [IamInstanceProfileAssociation]
iamInstanceProfileAssociations
        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 Int
httpStatus