{-# 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.ListHostedZones
-- 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)
--
-- Retrieves a list of the public and private hosted zones that are
-- associated with the current Amazon Web Services account. The response
-- includes a @HostedZones@ child element for each hosted zone.
--
-- Amazon Route 53 returns a maximum of 100 items in each response. If you
-- have a lot of hosted zones, you can use the @maxitems@ parameter to list
-- them in groups of up to 100.
--
-- This operation returns paginated results.
module Amazonka.Route53.ListHostedZones
  ( -- * Creating a Request
    ListHostedZones (..),
    newListHostedZones,

    -- * Request Lenses
    listHostedZones_delegationSetId,
    listHostedZones_marker,
    listHostedZones_maxItems,

    -- * Destructuring the Response
    ListHostedZonesResponse (..),
    newListHostedZonesResponse,

    -- * Response Lenses
    listHostedZonesResponse_marker,
    listHostedZonesResponse_nextMarker,
    listHostedZonesResponse_httpStatus,
    listHostedZonesResponse_hostedZones,
    listHostedZonesResponse_isTruncated,
    listHostedZonesResponse_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

-- | A request to retrieve a list of the public and private hosted zones that
-- are associated with the current Amazon Web Services account.
--
-- /See:/ 'newListHostedZones' smart constructor.
data ListHostedZones = ListHostedZones'
  { -- | If you\'re using reusable delegation sets and you want to list all of
    -- the hosted zones that are associated with a reusable delegation set,
    -- specify the ID of that reusable delegation set.
    ListHostedZones -> Maybe ResourceId
delegationSetId :: Prelude.Maybe ResourceId,
    -- | If the value of @IsTruncated@ in the previous response was @true@, you
    -- have more hosted zones. To get more hosted zones, submit another
    -- @ListHostedZones@ request.
    --
    -- For the value of @marker@, specify the value of @NextMarker@ from the
    -- previous response, which is the ID of the first hosted zone that Amazon
    -- Route 53 will return if you submit another request.
    --
    -- If the value of @IsTruncated@ in the previous response was @false@,
    -- there are no more hosted zones to get.
    ListHostedZones -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The maximum number of hosted zones that you want Amazon Route
    -- 53 to return. If you have more than @maxitems@ hosted zones, the value
    -- of @IsTruncated@ in the response is @true@, and the value of
    -- @NextMarker@ is the hosted zone ID of the first hosted zone that Route
    -- 53 will return if you submit another request.
    ListHostedZones -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text
  }
  deriving (ListHostedZones -> ListHostedZones -> Bool
(ListHostedZones -> ListHostedZones -> Bool)
-> (ListHostedZones -> ListHostedZones -> Bool)
-> Eq ListHostedZones
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHostedZones -> ListHostedZones -> Bool
$c/= :: ListHostedZones -> ListHostedZones -> Bool
== :: ListHostedZones -> ListHostedZones -> Bool
$c== :: ListHostedZones -> ListHostedZones -> Bool
Prelude.Eq, ReadPrec [ListHostedZones]
ReadPrec ListHostedZones
Int -> ReadS ListHostedZones
ReadS [ListHostedZones]
(Int -> ReadS ListHostedZones)
-> ReadS [ListHostedZones]
-> ReadPrec ListHostedZones
-> ReadPrec [ListHostedZones]
-> Read ListHostedZones
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHostedZones]
$creadListPrec :: ReadPrec [ListHostedZones]
readPrec :: ReadPrec ListHostedZones
$creadPrec :: ReadPrec ListHostedZones
readList :: ReadS [ListHostedZones]
$creadList :: ReadS [ListHostedZones]
readsPrec :: Int -> ReadS ListHostedZones
$creadsPrec :: Int -> ReadS ListHostedZones
Prelude.Read, Int -> ListHostedZones -> ShowS
[ListHostedZones] -> ShowS
ListHostedZones -> String
(Int -> ListHostedZones -> ShowS)
-> (ListHostedZones -> String)
-> ([ListHostedZones] -> ShowS)
-> Show ListHostedZones
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHostedZones] -> ShowS
$cshowList :: [ListHostedZones] -> ShowS
show :: ListHostedZones -> String
$cshow :: ListHostedZones -> String
showsPrec :: Int -> ListHostedZones -> ShowS
$cshowsPrec :: Int -> ListHostedZones -> ShowS
Prelude.Show, (forall x. ListHostedZones -> Rep ListHostedZones x)
-> (forall x. Rep ListHostedZones x -> ListHostedZones)
-> Generic ListHostedZones
forall x. Rep ListHostedZones x -> ListHostedZones
forall x. ListHostedZones -> Rep ListHostedZones x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHostedZones x -> ListHostedZones
$cfrom :: forall x. ListHostedZones -> Rep ListHostedZones x
Prelude.Generic)

