{-# 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.DescribeTransitGatewayVpcAttachments
-- 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 one or more VPC attachments. By default, all VPC attachments
-- are described. Alternatively, you can filter the results.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeTransitGatewayVpcAttachments
  ( -- * Creating a Request
    DescribeTransitGatewayVpcAttachments (..),
    newDescribeTransitGatewayVpcAttachments,

    -- * Request Lenses
    describeTransitGatewayVpcAttachments_dryRun,
    describeTransitGatewayVpcAttachments_filters,
    describeTransitGatewayVpcAttachments_maxResults,
    describeTransitGatewayVpcAttachments_nextToken,
    describeTransitGatewayVpcAttachments_transitGatewayAttachmentIds,

    -- * Destructuring the Response
    DescribeTransitGatewayVpcAttachmentsResponse (..),
    newDescribeTransitGatewayVpcAttachmentsResponse,

    -- * Response Lenses
    describeTransitGatewayVpcAttachmentsResponse_nextToken,
    describeTransitGatewayVpcAttachmentsResponse_transitGatewayVpcAttachments,
    describeTransitGatewayVpcAttachmentsResponse_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:/ 'newDescribeTransitGatewayVpcAttachments' smart constructor.
data DescribeTransitGatewayVpcAttachments = DescribeTransitGatewayVpcAttachments'
  { -- | 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@.
    DescribeTransitGatewayVpcAttachments -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. The possible values are:
    --
    -- -   @state@ - The state of the attachment. Valid values are @available@
    --     | @deleted@ | @deleting@ | @failed@ | @failing@ |
    --     @initiatingRequest@ | @modifying@ | @pendingAcceptance@ | @pending@
    --     | @rollingBack@ | @rejected@ | @rejecting@.
    --
    -- -   @transit-gateway-attachment-id@ - The ID of the attachment.
    --
    -- -   @transit-gateway-id@ - The ID of the transit gateway.
    --
    -- -   @vpc-id@ - The ID of the VPC.
    DescribeTransitGatewayVpcAttachments -> 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.
    DescribeTransitGatewayVpcAttachments -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    DescribeTransitGatewayVpcAttachments -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The IDs of the attachments.
    DescribeTransitGatewayVpcAttachments -> Maybe [Text]
transitGatewayAttachmentIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeTransitGatewayVpcAttachments
-> DescribeTransitGatewayVpcAttachments -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTransitGatewayVpcAttachments
-> DescribeTransitGatewayVpcAttachments -> Bool
$c/= :: DescribeTransitGatewayVpcAttachments
-> DescribeTransitGatewayVpcAttachments -> Bool
== :: DescribeTransitGatewayVpcAttachments
-> DescribeTransitGatewayVpcAttachments -> Bool
$c== :: DescribeTransitGatewayVpcAttachments
-> DescribeTransitGatewayVpcAttachments -> Bool
Prelude.Eq, ReadPrec [DescribeTransitGatewayVpcAttachments]
ReadPrec DescribeTransitGatewayVpcAttachments
Int -> ReadS DescribeTransitGatewayVpcAttachments
ReadS [DescribeTransitGatewayVpcAttachments]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTransitGatewayVpcAttachments]
$creadListPrec :: ReadPrec [DescribeTransitGatewayVpcAttachments]
readPrec :: ReadPrec DescribeTransitGatewayVpcAttachments
$creadPrec :: ReadPrec DescribeTransitGatewayVpcAttachments
readList :: ReadS [DescribeTransitGatewayVpcAttachments]
$creadList :: ReadS [DescribeTransitGatewayVpcAttachments]
readsPrec :: Int -> ReadS DescribeTransitGatewayVpcAttachments
$creadsPrec :: Int -> ReadS DescribeTransitGatewayVpcAttachments
Prelude.Read, Int -> DescribeTransitGatewayVpcAttachments -> ShowS
[DescribeTransitGatewayVpcAttachments] -> ShowS
DescribeTransitGatewayVpcAttachments -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTransitGatewayVpcAttachments] -> ShowS
$cshowList :: [DescribeTransitGatewayVpcAttachments] -> ShowS
show :: DescribeTransitGatewayVpcAttachments -> String
$cshow :: DescribeTransitGatewayVpcAttachments -> String
showsPrec :: Int -> DescribeTransitGatewayVpcAttachments -> ShowS
$cshowsPrec :: Int -> DescribeTransitGatewayVpcAttachments -> ShowS
Prelude.Show, forall x.
Rep DescribeTransitGatewayVpcAttachments x
-> DescribeTransitGatewayVpcAttachments
forall x.
DescribeTransitGatewayVpcAttachments
-> Rep DescribeTransitGatewayVpcAttachments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTransitGatewayVpcAttachments x
-> DescribeTransitGatewayVpcAttachments
$cfrom :: forall x.
DescribeTransitGatewayVpcAttachments
-> Rep DescribeTransitGatewayVpcAttachments x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTransitGatewayVpcAttachments' 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', 'describeTransitGatewayVpcAttachments_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', 'describeTransitGatewayVpcAttachments_filters' - One or more filters. The possible values are:
--
-- -   @state@ - The state of the attachment. Valid values are @available@
--     | @deleted@ | @deleting@ | @failed@ | @failing@ |
--     @initiatingRequest@ | @modifying@ | @pendingAcceptance@ | @pending@
--     | @rollingBack@ | @rejected@ | @rejecting@.
--
-- -   @transit-gateway-attachment-id@ - The ID of the attachment.
--
-- -   @transit-gateway-id@ - The ID of the transit gateway.
--
-- -   @vpc-id@ - The ID of the VPC.
--
-- 'maxResults', 'describeTransitGatewayVpcAttachments_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', 'describeTransitGatewayVpcAttachments_nextToken' - The token for the next page of results.
--
-- 'transitGatewayAttachmentIds', 'describeTransitGatewayVpcAttachments_transitGatewayAttachmentIds' - The IDs of the attachments.
newDescribeTransitGatewayVpcAttachments ::
  DescribeTransitGatewayVpcAttachments
newDescribeTransitGatewayVpcAttachments :: DescribeTransitGatewayVpcAttachments
newDescribeTransitGatewayVpcAttachments =
  DescribeTransitGatewayVpcAttachments'
    { $sel:dryRun:DescribeTransitGatewayVpcAttachments' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeTransitGatewayVpcAttachments' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeTransitGatewayVpcAttachments' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeTransitGatewayVpcAttachments' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayAttachmentIds:DescribeTransitGatewayVpcAttachments' :: 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@.
describeTransitGatewayVpcAttachments_dryRun :: Lens.Lens' DescribeTransitGatewayVpcAttachments (Prelude.Maybe Prelude.Bool)
describeTransitGatewayVpcAttachments_dryRun :: Lens' DescribeTransitGatewayVpcAttachments (Maybe Bool)
describeTransitGatewayVpcAttachments_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachments' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeTransitGatewayVpcAttachments
s@DescribeTransitGatewayVpcAttachments' {} Maybe Bool
a -> DescribeTransitGatewayVpcAttachments
s {$sel:dryRun:DescribeTransitGatewayVpcAttachments' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeTransitGatewayVpcAttachments)

-- | One or more filters. The possible values are:
--
-- -   @state@ - The state of the attachment. Valid values are @available@
--     | @deleted@ | @deleting@ | @failed@ | @failing@ |
--     @initiatingRequest@ | @modifying@ | @pendingAcceptance@ | @pending@
--     | @rollingBack@ | @rejected@ | @rejecting@.
--
-- -   @transit-gateway-attachment-id@ - The ID of the attachment.
--
-- -   @transit-gateway-id@ - The ID of the transit gateway.
--
-- -   @vpc-id@ - The ID of the VPC.
describeTransitGatewayVpcAttachments_filters :: Lens.Lens' DescribeTransitGatewayVpcAttachments (Prelude.Maybe [Filter])
describeTransitGatewayVpcAttachments_filters :: Lens' DescribeTransitGatewayVpcAttachments (Maybe [Filter])
describeTransitGatewayVpcAttachments_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachments' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeTransitGatewayVpcAttachments
s@DescribeTransitGatewayVpcAttachments' {} Maybe [Filter]
a -> DescribeTransitGatewayVpcAttachments
s {$sel:filters:DescribeTransitGatewayVpcAttachments' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeTransitGatewayVpcAttachments) 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.
describeTransitGatewayVpcAttachments_maxResults :: Lens.Lens' DescribeTransitGatewayVpcAttachments (Prelude.Maybe Prelude.Natural)
describeTransitGatewayVpcAttachments_maxResults :: Lens' DescribeTransitGatewayVpcAttachments (Maybe Natural)
describeTransitGatewayVpcAttachments_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachments' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeTransitGatewayVpcAttachments
s@DescribeTransitGatewayVpcAttachments' {} Maybe Natural
a -> DescribeTransitGatewayVpcAttachments
s {$sel:maxResults:DescribeTransitGatewayVpcAttachments' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeTransitGatewayVpcAttachments)

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

-- | The IDs of the attachments.
describeTransitGatewayVpcAttachments_transitGatewayAttachmentIds :: Lens.Lens' DescribeTransitGatewayVpcAttachments (Prelude.Maybe [Prelude.Text])
describeTransitGatewayVpcAttachments_transitGatewayAttachmentIds :: Lens' DescribeTransitGatewayVpcAttachments (Maybe [Text])
describeTransitGatewayVpcAttachments_transitGatewayAttachmentIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachments' {Maybe [Text]
transitGatewayAttachmentIds :: Maybe [Text]
$sel:transitGatewayAttachmentIds:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Text]
transitGatewayAttachmentIds} -> Maybe [Text]
transitGatewayAttachmentIds) (\s :: DescribeTransitGatewayVpcAttachments
s@DescribeTransitGatewayVpcAttachments' {} Maybe [Text]
a -> DescribeTransitGatewayVpcAttachments
s {$sel:transitGatewayAttachmentIds:DescribeTransitGatewayVpcAttachments' :: Maybe [Text]
transitGatewayAttachmentIds = Maybe [Text]
a} :: DescribeTransitGatewayVpcAttachments) 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
    DescribeTransitGatewayVpcAttachments
  where
  page :: DescribeTransitGatewayVpcAttachments
-> AWSResponse DescribeTransitGatewayVpcAttachments
-> Maybe DescribeTransitGatewayVpcAttachments
page DescribeTransitGatewayVpcAttachments
rq AWSResponse DescribeTransitGatewayVpcAttachments
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTransitGatewayVpcAttachments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTransitGatewayVpcAttachmentsResponse (Maybe Text)
describeTransitGatewayVpcAttachmentsResponse_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 DescribeTransitGatewayVpcAttachments
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeTransitGatewayVpcAttachmentsResponse
  (Maybe [TransitGatewayVpcAttachment])
describeTransitGatewayVpcAttachmentsResponse_transitGatewayVpcAttachments
            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.$ DescribeTransitGatewayVpcAttachments
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeTransitGatewayVpcAttachments (Maybe Text)
describeTransitGatewayVpcAttachments_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTransitGatewayVpcAttachments
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTransitGatewayVpcAttachmentsResponse (Maybe Text)
describeTransitGatewayVpcAttachmentsResponse_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
    DescribeTransitGatewayVpcAttachments
  where
  type
    AWSResponse DescribeTransitGatewayVpcAttachments =
      DescribeTransitGatewayVpcAttachmentsResponse
  request :: (Service -> Service)
-> DescribeTransitGatewayVpcAttachments
-> Request DescribeTransitGatewayVpcAttachments
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 DescribeTransitGatewayVpcAttachments
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeTransitGatewayVpcAttachments)))
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 [TransitGatewayVpcAttachment]
-> Int
-> DescribeTransitGatewayVpcAttachmentsResponse
DescribeTransitGatewayVpcAttachmentsResponse'
            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
