{-# 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.ListHostedZonesByVPC
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all the private hosted zones that a specified VPC is associated
-- with, regardless of which Amazon Web Services account or Amazon Web
-- Services service owns the hosted zones. The @HostedZoneOwner@ structure
-- in the response contains one of the following values:
--
-- -   An @OwningAccount@ element, which contains the account number of
--     either the current Amazon Web Services account or another Amazon Web
--     Services account. Some services, such as Cloud Map, create hosted
--     zones using the current account.
--
-- -   An @OwningService@ element, which identifies the Amazon Web Services
--     service that created and owns the hosted zone. For example, if a
--     hosted zone was created by Amazon Elastic File System (Amazon EFS),
--     the value of @Owner@ is @efs.amazonaws.com@.
module Amazonka.Route53.ListHostedZonesByVPC
  ( -- * Creating a Request
    ListHostedZonesByVPC (..),
    newListHostedZonesByVPC,

    -- * Request Lenses
    listHostedZonesByVPC_nextToken,
    listHostedZonesByVPC_maxItems,
    listHostedZonesByVPC_vPCId,
    listHostedZonesByVPC_vPCRegion,

    -- * Destructuring the Response
    ListHostedZonesByVPCResponse (..),
    newListHostedZonesByVPCResponse,

    -- * Response Lenses
    listHostedZonesByVPCResponse_nextToken,
    listHostedZonesByVPCResponse_httpStatus,
    listHostedZonesByVPCResponse_hostedZoneSummaries,
    listHostedZonesByVPCResponse_maxItems,
  )
where

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

-- | Lists all the private hosted zones that a specified VPC is associated
-- with, regardless of which Amazon Web Services account created the hosted
-- zones.
--
-- /See:/ 'newListHostedZonesByVPC' smart constructor.
data ListHostedZonesByVPC = ListHostedZonesByVPC'
  { -- | If the previous response included a @NextToken@ element, the specified
    -- VPC is associated with more hosted zones. To get more hosted zones,
    -- submit another @ListHostedZonesByVPC@ request.
    --
    -- For the value of @NextToken@, specify the value of @NextToken@ from the
    -- previous response.
    --
    -- If the previous response didn\'t include a @NextToken@ element, there
    -- are no more hosted zones to get.
    ListHostedZonesByVPC -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The maximum number of hosted zones that you want Amazon Route
    -- 53 to return. If the specified VPC is associated with more than
    -- @MaxItems@ hosted zones, the response includes a @NextToken@ element.
    -- @NextToken@ contains an encrypted token that identifies the first hosted
    -- zone that Route 53 will return if you submit another request.
    ListHostedZonesByVPC -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon VPC that you want to list hosted zones for.
    ListHostedZonesByVPC -> Text
vPCId :: Prelude.Text,
    -- | For the Amazon VPC that you specified for @VPCId@, the Amazon Web
    -- Services Region that you created the VPC in.
    ListHostedZonesByVPC -> VPCRegion
vPCRegion :: VPCRegion
  }
  deriving (ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool
(ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool)
-> (ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool)
-> Eq ListHostedZonesByVPC
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool
$c/= :: ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool
== :: ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool
$c== :: ListHostedZonesByVPC -> ListHostedZonesByVPC -> Bool
Prelude.Eq, ReadPrec [ListHostedZonesByVPC]
ReadPrec ListHostedZonesByVPC
Int -> ReadS ListHostedZonesByVPC
ReadS [ListHostedZonesByVPC]
(Int -> ReadS ListHostedZonesByVPC)
-> ReadS [ListHostedZonesByVPC]
-> ReadPrec ListHostedZonesByVPC
-> ReadPrec [ListHostedZonesByVPC]
-> Read ListHostedZonesByVPC
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHostedZonesByVPC]
$creadListPrec :: ReadPrec [ListHostedZonesByVPC]
readPrec :: ReadPrec ListHostedZonesByVPC
$creadPrec :: ReadPrec ListHostedZonesByVPC
readList :: ReadS [ListHostedZonesByVPC]
$creadList :: ReadS [ListHostedZonesByVPC]
readsPrec :: Int -> ReadS ListHostedZonesByVPC
$creadsPrec :: Int -> ReadS ListHostedZonesByVPC
Prelude.Read, Int -> ListHostedZonesByVPC -> ShowS
[ListHostedZonesByVPC] -> ShowS
ListHostedZonesByVPC -> String
(Int -> ListHostedZonesByVPC -> ShowS)
-> (ListHostedZonesByVPC -> String)
-> ([ListHostedZonesByVPC] -> ShowS)
-> Show ListHostedZonesByVPC
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHostedZonesByVPC] -> ShowS
$cshowList :: [ListHostedZonesByVPC] -> ShowS
show :: ListHostedZonesByVPC -> String
$cshow :: ListHostedZonesByVPC -> String
showsPrec :: Int -> ListHostedZonesByVPC -> ShowS
$cshowsPrec :: Int -> ListHostedZonesByVPC -> ShowS
Prelude.Show, (forall x. ListHostedZonesByVPC -> Rep ListHostedZonesByVPC x)
-> (forall x. Rep ListHostedZonesByVPC x -> ListHostedZonesByVPC)
-> Generic ListHostedZonesByVPC
forall x. Rep ListHostedZonesByVPC x -> ListHostedZonesByVPC
forall x. ListHostedZonesByVPC -> Rep ListHostedZonesByVPC x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHostedZonesByVPC x -> ListHostedZonesByVPC
$cfrom :: forall x. ListHostedZonesByVPC -> Rep ListHostedZonesByVPC x
Prelude.Generic)

