{-# 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.SSM.ListAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns all State Manager associations in the current Amazon Web
-- Services account and Amazon Web Services Region. You can limit the
-- results to a specific State Manager association document or managed node
-- by specifying a filter. State Manager is a capability of Amazon Web
-- Services Systems Manager.
--
-- This operation returns paginated results.
module Amazonka.SSM.ListAssociations
  ( -- * Creating a Request
    ListAssociations (..),
    newListAssociations,

    -- * Request Lenses
    listAssociations_associationFilterList,
    listAssociations_maxResults,
    listAssociations_nextToken,

    -- * Destructuring the Response
    ListAssociationsResponse (..),
    newListAssociationsResponse,

    -- * Response Lenses
    listAssociationsResponse_associations,
    listAssociationsResponse_nextToken,
    listAssociationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListAssociations' smart constructor.
data ListAssociations = ListAssociations'
  { -- | One or more filters. Use a filter to return a more specific list of
    -- results.
    --
    -- Filtering associations using the @InstanceID@ attribute only returns
    -- legacy associations created using the @InstanceID@ attribute.
    -- Associations targeting the managed node that are part of the Target
    -- Attributes @ResourceGroup@ or @Tags@ aren\'t returned.
    ListAssociations -> Maybe (NonEmpty AssociationFilter)
associationFilterList :: Prelude.Maybe (Prelude.NonEmpty AssociationFilter),
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    ListAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    ListAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListAssociations -> ListAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociations -> ListAssociations -> Bool
$c/= :: ListAssociations -> ListAssociations -> Bool
== :: ListAssociations -> ListAssociations -> Bool
$c== :: ListAssociations -> ListAssociations -> Bool
Prelude.Eq, ReadPrec [ListAssociations]
ReadPrec ListAssociations
Int -> ReadS ListAssociations
ReadS [ListAssociations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociations]
$creadListPrec :: ReadPrec [ListAssociations]
readPrec :: ReadPrec ListAssociations
$creadPrec :: ReadPrec ListAssociations
readList :: ReadS [ListAssociations]
$creadList :: ReadS [ListAssociations]
readsPrec :: Int -> ReadS ListAssociations
$creadsPrec :: Int -> ReadS ListAssociations
Prelude.Read, Int -> ListAssociations -> ShowS
[ListAssociations] -> ShowS
ListAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociations] -> ShowS
$cshowList :: [ListAssociations] -> ShowS
show :: ListAssociations -> String
$cshow :: ListAssociations -> String
showsPrec :: Int -> ListAssociations -> ShowS
$cshowsPrec :: Int -> ListAssociations -> ShowS
Prelude.Show, forall x. Rep ListAssociations x -> ListAssociations
forall x. ListAssociations -> Rep ListAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssociations x -> ListAssociations
$cfrom :: forall x. ListAssociations -> Rep ListAssociations x
Prelude.Generic)

-- |
-- Create a value of 'ListAssociations' 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:
--
-- 'associationFilterList', 'listAssociations_associationFilterList' - One or more filters. Use a filter to return a more specific list of
-- results.
--
-- Filtering associations using the @InstanceID@ attribute only returns
-- legacy associations created using the @InstanceID@ attribute.
-- Associations targeting the managed node that are part of the Target
-- Attributes @ResourceGroup@ or @Tags@ aren\'t returned.
--
-- 'maxResults', 'listAssociations_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- 'nextToken', 'listAssociations_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
newListAssociations ::
  ListAssociations
newListAssociations :: ListAssociations
newListAssociations =
  ListAssociations'
    { $sel:associationFilterList:ListAssociations' :: Maybe (NonEmpty AssociationFilter)
associationFilterList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | One or more filters. Use a filter to return a more specific list of
-- results.
--
-- Filtering associations using the @InstanceID@ attribute only returns
-- legacy associations created using the @InstanceID@ attribute.
-- Associations targeting the managed node that are part of the Target
-- Attributes @ResourceGroup@ or @Tags@ aren\'t returned.
listAssociations_associationFilterList :: Lens.Lens' ListAssociations (Prelude.Maybe (Prelude.NonEmpty AssociationFilter))
listAssociations_associationFilterList :: Lens' ListAssociations (Maybe (NonEmpty AssociationFilter))
listAssociations_associationFilterList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe (NonEmpty AssociationFilter)
associationFilterList :: Maybe (NonEmpty AssociationFilter)
$sel:associationFilterList:ListAssociations' :: ListAssociations -> Maybe (NonEmpty AssociationFilter)
associationFilterList} -> Maybe (NonEmpty AssociationFilter)
associationFilterList) (\s :: ListAssociations
s@ListAssociations' {} Maybe (NonEmpty AssociationFilter)
a -> ListAssociations
s {$sel:associationFilterList:ListAssociations' :: Maybe (NonEmpty AssociationFilter)
associationFilterList = Maybe (NonEmpty AssociationFilter)
a} :: ListAssociations) 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 items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
listAssociations_maxResults :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Natural)
listAssociations_maxResults :: Lens' ListAssociations (Maybe Natural)
listAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssociations' :: ListAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssociations
s@ListAssociations' {} Maybe Natural
a -> ListAssociations
s {$sel:maxResults:ListAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssociations)

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
listAssociations_nextToken :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Text)
listAssociations_nextToken :: Lens' ListAssociations (Maybe Text)
listAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociations' :: ListAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociations
s@ListAssociations' {} Maybe Text
a -> ListAssociations
s {$sel:nextToken:ListAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociations)

instance Core.AWSPager ListAssociations where
  page :: ListAssociations