-- |
-- Create a value of 'ListHostedZones' 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:
--
-- 'delegationSetId', 'listHostedZones_delegationSetId' - If you\'re using reusable delegation sets and you want to list all of
-- the hosted zones that are associated with a reusable delegation set,
-- specify the ID of that reusable delegation set.
--
-- 'marker', 'listHostedZones_marker' - If the value of @IsTruncated@ in the previous response was @true@, you
-- have more hosted zones. To get more hosted zones, submit another
-- @ListHostedZones@ request.
--
-- For the value of @marker@, specify the value of @NextMarker@ from the
-- previous response, which is the ID of the first hosted zone that Amazon
-- Route 53 will return if you submit another request.
--
-- If the value of @IsTruncated@ in the previous response was @false@,
-- there are no more hosted zones to get.
--
-- 'maxItems', 'listHostedZones_maxItems' - (Optional) The maximum number of hosted zones that you want Amazon Route
-- 53 to return. If you have more than @maxitems@ hosted zones, the value
-- of @IsTruncated@ in the response is @true@, and the value of
-- @NextMarker@ is the hosted zone ID of the first hosted zone that Route
-- 53 will return if you submit another request.
newListHostedZones ::
  ListHostedZones
newListHostedZones :: ListHostedZones
newListHostedZones =
  ListHostedZones' :: Maybe ResourceId -> Maybe Text -> Maybe Text -> ListHostedZones
ListHostedZones'
    { $sel:delegationSetId:ListHostedZones' :: Maybe ResourceId
delegationSetId = Maybe ResourceId
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListHostedZones' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListHostedZones' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | If you\'re using reusable delegation sets and you want to list all of
-- the hosted zones that are associated with a reusable delegation set,
-- specify the ID of that reusable delegation set.
listHostedZones_delegationSetId :: Lens.Lens' ListHostedZones (Prelude.Maybe ResourceId)
listHostedZones_delegationSetId :: (Maybe ResourceId -> f (Maybe ResourceId))
-> ListHostedZones -> f ListHostedZones
listHostedZones_delegationSetId = (ListHostedZones -> Maybe ResourceId)
-> (ListHostedZones -> Maybe ResourceId -> ListHostedZones)
-> Lens
     ListHostedZones
     ListHostedZones
     (Maybe ResourceId)
     (Maybe ResourceId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZones' {Maybe ResourceId
delegationSetId :: Maybe ResourceId
$sel:delegationSetId:ListHostedZones' :: ListHostedZones -> Maybe ResourceId
delegationSetId} -> Maybe ResourceId
delegationSetId) (\s :: ListHostedZones
s@ListHostedZones' {} Maybe ResourceId
a -> ListHostedZones
s {$sel:delegationSetId:ListHostedZones' :: Maybe ResourceId
delegationSetId = Maybe ResourceId
a} :: ListHostedZones)

-- | If the value of @IsTruncated@ in the previous response was @true@, you
-- have more hosted zones. To get more hosted zones, submit another
-- @ListHostedZones@ request.
--
-- For the value of @marker@, specify the value of @NextMarker@ from the
-- previous response, which is the ID of the first hosted zone that Amazon
-- Route 53 will return if you submit another request.
--
-- If the value of @IsTruncated@ in the previous response was @false@,
-- there are no more hosted zones to get.
listHostedZones_marker :: Lens.Lens' ListHostedZones (Prelude.Maybe Prelude.Text)
listHostedZones_marker :: (Maybe Text -> f (Maybe Text))
-> ListHostedZones -> f ListHostedZones
listHostedZones_marker = (ListHostedZones -> Maybe Text)
-> (ListHostedZones -> Maybe Text -> ListHostedZones)
-> Lens ListHostedZones ListHostedZones (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZones' {Maybe Text
marker :: Maybe Text
$sel:marker:ListHostedZones' :: ListHostedZones -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListHostedZones
s@ListHostedZones' {} Maybe Text
a -> ListHostedZones
s {$sel:marker:ListHostedZones' :: Maybe Text
marker = Maybe Text
a} :: ListHostedZones)

-- | (Optional) The maximum number of hosted zones that you want Amazon Route
-- 53 to return. If you have more than @maxitems@ hosted zones, the value
-- of @IsTruncated@ in the response is @true@, and the value of
-- @NextMarker@ is the hosted zone ID of the first hosted zone that Route
-- 53 will return if you submit another request.
listHostedZones_maxItems :: Lens.Lens' ListHostedZones (Prelude.Maybe Prelude.Text)
listHostedZones_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListHostedZones -> f ListHostedZones
listHostedZones_maxItems = (ListHostedZones -> Maybe Text)
-> (ListHostedZones -> Maybe Text -> ListHostedZones)
-> Lens ListHostedZones ListHostedZones (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZones' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListHostedZones' :: ListHostedZones -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListHostedZones
s@ListHostedZones' {} Maybe Text
a -> ListHostedZones
s {$sel:maxItems:ListHostedZones' :: Maybe Text
maxItems = Maybe Text
a} :: ListHostedZones)

instance Core.AWSPager ListHostedZones where
  page :: ListHostedZones
-> AWSResponse ListHostedZones -> Maybe ListHostedZones
page ListHostedZones
rq AWSResponse ListHostedZones
rs
    | Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListHostedZones
ListHostedZonesResponse
rs ListHostedZonesResponse
-> Getting Bool ListHostedZonesResponse Bool -> Bool
forall s a. s -> Getting a s a -> a
Lens.^. Getting Bool ListHostedZonesResponse Bool
Lens' ListHostedZonesResponse Bool
listHostedZonesResponse_isTruncated) =
      Maybe ListHostedZones
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListHostedZones
ListHostedZonesResponse
rs
            ListHostedZonesResponse
-> Getting (First Text) ListHostedZonesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListHostedZonesResponse
-> Const (First Text) ListHostedZonesResponse
Lens' ListHostedZonesResponse (Maybe Text)
listHostedZonesResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListHostedZonesResponse
 -> Const (First Text) ListHostedZonesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListHostedZonesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListHostedZones
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListHostedZones -> Maybe ListHostedZones
forall a. a -> Maybe a
Prelude.Just (ListHostedZones -> Maybe ListHostedZones)
-> ListHostedZones -> Maybe ListHostedZones
forall a b. (a -> b) -> a -> b
Prelude.$
        ListHostedZones
rq
          ListHostedZones
-> (ListHostedZones -> ListHostedZones) -> ListHostedZones
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListHostedZones -> Identity ListHostedZones
Lens ListHostedZones ListHostedZones (Maybe Text) (Maybe Text)
listHostedZones_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListHostedZones -> Identity ListHostedZones)
-> Maybe Text -> ListHostedZones -> ListHostedZones
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListHostedZones
ListHostedZonesResponse
rs
          ListHostedZonesResponse
-> Getting (First Text) ListHostedZonesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListHostedZonesResponse
-> Const (First Text) ListHostedZonesResponse
Lens' ListHostedZonesResponse (Maybe Text)
listHostedZonesResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListHostedZonesResponse
 -> Const (First Text) ListHostedZonesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListHostedZonesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListHostedZones where
  type
    AWSResponse ListHostedZones =
      ListHostedZonesResponse
  request :: ListHostedZones -> Request ListHostedZones
request = Service -> ListHostedZones -> Request ListHostedZones
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListHostedZones
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListHostedZones)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListHostedZones))
-> Logger
-> Service
-> Proxy ListHostedZones
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListHostedZones)))
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
-> Maybe Text
-> Int
-> [HostedZone]
-> Bool
-> Text
-> ListHostedZonesResponse
ListHostedZonesResponse'
            (Maybe Text
 -> Maybe Text
 -> Int
 -> [HostedZone]
 -> Bool
 -> Text
 -> ListHostedZonesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int -> [HostedZone] -> Bool -> Text -> ListHostedZonesResponse)
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
"Marker")
            Either
  String
  (Maybe Text
   -> Int -> [HostedZone] -> Bool -> Text -> ListHostedZonesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [HostedZone] -> Bool -> Text -> ListHostedZonesResponse)
forall (f :: * -> *) a b. Applicative f => 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
"NextMarker")
            Either
  String
  (Int -> [HostedZone] -> Bool -> Text -> ListHostedZonesResponse)
-> Either String Int
-> Either
     String ([HostedZone] -> Bool -> Text -> ListHostedZonesResponse)
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 ([HostedZone] -> Bool -> Text -> ListHostedZonesResponse)
-> Either String [HostedZone]
-> Either String (Bool -> Text -> ListHostedZonesResponse)
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
"HostedZones" 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 [HostedZone])
-> Either String [HostedZone]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [HostedZone]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"HostedZone"
                        )
            Either String (Bool -> Text -> ListHostedZonesResponse)
-> Either String Bool
-> Either String (Text -> ListHostedZonesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"IsTruncated")
            Either String (Text -> ListHostedZonesResponse)
-> Either String Text -> Either String ListHostedZonesResponse
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 ListHostedZones

instance Prelude.NFData ListHostedZones

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

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

instance Core.ToQuery ListHostedZones where
  toQuery :: ListHostedZones -> QueryString
toQuery ListHostedZones' {Maybe Text
Maybe ResourceId
maxItems :: Maybe Text
marker :: Maybe Text
delegationSetId :: Maybe ResourceId
$sel:maxItems:ListHostedZones' :: ListHostedZones -> Maybe Text
$sel:marker:ListHostedZones' :: ListHostedZones -> Maybe Text
$sel:delegationSetId:ListHostedZones' :: ListHostedZones -> Maybe ResourceId
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"delegationsetid" ByteString -> Maybe ResourceId -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ResourceId
delegationSetId,
        ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"maxitems" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxItems
      ]

-- | /See:/ 'newListHostedZonesResponse' smart constructor.
data ListHostedZonesResponse = ListHostedZonesResponse'
  { -- | For the second and subsequent calls to @ListHostedZones@, @Marker@ is
    -- the value that you specified for the @marker@ parameter in the request
    -- that produced the current response.
    ListHostedZonesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | If @IsTruncated@ is @true@, the value of @NextMarker@ identifies the
    -- first hosted zone in the next group of hosted zones. Submit another
    -- @ListHostedZones@ request, and specify the value of @NextMarker@ from
    -- the response in the @marker@ parameter.
    --
    -- This element is present only if @IsTruncated@ is @true@.
    ListHostedZonesResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListHostedZonesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains general information about the hosted zone.
    ListHostedZonesResponse -> [HostedZone]
hostedZones :: [HostedZone],
    -- | A flag indicating whether there are more hosted zones to be listed. If
    -- the response was truncated, you can get more hosted zones by submitting
    -- another @ListHostedZones@ request and specifying the value of
    -- @NextMarker@ in the @marker@ parameter.
    ListHostedZonesResponse -> Bool
isTruncated :: Prelude.Bool,
    -- | The value that you specified for the @maxitems@ parameter in the call to
    -- @ListHostedZones@ that produced the current response.
    ListHostedZonesResponse -> Text
maxItems :: Prelude.Text
  }
  deriving (ListHostedZonesResponse -> ListHostedZonesResponse -> Bool
(ListHostedZonesResponse -> ListHostedZonesResponse -> Bool)
-> (ListHostedZonesResponse -> ListHostedZonesResponse -> Bool)
-> Eq ListHostedZonesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHostedZonesResponse -> ListHostedZonesResponse -> Bool
$c/= :: ListHostedZonesResponse -> ListHostedZonesResponse -> Bool
== :: ListHostedZonesResponse -> ListHostedZonesResponse -> Bool
$c== :: ListHostedZonesResponse -> ListHostedZonesResponse -> Bool
Prelude.Eq, ReadPrec [ListHostedZonesResponse]
ReadPrec ListHostedZonesResponse
Int -> ReadS ListHostedZonesResponse
ReadS [ListHostedZonesResponse]
(Int -> ReadS ListHostedZonesResponse)
-> ReadS [ListHostedZonesResponse]
-> ReadPrec ListHostedZonesResponse
-> ReadPrec [ListHostedZonesResponse]
-> Read ListHostedZonesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHostedZonesResponse]
$creadListPrec :: ReadPrec [ListHostedZonesResponse]
readPrec :: ReadPrec ListHostedZonesResponse
$creadPrec :: ReadPrec ListHostedZonesResponse
readList :: ReadS [ListHostedZonesResponse]
$creadList :: ReadS [ListHostedZonesResponse]
readsPrec :: Int -> ReadS ListHostedZonesResponse
$creadsPrec :: Int -> ReadS ListHostedZonesResponse
Prelude.Read, Int -> ListHostedZonesResponse -> ShowS
[ListHostedZonesResponse] -> ShowS
ListHostedZonesResponse -> String
(Int -> ListHostedZonesResponse -> ShowS)
-> (ListHostedZonesResponse -> String)
-> ([ListHostedZonesResponse] -> ShowS)
-> Show ListHostedZonesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHostedZonesResponse] -> ShowS
$cshowList :: [ListHostedZonesResponse] -> ShowS
show :: ListHostedZonesResponse -> String
$cshow :: ListHostedZonesResponse -> String
showsPrec :: Int -> ListHostedZonesResponse -> ShowS
$cshowsPrec :: Int -> ListHostedZonesResponse -> ShowS
Prelude.Show, (forall x.
 ListHostedZonesResponse -> Rep ListHostedZonesResponse x)
-> (forall x.
    Rep ListHostedZonesResponse x -> ListHostedZonesResponse)
-> Generic ListHostedZonesResponse
forall x. Rep ListHostedZonesResponse x -> ListHostedZonesResponse
forall x. ListHostedZonesResponse -> Rep ListHostedZonesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHostedZonesResponse x -> ListHostedZonesResponse
$cfrom :: forall x. ListHostedZonesResponse -> Rep ListHostedZonesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListHostedZonesResponse' 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:
--
-- 'marker', 'listHostedZonesResponse_marker' - For the second and subsequent calls to @ListHostedZones@, @Marker@ is
-- the value that you specified for the @marker@ parameter in the request
-- that produced the current response.
--
-- 'nextMarker', 'listHostedZonesResponse_nextMarker' - If @IsTruncated@ is @true@, the value of @NextMarker@ identifies the
-- first hosted zone in the next group of hosted zones. Submit another
-- @ListHostedZones@ request, and specify the value of @NextMarker@ from
-- the response in the @marker@ parameter.
--
-- This element is present only if @IsTruncated@ is @true@.
--
-- 'httpStatus', 'listHostedZonesResponse_httpStatus' - The response's http status code.
--
-- 'hostedZones', 'listHostedZonesResponse_hostedZones' - A complex type that contains general information about the hosted zone.
--
-- 'isTruncated', 'listHostedZonesResponse_isTruncated' - A flag indicating whether there are more hosted zones to be listed. If
-- the response was truncated, you can get more hosted zones by submitting
-- another @ListHostedZones@ request and specifying the value of
-- @NextMarker@ in the @marker@ parameter.
--
-- 'maxItems', 'listHostedZonesResponse_maxItems' - The value that you specified for the @maxitems@ parameter in the call to
-- @ListHostedZones@ that produced the current response.
newListHostedZonesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'isTruncated'
  Prelude.Bool ->
  -- | 'maxItems'
  Prelude.Text ->
  ListHostedZonesResponse
newListHostedZonesResponse :: Int -> Bool -> Text -> ListHostedZonesResponse
newListHostedZonesResponse
  Int
pHttpStatus_
  Bool
pIsTruncated_
  Text
pMaxItems_ =
    ListHostedZonesResponse' :: Maybe Text
-> Maybe Text
-> Int
-> [HostedZone]
-> Bool
-> Text
-> ListHostedZonesResponse
ListHostedZonesResponse'
      { $sel:marker:ListHostedZonesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextMarker:ListHostedZonesResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListHostedZonesResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:hostedZones:ListHostedZonesResponse' :: [HostedZone]
hostedZones = [HostedZone]
forall a. Monoid a => a
Prelude.mempty,
        $sel:isTruncated:ListHostedZonesResponse' :: Bool
isTruncated = Bool
pIsTruncated_,
        $sel:maxItems:ListHostedZonesResponse' :: Text
maxItems = Text
pMaxItems_
      }

-- | For the second and subsequent calls to @ListHostedZones@, @Marker@ is
-- the value that you specified for the @marker@ parameter in the request
-- that produced the current response.
listHostedZonesResponse_marker :: Lens.Lens' ListHostedZonesResponse (Prelude.Maybe Prelude.Text)
listHostedZonesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListHostedZonesResponse -> f ListHostedZonesResponse
listHostedZonesResponse_marker = (ListHostedZonesResponse -> Maybe Text)
-> (ListHostedZonesResponse
    -> Maybe Text -> ListHostedZonesResponse)
-> Lens' ListHostedZonesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListHostedZonesResponse' :: ListHostedZonesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListHostedZonesResponse
s@ListHostedZonesResponse' {} Maybe Text
a -> ListHostedZonesResponse
s {$sel:marker:ListHostedZonesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListHostedZonesResponse)

-- | If @IsTruncated@ is @true@, the value of @NextMarker@ identifies the
-- first hosted zone in the next group of hosted zones. Submit another
-- @ListHostedZones@ request, and specify the value of @NextMarker@ from
-- the response in the @marker@ parameter.
--
-- This element is present only if @IsTruncated@ is @true@.
listHostedZonesResponse_nextMarker :: Lens.Lens' ListHostedZonesResponse (Prelude.Maybe Prelude.Text)
listHostedZonesResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListHostedZonesResponse -> f ListHostedZonesResponse
listHostedZonesResponse_nextMarker = (ListHostedZonesResponse -> Maybe Text)
-> (ListHostedZonesResponse
    -> Maybe Text -> ListHostedZonesResponse)
-> Lens' ListHostedZonesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListHostedZonesResponse' :: ListHostedZonesResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListHostedZonesResponse
s@ListHostedZonesResponse' {} Maybe Text
a -> ListHostedZonesResponse
s {$sel:nextMarker:ListHostedZonesResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListHostedZonesResponse)

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

-- | A complex type that contains general information about the hosted zone.
listHostedZonesResponse_hostedZones :: Lens.Lens' ListHostedZonesResponse [HostedZone]
listHostedZonesResponse_hostedZones :: ([HostedZone] -> f [HostedZone])
-> ListHostedZonesResponse -> f ListHostedZonesResponse
listHostedZonesResponse_hostedZones = (ListHostedZonesResponse -> [HostedZone])
-> (ListHostedZonesResponse
    -> [HostedZone] -> ListHostedZonesResponse)
-> Lens
     ListHostedZonesResponse
     ListHostedZonesResponse
     [HostedZone]
     [HostedZone]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesResponse' {[HostedZone]
hostedZones :: [HostedZone]
$sel:hostedZones:ListHostedZonesResponse' :: ListHostedZonesResponse -> [HostedZone]
hostedZones} -> [HostedZone]
hostedZones) (\s :: ListHostedZonesResponse
s@ListHostedZonesResponse' {} [HostedZone]
a -> ListHostedZonesResponse
s {$sel:hostedZones:ListHostedZonesResponse' :: [HostedZone]
hostedZones = [HostedZone]
a} :: ListHostedZonesResponse) (([HostedZone] -> f [HostedZone])
 -> ListHostedZonesResponse -> f ListHostedZonesResponse)
-> (([HostedZone] -> f [HostedZone])
    -> [HostedZone] -> f [HostedZone])
-> ([HostedZone] -> f [HostedZone])
-> ListHostedZonesResponse
-> f ListHostedZonesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HostedZone] -> f [HostedZone]) -> [HostedZone] -> f [HostedZone]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A flag indicating whether there are more hosted zones to be listed. If
-- the response was truncated, you can get more hosted zones by submitting
-- another @ListHostedZones@ request and specifying the value of
-- @NextMarker@ in the @marker@ parameter.
listHostedZonesResponse_isTruncated :: Lens.Lens' ListHostedZonesResponse Prelude.Bool
listHostedZonesResponse_isTruncated :: (Bool -> f Bool)
-> ListHostedZonesResponse -> f ListHostedZonesResponse
listHostedZonesResponse_isTruncated = (ListHostedZonesResponse -> Bool)
-> (ListHostedZonesResponse -> Bool -> ListHostedZonesResponse)
-> Lens' ListHostedZonesResponse Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesResponse' {Bool
isTruncated :: Bool
$sel:isTruncated:ListHostedZonesResponse' :: ListHostedZonesResponse -> Bool
isTruncated} -> Bool
isTruncated) (\s :: ListHostedZonesResponse
s@ListHostedZonesResponse' {} Bool
a -> ListHostedZonesResponse
s {$sel:isTruncated:ListHostedZonesResponse' :: Bool
isTruncated = Bool
a} :: ListHostedZonesResponse)

-- | The value that you specified for the @maxitems@ parameter in the call to
-- @ListHostedZones@ that produced the current response.
listHostedZonesResponse_maxItems :: Lens.Lens' ListHostedZonesResponse Prelude.Text
listHostedZonesResponse_maxItems :: (Text -> f Text)
-> ListHostedZonesResponse -> f ListHostedZonesResponse
listHostedZonesResponse_maxItems = (ListHostedZonesResponse -> Text)
-> (ListHostedZonesResponse -> Text -> ListHostedZonesResponse)
-> Lens ListHostedZonesResponse ListHostedZonesResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHostedZonesResponse' {Text
maxItems :: Text
$sel:maxItems:ListHostedZonesResponse' :: ListHostedZonesResponse -> Text
maxItems} -> Text
maxItems) (\s :: ListHostedZonesResponse
s@ListHostedZonesResponse' {} Text
a -> ListHostedZonesResponse
s {$sel:maxItems:ListHostedZonesResponse' :: Text
maxItems = Text
a} :: ListHostedZonesResponse)

instance Prelude.NFData ListHostedZonesResponse