-- |
-- Create a value of 'ListHostedZonesByVPC' 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', 'listHostedZonesByVPC_nextToken' - If the previous response included a @NextToken@ element, the specified
-- VPC is associated with more hosted zones. To get more hosted zones,
-- submit another @ListHostedZonesByVPC@ request.
--
-- For the value of @NextToken@, specify the value of @NextToken@ from the
-- previous response.
--
-- If the previous response didn\'t include a @NextToken@ element, there
-- are no more hosted zones to get.
--
-- 'maxItems', 'listHostedZonesByVPC_maxItems' - (Optional) The maximum number of hosted zones that you want Amazon Route
-- 53 to return. If the specified VPC is associated with more than
-- @MaxItems@ hosted zones, the response includes a @NextToken@ element.
-- @NextToken@ contains an encrypted token that identifies the first hosted
-- zone that Route 53 will return if you submit another request.
--
-- 'vPCId', 'listHostedZonesByVPC_vPCId' - The ID of the Amazon VPC that you want to list hosted zones for.
--
-- 'vPCRegion', 'listHostedZonesByVPC_vPCRegion' - For the Amazon VPC that you specified for @VPCId@, the Amazon Web
-- Services Region that you created the VPC in.
newListHostedZonesByVPC ::
  -- | 'vPCId'
  Prelude.Text ->
  -- | 'vPCRegion'
  VPCRegion ->
  ListHostedZonesByVPC
newListHostedZonesByVPC :: Text -> VPCRegion -> ListHostedZonesByVPC
newListHostedZonesByVPC Text
pVPCId_ VPCRegion
pVPCRegion_ =
  ListHostedZonesByVPC' :: Maybe Text
-> Maybe Text -> Text -> VPCRegion -> ListHostedZonesByVPC
ListHostedZonesByVPC'
    { $sel:nextToken:ListHostedZonesByVPC' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListHostedZonesByVPC' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vPCId:ListHostedZonesByVPC' :: Text
vPCId = Text
pVPCId_,
      $sel:vPCRegion:ListHostedZonesByVPC' :: VPCRegion
vPCRegion = VPCRegion
pVPCRegion_
    }

-- | If the previous response included a @NextToken@ element, the specified
-- VPC is associated with more hosted zones. To get more hosted zones,
-- submit another @ListHostedZonesByVPC@ request.
--
-- For the value of @NextToken@, specify the value of @NextToken@ from the
-- previous response.
--
-- If the previous response didn\'t include a @NextToken@ element, there
-- are no more hosted zones to get.
listHostedZonesByVPC_nextToken :: Lens.Lens' ListHostedZonesByVPC (Prelude.Maybe Prelude.Text)
listHostedZonesByVPC_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListHostedZonesByVPC -> f ListHostedZonesByVPC
listHostedZonesByVPC_nextToken = (ListHostedZonesByVPC -> Maybe Text)
-> (ListHostedZonesByVPC -> Maybe Text -> ListHostedZonesByVPC)
-> Lens
     ListHostedZonesByVPC ListHostedZonesByVPC (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPC' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHostedZonesByVPC
s@ListHostedZonesByVPC' {} Maybe Text
a -> ListHostedZonesByVPC
s {$sel:nextToken:ListHostedZonesByVPC' :: Maybe Text
nextToken = Maybe Text
a} :: ListHostedZonesByVPC)