"transitGatewayVpcAttachments"
                            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
    DescribeTransitGatewayVpcAttachments
  where
  hashWithSalt :: Int -> DescribeTransitGatewayVpcAttachments -> Int
hashWithSalt
    Int
_salt
    DescribeTransitGatewayVpcAttachments' {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:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Text]
$sel:nextToken:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Text
$sel:maxResults:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Natural
$sel:filters:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Filter]
$sel:dryRun:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> 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
    DescribeTransitGatewayVpcAttachments
  where
  rnf :: DescribeTransitGatewayVpcAttachments -> ()
rnf DescribeTransitGatewayVpcAttachments' {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:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Text]
$sel:nextToken:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Text
$sel:maxResults:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Natural
$sel:filters:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Filter]
$sel:dryRun:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> 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
    DescribeTransitGatewayVpcAttachments
  where
  toHeaders :: DescribeTransitGatewayVpcAttachments -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance
  Data.ToQuery
    DescribeTransitGatewayVpcAttachments
  where
  toQuery :: DescribeTransitGatewayVpcAttachments -> QueryString
toQuery DescribeTransitGatewayVpcAttachments' {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:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Text]
$sel:nextToken:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Text
$sel:maxResults:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Natural
$sel:filters:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe [Filter]
$sel:dryRun:DescribeTransitGatewayVpcAttachments' :: DescribeTransitGatewayVpcAttachments -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeTransitGatewayVpcAttachments" ::
                      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:/ 'newDescribeTransitGatewayVpcAttachmentsResponse' smart constructor.
