{-# 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.AppStream.DescribeUserStackAssociations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves a list that describes the UserStackAssociation objects. You
-- must specify either or both of the following:
--
-- -   The stack name
--
-- -   The user name (email address of the user associated with the stack)
--     and the authentication type for the user
--
-- This operation returns paginated results.
module Amazonka.AppStream.DescribeUserStackAssociations
  ( -- * Creating a Request
    DescribeUserStackAssociations (..),
    newDescribeUserStackAssociations,

    -- * Request Lenses
    describeUserStackAssociations_authenticationType,
    describeUserStackAssociations_maxResults,
    describeUserStackAssociations_nextToken,
    describeUserStackAssociations_stackName,
    describeUserStackAssociations_userName,

    -- * Destructuring the Response
    DescribeUserStackAssociationsResponse (..),
    newDescribeUserStackAssociationsResponse,

    -- * Response Lenses
    describeUserStackAssociationsResponse_nextToken,
    describeUserStackAssociationsResponse_userStackAssociations,
    describeUserStackAssociationsResponse_httpStatus,
  )
where

import Amazonka.AppStream.Types
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

-- | /See:/ 'newDescribeUserStackAssociations' smart constructor.
data DescribeUserStackAssociations = DescribeUserStackAssociations'
  { -- | The authentication type for the user who is associated with the stack.
    -- You must specify USERPOOL.
    DescribeUserStackAssociations -> Maybe AuthenticationType
authenticationType :: Prelude.Maybe AuthenticationType,
    -- | The maximum size of each page of results.
    DescribeUserStackAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    DescribeUserStackAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the stack that is associated with the user.
    DescribeUserStackAssociations -> Maybe Text
stackName :: Prelude.Maybe Prelude.Text,
    -- | The email address of the user who is associated with the stack.
    --
    -- Users\' email addresses are case-sensitive.
    DescribeUserStackAssociations -> Maybe (Sensitive Text)
userName :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (DescribeUserStackAssociations
-> DescribeUserStackAssociations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserStackAssociations
-> DescribeUserStackAssociations -> Bool
$c/= :: DescribeUserStackAssociations
-> DescribeUserStackAssociations -> Bool
== :: DescribeUserStackAssociations
-> DescribeUserStackAssociations -> Bool
$c== :: DescribeUserStackAssociations
-> DescribeUserStackAssociations -> Bool
Prelude.Eq, Int -> DescribeUserStackAssociations -> ShowS
[DescribeUserStackAssociations] -> ShowS
DescribeUserStackAssociations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserStackAssociations] -> ShowS
$cshowList :: [DescribeUserStackAssociations] -> ShowS
show :: DescribeUserStackAssociations -> String
$cshow :: DescribeUserStackAssociations -> String
showsPrec :: Int -> DescribeUserStackAssociations -> ShowS
$cshowsPrec :: Int -> DescribeUserStackAssociations -> ShowS
Prelude.Show, forall x.
Rep DescribeUserStackAssociations x
-> DescribeUserStackAssociations
forall x.
DescribeUserStackAssociations
-> Rep DescribeUserStackAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeUserStackAssociations x
-> DescribeUserStackAssociations
$cfrom :: forall x.
DescribeUserStackAssociations
-> Rep DescribeUserStackAssociations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUserStackAssociations' 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:
--
-- 'authenticationType', 'describeUserStackAssociations_authenticationType' - The authentication type for the user who is associated with the stack.
-- You must specify USERPOOL.
--
-- 'maxResults', 'describeUserStackAssociations_maxResults' - The maximum size of each page of results.
--
-- 'nextToken', 'describeUserStackAssociations_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
--
-- 'stackName', 'describeUserStackAssociations_stackName' - The name of the stack that is associated with the user.
--
-- 'userName', 'describeUserStackAssociations_userName' - The email address of the user who is associated with the stack.
--
-- Users\' email addresses are case-sensitive.
newDescribeUserStackAssociations ::
  DescribeUserStackAssociations
newDescribeUserStackAssociations :: DescribeUserStackAssociations
newDescribeUserStackAssociations =
  DescribeUserStackAssociations'
    { $sel:authenticationType:DescribeUserStackAssociations' :: Maybe AuthenticationType
authenticationType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeUserStackAssociations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeUserStackAssociations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:DescribeUserStackAssociations' :: Maybe Text
stackName = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:DescribeUserStackAssociations' :: Maybe (Sensitive Text)
userName = forall a. Maybe a
Prelude.Nothing
    }

-- | The authentication type for the user who is associated with the stack.
-- You must specify USERPOOL.
describeUserStackAssociations_authenticationType :: Lens.Lens' DescribeUserStackAssociations (Prelude.Maybe AuthenticationType)
describeUserStackAssociations_authenticationType :: Lens' DescribeUserStackAssociations (Maybe AuthenticationType)
describeUserStackAssociations_authenticationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociations' {Maybe AuthenticationType
authenticationType :: Maybe AuthenticationType
$sel:authenticationType:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe AuthenticationType
authenticationType} -> Maybe AuthenticationType
authenticationType) (\s :: DescribeUserStackAssociations
s@DescribeUserStackAssociations' {} Maybe AuthenticationType
a -> DescribeUserStackAssociations
s {$sel:authenticationType:DescribeUserStackAssociations' :: Maybe AuthenticationType
authenticationType = Maybe AuthenticationType
a} :: DescribeUserStackAssociations)