-- | (Optional) The maximum number of hosted zones that you want Amazon Route
-- 53 to return. If the specified VPC is associated with more than
-- @MaxItems@ hosted zones, the response includes a @NextToken@ element.
-- @NextToken@ contains an encrypted token that identifies the first hosted
-- zone that Route 53 will return if you submit another request.
listHostedZonesByVPC_maxItems :: Lens.Lens' ListHostedZonesByVPC (Prelude.Maybe Prelude.Text)
listHostedZonesByVPC_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListHostedZonesByVPC -> f ListHostedZonesByVPC
listHostedZonesByVPC_maxItems = (ListHostedZonesByVPC -> Maybe Text)
-> (ListHostedZonesByVPC -> Maybe Text -> ListHostedZonesByVPC)
-> Lens
     ListHostedZonesByVPC ListHostedZonesByVPC (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPC' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListHostedZonesByVPC
s@ListHostedZonesByVPC' {} Maybe Text
a -> ListHostedZonesByVPC
s {$sel:maxItems:ListHostedZonesByVPC' :: Maybe Text
maxItems = Maybe Text
a} :: ListHostedZonesByVPC)

-- | The ID of the Amazon VPC that you want to list hosted zones for.
listHostedZonesByVPC_vPCId :: Lens.Lens' ListHostedZonesByVPC Prelude.Text
listHostedZonesByVPC_vPCId :: (Text -> f Text) -> ListHostedZonesByVPC -> f ListHostedZonesByVPC
listHostedZonesByVPC_vPCId = (ListHostedZonesByVPC -> Text)
-> (ListHostedZonesByVPC -> Text -> ListHostedZonesByVPC)
-> Lens ListHostedZonesByVPC ListHostedZonesByVPC Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPC' {Text
vPCId :: Text
$sel:vPCId:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> Text
vPCId} -> Text
vPCId) (\s :: ListHostedZonesByVPC
s@ListHostedZonesByVPC' {} Text
a -> ListHostedZonesByVPC
s {$sel:vPCId:ListHostedZonesByVPC' :: Text
vPCId = Text
a} :: ListHostedZonesByVPC)

-- | For the Amazon VPC that you specified for @VPCId@, the Amazon Web
-- Services Region that you created the VPC in.
listHostedZonesByVPC_vPCRegion :: Lens.Lens' ListHostedZonesByVPC VPCRegion
listHostedZonesByVPC_vPCRegion :: (VPCRegion -> f VPCRegion)
-> ListHostedZonesByVPC -> f ListHostedZonesByVPC
listHostedZonesByVPC_vPCRegion = (ListHostedZonesByVPC -> VPCRegion)
-> (ListHostedZonesByVPC -> VPCRegion -> ListHostedZonesByVPC)
-> Lens
     ListHostedZonesByVPC ListHostedZonesByVPC VPCRegion VPCRegion
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPC' {VPCRegion
vPCRegion :: VPCRegion
$sel:vPCRegion:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> VPCRegion
vPCRegion} -> VPCRegion
vPCRegion) (\s :: ListHostedZonesByVPC
s@ListHostedZonesByVPC' {} VPCRegion
a -> ListHostedZonesByVPC
s {$sel:vPCRegion:ListHostedZonesByVPC' :: VPCRegion
vPCRegion = VPCRegion
a} :: ListHostedZonesByVPC)

instance Core.AWSRequest ListHostedZonesByVPC where
  type
    AWSResponse ListHostedZonesByVPC =
      ListHostedZonesByVPCResponse
  request :: ListHostedZonesByVPC -> Request ListHostedZonesByVPC