data DescribeTransitGatewayVpcAttachmentsResponse = DescribeTransitGatewayVpcAttachmentsResponse'
  { -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeTransitGatewayVpcAttachmentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the VPC attachments.
    DescribeTransitGatewayVpcAttachmentsResponse
-> Maybe [TransitGatewayVpcAttachment]
transitGatewayVpcAttachments :: Prelude.Maybe [TransitGatewayVpcAttachment],
    -- | The response's http status code.
    DescribeTransitGatewayVpcAttachmentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTransitGatewayVpcAttachmentsResponse
-> DescribeTransitGatewayVpcAttachmentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTransitGatewayVpcAttachmentsResponse
-> DescribeTransitGatewayVpcAttachmentsResponse -> Bool
$c/= :: DescribeTransitGatewayVpcAttachmentsResponse
-> DescribeTransitGatewayVpcAttachmentsResponse -> Bool
== :: DescribeTransitGatewayVpcAttachmentsResponse
-> DescribeTransitGatewayVpcAttachmentsResponse -> Bool
$c== :: DescribeTransitGatewayVpcAttachmentsResponse
-> DescribeTransitGatewayVpcAttachmentsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTransitGatewayVpcAttachmentsResponse]
ReadPrec DescribeTransitGatewayVpcAttachmentsResponse
Int -> ReadS DescribeTransitGatewayVpcAttachmentsResponse
ReadS [DescribeTransitGatewayVpcAttachmentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTransitGatewayVpcAttachmentsResponse]
$creadListPrec :: ReadPrec [DescribeTransitGatewayVpcAttachmentsResponse]
readPrec :: ReadPrec DescribeTransitGatewayVpcAttachmentsResponse
$creadPrec :: ReadPrec DescribeTransitGatewayVpcAttachmentsResponse
readList :: ReadS [DescribeTransitGatewayVpcAttachmentsResponse]
$creadList :: ReadS [DescribeTransitGatewayVpcAttachmentsResponse]
readsPrec :: Int -> ReadS DescribeTransitGatewayVpcAttachmentsResponse
$creadsPrec :: Int -> ReadS DescribeTransitGatewayVpcAttachmentsResponse
Prelude.Read, Int -> DescribeTransitGatewayVpcAttachmentsResponse -> ShowS
[DescribeTransitGatewayVpcAttachmentsResponse] -> ShowS
DescribeTransitGatewayVpcAttachmentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTransitGatewayVpcAttachmentsResponse] -> ShowS
$cshowList :: [DescribeTransitGatewayVpcAttachmentsResponse] -> ShowS
show :: DescribeTransitGatewayVpcAttachmentsResponse -> String
$cshow :: DescribeTransitGatewayVpcAttachmentsResponse -> String
showsPrec :: Int -> DescribeTransitGatewayVpcAttachmentsResponse -> ShowS
$cshowsPrec :: Int -> DescribeTransitGatewayVpcAttachmentsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeTransitGatewayVpcAttachmentsResponse x
-> DescribeTransitGatewayVpcAttachmentsResponse
forall x.
DescribeTransitGatewayVpcAttachmentsResponse
-> Rep DescribeTransitGatewayVpcAttachmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTransitGatewayVpcAttachmentsResponse x
-> DescribeTransitGatewayVpcAttachmentsResponse
$cfrom :: forall x.
DescribeTransitGatewayVpcAttachmentsResponse
-> Rep DescribeTransitGatewayVpcAttachmentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTransitGatewayVpcAttachmentsResponse' 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', 'describeTransitGatewayVpcAttachmentsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'transitGatewayVpcAttachments', 'describeTransitGatewayVpcAttachmentsResponse_transitGatewayVpcAttachments' - Information about the VPC attachments.
--
-- 'httpStatus', 'describeTransitGatewayVpcAttachmentsResponse_httpStatus' - The response's http status code.
newDescribeTransitGatewayVpcAttachmentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTransitGatewayVpcAttachmentsResponse
newDescribeTransitGatewayVpcAttachmentsResponse :: Int -> DescribeTransitGatewayVpcAttachmentsResponse
newDescribeTransitGatewayVpcAttachmentsResponse
  Int