-- | The maximum size of each page of results.
describeUserStackAssociations_maxResults :: Lens.Lens' DescribeUserStackAssociations (Prelude.Maybe Prelude.Natural)
describeUserStackAssociations_maxResults :: Lens' DescribeUserStackAssociations (Maybe Natural)
describeUserStackAssociations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeUserStackAssociations
s@DescribeUserStackAssociations' {} Maybe Natural
a -> DescribeUserStackAssociations
s {$sel:maxResults:DescribeUserStackAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeUserStackAssociations)

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
describeUserStackAssociations_nextToken :: Lens.Lens' DescribeUserStackAssociations (Prelude.Maybe Prelude.Text)
describeUserStackAssociations_nextToken :: Lens' DescribeUserStackAssociations (Maybe Text)
describeUserStackAssociations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeUserStackAssociations
s@DescribeUserStackAssociations' {} Maybe Text
a -> DescribeUserStackAssociations
s {$sel:nextToken:DescribeUserStackAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeUserStackAssociations)

-- | The name of the stack that is associated with the user.
describeUserStackAssociations_stackName :: Lens.Lens' DescribeUserStackAssociations (Prelude.Maybe Prelude.Text)
describeUserStackAssociations_stackName :: Lens' DescribeUserStackAssociations (Maybe Text)
describeUserStackAssociations_stackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociations' {Maybe Text
stackName :: Maybe Text
$sel:stackName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
stackName} -> Maybe Text
stackName) (\s :: DescribeUserStackAssociations
s@DescribeUserStackAssociations' {} Maybe Text
a -> DescribeUserStackAssociations
s {$sel:stackName:DescribeUserStackAssociations' :: Maybe Text
stackName = Maybe Text
a} :: DescribeUserStackAssociations)

-- | The email address of the user who is associated with the stack.
--
-- Users\' email addresses are case-sensitive.
describeUserStackAssociations_userName :: Lens.Lens' DescribeUserStackAssociations (Prelude.Maybe Prelude.Text)
describeUserStackAssociations_userName :: Lens' DescribeUserStackAssociations (Maybe Text)
describeUserStackAssociations_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociations' {Maybe (Sensitive Text)
userName :: Maybe (Sensitive Text)
$sel:userName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe (Sensitive Text)
userName} -> Maybe (Sensitive Text)
userName) (\s :: DescribeUserStackAssociations
s@DescribeUserStackAssociations' {} Maybe (Sensitive Text)
a -> DescribeUserStackAssociations
s {$sel:userName:DescribeUserStackAssociations' :: Maybe (Sensitive Text)
userName = Maybe (Sensitive Text)
a} :: DescribeUserStackAssociations) 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 a. Iso' (Sensitive a) a
Data._Sensitive

instance Core.AWSPager DescribeUserStackAssociations where
  page :: DescribeUserStackAssociations
-> AWSResponse DescribeUserStackAssociations
-> Maybe DescribeUserStackAssociations
page DescribeUserStackAssociations
rq AWSResponse DescribeUserStackAssociations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeUserStackAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeUserStackAssociationsResponse (Maybe Text)
describeUserStackAssociationsResponse_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 DescribeUserStackAssociations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeUserStackAssociationsResponse
  (Maybe (NonEmpty UserStackAssociation))
describeUserStackAssociationsResponse_userStackAssociations
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeUserStackAssociations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeUserStackAssociations (Maybe Text)
describeUserStackAssociations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeUserStackAssociations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeUserStackAssociationsResponse (Maybe Text)
describeUserStackAssociationsResponse_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
    DescribeUserStackAssociations
  where
  type
    AWSResponse DescribeUserStackAssociations =
      DescribeUserStackAssociationsResponse
  request :: (Service -> Service)