-> AWSResponse ListAssociations -> Maybe ListAssociations
page ListAssociations
rq AWSResponse ListAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociationsResponse (Maybe Text)
listAssociationsResponse_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 ListAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociationsResponse (Maybe [Association])
listAssociationsResponse_associations
            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.$ ListAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAssociations (Maybe Text)
listAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociationsResponse (Maybe Text)
listAssociationsResponse_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 ListAssociations where
  type
    AWSResponse ListAssociations =
      ListAssociationsResponse
  request :: (Service -> Service)
-> ListAssociations -> Request ListAssociations
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAssociations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAssociations)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Association]
-> Maybe Text -> Int -> ListAssociationsResponse
ListAssociationsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Associations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"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 ListAssociations where
  hashWithSalt :: Int -> ListAssociations -> Int
hashWithSalt Int
_salt ListAssociations' {Maybe Natural
Maybe (NonEmpty AssociationFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
associationFilterList :: Maybe (NonEmpty AssociationFilter)
$sel:nextToken:ListAssociations' :: ListAssociations -> Maybe Text
$sel:maxResults:ListAssociations' :: ListAssociations -> Maybe Natural
$sel:associationFilterList:ListAssociations' :: ListAssociations -> Maybe (NonEmpty AssociationFilter)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AssociationFilter)
associationFilterList
      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 ListAssociations where
  rnf :: ListAssociations -> ()
rnf ListAssociations' {Maybe Natural
Maybe (NonEmpty AssociationFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
associationFilterList :: Maybe (NonEmpty AssociationFilter)
$sel:nextToken:ListAssociations' :: ListAssociations -> Maybe Text
$sel:maxResults:ListAssociations' :: ListAssociations -> Maybe Natural
$sel:associationFilterList:ListAssociations' :: ListAssociations -> Maybe (NonEmpty AssociationFilter)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AssociationFilter)
associationFilterList
      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 ListAssociations where
  toHeaders :: ListAssociations -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"AmazonSSM.ListAssociations" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListAssociations where
  toJSON :: ListAssociations -> Value
toJSON ListAssociations' {Maybe Natural
Maybe (NonEmpty AssociationFilter)
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
associationFilterList :: Maybe (NonEmpty AssociationFilter)
$sel:nextToken:ListAssociations' :: ListAssociations -> Maybe Text
$sel:maxResults:ListAssociations' :: ListAssociations -> Maybe Natural
$sel:associationFilterList:ListAssociations' :: ListAssociations -> Maybe (NonEmpty AssociationFilter)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AssociationFilterList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty AssociationFilter)
associationFilterList,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

-- | /See:/ 'newListAssociationsResponse' smart constructor.
data ListAssociationsResponse = ListAssociationsResponse'
  { -- | The associations.
    ListAssociationsResponse -> Maybe [Association]
associations :: Prelude.Maybe [Association],
    -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    ListAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAssociationsResponse -> ListAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
$c/= :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
== :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
$c== :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListAssociationsResponse]
ReadPrec ListAssociationsResponse
Int -> ReadS ListAssociationsResponse
ReadS [ListAssociationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociationsResponse]
$creadListPrec :: ReadPrec [ListAssociationsResponse]
readPrec :: ReadPrec ListAssociationsResponse
$creadPrec :: ReadPrec ListAssociationsResponse
readList :: ReadS [ListAssociationsResponse]
$creadList :: ReadS [ListAssociationsResponse]
readsPrec :: Int -> ReadS ListAssociationsResponse
$creadsPrec :: Int -> ReadS ListAssociationsResponse
Prelude.Read, Int -> ListAssociationsResponse -> ShowS
[ListAssociationsResponse] -> ShowS
ListAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociationsResponse] -> ShowS
$cshowList :: [ListAssociationsResponse] -> ShowS
show :: ListAssociationsResponse -> String
$cshow :: ListAssociationsResponse -> String
showsPrec :: Int -> ListAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListAssociationsResponse x -> ListAssociationsResponse
forall x.
ListAssociationsResponse -> Rep ListAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociationsResponse x -> ListAssociationsResponse
$cfrom :: forall x.
ListAssociationsResponse -> Rep ListAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAssociationsResponse' 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:
--
-- 'associations', 'listAssociationsResponse_associations' - The associations.
--
-- 'nextToken', 'listAssociationsResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'httpStatus', 'listAssociationsResponse_httpStatus' - The response's http status code.
newListAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssociationsResponse
newListAssociationsResponse :: Int -> ListAssociationsResponse
newListAssociationsResponse Int
pHttpStatus_ =
  ListAssociationsResponse'
    { $sel:associations:ListAssociationsResponse' :: Maybe [Association]
associations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAssociationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The associations.
listAssociationsResponse_associations :: Lens.Lens' ListAssociationsResponse (Prelude.Maybe [Association])
listAssociationsResponse_associations :: Lens' ListAssociationsResponse (Maybe [Association])
listAssociationsResponse_associations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationsResponse' {Maybe [Association]
associations :: Maybe [Association]
$sel:associations:ListAssociationsResponse' :: ListAssociationsResponse -> Maybe [Association]
associations} -> Maybe [Association]
associations) (\s :: ListAssociationsResponse
s@ListAssociationsResponse' {} Maybe [Association]
a -> ListAssociationsResponse
s {$sel:associations:ListAssociationsResponse' :: Maybe [Association]
associations = Maybe [Association]
a} :: ListAssociationsResponse) 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 when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
listAssociationsResponse_nextToken :: Lens.Lens' ListAssociationsResponse (Prelude.Maybe Prelude.Text)
listAssociationsResponse_nextToken :: Lens' ListAssociationsResponse (Maybe Text)
listAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociationsResponse' :: ListAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociationsResponse
s@ListAssociationsResponse' {} Maybe Text
a -> ListAssociationsResponse
s {$sel:nextToken:ListAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociationsResponse)

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

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