{-# 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.Organizations.ListHandshakesForAccount
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the current handshakes that are associated with the account of the
-- requesting user.
--
-- Handshakes that are @ACCEPTED@, @DECLINED@, @CANCELED@, or @EXPIRED@
-- appear in the results of this API for only 30 days after changing to
-- that state. After that, they\'re deleted and no longer accessible.
--
-- Always check the @NextToken@ response parameter for a @null@ value when
-- calling a @List*@ operation. These operations can occasionally return an
-- empty set of results even when there are more results available. The
-- @NextToken@ response parameter value is @null@ /only/ when there are no
-- more results to display.
--
-- This operation can be called from any account in the organization.
--
-- This operation returns paginated results.
module Amazonka.Organizations.ListHandshakesForAccount
  ( -- * Creating a Request
    ListHandshakesForAccount (..),
    newListHandshakesForAccount,

    -- * Request Lenses
    listHandshakesForAccount_filter,
    listHandshakesForAccount_maxResults,
    listHandshakesForAccount_nextToken,

    -- * Destructuring the Response
    ListHandshakesForAccountResponse (..),
    newListHandshakesForAccountResponse,

    -- * Response Lenses
    listHandshakesForAccountResponse_handshakes,
    listHandshakesForAccountResponse_nextToken,
    listHandshakesForAccountResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListHandshakesForAccount' smart constructor.
data ListHandshakesForAccount = ListHandshakesForAccount'
  { -- | Filters the handshakes that you want included in the response. The
    -- default is all types. Use the @ActionType@ element to limit the output
    -- to only a specified type, such as @INVITE@, @ENABLE_ALL_FEATURES@, or
    -- @APPROVE_ALL_FEATURES@. Alternatively, for the @ENABLE_ALL_FEATURES@
    -- handshake that generates a separate child handshake for each member
    -- account, you can specify @ParentHandshakeId@ to see only the handshakes
    -- that were generated by that parent request.
    ListHandshakesForAccount -> Maybe HandshakeFilter
filter' :: Prelude.Maybe HandshakeFilter,
    -- | The total number of results that you want included on each page of the
    -- response. If you do not include this parameter, it defaults to a value
    -- that is specific to the operation. If additional items exist beyond the
    -- maximum you specify, the @NextToken@ response element is present and has
    -- a value (is not null). Include that value as the @NextToken@ request
    -- parameter in the next call to the operation to get the next part of the
    -- results. Note that Organizations might return fewer results than the
    -- maximum even when there are more results available. You should check
    -- @NextToken@ after every operation to ensure that you receive all of the
    -- results.
    ListHandshakesForAccount -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The parameter for receiving additional results if you receive a
    -- @NextToken@ response in a previous request. A @NextToken@ response
    -- indicates that more output is available. Set this parameter to the value
    -- of the previous call\'s @NextToken@ response to indicate where the
    -- output should continue from.
    ListHandshakesForAccount -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListHandshakesForAccount -> ListHandshakesForAccount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHandshakesForAccount -> ListHandshakesForAccount -> Bool
$c/= :: ListHandshakesForAccount -> ListHandshakesForAccount -> Bool
== :: ListHandshakesForAccount -> ListHandshakesForAccount -> Bool
$c== :: ListHandshakesForAccount -> ListHandshakesForAccount -> Bool
Prelude.Eq, ReadPrec [ListHandshakesForAccount]
ReadPrec ListHandshakesForAccount
Int -> ReadS ListHandshakesForAccount
ReadS [ListHandshakesForAccount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHandshakesForAccount]
$creadListPrec :: ReadPrec [ListHandshakesForAccount]
readPrec :: ReadPrec ListHandshakesForAccount
$creadPrec :: ReadPrec ListHandshakesForAccount
readList :: ReadS [ListHandshakesForAccount]
$creadList :: ReadS [ListHandshakesForAccount]
readsPrec :: Int -> ReadS ListHandshakesForAccount
$creadsPrec :: Int -> ReadS ListHandshakesForAccount
Prelude.Read, Int -> ListHandshakesForAccount -> ShowS
[ListHandshakesForAccount] -> ShowS
ListHandshakesForAccount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHandshakesForAccount] -> ShowS
$cshowList :: [ListHandshakesForAccount] -> ShowS
show :: ListHandshakesForAccount -> String
$cshow :: ListHandshakesForAccount -> String
showsPrec :: Int -> ListHandshakesForAccount -> ShowS
$cshowsPrec :: Int -> ListHandshakesForAccount -> ShowS
Prelude.Show, forall x.
Rep ListHandshakesForAccount x -> ListHandshakesForAccount
forall x.
ListHandshakesForAccount -> Rep ListHandshakesForAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHandshakesForAccount x -> ListHandshakesForAccount
$cfrom :: forall x.
ListHandshakesForAccount -> Rep ListHandshakesForAccount x
Prelude.Generic)

-- |
-- Create a value of 'ListHandshakesForAccount' 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:
--
-- 'filter'', 'listHandshakesForAccount_filter' - Filters the handshakes that you want included in the response. The
-- default is all types. Use the @ActionType@ element to limit the output
-- to only a specified type, such as @INVITE@, @ENABLE_ALL_FEATURES@, or
-- @APPROVE_ALL_FEATURES@. Alternatively, for the @ENABLE_ALL_FEATURES@
-- handshake that generates a separate child handshake for each member
-- account, you can specify @ParentHandshakeId@ to see only the handshakes
-- that were generated by that parent request.
--
-- 'maxResults', 'listHandshakesForAccount_maxResults' - The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
--
-- 'nextToken', 'listHandshakesForAccount_nextToken' - The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
newListHandshakesForAccount ::
  ListHandshakesForAccount
newListHandshakesForAccount :: ListHandshakesForAccount
newListHandshakesForAccount =
  ListHandshakesForAccount'
    { $sel:filter':ListHandshakesForAccount' :: Maybe HandshakeFilter
filter' =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListHandshakesForAccount' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListHandshakesForAccount' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Filters the handshakes that you want included in the response. The
-- default is all types. Use the @ActionType@ element to limit the output
-- to only a specified type, such as @INVITE@, @ENABLE_ALL_FEATURES@, or
-- @APPROVE_ALL_FEATURES@. Alternatively, for the @ENABLE_ALL_FEATURES@
-- handshake that generates a separate child handshake for each member
-- account, you can specify @ParentHandshakeId@ to see only the handshakes
-- that were generated by that parent request.
listHandshakesForAccount_filter :: Lens.Lens' ListHandshakesForAccount (Prelude.Maybe HandshakeFilter)
listHandshakesForAccount_filter :: Lens' ListHandshakesForAccount (Maybe HandshakeFilter)
listHandshakesForAccount_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForAccount' {Maybe HandshakeFilter
filter' :: Maybe HandshakeFilter
$sel:filter':ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe HandshakeFilter
filter'} -> Maybe HandshakeFilter
filter') (\s :: ListHandshakesForAccount
s@ListHandshakesForAccount' {} Maybe HandshakeFilter
a -> ListHandshakesForAccount
s {$sel:filter':ListHandshakesForAccount' :: Maybe HandshakeFilter
filter' = Maybe HandshakeFilter
a} :: ListHandshakesForAccount)

-- | The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
listHandshakesForAccount_maxResults :: Lens.Lens' ListHandshakesForAccount (Prelude.Maybe Prelude.Natural)
listHandshakesForAccount_maxResults :: Lens' ListHandshakesForAccount (Maybe Natural)
listHandshakesForAccount_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForAccount' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListHandshakesForAccount
s@ListHandshakesForAccount' {} Maybe Natural
a -> ListHandshakesForAccount
s {$sel:maxResults:ListHandshakesForAccount' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListHandshakesForAccount)

-- | The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
listHandshakesForAccount_nextToken :: Lens.Lens' ListHandshakesForAccount (Prelude.Maybe Prelude.Text)
listHandshakesForAccount_nextToken :: Lens' ListHandshakesForAccount (Maybe Text)
listHandshakesForAccount_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForAccount' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHandshakesForAccount
s@ListHandshakesForAccount' {} Maybe Text
a -> ListHandshakesForAccount
s {$sel:nextToken:ListHandshakesForAccount' :: Maybe Text
nextToken = Maybe Text
a} :: ListHandshakesForAccount)

instance Core.AWSPager ListHandshakesForAccount where
  page :: ListHandshakesForAccount
-> AWSResponse ListHandshakesForAccount
-> Maybe ListHandshakesForAccount
page ListHandshakesForAccount
rq AWSResponse ListHandshakesForAccount
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListHandshakesForAccount
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHandshakesForAccountResponse (Maybe Text)
listHandshakesForAccountResponse_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 ListHandshakesForAccount
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHandshakesForAccountResponse (Maybe [Handshake])
listHandshakesForAccountResponse_handshakes
            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.$ ListHandshakesForAccount
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListHandshakesForAccount (Maybe Text)
listHandshakesForAccount_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListHandshakesForAccount
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHandshakesForAccountResponse (Maybe Text)
listHandshakesForAccountResponse_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 ListHandshakesForAccount where
  type
    AWSResponse ListHandshakesForAccount =
      ListHandshakesForAccountResponse
  request :: (Service -> Service)
-> ListHandshakesForAccount -> Request ListHandshakesForAccount
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 ListHandshakesForAccount
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListHandshakesForAccount)))
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 [Handshake]
-> Maybe Text -> Int -> ListHandshakesForAccountResponse
ListHandshakesForAccountResponse'
            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
"Handshakes" 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 ListHandshakesForAccount where
  hashWithSalt :: Int -> ListHandshakesForAccount -> Int
hashWithSalt Int
_salt ListHandshakesForAccount' {Maybe Natural
Maybe Text
Maybe HandshakeFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe HandshakeFilter
$sel:nextToken:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Text
$sel:maxResults:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Natural
$sel:filter':ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe HandshakeFilter
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HandshakeFilter
filter'
      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 ListHandshakesForAccount where
  rnf :: ListHandshakesForAccount -> ()
rnf ListHandshakesForAccount' {Maybe Natural
Maybe Text
Maybe HandshakeFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe HandshakeFilter
$sel:nextToken:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Text
$sel:maxResults:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Natural
$sel:filter':ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe HandshakeFilter
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe HandshakeFilter
filter'
      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 ListHandshakesForAccount where
  toHeaders :: ListHandshakesForAccount -> 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
"AWSOrganizationsV20161128.ListHandshakesForAccount" ::
                          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 ListHandshakesForAccount where
  toJSON :: ListHandshakesForAccount -> Value
toJSON ListHandshakesForAccount' {Maybe Natural
Maybe Text
Maybe HandshakeFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe HandshakeFilter
$sel:nextToken:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Text
$sel:maxResults:ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe Natural
$sel:filter':ListHandshakesForAccount' :: ListHandshakesForAccount -> Maybe HandshakeFilter
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filter" 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 HandshakeFilter
filter',
            (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 ListHandshakesForAccount where
  toPath :: ListHandshakesForAccount -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListHandshakesForAccountResponse' smart constructor.
data ListHandshakesForAccountResponse = ListHandshakesForAccountResponse'
  { -- | A list of Handshake objects with details about each of the handshakes
    -- that is associated with the specified account.
    ListHandshakesForAccountResponse -> Maybe [Handshake]
handshakes :: Prelude.Maybe [Handshake],
    -- | If present, indicates that more output is available than is included in
    -- the current response. Use this value in the @NextToken@ request
    -- parameter in a subsequent call to the operation to get the next part of
    -- the output. You should repeat this until the @NextToken@ response
    -- element comes back as @null@.
    ListHandshakesForAccountResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListHandshakesForAccountResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListHandshakesForAccountResponse
-> ListHandshakesForAccountResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHandshakesForAccountResponse
-> ListHandshakesForAccountResponse -> Bool
$c/= :: ListHandshakesForAccountResponse
-> ListHandshakesForAccountResponse -> Bool
== :: ListHandshakesForAccountResponse
-> ListHandshakesForAccountResponse -> Bool
$c== :: ListHandshakesForAccountResponse
-> ListHandshakesForAccountResponse -> Bool
Prelude.Eq, Int -> ListHandshakesForAccountResponse -> ShowS
[ListHandshakesForAccountResponse] -> ShowS
ListHandshakesForAccountResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHandshakesForAccountResponse] -> ShowS
$cshowList :: [ListHandshakesForAccountResponse] -> ShowS
show :: ListHandshakesForAccountResponse -> String
$cshow :: ListHandshakesForAccountResponse -> String
showsPrec :: Int -> ListHandshakesForAccountResponse -> ShowS
$cshowsPrec :: Int -> ListHandshakesForAccountResponse -> ShowS
Prelude.Show, forall x.
Rep ListHandshakesForAccountResponse x
-> ListHandshakesForAccountResponse
forall x.
ListHandshakesForAccountResponse
-> Rep ListHandshakesForAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHandshakesForAccountResponse x
-> ListHandshakesForAccountResponse
$cfrom :: forall x.
ListHandshakesForAccountResponse
-> Rep ListHandshakesForAccountResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListHandshakesForAccountResponse' 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:
--
-- 'handshakes', 'listHandshakesForAccountResponse_handshakes' - A list of Handshake objects with details about each of the handshakes
-- that is associated with the specified account.
--
-- 'nextToken', 'listHandshakesForAccountResponse_nextToken' - If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
--
-- 'httpStatus', 'listHandshakesForAccountResponse_httpStatus' - The response's http status code.
newListHandshakesForAccountResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListHandshakesForAccountResponse
newListHandshakesForAccountResponse :: Int -> ListHandshakesForAccountResponse
newListHandshakesForAccountResponse Int
pHttpStatus_ =
  ListHandshakesForAccountResponse'
    { $sel:handshakes:ListHandshakesForAccountResponse' :: Maybe [Handshake]
handshakes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListHandshakesForAccountResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListHandshakesForAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of Handshake objects with details about each of the handshakes
-- that is associated with the specified account.
listHandshakesForAccountResponse_handshakes :: Lens.Lens' ListHandshakesForAccountResponse (Prelude.Maybe [Handshake])
listHandshakesForAccountResponse_handshakes :: Lens' ListHandshakesForAccountResponse (Maybe [Handshake])
listHandshakesForAccountResponse_handshakes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForAccountResponse' {Maybe [Handshake]
handshakes :: Maybe [Handshake]
$sel:handshakes:ListHandshakesForAccountResponse' :: ListHandshakesForAccountResponse -> Maybe [Handshake]
handshakes} -> Maybe [Handshake]
handshakes) (\s :: ListHandshakesForAccountResponse
s@ListHandshakesForAccountResponse' {} Maybe [Handshake]
a -> ListHandshakesForAccountResponse
s {$sel:handshakes:ListHandshakesForAccountResponse' :: Maybe [Handshake]
handshakes = Maybe [Handshake]
a} :: ListHandshakesForAccountResponse) 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

-- | If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
listHandshakesForAccountResponse_nextToken :: Lens.Lens' ListHandshakesForAccountResponse (Prelude.Maybe Prelude.Text)
listHandshakesForAccountResponse_nextToken :: Lens' ListHandshakesForAccountResponse (Maybe Text)
listHandshakesForAccountResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForAccountResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHandshakesForAccountResponse' :: ListHandshakesForAccountResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHandshakesForAccountResponse
s@ListHandshakesForAccountResponse' {} Maybe Text
a -> ListHandshakesForAccountResponse
s {$sel:nextToken:ListHandshakesForAccountResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListHandshakesForAccountResponse)

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

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