request = Service -> ListHostedZonesByVPC -> Request ListHostedZonesByVPC
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListHostedZonesByVPC
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListHostedZonesByVPC)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListHostedZonesByVPC))
-> Logger
-> Service
-> Proxy ListHostedZonesByVPC
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListHostedZonesByVPC)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Int
-> [HostedZoneSummary]
-> Text
-> ListHostedZonesByVPCResponse
ListHostedZonesByVPCResponse'
            (Maybe Text
 -> Int
 -> [HostedZoneSummary]
 -> Text
 -> ListHostedZonesByVPCResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [HostedZoneSummary] -> Text -> ListHostedZonesByVPCResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either
  String
  (Int
   -> [HostedZoneSummary] -> Text -> ListHostedZonesByVPCResponse)
-> Either String Int
-> Either
     String
     ([HostedZoneSummary] -> Text -> ListHostedZonesByVPCResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([HostedZoneSummary] -> Text -> ListHostedZonesByVPCResponse)
-> Either String [HostedZoneSummary]
-> Either String (Text -> ListHostedZonesByVPCResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HostedZoneSummaries"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [HostedZoneSummary])
-> Either String [HostedZoneSummary]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [HostedZoneSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"HostedZoneSummary"
                        )
            Either String (Text -> ListHostedZonesByVPCResponse)
-> Either String Text -> Either String ListHostedZonesByVPCResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"MaxItems")
      )

instance Prelude.Hashable ListHostedZonesByVPC

instance Prelude.NFData ListHostedZonesByVPC

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

instance Core.ToPath ListHostedZonesByVPC where
  toPath :: ListHostedZonesByVPC -> ByteString
toPath = ByteString -> ListHostedZonesByVPC -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/hostedzonesbyvpc"

instance Core.ToQuery ListHostedZonesByVPC where
  toQuery :: ListHostedZonesByVPC -> QueryString
toQuery ListHostedZonesByVPC' {Maybe Text
Text
VPCRegion
vPCRegion :: VPCRegion
vPCId :: Text
maxItems :: Maybe Text
nextToken :: Maybe Text
$sel:vPCRegion:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> VPCRegion
$sel:vPCId:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> Text
$sel:maxItems:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> Maybe Text
$sel:nextToken:ListHostedZonesByVPC' :: ListHostedZonesByVPC -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nexttoken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxitems" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxItems,
        ByteString
"vpcid" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
vPCId,
        ByteString
"vpcregion" ByteString -> VPCRegion -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: VPCRegion
vPCRegion
      ]

-- | /See:/ 'newListHostedZonesByVPCResponse' smart constructor.
data ListHostedZonesByVPCResponse = ListHostedZonesByVPCResponse'
  { -- | The value that you will use for @NextToken@ in the next
    -- @ListHostedZonesByVPC@ request.
    ListHostedZonesByVPCResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListHostedZonesByVPCResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list that contains one @HostedZoneSummary@ element for each hosted
    -- zone that the specified Amazon VPC is associated with. Each
    -- @HostedZoneSummary@ element contains the hosted zone name and ID, and
    -- information about who owns the hosted zone.
    ListHostedZonesByVPCResponse -> [HostedZoneSummary]
hostedZoneSummaries :: [HostedZoneSummary],
    -- | The value that you specified for @MaxItems@ in the most recent
    -- @ListHostedZonesByVPC@ request.
    ListHostedZonesByVPCResponse -> Text
maxItems :: Prelude.Text
  }
  deriving (ListHostedZonesByVPCResponse
-> ListHostedZonesByVPCResponse -> Bool
(ListHostedZonesByVPCResponse
 -> ListHostedZonesByVPCResponse -> Bool)
-> (ListHostedZonesByVPCResponse
    -> ListHostedZonesByVPCResponse -> Bool)
-> Eq ListHostedZonesByVPCResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHostedZonesByVPCResponse
-> ListHostedZonesByVPCResponse -> Bool
$c/= :: ListHostedZonesByVPCResponse
-> ListHostedZonesByVPCResponse -> Bool
== :: ListHostedZonesByVPCResponse
-> ListHostedZonesByVPCResponse -> Bool
$c== :: ListHostedZonesByVPCResponse
-> ListHostedZonesByVPCResponse -> Bool
Prelude.Eq, ReadPrec [ListHostedZonesByVPCResponse]
ReadPrec ListHostedZonesByVPCResponse
Int -> ReadS ListHostedZonesByVPCResponse
ReadS [ListHostedZonesByVPCResponse]
(Int -> ReadS ListHostedZonesByVPCResponse)
-> ReadS [ListHostedZonesByVPCResponse]
-> ReadPrec ListHostedZonesByVPCResponse
-> ReadPrec [ListHostedZonesByVPCResponse]
-> Read ListHostedZonesByVPCResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHostedZonesByVPCResponse]
$creadListPrec :: ReadPrec [ListHostedZonesByVPCResponse]
readPrec :: ReadPrec ListHostedZonesByVPCResponse
$creadPrec :: ReadPrec ListHostedZonesByVPCResponse
readList :: ReadS [ListHostedZonesByVPCResponse]
$creadList :: ReadS [ListHostedZonesByVPCResponse]
readsPrec :: Int -> ReadS ListHostedZonesByVPCResponse
$creadsPrec :: Int -> ReadS ListHostedZonesByVPCResponse
Prelude.Read, Int -> ListHostedZonesByVPCResponse -> ShowS
[ListHostedZonesByVPCResponse] -> ShowS
ListHostedZonesByVPCResponse -> String
(Int -> ListHostedZonesByVPCResponse -> ShowS)
-> (ListHostedZonesByVPCResponse -> String)
-> ([ListHostedZonesByVPCResponse] -> ShowS)
-> Show ListHostedZonesByVPCResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHostedZonesByVPCResponse] -> ShowS
$cshowList :: [ListHostedZonesByVPCResponse] -> ShowS
show :: ListHostedZonesByVPCResponse -> String
$cshow :: ListHostedZonesByVPCResponse -> String
showsPrec :: Int -> ListHostedZonesByVPCResponse -> ShowS
$cshowsPrec :: Int -> ListHostedZonesByVPCResponse -> ShowS
Prelude.Show, (forall x.
 ListHostedZonesByVPCResponse -> Rep ListHostedZonesByVPCResponse x)
