{-# 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.ListHandshakesForOrganization
-- 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 handshakes that are associated with the organization that the
-- requesting user is part of. The @ListHandshakesForOrganization@
-- operation returns a list of handshake structures. Each structure
-- contains details and status about a handshake.
--
-- 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 only from the organization\'s management
-- account or by a member account that is a delegated administrator for an
-- Amazon Web Services service.
--
-- This operation returns paginated results.
module Amazonka.Organizations.ListHandshakesForOrganization
  ( -- * Creating a Request
    ListHandshakesForOrganization (..),
    newListHandshakesForOrganization,

    -- * Request Lenses
    listHandshakesForOrganization_filter,
    listHandshakesForOrganization_maxResults,
    listHandshakesForOrganization_nextToken,

    -- * Destructuring the Response
    ListHandshakesForOrganizationResponse (..),
    newListHandshakesForOrganizationResponse,

    -- * Response Lenses
    listHandshakesForOrganizationResponse_handshakes,
    listHandshakesForOrganizationResponse_nextToken,
    listHandshakesForOrganizationResponse_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:/ 'newListHandshakesForOrganization' smart constructor.
data ListHandshakesForOrganization = ListHandshakesForOrganization'
  { -- | A filter of 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 the @ParentHandshakeId@ to see only the
    -- handshakes that were generated by that parent request.
    ListHandshakesForOrganization -> 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.
    ListHandshakesForOrganization -> 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.
    ListHandshakesForOrganization -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListHandshakesForOrganization
-> ListHandshakesForOrganization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHandshakesForOrganization
-> ListHandshakesForOrganization -> Bool
$c/= :: ListHandshakesForOrganization
-> ListHandshakesForOrganization -> Bool
== :: ListHandshakesForOrganization
-> ListHandshakesForOrganization -> Bool
$c== :: ListHandshakesForOrganization
-> ListHandshakesForOrganization -> Bool
Prelude.Eq, ReadPrec [ListHandshakesForOrganization]
ReadPrec ListHandshakesForOrganization
Int -> ReadS ListHandshakesForOrganization
ReadS [ListHandshakesForOrganization]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHandshakesForOrganization]
$creadListPrec :: ReadPrec [ListHandshakesForOrganization]
readPrec :: ReadPrec ListHandshakesForOrganization
$creadPrec :: ReadPrec ListHandshakesForOrganization
readList :: ReadS [ListHandshakesForOrganization]
$creadList :: ReadS [ListHandshakesForOrganization]
readsPrec :: Int -> ReadS ListHandshakesForOrganization
$creadsPrec :: Int -> ReadS ListHandshakesForOrganization
Prelude.Read, Int -> ListHandshakesForOrganization -> ShowS
[ListHandshakesForOrganization] -> ShowS
ListHandshakesForOrganization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHandshakesForOrganization] -> ShowS
$cshowList :: [ListHandshakesForOrganization] -> ShowS
show :: ListHandshakesForOrganization -> String
$cshow :: ListHandshakesForOrganization -> String
showsPrec :: Int -> ListHandshakesForOrganization -> ShowS
$cshowsPrec :: Int -> ListHandshakesForOrganization -> ShowS
Prelude.Show, forall x.
Rep ListHandshakesForOrganization x
-> ListHandshakesForOrganization
forall x.
ListHandshakesForOrganization
-> Rep ListHandshakesForOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHandshakesForOrganization x
-> ListHandshakesForOrganization
$cfrom :: forall x.
ListHandshakesForOrganization
-> Rep ListHandshakesForOrganization x
Prelude.Generic)

-- |
-- Create a value of 'ListHandshakesForOrganization' 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'', 'listHandshakesForOrganization_filter' - A filter of 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 the @ParentHandshakeId@ to see only the
-- handshakes that were generated by that parent request.
--
-- 'maxResults', 'listHandshakesForOrganization_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', 'listHandshakesForOrganization_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.
newListHandshakesForOrganization ::
  ListHandshakesForOrganization
newListHandshakesForOrganization :: ListHandshakesForOrganization
newListHandshakesForOrganization =
  ListHandshakesForOrganization'
    { $sel:filter':ListHandshakesForOrganization' :: Maybe HandshakeFilter
filter' =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListHandshakesForOrganization' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListHandshakesForOrganization' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | A filter of 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 the @ParentHandshakeId@ to see only the
-- handshakes that were generated by that parent request.
listHandshakesForOrganization_filter :: Lens.Lens' ListHandshakesForOrganization (Prelude.Maybe HandshakeFilter)
listHandshakesForOrganization_filter :: Lens' ListHandshakesForOrganization (Maybe HandshakeFilter)
listHandshakesForOrganization_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForOrganization' {Maybe HandshakeFilter
filter' :: Maybe HandshakeFilter
$sel:filter':ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe HandshakeFilter
filter'} -> Maybe HandshakeFilter
filter') (\s :: ListHandshakesForOrganization
s@ListHandshakesForOrganization' {} Maybe HandshakeFilter
a -> ListHandshakesForOrganization
s {$sel:filter':ListHandshakesForOrganization' :: Maybe HandshakeFilter
filter' = Maybe HandshakeFilter
a} :: ListHandshakesForOrganization)

-- | 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.
listHandshakesForOrganization_maxResults :: Lens.Lens' ListHandshakesForOrganization (Prelude.Maybe Prelude.Natural)
listHandshakesForOrganization_maxResults :: Lens' ListHandshakesForOrganization (Maybe Natural)
listHandshakesForOrganization_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForOrganization' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListHandshakesForOrganization
s@ListHandshakesForOrganization' {} Maybe Natural
a -> ListHandshakesForOrganization
s {$sel:maxResults:ListHandshakesForOrganization' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListHandshakesForOrganization)

-- | 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.
listHandshakesForOrganization_nextToken :: Lens.Lens' ListHandshakesForOrganization (Prelude.Maybe Prelude.Text)
listHandshakesForOrganization_nextToken :: Lens' ListHandshakesForOrganization (Maybe Text)
listHandshakesForOrganization_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForOrganization' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHandshakesForOrganization
s@ListHandshakesForOrganization' {} Maybe Text
a -> ListHandshakesForOrganization
s {$sel:nextToken:ListHandshakesForOrganization' :: Maybe Text
nextToken = Maybe Text
a} :: ListHandshakesForOrganization)

instance Core.AWSPager ListHandshakesForOrganization where
  page :: ListHandshakesForOrganization
-> AWSResponse ListHandshakesForOrganization
-> Maybe ListHandshakesForOrganization
page ListHandshakesForOrganization
rq AWSResponse ListHandshakesForOrganization
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListHandshakesForOrganization
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHandshakesForOrganizationResponse (Maybe Text)
listHandshakesForOrganizationResponse_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 ListHandshakesForOrganization
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHandshakesForOrganizationResponse (Maybe [Handshake])
listHandshakesForOrganizationResponse_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.$ ListHandshakesForOrganization
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListHandshakesForOrganization (Maybe Text)
listHandshakesForOrganization_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListHandshakesForOrganization
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListHandshakesForOrganizationResponse (Maybe Text)
listHandshakesForOrganizationResponse_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
    ListHandshakesForOrganization
  where
  type
    AWSResponse ListHandshakesForOrganization =
      ListHandshakesForOrganizationResponse
  request :: (Service -> Service)
-> ListHandshakesForOrganization
-> Request ListHandshakesForOrganization
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 ListHandshakesForOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListHandshakesForOrganization)))
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 -> ListHandshakesForOrganizationResponse
ListHandshakesForOrganizationResponse'
            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
    ListHandshakesForOrganization
  where
  hashWithSalt :: Int -> ListHandshakesForOrganization -> Int
hashWithSalt Int
_salt ListHandshakesForOrganization' {Maybe Natural
Maybe Text
Maybe HandshakeFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe HandshakeFilter
$sel:nextToken:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Text
$sel:maxResults:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Natural
$sel:filter':ListHandshakesForOrganization' :: ListHandshakesForOrganization -> 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 ListHandshakesForOrganization where
  rnf :: ListHandshakesForOrganization -> ()
rnf ListHandshakesForOrganization' {Maybe Natural
Maybe Text
Maybe HandshakeFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe HandshakeFilter
$sel:nextToken:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Text
$sel:maxResults:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Natural
$sel:filter':ListHandshakesForOrganization' :: ListHandshakesForOrganization -> 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 ListHandshakesForOrganization where
  toHeaders :: ListHandshakesForOrganization -> 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.ListHandshakesForOrganization" ::
                          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 ListHandshakesForOrganization where
  toJSON :: ListHandshakesForOrganization -> Value
toJSON ListHandshakesForOrganization' {Maybe Natural
Maybe Text
Maybe HandshakeFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe HandshakeFilter
$sel:nextToken:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Text
$sel:maxResults:ListHandshakesForOrganization' :: ListHandshakesForOrganization -> Maybe Natural
$sel:filter':ListHandshakesForOrganization' :: ListHandshakesForOrganization -> 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 ListHandshakesForOrganization where
  toPath :: ListHandshakesForOrganization -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListHandshakesForOrganizationResponse' smart constructor.
data ListHandshakesForOrganizationResponse = ListHandshakesForOrganizationResponse'
  { -- | A list of Handshake objects with details about each of the handshakes
    -- that are associated with an organization.
    ListHandshakesForOrganizationResponse -> 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@.
    ListHandshakesForOrganizationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListHandshakesForOrganizationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListHandshakesForOrganizationResponse
-> ListHandshakesForOrganizationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHandshakesForOrganizationResponse
-> ListHandshakesForOrganizationResponse -> Bool
$c/= :: ListHandshakesForOrganizationResponse
-> ListHandshakesForOrganizationResponse -> Bool
== :: ListHandshakesForOrganizationResponse
-> ListHandshakesForOrganizationResponse -> Bool
$c== :: ListHandshakesForOrganizationResponse
-> ListHandshakesForOrganizationResponse -> Bool
Prelude.Eq, Int -> ListHandshakesForOrganizationResponse -> ShowS
[ListHandshakesForOrganizationResponse] -> ShowS
ListHandshakesForOrganizationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHandshakesForOrganizationResponse] -> ShowS
$cshowList :: [ListHandshakesForOrganizationResponse] -> ShowS
show :: ListHandshakesForOrganizationResponse -> String
$cshow :: ListHandshakesForOrganizationResponse -> String
showsPrec :: Int -> ListHandshakesForOrganizationResponse -> ShowS
$cshowsPrec :: Int -> ListHandshakesForOrganizationResponse -> ShowS
Prelude.Show, forall x.
Rep ListHandshakesForOrganizationResponse x
-> ListHandshakesForOrganizationResponse
forall x.
ListHandshakesForOrganizationResponse
-> Rep ListHandshakesForOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHandshakesForOrganizationResponse x
-> ListHandshakesForOrganizationResponse
$cfrom :: forall x.
ListHandshakesForOrganizationResponse
-> Rep ListHandshakesForOrganizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListHandshakesForOrganizationResponse' 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', 'listHandshakesForOrganizationResponse_handshakes' - A list of Handshake objects with details about each of the handshakes
-- that are associated with an organization.
--
-- 'nextToken', 'listHandshakesForOrganizationResponse_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', 'listHandshakesForOrganizationResponse_httpStatus' - The response's http status code.
newListHandshakesForOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListHandshakesForOrganizationResponse
newListHandshakesForOrganizationResponse :: Int -> ListHandshakesForOrganizationResponse
newListHandshakesForOrganizationResponse Int
pHttpStatus_ =
  ListHandshakesForOrganizationResponse'
    { $sel:handshakes:ListHandshakesForOrganizationResponse' :: Maybe [Handshake]
handshakes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListHandshakesForOrganizationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListHandshakesForOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of Handshake objects with details about each of the handshakes
-- that are associated with an organization.
listHandshakesForOrganizationResponse_handshakes :: Lens.Lens' ListHandshakesForOrganizationResponse (Prelude.Maybe [Handshake])
listHandshakesForOrganizationResponse_handshakes :: Lens' ListHandshakesForOrganizationResponse (Maybe [Handshake])
listHandshakesForOrganizationResponse_handshakes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForOrganizationResponse' {Maybe [Handshake]
handshakes :: Maybe [Handshake]
$sel:handshakes:ListHandshakesForOrganizationResponse' :: ListHandshakesForOrganizationResponse -> Maybe [Handshake]
handshakes} -> Maybe [Handshake]
handshakes) (\s :: ListHandshakesForOrganizationResponse
s@ListHandshakesForOrganizationResponse' {} Maybe [Handshake]
a -> ListHandshakesForOrganizationResponse
s {$sel:handshakes:ListHandshakesForOrganizationResponse' :: Maybe [Handshake]
handshakes = Maybe [Handshake]
a} :: ListHandshakesForOrganizationResponse) 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@.
listHandshakesForOrganizationResponse_nextToken :: Lens.Lens' ListHandshakesForOrganizationResponse (Prelude.Maybe Prelude.Text)
listHandshakesForOrganizationResponse_nextToken :: Lens' ListHandshakesForOrganizationResponse (Maybe Text)
listHandshakesForOrganizationResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHandshakesForOrganizationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHandshakesForOrganizationResponse' :: ListHandshakesForOrganizationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHandshakesForOrganizationResponse
s@ListHandshakesForOrganizationResponse' {} Maybe Text
a -> ListHandshakesForOrganizationResponse
s {$sel:nextToken:ListHandshakesForOrganizationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListHandshakesForOrganizationResponse)

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

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