pHttpStatus_ =
    DescribeTransitGatewayVpcAttachmentsResponse'
      { $sel:nextToken:DescribeTransitGatewayVpcAttachmentsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayVpcAttachments:DescribeTransitGatewayVpcAttachmentsResponse' :: Maybe [TransitGatewayVpcAttachment]
transitGatewayVpcAttachments =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeTransitGatewayVpcAttachmentsResponse' :: 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.
describeTransitGatewayVpcAttachmentsResponse_nextToken :: Lens.Lens' DescribeTransitGatewayVpcAttachmentsResponse (Prelude.Maybe Prelude.Text)
describeTransitGatewayVpcAttachmentsResponse_nextToken :: Lens' DescribeTransitGatewayVpcAttachmentsResponse (Maybe Text)
describeTransitGatewayVpcAttachmentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTransitGatewayVpcAttachmentsResponse' :: DescribeTransitGatewayVpcAttachmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTransitGatewayVpcAttachmentsResponse
s@DescribeTransitGatewayVpcAttachmentsResponse' {} Maybe Text
a -> DescribeTransitGatewayVpcAttachmentsResponse
s {$sel:nextToken:DescribeTransitGatewayVpcAttachmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTransitGatewayVpcAttachmentsResponse)

-- | Information about the VPC attachments.
describeTransitGatewayVpcAttachmentsResponse_transitGatewayVpcAttachments :: Lens.Lens' DescribeTransitGatewayVpcAttachmentsResponse (Prelude.Maybe [TransitGatewayVpcAttachment])
describeTransitGatewayVpcAttachmentsResponse_transitGatewayVpcAttachments :: Lens'
  DescribeTransitGatewayVpcAttachmentsResponse
  (Maybe [TransitGatewayVpcAttachment])
describeTransitGatewayVpcAttachmentsResponse_transitGatewayVpcAttachments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachmentsResponse' {Maybe [TransitGatewayVpcAttachment]
transitGatewayVpcAttachments :: Maybe [TransitGatewayVpcAttachment]
$sel:transitGatewayVpcAttachments:DescribeTransitGatewayVpcAttachmentsResponse' :: DescribeTransitGatewayVpcAttachmentsResponse
-> Maybe [TransitGatewayVpcAttachment]
transitGatewayVpcAttachments} -> Maybe [TransitGatewayVpcAttachment]
transitGatewayVpcAttachments) (\s :: DescribeTransitGatewayVpcAttachmentsResponse
s@DescribeTransitGatewayVpcAttachmentsResponse' {} Maybe [TransitGatewayVpcAttachment]
a -> DescribeTransitGatewayVpcAttachmentsResponse
s {$sel:transitGatewayVpcAttachments:DescribeTransitGatewayVpcAttachmentsResponse' :: Maybe [TransitGatewayVpcAttachment]
transitGatewayVpcAttachments = Maybe [TransitGatewayVpcAttachment]
a} :: DescribeTransitGatewayVpcAttachmentsResponse) 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.
describeTransitGatewayVpcAttachmentsResponse_httpStatus :: Lens.Lens' DescribeTransitGatewayVpcAttachmentsResponse Prelude.Int
describeTransitGatewayVpcAttachmentsResponse_httpStatus :: Lens' DescribeTransitGatewayVpcAttachmentsResponse Int
describeTransitGatewayVpcAttachmentsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTransitGatewayVpcAttachmentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTransitGatewayVpcAttachmentsResponse' :: DescribeTransitGatewayVpcAttachmentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTransitGatewayVpcAttachmentsResponse
s@DescribeTransitGatewayVpcAttachmentsResponse' {} Int
a -> DescribeTransitGatewayVpcAttachmentsResponse
s {$sel:httpStatus:DescribeTransitGatewayVpcAttachmentsResponse' :: Int
httpStatus = Int
a} :: DescribeTransitGatewayVpcAttachmentsResponse)

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