-> (forall x.
    Rep ListHostedZonesByVPCResponse x -> ListHostedZonesByVPCResponse)
-> Generic ListHostedZonesByVPCResponse
forall x.
Rep ListHostedZonesByVPCResponse x -> ListHostedZonesByVPCResponse
forall x.
ListHostedZonesByVPCResponse -> Rep ListHostedZonesByVPCResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHostedZonesByVPCResponse x -> ListHostedZonesByVPCResponse
$cfrom :: forall x.
ListHostedZonesByVPCResponse -> Rep ListHostedZonesByVPCResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListHostedZonesByVPCResponse' 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', 'listHostedZonesByVPCResponse_nextToken' - The value that you will use for @NextToken@ in the next
-- @ListHostedZonesByVPC@ request.
--
-- 'httpStatus', 'listHostedZonesByVPCResponse_httpStatus' - The response's http status code.
--
-- 'hostedZoneSummaries', 'listHostedZonesByVPCResponse_hostedZoneSummaries' - A list that contains one @HostedZoneSummary@ element for each hosted
-- zone that the specified Amazon VPC is associated with. Each
-- @HostedZoneSummary@ element contains the hosted zone name and ID, and
-- information about who owns the hosted zone.
--
-- 'maxItems', 'listHostedZonesByVPCResponse_maxItems' - The value that you specified for @MaxItems@ in the most recent
-- @ListHostedZonesByVPC@ request.
newListHostedZonesByVPCResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'maxItems'
  Prelude.Text ->
  ListHostedZonesByVPCResponse
newListHostedZonesByVPCResponse :: Int -> Text -> ListHostedZonesByVPCResponse
newListHostedZonesByVPCResponse
  Int
pHttpStatus_
  Text
pMaxItems_ =
    ListHostedZonesByVPCResponse' :: Maybe Text
-> Int
-> [HostedZoneSummary]
-> Text
-> ListHostedZonesByVPCResponse
ListHostedZonesByVPCResponse'
      { $sel:nextToken:ListHostedZonesByVPCResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListHostedZonesByVPCResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:hostedZoneSummaries:ListHostedZonesByVPCResponse' :: [HostedZoneSummary]
hostedZoneSummaries = [HostedZoneSummary]
forall a. Monoid a => a
Prelude.mempty,
        $sel:maxItems:ListHostedZonesByVPCResponse' :: Text
maxItems = Text
pMaxItems_
      }

-- | The value that you will use for @NextToken@ in the next
-- @ListHostedZonesByVPC@ request.
listHostedZonesByVPCResponse_nextToken :: Lens.Lens' ListHostedZonesByVPCResponse (Prelude.Maybe Prelude.Text)
listHostedZonesByVPCResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListHostedZonesByVPCResponse -> f ListHostedZonesByVPCResponse
listHostedZonesByVPCResponse_nextToken = (ListHostedZonesByVPCResponse -> Maybe Text)
-> (ListHostedZonesByVPCResponse
    -> Maybe Text -> ListHostedZonesByVPCResponse)
-> Lens
     ListHostedZonesByVPCResponse
     ListHostedZonesByVPCResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPCResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHostedZonesByVPCResponse' :: ListHostedZonesByVPCResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHostedZonesByVPCResponse
s@ListHostedZonesByVPCResponse' {} Maybe Text
a -> ListHostedZonesByVPCResponse
s {$sel:nextToken:ListHostedZonesByVPCResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListHostedZonesByVPCResponse)

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

-- | A list that contains one @HostedZoneSummary@ element for each hosted
-- zone that the specified Amazon VPC is associated with. Each
-- @HostedZoneSummary@ element contains the hosted zone name and ID, and
-- information about who owns the hosted zone.
listHostedZonesByVPCResponse_hostedZoneSummaries :: Lens.Lens' ListHostedZonesByVPCResponse [HostedZoneSummary]
listHostedZonesByVPCResponse_hostedZoneSummaries :: ([HostedZoneSummary] -> f [HostedZoneSummary])
-> ListHostedZonesByVPCResponse -> f ListHostedZonesByVPCResponse
listHostedZonesByVPCResponse_hostedZoneSummaries = (ListHostedZonesByVPCResponse -> [HostedZoneSummary])
-> (ListHostedZonesByVPCResponse
    -> [HostedZoneSummary] -> ListHostedZonesByVPCResponse)
-> Lens
     ListHostedZonesByVPCResponse
     ListHostedZonesByVPCResponse
     [HostedZoneSummary]
     [HostedZoneSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPCResponse' {[HostedZoneSummary]
hostedZoneSummaries :: [HostedZoneSummary]
$sel:hostedZoneSummaries:ListHostedZonesByVPCResponse' :: ListHostedZonesByVPCResponse -> [HostedZoneSummary]
hostedZoneSummaries} -> [HostedZoneSummary]
hostedZoneSummaries) (\s :: ListHostedZonesByVPCResponse
s@ListHostedZonesByVPCResponse' {} [HostedZoneSummary]
a -> ListHostedZonesByVPCResponse
s {$sel:hostedZoneSummaries:ListHostedZonesByVPCResponse' :: [HostedZoneSummary]
hostedZoneSummaries = [HostedZoneSummary]
a} :: ListHostedZonesByVPCResponse) (([HostedZoneSummary] -> f [HostedZoneSummary])
 -> ListHostedZonesByVPCResponse -> f ListHostedZonesByVPCResponse)
-> (([HostedZoneSummary] -> f [HostedZoneSummary])
    -> [HostedZoneSummary] -> f [HostedZoneSummary])
-> ([HostedZoneSummary] -> f [HostedZoneSummary])
-> ListHostedZonesByVPCResponse
-> f ListHostedZonesByVPCResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HostedZoneSummary] -> f [HostedZoneSummary])
-> [HostedZoneSummary] -> f [HostedZoneSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The value that you specified for @MaxItems@ in the most recent
-- @ListHostedZonesByVPC@ request.
listHostedZonesByVPCResponse_maxItems :: Lens.Lens' ListHostedZonesByVPCResponse Prelude.Text
listHostedZonesByVPCResponse_maxItems :: (Text -> f Text)
-> ListHostedZonesByVPCResponse -> f ListHostedZonesByVPCResponse
listHostedZonesByVPCResponse_maxItems = (ListHostedZonesByVPCResponse -> Text)
-> (ListHostedZonesByVPCResponse
    -> Text -> ListHostedZonesByVPCResponse)
-> Lens
     ListHostedZonesByVPCResponse ListHostedZonesByVPCResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesByVPCResponse' {Text
maxItems :: Text
$sel:maxItems:ListHostedZonesByVPCResponse' :: ListHostedZonesByVPCResponse -> Text
maxItems} -> Text
maxItems) (\s :: ListHostedZonesByVPCResponse
s@ListHostedZonesByVPCResponse' {} Text
a -> ListHostedZonesByVPCResponse
s {$sel:maxItems:ListHostedZonesByVPCResponse' :: Text
maxItems = Text
a} :: ListHostedZonesByVPCResponse)

instance Prelude.NFData ListHostedZonesByVPCResponse