{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.DescribeTransitGatewayPeeringAttachments
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes your transit gateway peering attachments.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeTransitGatewayPeeringAttachments
  ( -- * Creating a Request
    DescribeTransitGatewayPeeringAttachments (..),
    newDescribeTransitGatewayPeeringAttachments,

    -- * Request Lenses
    describeTransitGatewayPeeringAttachments_dryRun,
    describeTransitGatewayPeeringAttachments_filters,
    describeTransitGatewayPeeringAttachments_maxResults,
    describeTransitGatewayPeeringAttachments_nextToken,
    describeTransitGatewayPeeringAttachments_transitGatewayAttachmentIds,

    -- * Destructuring the Response
    DescribeTransitGatewayPeeringAttachmentsResponse (..),
    newDescribeTransitGatewayPeeringAttachmentsResponse,

    -- * Response Lenses
    describeTransitGatewayPeeringAttachmentsResponse_nextToken,
    describeTransitGatewayPeeringAttachmentsResponse_transitGatewayPeeringAttachments,
    describeTransitGatewayPeeringAttachmentsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeTransitGatewayPeeringAttachments' smart constructor.
data DescribeTransitGatewayPeeringAttachments = DescribeTransitGatewayPeeringAttachments'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeTransitGatewayPeeringAttachments -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. The possible values are:
    --
    -- -   @transit-gateway-attachment-id@ - The ID of the transit gateway
    --     attachment.
    --
    -- -   @local-owner-id@ - The ID of your Amazon Web Services account.
    --
    -- -   @remote-owner-id@ - The ID of the Amazon Web Services account in the
    --     remote Region that owns the transit gateway.
    --
    -- -   @state@ - The state of the peering attachment. Valid values are
    --     @available@ | @deleted@ | @deleting@ | @failed@ | @failing@ |
    --     @initiatingRequest@ | @modifying@ | @pendingAcceptance@ | @pending@
    --     | @rollingBack@ | @rejected@ | @rejecting@).
    --
    -- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
    --     resource. Use the tag key in the filter name and the tag value as
    --     the filter value. For example, to find all resources that have a tag
    --     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
    --     the filter name and @TeamA@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the resource. Use this
    --     filter to find all resources that have a tag with a specific key,
    --     regardless of the tag value.
    --
    -- -   @transit-gateway-id@ - The ID of the transit gateway.
    DescribeTransitGatewayPeeringAttachments -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    DescribeTransitGatewayPeeringAttachments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeTransitGatewayPeeringAttachments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more IDs of the transit gateway peering attachments.
    DescribeTransitGatewayPeeringAttachments -> Maybe [Text]
transitGatewayAttachmentIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeTransitGatewayPeeringAttachments
-> DescribeTransitGatewayPeeringAttachments -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTransitGatewayPeeringAttachments
-> DescribeTransitGatewayPeeringAttachments -> Bool
$c/= :: DescribeTransitGatewayPeeringAttachments
-> DescribeTransitGatewayPeeringAttachments -> Bool
== :: DescribeTransitGatewayPeeringAttachments
-> DescribeTransitGatewayPeeringAttachments -> Bool
$c== :: DescribeTransitGatewayPeeringAttachments
-> DescribeTransitGatewayPeeringAttachments -> Bool
Prelude.Eq, ReadPrec [DescribeTransitGatewayPeeringAttachments]
ReadPrec DescribeTransitGatewayPeeringAttachments
Int -> ReadS DescribeTransitGatewayPeeringAttachments
ReadS [DescribeTransitGatewayPeeringAttachments]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTransitGatewayPeeringAttachments]
$creadListPrec :: ReadPrec [DescribeTransitGatewayPeeringAttachments]
readPrec :: ReadPrec DescribeTransitGatewayPeeringAttachments
$creadPrec :: ReadPrec DescribeTransitGatewayPeeringAttachments
readList :: ReadS [DescribeTransitGatewayPeeringAttachments]
$creadList :: ReadS [DescribeTransitGatewayPeeringAttachments]
readsPrec :: Int -> ReadS DescribeTransitGatewayPeeringAttachments
$creadsPrec :: Int -> ReadS DescribeTransitGatewayPeeringAttachments
Prelude.Read, Int -> DescribeTransitGatewayPeeringAttachments -> ShowS
[DescribeTransitGatewayPeeringAttachments] -> ShowS
DescribeTransitGatewayPeeringAttachments -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTransitGatewayPeeringAttachments] -> ShowS
$cshowList :: [DescribeTransitGatewayPeeringAttachments] -> ShowS
show :: DescribeTransitGatewayPeeringAttachments -> String
$cshow :: DescribeTransitGatewayPeeringAttachments -> String
showsPrec :: Int -> DescribeTransitGatewayPeeringAttachments -> ShowS
$cshowsPrec :: Int -> DescribeTransitGatewayPeeringAttachments -> ShowS
Prelude.Show, forall x.
Rep DescribeTransitGatewayPeeringAttachments x
-> DescribeTransitGatewayPeeringAttachments
forall x.
DescribeTransitGatewayPeeringAttachments
-> Rep DescribeTransitGatewayPeeringAttachments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTransitGatewayPeeringAttachments x
-> DescribeTransitGatewayPeeringAttachments
$cfrom :: forall x.
DescribeTransitGatewayPeeringAttachments
-> Rep DescribeTransitGatewayPeeringAttachments x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTransitGatewayPeeringAttachments' 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:
--
-- 'dryRun', 'describeTransitGatewayPeeringAttachments_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeTransitGatewayPeeringAttachments_filters' - One or more filters. The possible values are:
--
-- -   @transit-gateway-attachment-id@ - The ID of the transit gateway
--     attachment.
--
-- -   @local-owner-id@ - The ID of your Amazon Web Services account.
--
-- -   @remote-owner-id@ - The ID of the Amazon Web Services account in the
--     remote Region that owns the transit gateway.
--
-- -   @state@ - The state of the peering attachment. Valid values are
--     @available@ | @deleted@ | @deleting@ | @failed@ | @failing@ |
--     @initiatingRequest@ | @modifying@ | @pendingAcceptance@ | @pending@
--     | @rollingBack@ | @rejected@ | @rejecting@).
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources that have a tag with a specific key,
--     regardless of the tag value.
--
-- -   @transit-gateway-id@ - The ID of the transit gateway.
--
-- 'maxResults', 'describeTransitGatewayPeeringAttachments_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'nextToken', 'describeTransitGatewayPeeringAttachments_nextToken' - The token for the next page of results.
--
-- 'transitGatewayAttachmentIds', 'describeTransitGatewayPeeringAttachments_transitGatewayAttachmentIds' - One or more IDs of the transit gateway peering attachments.
newDescribeTransitGatewayPeeringAttachments ::
  DescribeTransitGatewayPeeringAttachments