-> DescribeUserStackAssociations
-> Request DescribeUserStackAssociations
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 DescribeUserStackAssociations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeUserStackAssociations)))
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 Text
-> Maybe (NonEmpty UserStackAssociation)
-> Int
-> DescribeUserStackAssociationsResponse
DescribeUserStackAssociationsResponse'
            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
"NextToken")
            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
"UserStackAssociations")
            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
    DescribeUserStackAssociations
  where
  hashWithSalt :: Int -> DescribeUserStackAssociations -> Int
hashWithSalt Int
_salt DescribeUserStackAssociations' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe AuthenticationType
userName :: Maybe (Sensitive Text)
stackName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
authenticationType :: Maybe AuthenticationType
$sel:userName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe (Sensitive Text)
$sel:stackName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
$sel:nextToken:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
$sel:maxResults:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Natural
$sel:authenticationType:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe AuthenticationType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthenticationType
authenticationType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
userName

instance Prelude.NFData DescribeUserStackAssociations where
  rnf :: DescribeUserStackAssociations -> ()
rnf DescribeUserStackAssociations' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe AuthenticationType
userName :: Maybe (Sensitive Text)
stackName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
authenticationType :: Maybe AuthenticationType
$sel:userName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe (Sensitive Text)
$sel:stackName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
$sel:nextToken:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
$sel:maxResults:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Natural
$sel:authenticationType:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe AuthenticationType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthenticationType
authenticationType
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
userName

instance Data.ToHeaders DescribeUserStackAssociations where
  toHeaders :: DescribeUserStackAssociations -> 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
"PhotonAdminProxyService.DescribeUserStackAssociations" ::
                          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 DescribeUserStackAssociations where
  toJSON :: DescribeUserStackAssociations -> Value
toJSON DescribeUserStackAssociations' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe AuthenticationType
userName :: Maybe (Sensitive Text)
stackName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
authenticationType :: Maybe AuthenticationType
$sel:userName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe (Sensitive Text)
$sel:stackName:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
$sel:nextToken:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Text
$sel:maxResults:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe Natural
$sel:authenticationType:DescribeUserStackAssociations' :: DescribeUserStackAssociations -> Maybe AuthenticationType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AuthenticationType" 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 AuthenticationType
authenticationType,
            (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,
            (Key
"StackName" 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
stackName,
            (Key
"UserName" 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 (Sensitive Text)
userName
          ]
      )

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

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

-- | /See:/ 'newDescribeUserStackAssociationsResponse' smart constructor.
data DescribeUserStackAssociationsResponse = DescribeUserStackAssociationsResponse'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    DescribeUserStackAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The UserStackAssociation objects.
    DescribeUserStackAssociationsResponse
-> Maybe (NonEmpty UserStackAssociation)
userStackAssociations :: Prelude.Maybe (Prelude.NonEmpty UserStackAssociation),
    -- | The response's http status code.
    DescribeUserStackAssociationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeUserStackAssociationsResponse
-> DescribeUserStackAssociationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserStackAssociationsResponse
-> DescribeUserStackAssociationsResponse -> Bool
$c/= :: DescribeUserStackAssociationsResponse
-> DescribeUserStackAssociationsResponse -> Bool
== :: DescribeUserStackAssociationsResponse
-> DescribeUserStackAssociationsResponse -> Bool
$c== :: DescribeUserStackAssociationsResponse
-> DescribeUserStackAssociationsResponse -> Bool
Prelude.Eq, Int -> DescribeUserStackAssociationsResponse -> ShowS
[DescribeUserStackAssociationsResponse] -> ShowS
DescribeUserStackAssociationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserStackAssociationsResponse] -> ShowS
$cshowList :: [DescribeUserStackAssociationsResponse] -> ShowS
show :: DescribeUserStackAssociationsResponse -> String
$cshow :: DescribeUserStackAssociationsResponse -> String
showsPrec :: Int -> DescribeUserStackAssociationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeUserStackAssociationsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeUserStackAssociationsResponse x
-> DescribeUserStackAssociationsResponse
forall x.
DescribeUserStackAssociationsResponse
-> Rep DescribeUserStackAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeUserStackAssociationsResponse x
-> DescribeUserStackAssociationsResponse
$cfrom :: forall x.
DescribeUserStackAssociationsResponse
-> Rep DescribeUserStackAssociationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUserStackAssociationsResponse' 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', 'describeUserStackAssociationsResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'userStackAssociations', 'describeUserStackAssociationsResponse_userStackAssociations' - The UserStackAssociation objects.
--
-- 'httpStatus', 'describeUserStackAssociationsResponse_httpStatus' - The response's http status code.
newDescribeUserStackAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeUserStackAssociationsResponse
newDescribeUserStackAssociationsResponse :: Int -> DescribeUserStackAssociationsResponse
newDescribeUserStackAssociationsResponse Int
pHttpStatus_ =
  DescribeUserStackAssociationsResponse'
    { $sel:nextToken:DescribeUserStackAssociationsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:userStackAssociations:DescribeUserStackAssociationsResponse' :: Maybe (NonEmpty UserStackAssociation)
userStackAssociations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeUserStackAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
describeUserStackAssociationsResponse_nextToken :: Lens.Lens' DescribeUserStackAssociationsResponse (Prelude.Maybe Prelude.Text)
describeUserStackAssociationsResponse_nextToken :: Lens' DescribeUserStackAssociationsResponse (Maybe Text)
describeUserStackAssociationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeUserStackAssociationsResponse' :: DescribeUserStackAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeUserStackAssociationsResponse
s@DescribeUserStackAssociationsResponse' {} Maybe Text
a -> DescribeUserStackAssociationsResponse
s {$sel:nextToken:DescribeUserStackAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeUserStackAssociationsResponse)

-- | The UserStackAssociation objects.
describeUserStackAssociationsResponse_userStackAssociations :: Lens.Lens' DescribeUserStackAssociationsResponse (Prelude.Maybe (Prelude.NonEmpty UserStackAssociation))
describeUserStackAssociationsResponse_userStackAssociations :: Lens'
  DescribeUserStackAssociationsResponse
  (Maybe (NonEmpty UserStackAssociation))
describeUserStackAssociationsResponse_userStackAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociationsResponse' {Maybe (NonEmpty UserStackAssociation)
userStackAssociations :: Maybe (NonEmpty UserStackAssociation)
$sel:userStackAssociations:DescribeUserStackAssociationsResponse' :: DescribeUserStackAssociationsResponse
-> Maybe (NonEmpty UserStackAssociation)
userStackAssociations} -> Maybe (NonEmpty UserStackAssociation)
userStackAssociations) (\s :: DescribeUserStackAssociationsResponse
s@DescribeUserStackAssociationsResponse' {} Maybe (NonEmpty UserStackAssociation)
a -> DescribeUserStackAssociationsResponse
s {$sel:userStackAssociations:DescribeUserStackAssociationsResponse' :: Maybe (NonEmpty UserStackAssociation)
userStackAssociations = Maybe (NonEmpty UserStackAssociation)
a} :: DescribeUserStackAssociationsResponse) 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 response's http status code.
describeUserStackAssociationsResponse_httpStatus :: Lens.Lens' DescribeUserStackAssociationsResponse Prelude.Int
describeUserStackAssociationsResponse_httpStatus :: Lens' DescribeUserStackAssociationsResponse Int
describeUserStackAssociationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserStackAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeUserStackAssociationsResponse' :: DescribeUserStackAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeUserStackAssociationsResponse
s@DescribeUserStackAssociationsResponse' {} Int
a -> DescribeUserStackAssociationsResponse
s {$sel:httpStatus:DescribeUserStackAssociationsResponse' :: Int
httpStatus = Int
a} :: DescribeUserStackAssociationsResponse)

instance
  Prelude.NFData
    DescribeUserStackAssociationsResponse
  where
  rnf :: DescribeUserStackAssociationsResponse -> ()
rnf DescribeUserStackAssociationsResponse' {Int
Maybe (NonEmpty UserStackAssociation)
Maybe Text
httpStatus :: Int
userStackAssociations :: Maybe (NonEmpty UserStackAssociation)
nextToken :: Maybe Text
$sel:httpStatus:DescribeUserStackAssociationsResponse' :: DescribeUserStackAssociationsResponse -> Int
$sel:userStackAssociations:DescribeUserStackAssociationsResponse' :: DescribeUserStackAssociationsResponse
-> Maybe (NonEmpty UserStackAssociation)
$sel:nextToken:DescribeUserStackAssociationsResponse' :: DescribeUserStackAssociationsResponse -> Maybe Text
..} =
    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 Maybe (NonEmpty UserStackAssociation)
userStackAssociations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus