{-# 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.Route53.ListVPCAssociationAuthorizations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a list of the VPCs that were created by other accounts and that can
-- be associated with a specified hosted zone because you\'ve submitted one
-- or more @CreateVPCAssociationAuthorization@ requests.
--
-- The response includes a @VPCs@ element with a @VPC@ child element for
-- each VPC that can be associated with the hosted zone.
--
-- This operation returns paginated results.
module Amazonka.Route53.ListVPCAssociationAuthorizations
  ( -- * Creating a Request
    ListVPCAssociationAuthorizations (..),
    newListVPCAssociationAuthorizations,

    -- * Request Lenses
    listVPCAssociationAuthorizations_maxResults,
    listVPCAssociationAuthorizations_nextToken,
    listVPCAssociationAuthorizations_hostedZoneId,

    -- * Destructuring the Response
    ListVPCAssociationAuthorizationsResponse (..),
    newListVPCAssociationAuthorizationsResponse,

    -- * Response Lenses
    listVPCAssociationAuthorizationsResponse_nextToken,
    listVPCAssociationAuthorizationsResponse_httpStatus,
    listVPCAssociationAuthorizationsResponse_hostedZoneId,
    listVPCAssociationAuthorizationsResponse_vPCs,
  )
where

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

-- | A complex type that contains information about that can be associated
-- with your hosted zone.
--
-- /See:/ 'newListVPCAssociationAuthorizations' smart constructor.
data ListVPCAssociationAuthorizations = ListVPCAssociationAuthorizations'
  { -- | /Optional/: An integer that specifies the maximum number of VPCs that
    -- you want Amazon Route 53 to return. If you don\'t specify a value for
    -- @MaxResults@, Route 53 returns up to 50 VPCs per page.
    ListVPCAssociationAuthorizations -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | /Optional/: If a response includes a @NextToken@ element, there are more
    -- VPCs that can be associated with the specified hosted zone. To get the
    -- next page of results, submit another request, and include the value of
    -- @NextToken@ from the response in the @nexttoken@ parameter in another
    -- @ListVPCAssociationAuthorizations@ request.
    ListVPCAssociationAuthorizations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the hosted zone for which you want a list of VPCs that can be
    -- associated with the hosted zone.
    ListVPCAssociationAuthorizations -> ResourceId
hostedZoneId :: ResourceId
  }
  deriving (ListVPCAssociationAuthorizations
-> ListVPCAssociationAuthorizations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVPCAssociationAuthorizations
-> ListVPCAssociationAuthorizations -> Bool
$c/= :: ListVPCAssociationAuthorizations
-> ListVPCAssociationAuthorizations -> Bool
== :: ListVPCAssociationAuthorizations
-> ListVPCAssociationAuthorizations -> Bool
$c== :: ListVPCAssociationAuthorizations
-> ListVPCAssociationAuthorizations -> Bool
Prelude.Eq, ReadPrec [ListVPCAssociationAuthorizations]
ReadPrec ListVPCAssociationAuthorizations
Int -> ReadS ListVPCAssociationAuthorizations
ReadS [ListVPCAssociationAuthorizations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVPCAssociationAuthorizations]
$creadListPrec :: ReadPrec [ListVPCAssociationAuthorizations]
readPrec :: ReadPrec ListVPCAssociationAuthorizations
$creadPrec :: ReadPrec ListVPCAssociationAuthorizations
readList :: ReadS [ListVPCAssociationAuthorizations]
$creadList :: ReadS [ListVPCAssociationAuthorizations]
readsPrec :: Int -> ReadS ListVPCAssociationAuthorizations
$creadsPrec :: Int -> ReadS ListVPCAssociationAuthorizations
Prelude.Read, Int -> ListVPCAssociationAuthorizations -> ShowS
[ListVPCAssociationAuthorizations] -> ShowS
ListVPCAssociationAuthorizations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVPCAssociationAuthorizations] -> ShowS
$cshowList :: [ListVPCAssociationAuthorizations] -> ShowS
show :: ListVPCAssociationAuthorizations -> String
$cshow :: ListVPCAssociationAuthorizations -> String
showsPrec :: Int -> ListVPCAssociationAuthorizations -> ShowS
$cshowsPrec :: Int -> ListVPCAssociationAuthorizations -> ShowS
Prelude.Show, forall x.
Rep ListVPCAssociationAuthorizations x
-> ListVPCAssociationAuthorizations
forall x.
ListVPCAssociationAuthorizations
-> Rep ListVPCAssociationAuthorizations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVPCAssociationAuthorizations x
-> ListVPCAssociationAuthorizations
$cfrom :: forall x.
ListVPCAssociationAuthorizations
-> Rep ListVPCAssociationAuthorizations x
Prelude.Generic)

-- |
-- Create a value of 'ListVPCAssociationAuthorizations' 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:
--
-- 'maxResults', 'listVPCAssociationAuthorizations_maxResults' - /Optional/: An integer that specifies the maximum number of VPCs that
-- you want Amazon Route 53 to return. If you don\'t specify a value for
-- @MaxResults@, Route 53 returns up to 50 VPCs per page.
--
-- 'nextToken', 'listVPCAssociationAuthorizations_nextToken' - /Optional/: If a response includes a @NextToken@ element, there are more
-- VPCs that can be associated with the specified hosted zone. To get the
-- next page of results, submit another request, and include the value of
-- @NextToken@ from the response in the @nexttoken@ parameter in another
-- @ListVPCAssociationAuthorizations@ request.
--
-- 'hostedZoneId', 'listVPCAssociationAuthorizations_hostedZoneId' - The ID of the hosted zone for which you want a list of VPCs that can be
-- associated with the hosted zone.
newListVPCAssociationAuthorizations ::
  -- | 'hostedZoneId'
  ResourceId ->
  ListVPCAssociationAuthorizations
newListVPCAssociationAuthorizations :: ResourceId -> ListVPCAssociationAuthorizations
newListVPCAssociationAuthorizations ResourceId
pHostedZoneId_ =
  ListVPCAssociationAuthorizations'
    { $sel:maxResults:ListVPCAssociationAuthorizations' :: Maybe Text
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListVPCAssociationAuthorizations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_
    }

-- | /Optional/: An integer that specifies the maximum number of VPCs that
-- you want Amazon Route 53 to return. If you don\'t specify a value for
-- @MaxResults@, Route 53 returns up to 50 VPCs per page.
listVPCAssociationAuthorizations_maxResults :: Lens.Lens' ListVPCAssociationAuthorizations (Prelude.Maybe Prelude.Text)
listVPCAssociationAuthorizations_maxResults :: Lens' ListVPCAssociationAuthorizations (Maybe Text)
listVPCAssociationAuthorizations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCAssociationAuthorizations' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: ListVPCAssociationAuthorizations
s@ListVPCAssociationAuthorizations' {} Maybe Text
a -> ListVPCAssociationAuthorizations
s {$sel:maxResults:ListVPCAssociationAuthorizations' :: Maybe Text
maxResults = Maybe Text
a} :: ListVPCAssociationAuthorizations)

-- | /Optional/: If a response includes a @NextToken@ element, there are more
-- VPCs that can be associated with the specified hosted zone. To get the
-- next page of results, submit another request, and include the value of
-- @NextToken@ from the response in the @nexttoken@ parameter in another
-- @ListVPCAssociationAuthorizations@ request.
listVPCAssociationAuthorizations_nextToken :: Lens.Lens' ListVPCAssociationAuthorizations (Prelude.Maybe Prelude.Text)
listVPCAssociationAuthorizations_nextToken :: Lens' ListVPCAssociationAuthorizations (Maybe Text)
listVPCAssociationAuthorizations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCAssociationAuthorizations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVPCAssociationAuthorizations
s@ListVPCAssociationAuthorizations' {} Maybe Text
a -> ListVPCAssociationAuthorizations
s {$sel:nextToken:ListVPCAssociationAuthorizations' :: Maybe Text
nextToken = Maybe Text
a} :: ListVPCAssociationAuthorizations)

-- | The ID of the hosted zone for which you want a list of VPCs that can be
-- associated with the hosted zone.
listVPCAssociationAuthorizations_hostedZoneId :: Lens.Lens' ListVPCAssociationAuthorizations ResourceId
listVPCAssociationAuthorizations_hostedZoneId :: Lens' ListVPCAssociationAuthorizations ResourceId
listVPCAssociationAuthorizations_hostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCAssociationAuthorizations' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: ListVPCAssociationAuthorizations
s@ListVPCAssociationAuthorizations' {} ResourceId
a -> ListVPCAssociationAuthorizations
s {$sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ResourceId
hostedZoneId = ResourceId
a} :: ListVPCAssociationAuthorizations)

instance
  Core.AWSPager
    ListVPCAssociationAuthorizations
  where
  page :: ListVPCAssociationAuthorizations
-> AWSResponse ListVPCAssociationAuthorizations
-> Maybe ListVPCAssociationAuthorizations
page ListVPCAssociationAuthorizations
rq AWSResponse ListVPCAssociationAuthorizations
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListVPCAssociationAuthorizations
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVPCAssociationAuthorizationsResponse (Maybe Text)
listVPCAssociationAuthorizationsResponse_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 ListVPCAssociationAuthorizations
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListVPCAssociationAuthorizationsResponse (NonEmpty VPC)
listVPCAssociationAuthorizationsResponse_vPCs
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListVPCAssociationAuthorizations
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVPCAssociationAuthorizations (Maybe Text)
listVPCAssociationAuthorizations_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVPCAssociationAuthorizations
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVPCAssociationAuthorizationsResponse (Maybe Text)
listVPCAssociationAuthorizationsResponse_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
    ListVPCAssociationAuthorizations
  where
  type
    AWSResponse ListVPCAssociationAuthorizations =
      ListVPCAssociationAuthorizationsResponse
  request :: (Service -> Service)
-> ListVPCAssociationAuthorizations
-> Request ListVPCAssociationAuthorizations
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListVPCAssociationAuthorizations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListVPCAssociationAuthorizations)))
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
-> Int
-> ResourceId
-> NonEmpty VPC
-> ListVPCAssociationAuthorizationsResponse
ListVPCAssociationAuthorizationsResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"HostedZoneId")
            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
"VPCs"
                            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 a. FromXML a => Text -> [Node] -> Either String (NonEmpty a)
Data.parseXMLList1 Text
"VPC"
                        )
      )

instance
  Prelude.Hashable
    ListVPCAssociationAuthorizations
  where
  hashWithSalt :: Int -> ListVPCAssociationAuthorizations -> Int
hashWithSalt
    Int
_salt
    ListVPCAssociationAuthorizations' {Maybe Text
ResourceId
hostedZoneId :: ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> ResourceId
$sel:nextToken:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
$sel:maxResults:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceId
hostedZoneId

instance
  Prelude.NFData
    ListVPCAssociationAuthorizations
  where
  rnf :: ListVPCAssociationAuthorizations -> ()
rnf ListVPCAssociationAuthorizations' {Maybe Text
ResourceId
hostedZoneId :: ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> ResourceId
$sel:nextToken:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
$sel:maxResults:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
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 ResourceId
hostedZoneId

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

instance Data.ToPath ListVPCAssociationAuthorizations where
  toPath :: ListVPCAssociationAuthorizations -> ByteString
toPath ListVPCAssociationAuthorizations' {Maybe Text
ResourceId
hostedZoneId :: ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> ResourceId
$sel:nextToken:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
$sel:maxResults:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2013-04-01/hostedzone/",
        forall a. ToByteString a => a -> ByteString
Data.toBS ResourceId
hostedZoneId,
        ByteString
"/authorizevpcassociation"
      ]

instance
  Data.ToQuery
    ListVPCAssociationAuthorizations
  where
  toQuery :: ListVPCAssociationAuthorizations -> QueryString
toQuery ListVPCAssociationAuthorizations' {Maybe Text
ResourceId
hostedZoneId :: ResourceId
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:hostedZoneId:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> ResourceId
$sel:nextToken:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
$sel:maxResults:ListVPCAssociationAuthorizations' :: ListVPCAssociationAuthorizations -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxresults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxResults,
        ByteString
"nexttoken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | A complex type that contains the response information for the request.
--
-- /See:/ 'newListVPCAssociationAuthorizationsResponse' smart constructor.
data ListVPCAssociationAuthorizationsResponse = ListVPCAssociationAuthorizationsResponse'
  { -- | When the response includes a @NextToken@ element, there are more VPCs
    -- that can be associated with the specified hosted zone. To get the next
    -- page of VPCs, submit another @ListVPCAssociationAuthorizations@ request,
    -- and include the value of the @NextToken@ element from the response in
    -- the @nexttoken@ request parameter.
    ListVPCAssociationAuthorizationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListVPCAssociationAuthorizationsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the hosted zone that you can associate the listed VPCs with.
    ListVPCAssociationAuthorizationsResponse -> ResourceId
hostedZoneId :: ResourceId,
    -- | The list of VPCs that are authorized to be associated with the specified
    -- hosted zone.
    ListVPCAssociationAuthorizationsResponse -> NonEmpty VPC
vPCs :: Prelude.NonEmpty VPC
  }
  deriving (ListVPCAssociationAuthorizationsResponse
-> ListVPCAssociationAuthorizationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVPCAssociationAuthorizationsResponse
-> ListVPCAssociationAuthorizationsResponse -> Bool
$c/= :: ListVPCAssociationAuthorizationsResponse
-> ListVPCAssociationAuthorizationsResponse -> Bool
== :: ListVPCAssociationAuthorizationsResponse
-> ListVPCAssociationAuthorizationsResponse -> Bool
$c== :: ListVPCAssociationAuthorizationsResponse
-> ListVPCAssociationAuthorizationsResponse -> Bool
Prelude.Eq, ReadPrec [ListVPCAssociationAuthorizationsResponse]
ReadPrec ListVPCAssociationAuthorizationsResponse
Int -> ReadS ListVPCAssociationAuthorizationsResponse
ReadS [ListVPCAssociationAuthorizationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVPCAssociationAuthorizationsResponse]
$creadListPrec :: ReadPrec [ListVPCAssociationAuthorizationsResponse]
readPrec :: ReadPrec ListVPCAssociationAuthorizationsResponse
$creadPrec :: ReadPrec ListVPCAssociationAuthorizationsResponse
readList :: ReadS [ListVPCAssociationAuthorizationsResponse]
$creadList :: ReadS [ListVPCAssociationAuthorizationsResponse]
readsPrec :: Int -> ReadS ListVPCAssociationAuthorizationsResponse
$creadsPrec :: Int -> ReadS ListVPCAssociationAuthorizationsResponse
Prelude.Read, Int -> ListVPCAssociationAuthorizationsResponse -> ShowS
[ListVPCAssociationAuthorizationsResponse] -> ShowS
ListVPCAssociationAuthorizationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVPCAssociationAuthorizationsResponse] -> ShowS
$cshowList :: [ListVPCAssociationAuthorizationsResponse] -> ShowS
show :: ListVPCAssociationAuthorizationsResponse -> String
$cshow :: ListVPCAssociationAuthorizationsResponse -> String
showsPrec :: Int -> ListVPCAssociationAuthorizationsResponse -> ShowS
$cshowsPrec :: Int -> ListVPCAssociationAuthorizationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListVPCAssociationAuthorizationsResponse x
-> ListVPCAssociationAuthorizationsResponse
forall x.
ListVPCAssociationAuthorizationsResponse
-> Rep ListVPCAssociationAuthorizationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVPCAssociationAuthorizationsResponse x
-> ListVPCAssociationAuthorizationsResponse
$cfrom :: forall x.
ListVPCAssociationAuthorizationsResponse
-> Rep ListVPCAssociationAuthorizationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVPCAssociationAuthorizationsResponse' 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', 'listVPCAssociationAuthorizationsResponse_nextToken' - When the response includes a @NextToken@ element, there are more VPCs
-- that can be associated with the specified hosted zone. To get the next
-- page of VPCs, submit another @ListVPCAssociationAuthorizations@ request,
-- and include the value of the @NextToken@ element from the response in
-- the @nexttoken@ request parameter.
--
-- 'httpStatus', 'listVPCAssociationAuthorizationsResponse_httpStatus' - The response's http status code.
--
-- 'hostedZoneId', 'listVPCAssociationAuthorizationsResponse_hostedZoneId' - The ID of the hosted zone that you can associate the listed VPCs with.
--
-- 'vPCs', 'listVPCAssociationAuthorizationsResponse_vPCs' - The list of VPCs that are authorized to be associated with the specified
-- hosted zone.
newListVPCAssociationAuthorizationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'hostedZoneId'
  ResourceId ->
  -- | 'vPCs'
  Prelude.NonEmpty VPC ->
  ListVPCAssociationAuthorizationsResponse
newListVPCAssociationAuthorizationsResponse :: Int
-> ResourceId
-> NonEmpty VPC
-> ListVPCAssociationAuthorizationsResponse
newListVPCAssociationAuthorizationsResponse
  Int
pHttpStatus_
  ResourceId
pHostedZoneId_
  NonEmpty VPC
pVPCs_ =
    ListVPCAssociationAuthorizationsResponse'
      { $sel:nextToken:ListVPCAssociationAuthorizationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListVPCAssociationAuthorizationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:hostedZoneId:ListVPCAssociationAuthorizationsResponse' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_,
        $sel:vPCs:ListVPCAssociationAuthorizationsResponse' :: NonEmpty VPC
vPCs = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty VPC
pVPCs_
      }

-- | When the response includes a @NextToken@ element, there are more VPCs
-- that can be associated with the specified hosted zone. To get the next
-- page of VPCs, submit another @ListVPCAssociationAuthorizations@ request,
-- and include the value of the @NextToken@ element from the response in
-- the @nexttoken@ request parameter.
listVPCAssociationAuthorizationsResponse_nextToken :: Lens.Lens' ListVPCAssociationAuthorizationsResponse (Prelude.Maybe Prelude.Text)
listVPCAssociationAuthorizationsResponse_nextToken :: Lens' ListVPCAssociationAuthorizationsResponse (Maybe Text)
listVPCAssociationAuthorizationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCAssociationAuthorizationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVPCAssociationAuthorizationsResponse
s@ListVPCAssociationAuthorizationsResponse' {} Maybe Text
a -> ListVPCAssociationAuthorizationsResponse
s {$sel:nextToken:ListVPCAssociationAuthorizationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVPCAssociationAuthorizationsResponse)

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

-- | The ID of the hosted zone that you can associate the listed VPCs with.
listVPCAssociationAuthorizationsResponse_hostedZoneId :: Lens.Lens' ListVPCAssociationAuthorizationsResponse ResourceId
listVPCAssociationAuthorizationsResponse_hostedZoneId :: Lens' ListVPCAssociationAuthorizationsResponse ResourceId
listVPCAssociationAuthorizationsResponse_hostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCAssociationAuthorizationsResponse' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: ListVPCAssociationAuthorizationsResponse
s@ListVPCAssociationAuthorizationsResponse' {} ResourceId
a -> ListVPCAssociationAuthorizationsResponse
s {$sel:hostedZoneId:ListVPCAssociationAuthorizationsResponse' :: ResourceId
hostedZoneId = ResourceId
a} :: ListVPCAssociationAuthorizationsResponse)

-- | The list of VPCs that are authorized to be associated with the specified
-- hosted zone.
listVPCAssociationAuthorizationsResponse_vPCs :: Lens.Lens' ListVPCAssociationAuthorizationsResponse (Prelude.NonEmpty VPC)
listVPCAssociationAuthorizationsResponse_vPCs :: Lens' ListVPCAssociationAuthorizationsResponse (NonEmpty VPC)
listVPCAssociationAuthorizationsResponse_vPCs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCAssociationAuthorizationsResponse' {NonEmpty VPC
vPCs :: NonEmpty VPC
$sel:vPCs:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> NonEmpty VPC
vPCs} -> NonEmpty VPC
vPCs) (\s :: ListVPCAssociationAuthorizationsResponse
s@ListVPCAssociationAuthorizationsResponse' {} NonEmpty VPC
a -> ListVPCAssociationAuthorizationsResponse
s {$sel:vPCs:ListVPCAssociationAuthorizationsResponse' :: NonEmpty VPC
vPCs = NonEmpty VPC
a} :: ListVPCAssociationAuthorizationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListVPCAssociationAuthorizationsResponse
  where
  rnf :: ListVPCAssociationAuthorizationsResponse -> ()
rnf ListVPCAssociationAuthorizationsResponse' {Int
Maybe Text
NonEmpty VPC
ResourceId
vPCs :: NonEmpty VPC
hostedZoneId :: ResourceId
httpStatus :: Int
nextToken :: Maybe Text
$sel:vPCs:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> NonEmpty VPC
$sel:hostedZoneId:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> ResourceId
$sel:httpStatus:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> Int
$sel:nextToken:ListVPCAssociationAuthorizationsResponse' :: ListVPCAssociationAuthorizationsResponse -> 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 Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceId
hostedZoneId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty VPC
vPCs