newDescribeTransitGatewayPeeringAttachments :: DescribeTransitGatewayPeeringAttachments
newDescribeTransitGatewayPeeringAttachments =
  DescribeTransitGatewayPeeringAttachments'
    { $sel:dryRun:DescribeTransitGatewayPeeringAttachments' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeTransitGatewayPeeringAttachments' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeTransitGatewayPeeringAttachments' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeTransitGatewayPeeringAttachments' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayAttachmentIds:DescribeTransitGatewayPeeringAttachments' :: Maybe [Text]
transitGatewayAttachmentIds =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeTransitGatewayPeeringAttachments_dryRun :: Lens.Lens' DescribeTransitGatewayPeeringAttachments (Prelude.Maybe Prelude.Bool)
describeTransitGatewayPeeringAttachments_dryRun :: Lens' DescribeTransitGatewayPeeringAttachments (Maybe Bool)
describeTransitGatewayPeeringAttachments_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachments' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeTransitGatewayPeeringAttachments
s@DescribeTransitGatewayPeeringAttachments' {} Maybe Bool
a -> DescribeTransitGatewayPeeringAttachments
s {$sel:dryRun:DescribeTransitGatewayPeeringAttachments' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeTransitGatewayPeeringAttachments)

-- | One or more filters. The possible values are:
--
-- -   @transit-gateway-attachment-id@ - The ID of the transit gateway
--     attachment.
--
-- -   @local-owner-id@ - The ID of your Amazon Web Services account.
--
-- -   @remote-owner-id@ - The ID of the Amazon Web Services account in the
--     remote Region that owns the transit gateway.
--
-- -   @state@ - The state of the peering attachment. Valid values are
--     @available@ | @deleted@ | @deleting@ | @failed@ | @failing@ |
--     @initiatingRequest@ | @modifying@ | @pendingAcceptance@ | @pending@
--     | @rollingBack@ | @rejected@ | @rejecting@).
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources that have a tag with a specific key,
--     regardless of the tag value.
--
-- -   @transit-gateway-id@ - The ID of the transit gateway.
describeTransitGatewayPeeringAttachments_filters :: Lens.Lens' DescribeTransitGatewayPeeringAttachments (Prelude.Maybe [Filter])
describeTransitGatewayPeeringAttachments_filters :: Lens' DescribeTransitGatewayPeeringAttachments (Maybe [Filter])
describeTransitGatewayPeeringAttachments_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachments' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeTransitGatewayPeeringAttachments
s@DescribeTransitGatewayPeeringAttachments' {} Maybe [Filter]
a -> DescribeTransitGatewayPeeringAttachments
s {$sel:filters:DescribeTransitGatewayPeeringAttachments' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeTransitGatewayPeeringAttachments) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
describeTransitGatewayPeeringAttachments_maxResults :: Lens.Lens' DescribeTransitGatewayPeeringAttachments (Prelude.Maybe Prelude.Natural)
describeTransitGatewayPeeringAttachments_maxResults :: Lens' DescribeTransitGatewayPeeringAttachments (Maybe Natural)
describeTransitGatewayPeeringAttachments_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeTransitGatewayPeeringAttachments
s@DescribeTransitGatewayPeeringAttachments' {} Maybe Natural
a -> DescribeTransitGatewayPeeringAttachments
s {$sel:maxResults:DescribeTransitGatewayPeeringAttachments' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeTransitGatewayPeeringAttachments)

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

-- | One or more IDs of the transit gateway peering attachments.
describeTransitGatewayPeeringAttachments_transitGatewayAttachmentIds :: Lens.Lens' DescribeTransitGatewayPeeringAttachments (Prelude.Maybe [Prelude.Text])
describeTransitGatewayPeeringAttachments_transitGatewayAttachmentIds :: Lens' DescribeTransitGatewayPeeringAttachments (Maybe [Text])
describeTransitGatewayPeeringAttachments_transitGatewayAttachmentIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachments' {Maybe [Text]
transitGatewayAttachmentIds :: Maybe [Text]
$sel:transitGatewayAttachmentIds:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe [Text]
transitGatewayAttachmentIds} -> Maybe [Text]
transitGatewayAttachmentIds) (\s :: DescribeTransitGatewayPeeringAttachments
s@DescribeTransitGatewayPeeringAttachments' {} Maybe [Text]
a -> DescribeTransitGatewayPeeringAttachments
s {$sel:transitGatewayAttachmentIds:DescribeTransitGatewayPeeringAttachments' :: Maybe [Text]
transitGatewayAttachmentIds = Maybe [Text]
a} :: DescribeTransitGatewayPeeringAttachments) 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

instance
  Core.AWSPager
    DescribeTransitGatewayPeeringAttachments
  where
  page :: DescribeTransitGatewayPeeringAttachments
-> AWSResponse DescribeTransitGatewayPeeringAttachments
-> Maybe DescribeTransitGatewayPeeringAttachments
page DescribeTransitGatewayPeeringAttachments
rq AWSResponse DescribeTransitGatewayPeeringAttachments
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTransitGatewayPeeringAttachments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTransitGatewayPeeringAttachmentsResponse (Maybe Text)
describeTransitGatewayPeeringAttachmentsResponse_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 DescribeTransitGatewayPeeringAttachments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeTransitGatewayPeeringAttachmentsResponse
  (Maybe [TransitGatewayPeeringAttachment])
describeTransitGatewayPeeringAttachmentsResponse_transitGatewayPeeringAttachments
            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.$ DescribeTransitGatewayPeeringAttachments
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeTransitGatewayPeeringAttachments (Maybe Text)
describeTransitGatewayPeeringAttachments_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTransitGatewayPeeringAttachments
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTransitGatewayPeeringAttachmentsResponse (Maybe Text)
describeTransitGatewayPeeringAttachmentsResponse_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
    DescribeTransitGatewayPeeringAttachments
  where
  type
    AWSResponse
      DescribeTransitGatewayPeeringAttachments =
      DescribeTransitGatewayPeeringAttachmentsResponse
  request :: (Service -> Service)
-> DescribeTransitGatewayPeeringAttachments
-> Request DescribeTransitGatewayPeeringAttachments
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeTransitGatewayPeeringAttachments
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeTransitGatewayPeeringAttachments)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [TransitGatewayPeeringAttachment]
-> Int
-> DescribeTransitGatewayPeeringAttachmentsResponse
DescribeTransitGatewayPeeringAttachmentsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"transitGatewayPeeringAttachments"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

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

instance
  Prelude.NFData
    DescribeTransitGatewayPeeringAttachments
  where
  rnf :: DescribeTransitGatewayPeeringAttachments -> ()
rnf DescribeTransitGatewayPeeringAttachments' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
transitGatewayAttachmentIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayAttachmentIds:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe [Text]
$sel:nextToken:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Text
$sel:maxResults:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Natural
$sel:filters:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe [Filter]
$sel:dryRun:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
transitGatewayAttachmentIds

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

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

instance
  Data.ToQuery
    DescribeTransitGatewayPeeringAttachments
  where
  toQuery :: DescribeTransitGatewayPeeringAttachments -> QueryString
toQuery DescribeTransitGatewayPeeringAttachments' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
transitGatewayAttachmentIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:transitGatewayAttachmentIds:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe [Text]
$sel:nextToken:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Text
$sel:maxResults:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Natural
$sel:filters:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe [Filter]
$sel:dryRun:DescribeTransitGatewayPeeringAttachments' :: DescribeTransitGatewayPeeringAttachments -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeTransitGatewayPeeringAttachments" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TransitGatewayAttachmentIds"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
transitGatewayAttachmentIds
          )
      ]

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

-- |
-- Create a value of 'DescribeTransitGatewayPeeringAttachmentsResponse' 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', 'describeTransitGatewayPeeringAttachmentsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'transitGatewayPeeringAttachments', 'describeTransitGatewayPeeringAttachmentsResponse_transitGatewayPeeringAttachments' - The transit gateway peering attachments.
--
-- 'httpStatus', 'describeTransitGatewayPeeringAttachmentsResponse_httpStatus' - The response's http status code.
newDescribeTransitGatewayPeeringAttachmentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTransitGatewayPeeringAttachmentsResponse
newDescribeTransitGatewayPeeringAttachmentsResponse :: Int -> DescribeTransitGatewayPeeringAttachmentsResponse
newDescribeTransitGatewayPeeringAttachmentsResponse
  Int
pHttpStatus_ =
    DescribeTransitGatewayPeeringAttachmentsResponse'
      { $sel:nextToken:DescribeTransitGatewayPeeringAttachmentsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayPeeringAttachments:DescribeTransitGatewayPeeringAttachmentsResponse' :: Maybe [TransitGatewayPeeringAttachment]
transitGatewayPeeringAttachments =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeTransitGatewayPeeringAttachmentsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeTransitGatewayPeeringAttachmentsResponse_nextToken :: Lens.Lens' DescribeTransitGatewayPeeringAttachmentsResponse (Prelude.Maybe Prelude.Text)
describeTransitGatewayPeeringAttachmentsResponse_nextToken :: Lens' DescribeTransitGatewayPeeringAttachmentsResponse (Maybe Text)
describeTransitGatewayPeeringAttachmentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTransitGatewayPeeringAttachmentsResponse' :: DescribeTransitGatewayPeeringAttachmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTransitGatewayPeeringAttachmentsResponse
s@DescribeTransitGatewayPeeringAttachmentsResponse' {} Maybe Text
a -> DescribeTransitGatewayPeeringAttachmentsResponse
s {$sel:nextToken:DescribeTransitGatewayPeeringAttachmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTransitGatewayPeeringAttachmentsResponse)

-- | The transit gateway peering attachments.
describeTransitGatewayPeeringAttachmentsResponse_transitGatewayPeeringAttachments :: Lens.Lens' DescribeTransitGatewayPeeringAttachmentsResponse (Prelude.Maybe [TransitGatewayPeeringAttachment])
describeTransitGatewayPeeringAttachmentsResponse_transitGatewayPeeringAttachments :: Lens'
  DescribeTransitGatewayPeeringAttachmentsResponse
  (Maybe [TransitGatewayPeeringAttachment])
describeTransitGatewayPeeringAttachmentsResponse_transitGatewayPeeringAttachments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachmentsResponse' {Maybe [TransitGatewayPeeringAttachment]
transitGatewayPeeringAttachments :: Maybe [TransitGatewayPeeringAttachment]
$sel:transitGatewayPeeringAttachments:DescribeTransitGatewayPeeringAttachmentsResponse' :: DescribeTransitGatewayPeeringAttachmentsResponse
-> Maybe [TransitGatewayPeeringAttachment]
transitGatewayPeeringAttachments} -> Maybe [TransitGatewayPeeringAttachment]
transitGatewayPeeringAttachments) (\s :: DescribeTransitGatewayPeeringAttachmentsResponse
s@DescribeTransitGatewayPeeringAttachmentsResponse' {} Maybe [TransitGatewayPeeringAttachment]
a -> DescribeTransitGatewayPeeringAttachmentsResponse
s {$sel:transitGatewayPeeringAttachments:DescribeTransitGatewayPeeringAttachmentsResponse' :: Maybe [TransitGatewayPeeringAttachment]
transitGatewayPeeringAttachments = Maybe [TransitGatewayPeeringAttachment]
a} :: DescribeTransitGatewayPeeringAttachmentsResponse) 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.
describeTransitGatewayPeeringAttachmentsResponse_httpStatus :: Lens.Lens' DescribeTransitGatewayPeeringAttachmentsResponse Prelude.Int
describeTransitGatewayPeeringAttachmentsResponse_httpStatus :: Lens' DescribeTransitGatewayPeeringAttachmentsResponse Int
describeTransitGatewayPeeringAttachmentsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayPeeringAttachmentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTransitGatewayPeeringAttachmentsResponse' :: DescribeTransitGatewayPeeringAttachmentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTransitGatewayPeeringAttachmentsResponse
s@DescribeTransitGatewayPeeringAttachmentsResponse' {} Int
a -> DescribeTransitGatewayPeeringAttachmentsResponse
s {$sel:httpStatus:DescribeTransitGatewayPeeringAttachmentsResponse' :: Int
httpStatus = Int
a} :: DescribeTransitGatewayPeeringAttachmentsResponse)

instance
  Prelude.NFData
    DescribeTransitGatewayPeeringAttachmentsResponse
  where
  rnf :: DescribeTransitGatewayPeeringAttachmentsResponse -> ()
rnf
    DescribeTransitGatewayPeeringAttachmentsResponse' {Int
Maybe [TransitGatewayPeeringAttachment]
Maybe Text
httpStatus :: Int
transitGatewayPeeringAttachments :: Maybe [TransitGatewayPeeringAttachment]
nextToken :: Maybe Text
$sel:httpStatus:DescribeTransitGatewayPeeringAttachmentsResponse' :: DescribeTransitGatewayPeeringAttachmentsResponse -> Int
$sel:transitGatewayPeeringAttachments:DescribeTransitGatewayPeeringAttachmentsResponse' :: DescribeTransitGatewayPeeringAttachmentsResponse
-> Maybe [TransitGatewayPeeringAttachment]
$sel:nextToken:DescribeTransitGatewayPeeringAttachmentsResponse' :: DescribeTransitGatewayPeeringAttachmentsResponse -> 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 [TransitGatewayPeeringAttachment]
transitGatewayPeeringAttachments
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus