{-# 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.ListResourceRecordSets
-- 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 the resource record sets in a specified hosted zone.
--
-- @ListResourceRecordSets@ returns up to 300 resource record sets at a
-- time in ASCII order, beginning at a position specified by the @name@ and
-- @type@ elements.
--
-- __Sort order__
--
-- @ListResourceRecordSets@ sorts results first by DNS name with the labels
-- reversed, for example:
--
-- @com.example.www.@
--
-- Note the trailing dot, which can change the sort order when the record
-- name contains characters that appear before @.@ (decimal 46) in the
-- ASCII table. These characters include the following:
-- @! \" # $ % & \' ( ) * + , -@
--
-- When multiple records have the same DNS name, @ListResourceRecordSets@
-- sorts results by the record type.
--
-- __Specifying where to start listing records__
--
-- You can use the name and type elements to specify the resource record
-- set that the list begins with:
--
-- [If you do not specify Name or Type]
--     The results begin with the first resource record set that the hosted
--     zone contains.
--
-- [If you specify Name but not Type]
--     The results begin with the first resource record set in the list
--     whose name is greater than or equal to @Name@.
--
-- [If you specify Type but not Name]
--     Amazon Route 53 returns the @InvalidInput@ error.
--
-- [If you specify both Name and Type]
--     The results begin with the first resource record set in the list
--     whose name is greater than or equal to @Name@, and whose type is
--     greater than or equal to @Type@.
--
-- __Resource record sets that are PENDING__
--
-- This action returns the most current version of the records. This
-- includes records that are @PENDING@, and that are not yet available on
-- all Route 53 DNS servers.
--
-- __Changing resource record sets__
--
-- To ensure that you get an accurate listing of the resource record sets
-- for a hosted zone at a point in time, do not submit a
-- @ChangeResourceRecordSets@ request while you\'re paging through the
-- results of a @ListResourceRecordSets@ request. If you do, some pages may
-- display results without the latest changes while other pages display
-- results with the latest changes.
--
-- __Displaying the next page of results__
--
-- If a @ListResourceRecordSets@ command returns more than one page of
-- results, the value of @IsTruncated@ is @true@. To display the next page
-- of results, get the values of @NextRecordName@, @NextRecordType@, and
-- @NextRecordIdentifier@ (if any) from the response. Then submit another
-- @ListResourceRecordSets@ request, and specify those values for
-- @StartRecordName@, @StartRecordType@, and @StartRecordIdentifier@.
--
-- This operation returns paginated results.
module Amazonka.Route53.ListResourceRecordSets
  ( -- * Creating a Request
    ListResourceRecordSets (..),
    newListResourceRecordSets,

    -- * Request Lenses
    listResourceRecordSets_startRecordName,
    listResourceRecordSets_startRecordType,
    listResourceRecordSets_startRecordIdentifier,
    listResourceRecordSets_maxItems,
    listResourceRecordSets_hostedZoneId,

    -- * Destructuring the Response
    ListResourceRecordSetsResponse (..),
    newListResourceRecordSetsResponse,

    -- * Response Lenses
    listResourceRecordSetsResponse_nextRecordType,
    listResourceRecordSetsResponse_nextRecordName,
    listResourceRecordSetsResponse_nextRecordIdentifier,
    listResourceRecordSetsResponse_httpStatus,
    listResourceRecordSetsResponse_resourceRecordSets,
    listResourceRecordSetsResponse_isTruncated,
    listResourceRecordSetsResponse_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 for the resource record sets that are associated with a
-- specified hosted zone.
--
-- /See:/ 'newListResourceRecordSets' smart constructor.
data ListResourceRecordSets = ListResourceRecordSets'
  { -- | The first name in the lexicographic ordering of resource record sets
    -- that you want to list. If the specified record name doesn\'t exist, the
    -- results begin with the first resource record set that has a name greater
    -- than the value of @name@.
    ListResourceRecordSets -> Maybe Text
startRecordName :: Prelude.Maybe Prelude.Text,
    -- | The type of resource record set to begin the record listing from.
    --
    -- Valid values for basic resource record sets: @A@ | @AAAA@ | @CAA@ |
    -- @CNAME@ | @MX@ | @NAPTR@ | @NS@ | @PTR@ | @SOA@ | @SPF@ | @SRV@ | @TXT@
    --
    -- Values for weighted, latency, geolocation, and failover resource record
    -- sets: @A@ | @AAAA@ | @CAA@ | @CNAME@ | @MX@ | @NAPTR@ | @PTR@ | @SPF@ |
    -- @SRV@ | @TXT@
    --
    -- Values for alias resource record sets:
    --
    -- -   __API Gateway custom regional API or edge-optimized API__: A
    --
    -- -   __CloudFront distribution__: A or AAAA
    --
    -- -   __Elastic Beanstalk environment that has a regionalized subdomain__:
    --     A
    --
    -- -   __Elastic Load Balancing load balancer__: A | AAAA
    --
    -- -   __S3 bucket__: A
    --
    -- -   __VPC interface VPC endpoint__: A
    --
    -- -   __Another resource record set in this hosted zone:__ The type of the
    --     resource record set that the alias references.
    --
    -- Constraint: Specifying @type@ without specifying @name@ returns an
    -- @InvalidInput@ error.
    ListResourceRecordSets -> Maybe RRType
startRecordType :: Prelude.Maybe RRType,
    -- | /Resource record sets that have a routing policy other than simple:/ If
    -- results were truncated for a given DNS name and type, specify the value
    -- of @NextRecordIdentifier@ from the previous response to get the next
    -- resource record set that has the current DNS name and type.
    ListResourceRecordSets -> Maybe Text
startRecordIdentifier :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The maximum number of resource records sets to include in the
    -- response body for this request. If the response includes more than
    -- @maxitems@ resource record sets, the value of the @IsTruncated@ element
    -- in the response is @true@, and the values of the @NextRecordName@ and
    -- @NextRecordType@ elements in the response identify the first resource
    -- record set in the next group of @maxitems@ resource record sets.
    ListResourceRecordSets -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
    -- | The ID of the hosted zone that contains the resource record sets that
    -- you want to list.
    ListResourceRecordSets -> ResourceId
hostedZoneId :: ResourceId
  }
  deriving (ListResourceRecordSets -> ListResourceRecordSets -> Bool
(ListResourceRecordSets -> ListResourceRecordSets -> Bool)
-> (ListResourceRecordSets -> ListResourceRecordSets -> Bool)
-> Eq ListResourceRecordSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourceRecordSets -> ListResourceRecordSets -> Bool
$c/= :: ListResourceRecordSets -> ListResourceRecordSets -> Bool
== :: ListResourceRecordSets -> ListResourceRecordSets -> Bool
$c== :: ListResourceRecordSets -> ListResourceRecordSets -> Bool
Prelude.Eq, ReadPrec [ListResourceRecordSets]
ReadPrec ListResourceRecordSets
Int -> ReadS ListResourceRecordSets
ReadS [ListResourceRecordSets]
(Int -> ReadS ListResourceRecordSets)
-> ReadS [ListResourceRecordSets]
-> ReadPrec ListResourceRecordSets
-> ReadPrec [ListResourceRecordSets]
-> Read ListResourceRecordSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourceRecordSets]
$creadListPrec :: ReadPrec [ListResourceRecordSets]
readPrec :: ReadPrec ListResourceRecordSets
$creadPrec :: ReadPrec ListResourceRecordSets
readList :: ReadS [ListResourceRecordSets]
$creadList :: ReadS [ListResourceRecordSets]
readsPrec :: Int -> ReadS ListResourceRecordSets
$creadsPrec :: Int -> ReadS ListResourceRecordSets
Prelude.Read, Int -> ListResourceRecordSets -> ShowS
[ListResourceRecordSets] -> ShowS
ListResourceRecordSets -> String
(Int -> ListResourceRecordSets -> ShowS)
-> (ListResourceRecordSets -> String)
-> ([ListResourceRecordSets] -> ShowS)
-> Show ListResourceRecordSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourceRecordSets] -> ShowS
$cshowList :: [ListResourceRecordSets] -> ShowS
show :: ListResourceRecordSets -> String
$cshow :: ListResourceRecordSets -> String
showsPrec :: Int -> ListResourceRecordSets -> ShowS
$cshowsPrec :: Int -> ListResourceRecordSets -> ShowS
Prelude.Show, (forall x. ListResourceRecordSets -> Rep ListResourceRecordSets x)
-> (forall x.
    Rep ListResourceRecordSets x -> ListResourceRecordSets)
-> Generic ListResourceRecordSets
forall x. Rep ListResourceRecordSets x -> ListResourceRecordSets
forall x. ListResourceRecordSets -> Rep ListResourceRecordSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListResourceRecordSets x -> ListResourceRecordSets
$cfrom :: forall x. ListResourceRecordSets -> Rep ListResourceRecordSets x
Prelude.Generic)

-- |
-- Create a value of 'ListResourceRecordSets' 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:
--
-- 'startRecordName', 'listResourceRecordSets_startRecordName' - The first name in the lexicographic ordering of resource record sets
-- that you want to list. If the specified record name doesn\'t exist, the
-- results begin with the first resource record set that has a name greater
-- than the value of @name@.
--
-- 'startRecordType', 'listResourceRecordSets_startRecordType' - The type of resource record set to begin the record listing from.
--
-- Valid values for basic resource record sets: @A@ | @AAAA@ | @CAA@ |
-- @CNAME@ | @MX@ | @NAPTR@ | @NS@ | @PTR@ | @SOA@ | @SPF@ | @SRV@ | @TXT@
--
-- Values for weighted, latency, geolocation, and failover resource record
-- sets: @A@ | @AAAA@ | @CAA@ | @CNAME@ | @MX@ | @NAPTR@ | @PTR@ | @SPF@ |
-- @SRV@ | @TXT@
--
-- Values for alias resource record sets:
--
-- -   __API Gateway custom regional API or edge-optimized API__: A
--
-- -   __CloudFront distribution__: A or AAAA
--
-- -   __Elastic Beanstalk environment that has a regionalized subdomain__:
--     A
--
-- -   __Elastic Load Balancing load balancer__: A | AAAA
--
-- -   __S3 bucket__: A
--
-- -   __VPC interface VPC endpoint__: A
--
-- -   __Another resource record set in this hosted zone:__ The type of the
--     resource record set that the alias references.
--
-- Constraint: Specifying @type@ without specifying @name@ returns an
-- @InvalidInput@ error.
--
-- 'startRecordIdentifier', 'listResourceRecordSets_startRecordIdentifier' - /Resource record sets that have a routing policy other than simple:/ If
-- results were truncated for a given DNS name and type, specify the value
-- of @NextRecordIdentifier@ from the previous response to get the next
-- resource record set that has the current DNS name and type.
--
-- 'maxItems', 'listResourceRecordSets_maxItems' - (Optional) The maximum number of resource records sets to include in the
-- response body for this request. If the response includes more than
-- @maxitems@ resource record sets, the value of the @IsTruncated@ element
-- in the response is @true@, and the values of the @NextRecordName@ and
-- @NextRecordType@ elements in the response identify the first resource
-- record set in the next group of @maxitems@ resource record sets.
--
-- 'hostedZoneId', 'listResourceRecordSets_hostedZoneId' - The ID of the hosted zone that contains the resource record sets that
-- you want to list.
newListResourceRecordSets ::
  -- | 'hostedZoneId'
  ResourceId ->
  ListResourceRecordSets
newListResourceRecordSets :: ResourceId -> ListResourceRecordSets
newListResourceRecordSets ResourceId
pHostedZoneId_ =
  ListResourceRecordSets' :: Maybe Text
-> Maybe RRType
-> Maybe Text
-> Maybe Text
-> ResourceId
-> ListResourceRecordSets
ListResourceRecordSets'
    { $sel:startRecordName:ListResourceRecordSets' :: Maybe Text
startRecordName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startRecordType:ListResourceRecordSets' :: Maybe RRType
startRecordType = Maybe RRType
forall a. Maybe a
Prelude.Nothing,
      $sel:startRecordIdentifier:ListResourceRecordSets' :: Maybe Text
startRecordIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListResourceRecordSets' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hostedZoneId:ListResourceRecordSets' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_
    }

-- | The first name in the lexicographic ordering of resource record sets
-- that you want to list. If the specified record name doesn\'t exist, the
-- results begin with the first resource record set that has a name greater
-- than the value of @name@.
listResourceRecordSets_startRecordName :: Lens.Lens' ListResourceRecordSets (Prelude.Maybe Prelude.Text)
listResourceRecordSets_startRecordName :: (Maybe Text -> f (Maybe Text))
-> ListResourceRecordSets -> f ListResourceRecordSets
listResourceRecordSets_startRecordName = (ListResourceRecordSets -> Maybe Text)
-> (ListResourceRecordSets -> Maybe Text -> ListResourceRecordSets)
-> Lens
     ListResourceRecordSets
     ListResourceRecordSets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSets' {Maybe Text
startRecordName :: Maybe Text
$sel:startRecordName:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
startRecordName} -> Maybe Text
startRecordName) (\s :: ListResourceRecordSets
s@ListResourceRecordSets' {} Maybe Text
a -> ListResourceRecordSets
s {$sel:startRecordName:ListResourceRecordSets' :: Maybe Text
startRecordName = Maybe Text
a} :: ListResourceRecordSets)

-- | The type of resource record set to begin the record listing from.
--
-- Valid values for basic resource record sets: @A@ | @AAAA@ | @CAA@ |
-- @CNAME@ | @MX@ | @NAPTR@ | @NS@ | @PTR@ | @SOA@ | @SPF@ | @SRV@ | @TXT@
--
-- Values for weighted, latency, geolocation, and failover resource record
-- sets: @A@ | @AAAA@ | @CAA@ | @CNAME@ | @MX@ | @NAPTR@ | @PTR@ | @SPF@ |
-- @SRV@ | @TXT@
--
-- Values for alias resource record sets:
--
-- -   __API Gateway custom regional API or edge-optimized API__: A
--
-- -   __CloudFront distribution__: A or AAAA
--
-- -   __Elastic Beanstalk environment that has a regionalized subdomain__:
--     A
--
-- -   __Elastic Load Balancing load balancer__: A | AAAA
--
-- -   __S3 bucket__: A
--
-- -   __VPC interface VPC endpoint__: A
--
-- -   __Another resource record set in this hosted zone:__ The type of the
--     resource record set that the alias references.
--
-- Constraint: Specifying @type@ without specifying @name@ returns an
-- @InvalidInput@ error.
listResourceRecordSets_startRecordType :: Lens.Lens' ListResourceRecordSets (Prelude.Maybe RRType)
listResourceRecordSets_startRecordType :: (Maybe RRType -> f (Maybe RRType))
-> ListResourceRecordSets -> f ListResourceRecordSets
listResourceRecordSets_startRecordType = (ListResourceRecordSets -> Maybe RRType)
-> (ListResourceRecordSets
    -> Maybe RRType -> ListResourceRecordSets)
-> Lens
     ListResourceRecordSets
     ListResourceRecordSets
     (Maybe RRType)
     (Maybe RRType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSets' {Maybe RRType
startRecordType :: Maybe RRType
$sel:startRecordType:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe RRType
startRecordType} -> Maybe RRType
startRecordType) (\s :: ListResourceRecordSets
s@ListResourceRecordSets' {} Maybe RRType
a -> ListResourceRecordSets
s {$sel:startRecordType:ListResourceRecordSets' :: Maybe RRType
startRecordType = Maybe RRType
a} :: ListResourceRecordSets)

-- | /Resource record sets that have a routing policy other than simple:/ If
-- results were truncated for a given DNS name and type, specify the value
-- of @NextRecordIdentifier@ from the previous response to get the next
-- resource record set that has the current DNS name and type.
listResourceRecordSets_startRecordIdentifier :: Lens.Lens' ListResourceRecordSets (Prelude.Maybe Prelude.Text)
listResourceRecordSets_startRecordIdentifier :: (Maybe Text -> f (Maybe Text))
-> ListResourceRecordSets -> f ListResourceRecordSets
listResourceRecordSets_startRecordIdentifier = (ListResourceRecordSets -> Maybe Text)
-> (ListResourceRecordSets -> Maybe Text -> ListResourceRecordSets)
-> Lens
     ListResourceRecordSets
     ListResourceRecordSets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSets' {Maybe Text
startRecordIdentifier :: Maybe Text
$sel:startRecordIdentifier:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
startRecordIdentifier} -> Maybe Text
startRecordIdentifier) (\s :: ListResourceRecordSets
s@ListResourceRecordSets' {} Maybe Text
a -> ListResourceRecordSets
s {$sel:startRecordIdentifier:ListResourceRecordSets' :: Maybe Text
startRecordIdentifier = Maybe Text
a} :: ListResourceRecordSets)

-- | (Optional) The maximum number of resource records sets to include in the
-- response body for this request. If the response includes more than
-- @maxitems@ resource record sets, the value of the @IsTruncated@ element
-- in the response is @true@, and the values of the @NextRecordName@ and
-- @NextRecordType@ elements in the response identify the first resource
-- record set in the next group of @maxitems@ resource record sets.
listResourceRecordSets_maxItems :: Lens.Lens' ListResourceRecordSets (Prelude.Maybe Prelude.Text)
listResourceRecordSets_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListResourceRecordSets -> f ListResourceRecordSets
listResourceRecordSets_maxItems = (ListResourceRecordSets -> Maybe Text)
-> (ListResourceRecordSets -> Maybe Text -> ListResourceRecordSets)
-> Lens
     ListResourceRecordSets
     ListResourceRecordSets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSets' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListResourceRecordSets
s@ListResourceRecordSets' {} Maybe Text
a -> ListResourceRecordSets
s {$sel:maxItems:ListResourceRecordSets' :: Maybe Text
maxItems = Maybe Text
a} :: ListResourceRecordSets)

-- | The ID of the hosted zone that contains the resource record sets that
-- you want to list.
listResourceRecordSets_hostedZoneId :: Lens.Lens' ListResourceRecordSets ResourceId
listResourceRecordSets_hostedZoneId :: (ResourceId -> f ResourceId)
-> ListResourceRecordSets -> f ListResourceRecordSets
listResourceRecordSets_hostedZoneId = (ListResourceRecordSets -> ResourceId)
-> (ListResourceRecordSets -> ResourceId -> ListResourceRecordSets)
-> Lens
     ListResourceRecordSets ListResourceRecordSets ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSets' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:ListResourceRecordSets' :: ListResourceRecordSets -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: ListResourceRecordSets
s@ListResourceRecordSets' {} ResourceId
a -> ListResourceRecordSets
s {$sel:hostedZoneId:ListResourceRecordSets' :: ResourceId
hostedZoneId = ResourceId
a} :: ListResourceRecordSets)

instance Core.AWSPager ListResourceRecordSets where
  page :: ListResourceRecordSets
-> AWSResponse ListResourceRecordSets
-> Maybe ListResourceRecordSets
page ListResourceRecordSets
rq AWSResponse ListResourceRecordSets
rs
    | Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
            ListResourceRecordSetsResponse
-> Getting Bool ListResourceRecordSetsResponse Bool -> Bool
forall s a. s -> Getting a s a -> a
Lens.^. Getting Bool ListResourceRecordSetsResponse Bool
Lens' ListResourceRecordSetsResponse Bool
listResourceRecordSetsResponse_isTruncated
        ) =
      Maybe ListResourceRecordSets
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
            ListResourceRecordSetsResponse
-> Getting (First Text) ListResourceRecordSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListResourceRecordSetsResponse
-> Const (First Text) ListResourceRecordSetsResponse
Lens' ListResourceRecordSetsResponse (Maybe Text)
listResourceRecordSetsResponse_nextRecordName
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListResourceRecordSetsResponse
 -> Const (First Text) ListResourceRecordSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListResourceRecordSetsResponse 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
        )
        Bool -> Bool -> Bool
Prelude.&& Maybe RRType -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
          ( AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
              ListResourceRecordSetsResponse
-> Getting (First RRType) ListResourceRecordSetsResponse RRType
-> Maybe RRType
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe RRType -> Const (First RRType) (Maybe RRType))
-> ListResourceRecordSetsResponse
-> Const (First RRType) ListResourceRecordSetsResponse
Lens' ListResourceRecordSetsResponse (Maybe RRType)
listResourceRecordSetsResponse_nextRecordType
                ((Maybe RRType -> Const (First RRType) (Maybe RRType))
 -> ListResourceRecordSetsResponse
 -> Const (First RRType) ListResourceRecordSetsResponse)
-> ((RRType -> Const (First RRType) RRType)
    -> Maybe RRType -> Const (First RRType) (Maybe RRType))
-> Getting (First RRType) ListResourceRecordSetsResponse RRType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (RRType -> Const (First RRType) RRType)
-> Maybe RRType -> Const (First RRType) (Maybe RRType)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
          )
        Bool -> Bool -> Bool
Prelude.&& Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
          ( AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
              ListResourceRecordSetsResponse
-> Getting (First Text) ListResourceRecordSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListResourceRecordSetsResponse
-> Const (First Text) ListResourceRecordSetsResponse
Lens' ListResourceRecordSetsResponse (Maybe Text)
listResourceRecordSetsResponse_nextRecordIdentifier
                ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListResourceRecordSetsResponse
 -> Const (First Text) ListResourceRecordSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListResourceRecordSetsResponse 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 ListResourceRecordSets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListResourceRecordSets -> Maybe ListResourceRecordSets
forall a. a -> Maybe a
Prelude.Just (ListResourceRecordSets -> Maybe ListResourceRecordSets)
-> ListResourceRecordSets -> Maybe ListResourceRecordSets
forall a b. (a -> b) -> a -> b
Prelude.$
        ListResourceRecordSets
rq
          ListResourceRecordSets
-> (ListResourceRecordSets -> ListResourceRecordSets)
-> ListResourceRecordSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListResourceRecordSets -> Identity ListResourceRecordSets
Lens
  ListResourceRecordSets
  ListResourceRecordSets
  (Maybe Text)
  (Maybe Text)
listResourceRecordSets_startRecordName
          ((Maybe Text -> Identity (Maybe Text))
 -> ListResourceRecordSets -> Identity ListResourceRecordSets)
-> Maybe Text -> ListResourceRecordSets -> ListResourceRecordSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
          ListResourceRecordSetsResponse
-> Getting (First Text) ListResourceRecordSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListResourceRecordSetsResponse
-> Const (First Text) ListResourceRecordSetsResponse
Lens' ListResourceRecordSetsResponse (Maybe Text)
listResourceRecordSetsResponse_nextRecordName
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListResourceRecordSetsResponse
 -> Const (First Text) ListResourceRecordSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListResourceRecordSetsResponse 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
          ListResourceRecordSets
-> (ListResourceRecordSets -> ListResourceRecordSets)
-> ListResourceRecordSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe RRType -> Identity (Maybe RRType))
-> ListResourceRecordSets -> Identity ListResourceRecordSets
Lens
  ListResourceRecordSets
  ListResourceRecordSets
  (Maybe RRType)
  (Maybe RRType)
listResourceRecordSets_startRecordType
          ((Maybe RRType -> Identity (Maybe RRType))
 -> ListResourceRecordSets -> Identity ListResourceRecordSets)
-> Maybe RRType -> ListResourceRecordSets -> ListResourceRecordSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
          ListResourceRecordSetsResponse
-> Getting (First RRType) ListResourceRecordSetsResponse RRType
-> Maybe RRType
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe RRType -> Const (First RRType) (Maybe RRType))
-> ListResourceRecordSetsResponse
-> Const (First RRType) ListResourceRecordSetsResponse
Lens' ListResourceRecordSetsResponse (Maybe RRType)
listResourceRecordSetsResponse_nextRecordType
            ((Maybe RRType -> Const (First RRType) (Maybe RRType))
 -> ListResourceRecordSetsResponse
 -> Const (First RRType) ListResourceRecordSetsResponse)
-> ((RRType -> Const (First RRType) RRType)
    -> Maybe RRType -> Const (First RRType) (Maybe RRType))
-> Getting (First RRType) ListResourceRecordSetsResponse RRType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (RRType -> Const (First RRType) RRType)
-> Maybe RRType -> Const (First RRType) (Maybe RRType)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
          ListResourceRecordSets
-> (ListResourceRecordSets -> ListResourceRecordSets)
-> ListResourceRecordSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListResourceRecordSets -> Identity ListResourceRecordSets
Lens
  ListResourceRecordSets
  ListResourceRecordSets
  (Maybe Text)
  (Maybe Text)
listResourceRecordSets_startRecordIdentifier
          ((Maybe Text -> Identity (Maybe Text))
 -> ListResourceRecordSets -> Identity ListResourceRecordSets)
-> Maybe Text -> ListResourceRecordSets -> ListResourceRecordSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListResourceRecordSets
ListResourceRecordSetsResponse
rs
          ListResourceRecordSetsResponse
-> Getting (First Text) ListResourceRecordSetsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListResourceRecordSetsResponse
-> Const (First Text) ListResourceRecordSetsResponse
Lens' ListResourceRecordSetsResponse (Maybe Text)
listResourceRecordSetsResponse_nextRecordIdentifier
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListResourceRecordSetsResponse
 -> Const (First Text) ListResourceRecordSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListResourceRecordSetsResponse 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 ListResourceRecordSets where
  type
    AWSResponse ListResourceRecordSets =
      ListResourceRecordSetsResponse
  request :: ListResourceRecordSets -> Request ListResourceRecordSets
request = Service -> ListResourceRecordSets -> Request ListResourceRecordSets
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListResourceRecordSets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListResourceRecordSets)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListResourceRecordSets))
-> Logger
-> Service
-> Proxy ListResourceRecordSets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListResourceRecordSets)))
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 RRType
-> Maybe Text
-> Maybe Text
-> Int
-> [ResourceRecordSet]
-> Bool
-> Text
-> ListResourceRecordSetsResponse
ListResourceRecordSetsResponse'
            (Maybe RRType
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> [ResourceRecordSet]
 -> Bool
 -> Text
 -> ListResourceRecordSetsResponse)
-> Either String (Maybe RRType)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Int
      -> [ResourceRecordSet]
      -> Bool
      -> Text
      -> ListResourceRecordSetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe RRType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextRecordType")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Int
   -> [ResourceRecordSet]
   -> Bool
   -> Text
   -> ListResourceRecordSetsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int
      -> [ResourceRecordSet]
      -> Bool
      -> Text
      -> ListResourceRecordSetsResponse)
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
"NextRecordName")
            Either
  String
  (Maybe Text
   -> Int
   -> [ResourceRecordSet]
   -> Bool
   -> Text
   -> ListResourceRecordSetsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [ResourceRecordSet]
      -> Bool
      -> Text
      -> ListResourceRecordSetsResponse)
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
"NextRecordIdentifier")
            Either
  String
  (Int
   -> [ResourceRecordSet]
   -> Bool
   -> Text
   -> ListResourceRecordSetsResponse)
-> Either String Int
-> Either
     String
     ([ResourceRecordSet]
      -> Bool -> Text -> ListResourceRecordSetsResponse)
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
  ([ResourceRecordSet]
   -> Bool -> Text -> ListResourceRecordSetsResponse)
-> Either String [ResourceRecordSet]
-> Either String (Bool -> Text -> ListResourceRecordSetsResponse)
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
"ResourceRecordSets"
                            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 [ResourceRecordSet])
-> Either String [ResourceRecordSet]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [ResourceRecordSet]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ResourceRecordSet"
                        )
            Either String (Bool -> Text -> ListResourceRecordSetsResponse)
-> Either String Bool
-> Either String (Text -> ListResourceRecordSetsResponse)
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 -> ListResourceRecordSetsResponse)
-> Either String Text
-> Either String ListResourceRecordSetsResponse
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 ListResourceRecordSets

instance Prelude.NFData ListResourceRecordSets

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

instance Core.ToPath ListResourceRecordSets where
  toPath :: ListResourceRecordSets -> ByteString
toPath ListResourceRecordSets' {Maybe Text
Maybe RRType
ResourceId
hostedZoneId :: ResourceId
maxItems :: Maybe Text
startRecordIdentifier :: Maybe Text
startRecordType :: Maybe RRType
startRecordName :: Maybe Text
$sel:hostedZoneId:ListResourceRecordSets' :: ListResourceRecordSets -> ResourceId
$sel:maxItems:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
$sel:startRecordIdentifier:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
$sel:startRecordType:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe RRType
$sel:startRecordName:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2013-04-01/hostedzone/",
        ResourceId -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ResourceId
hostedZoneId,
        ByteString
"/rrset"
      ]

instance Core.ToQuery ListResourceRecordSets where
  toQuery :: ListResourceRecordSets -> QueryString
toQuery ListResourceRecordSets' {Maybe Text
Maybe RRType
ResourceId
hostedZoneId :: ResourceId
maxItems :: Maybe Text
startRecordIdentifier :: Maybe Text
startRecordType :: Maybe RRType
startRecordName :: Maybe Text
$sel:hostedZoneId:ListResourceRecordSets' :: ListResourceRecordSets -> ResourceId
$sel:maxItems:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
$sel:startRecordIdentifier:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
$sel:startRecordType:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe RRType
$sel:startRecordName:ListResourceRecordSets' :: ListResourceRecordSets -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"name" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
startRecordName,
        ByteString
"type" ByteString -> Maybe RRType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RRType
startRecordType,
        ByteString
"identifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
startRecordIdentifier,
        ByteString
"maxitems" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxItems
      ]

-- | A complex type that contains list information for the resource record
-- set.
--
-- /See:/ 'newListResourceRecordSetsResponse' smart constructor.
data ListResourceRecordSetsResponse = ListResourceRecordSetsResponse'
  { -- | If the results were truncated, the type of the next record in the list.
    --
    -- This element is present only if @IsTruncated@ is true.
    ListResourceRecordSetsResponse -> Maybe RRType
nextRecordType :: Prelude.Maybe RRType,
    -- | If the results were truncated, the name of the next record in the list.
    --
    -- This element is present only if @IsTruncated@ is true.
    ListResourceRecordSetsResponse -> Maybe Text
nextRecordName :: Prelude.Maybe Prelude.Text,
    -- | /Resource record sets that have a routing policy other than simple:/ If
    -- results were truncated for a given DNS name and type, the value of
    -- @SetIdentifier@ for the next resource record set that has the current
    -- DNS name and type.
    --
    -- For information about routing policies, see
    -- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html Choosing a Routing Policy>
    -- in the /Amazon Route 53 Developer Guide/.
    ListResourceRecordSetsResponse -> Maybe Text
nextRecordIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListResourceRecordSetsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Information about multiple resource record sets.
    ListResourceRecordSetsResponse -> [ResourceRecordSet]
resourceRecordSets :: [ResourceRecordSet],
    -- | A flag that indicates whether more resource record sets remain to be
    -- listed. If your results were truncated, you can make a follow-up
    -- pagination request by using the @NextRecordName@ element.
    ListResourceRecordSetsResponse -> Bool
isTruncated :: Prelude.Bool,
    -- | The maximum number of records you requested.
    ListResourceRecordSetsResponse -> Text
maxItems :: Prelude.Text
  }
  deriving (ListResourceRecordSetsResponse
-> ListResourceRecordSetsResponse -> Bool
(ListResourceRecordSetsResponse
 -> ListResourceRecordSetsResponse -> Bool)
-> (ListResourceRecordSetsResponse
    -> ListResourceRecordSetsResponse -> Bool)
-> Eq ListResourceRecordSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourceRecordSetsResponse
-> ListResourceRecordSetsResponse -> Bool
$c/= :: ListResourceRecordSetsResponse
-> ListResourceRecordSetsResponse -> Bool
== :: ListResourceRecordSetsResponse
-> ListResourceRecordSetsResponse -> Bool
$c== :: ListResourceRecordSetsResponse
-> ListResourceRecordSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListResourceRecordSetsResponse]
ReadPrec ListResourceRecordSetsResponse
Int -> ReadS ListResourceRecordSetsResponse
ReadS [ListResourceRecordSetsResponse]
(Int -> ReadS ListResourceRecordSetsResponse)
-> ReadS [ListResourceRecordSetsResponse]
-> ReadPrec ListResourceRecordSetsResponse
-> ReadPrec [ListResourceRecordSetsResponse]
-> Read ListResourceRecordSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourceRecordSetsResponse]
$creadListPrec :: ReadPrec [ListResourceRecordSetsResponse]
readPrec :: ReadPrec ListResourceRecordSetsResponse
$creadPrec :: ReadPrec ListResourceRecordSetsResponse
readList :: ReadS [ListResourceRecordSetsResponse]
$creadList :: ReadS [ListResourceRecordSetsResponse]
readsPrec :: Int -> ReadS ListResourceRecordSetsResponse
$creadsPrec :: Int -> ReadS ListResourceRecordSetsResponse
Prelude.Read, Int -> ListResourceRecordSetsResponse -> ShowS
[ListResourceRecordSetsResponse] -> ShowS
ListResourceRecordSetsResponse -> String
(Int -> ListResourceRecordSetsResponse -> ShowS)
-> (ListResourceRecordSetsResponse -> String)
-> ([ListResourceRecordSetsResponse] -> ShowS)
-> Show ListResourceRecordSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourceRecordSetsResponse] -> ShowS
$cshowList :: [ListResourceRecordSetsResponse] -> ShowS
show :: ListResourceRecordSetsResponse -> String
$cshow :: ListResourceRecordSetsResponse -> String
showsPrec :: Int -> ListResourceRecordSetsResponse -> ShowS
$cshowsPrec :: Int -> ListResourceRecordSetsResponse -> ShowS
Prelude.Show, (forall x.
 ListResourceRecordSetsResponse
 -> Rep ListResourceRecordSetsResponse x)
-> (forall x.
    Rep ListResourceRecordSetsResponse x
    -> ListResourceRecordSetsResponse)
-> Generic ListResourceRecordSetsResponse
forall x.
Rep ListResourceRecordSetsResponse x
-> ListResourceRecordSetsResponse
forall x.
ListResourceRecordSetsResponse
-> Rep ListResourceRecordSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourceRecordSetsResponse x
-> ListResourceRecordSetsResponse
$cfrom :: forall x.
ListResourceRecordSetsResponse
-> Rep ListResourceRecordSetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListResourceRecordSetsResponse' 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:
--
-- 'nextRecordType', 'listResourceRecordSetsResponse_nextRecordType' - If the results were truncated, the type of the next record in the list.
--
-- This element is present only if @IsTruncated@ is true.
--
-- 'nextRecordName', 'listResourceRecordSetsResponse_nextRecordName' - If the results were truncated, the name of the next record in the list.
--
-- This element is present only if @IsTruncated@ is true.
--
-- 'nextRecordIdentifier', 'listResourceRecordSetsResponse_nextRecordIdentifier' - /Resource record sets that have a routing policy other than simple:/ If
-- results were truncated for a given DNS name and type, the value of
-- @SetIdentifier@ for the next resource record set that has the current
-- DNS name and type.
--
-- For information about routing policies, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html Choosing a Routing Policy>
-- in the /Amazon Route 53 Developer Guide/.
--
-- 'httpStatus', 'listResourceRecordSetsResponse_httpStatus' - The response's http status code.
--
-- 'resourceRecordSets', 'listResourceRecordSetsResponse_resourceRecordSets' - Information about multiple resource record sets.
--
-- 'isTruncated', 'listResourceRecordSetsResponse_isTruncated' - A flag that indicates whether more resource record sets remain to be
-- listed. If your results were truncated, you can make a follow-up
-- pagination request by using the @NextRecordName@ element.
--
-- 'maxItems', 'listResourceRecordSetsResponse_maxItems' - The maximum number of records you requested.
newListResourceRecordSetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'isTruncated'
  Prelude.Bool ->
  -- | 'maxItems'
  Prelude.Text ->
  ListResourceRecordSetsResponse
newListResourceRecordSetsResponse :: Int -> Bool -> Text -> ListResourceRecordSetsResponse
newListResourceRecordSetsResponse
  Int
pHttpStatus_
  Bool
pIsTruncated_
  Text
pMaxItems_ =
    ListResourceRecordSetsResponse' :: Maybe RRType
-> Maybe Text
-> Maybe Text
-> Int
-> [ResourceRecordSet]
-> Bool
-> Text
-> ListResourceRecordSetsResponse
ListResourceRecordSetsResponse'
      { $sel:nextRecordType:ListResourceRecordSetsResponse' :: Maybe RRType
nextRecordType =
          Maybe RRType
forall a. Maybe a
Prelude.Nothing,
        $sel:nextRecordName:ListResourceRecordSetsResponse' :: Maybe Text
nextRecordName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextRecordIdentifier:ListResourceRecordSetsResponse' :: Maybe Text
nextRecordIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListResourceRecordSetsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:resourceRecordSets:ListResourceRecordSetsResponse' :: [ResourceRecordSet]
resourceRecordSets = [ResourceRecordSet]
forall a. Monoid a => a
Prelude.mempty,
        $sel:isTruncated:ListResourceRecordSetsResponse' :: Bool
isTruncated = Bool
pIsTruncated_,
        $sel:maxItems:ListResourceRecordSetsResponse' :: Text
maxItems = Text
pMaxItems_
      }

-- | If the results were truncated, the type of the next record in the list.
--
-- This element is present only if @IsTruncated@ is true.
listResourceRecordSetsResponse_nextRecordType :: Lens.Lens' ListResourceRecordSetsResponse (Prelude.Maybe RRType)
listResourceRecordSetsResponse_nextRecordType :: (Maybe RRType -> f (Maybe RRType))
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
listResourceRecordSetsResponse_nextRecordType = (ListResourceRecordSetsResponse -> Maybe RRType)
-> (ListResourceRecordSetsResponse
    -> Maybe RRType -> ListResourceRecordSetsResponse)
-> Lens' ListResourceRecordSetsResponse (Maybe RRType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSetsResponse' {Maybe RRType
nextRecordType :: Maybe RRType
$sel:nextRecordType:ListResourceRecordSetsResponse' :: ListResourceRecordSetsResponse -> Maybe RRType
nextRecordType} -> Maybe RRType
nextRecordType) (\s :: ListResourceRecordSetsResponse
s@ListResourceRecordSetsResponse' {} Maybe RRType
a -> ListResourceRecordSetsResponse
s {$sel:nextRecordType:ListResourceRecordSetsResponse' :: Maybe RRType
nextRecordType = Maybe RRType
a} :: ListResourceRecordSetsResponse)

-- | If the results were truncated, the name of the next record in the list.
--
-- This element is present only if @IsTruncated@ is true.
listResourceRecordSetsResponse_nextRecordName :: Lens.Lens' ListResourceRecordSetsResponse (Prelude.Maybe Prelude.Text)
listResourceRecordSetsResponse_nextRecordName :: (Maybe Text -> f (Maybe Text))
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
listResourceRecordSetsResponse_nextRecordName = (ListResourceRecordSetsResponse -> Maybe Text)
-> (ListResourceRecordSetsResponse
    -> Maybe Text -> ListResourceRecordSetsResponse)
-> Lens' ListResourceRecordSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSetsResponse' {Maybe Text
nextRecordName :: Maybe Text
$sel:nextRecordName:ListResourceRecordSetsResponse' :: ListResourceRecordSetsResponse -> Maybe Text
nextRecordName} -> Maybe Text
nextRecordName) (\s :: ListResourceRecordSetsResponse
s@ListResourceRecordSetsResponse' {} Maybe Text
a -> ListResourceRecordSetsResponse
s {$sel:nextRecordName:ListResourceRecordSetsResponse' :: Maybe Text
nextRecordName = Maybe Text
a} :: ListResourceRecordSetsResponse)

-- | /Resource record sets that have a routing policy other than simple:/ If
-- results were truncated for a given DNS name and type, the value of
-- @SetIdentifier@ for the next resource record set that has the current
-- DNS name and type.
--
-- For information about routing policies, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html Choosing a Routing Policy>
-- in the /Amazon Route 53 Developer Guide/.
listResourceRecordSetsResponse_nextRecordIdentifier :: Lens.Lens' ListResourceRecordSetsResponse (Prelude.Maybe Prelude.Text)
listResourceRecordSetsResponse_nextRecordIdentifier :: (Maybe Text -> f (Maybe Text))
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
listResourceRecordSetsResponse_nextRecordIdentifier = (ListResourceRecordSetsResponse -> Maybe Text)
-> (ListResourceRecordSetsResponse
    -> Maybe Text -> ListResourceRecordSetsResponse)
-> Lens' ListResourceRecordSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSetsResponse' {Maybe Text
nextRecordIdentifier :: Maybe Text
$sel:nextRecordIdentifier:ListResourceRecordSetsResponse' :: ListResourceRecordSetsResponse -> Maybe Text
nextRecordIdentifier} -> Maybe Text
nextRecordIdentifier) (\s :: ListResourceRecordSetsResponse
s@ListResourceRecordSetsResponse' {} Maybe Text
a -> ListResourceRecordSetsResponse
s {$sel:nextRecordIdentifier:ListResourceRecordSetsResponse' :: Maybe Text
nextRecordIdentifier = Maybe Text
a} :: ListResourceRecordSetsResponse)

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

-- | Information about multiple resource record sets.
listResourceRecordSetsResponse_resourceRecordSets :: Lens.Lens' ListResourceRecordSetsResponse [ResourceRecordSet]
listResourceRecordSetsResponse_resourceRecordSets :: ([ResourceRecordSet] -> f [ResourceRecordSet])
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
listResourceRecordSetsResponse_resourceRecordSets = (ListResourceRecordSetsResponse -> [ResourceRecordSet])
-> (ListResourceRecordSetsResponse
    -> [ResourceRecordSet] -> ListResourceRecordSetsResponse)
-> Lens
     ListResourceRecordSetsResponse
     ListResourceRecordSetsResponse
     [ResourceRecordSet]
     [ResourceRecordSet]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSetsResponse' {[ResourceRecordSet]
resourceRecordSets :: [ResourceRecordSet]
$sel:resourceRecordSets:ListResourceRecordSetsResponse' :: ListResourceRecordSetsResponse -> [ResourceRecordSet]
resourceRecordSets} -> [ResourceRecordSet]
resourceRecordSets) (\s :: ListResourceRecordSetsResponse
s@ListResourceRecordSetsResponse' {} [ResourceRecordSet]
a -> ListResourceRecordSetsResponse
s {$sel:resourceRecordSets:ListResourceRecordSetsResponse' :: [ResourceRecordSet]
resourceRecordSets = [ResourceRecordSet]
a} :: ListResourceRecordSetsResponse) (([ResourceRecordSet] -> f [ResourceRecordSet])
 -> ListResourceRecordSetsResponse
 -> f ListResourceRecordSetsResponse)
-> (([ResourceRecordSet] -> f [ResourceRecordSet])
    -> [ResourceRecordSet] -> f [ResourceRecordSet])
-> ([ResourceRecordSet] -> f [ResourceRecordSet])
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResourceRecordSet] -> f [ResourceRecordSet])
-> [ResourceRecordSet] -> f [ResourceRecordSet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A flag that indicates whether more resource record sets remain to be
-- listed. If your results were truncated, you can make a follow-up
-- pagination request by using the @NextRecordName@ element.
listResourceRecordSetsResponse_isTruncated :: Lens.Lens' ListResourceRecordSetsResponse Prelude.Bool
listResourceRecordSetsResponse_isTruncated :: (Bool -> f Bool)
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
listResourceRecordSetsResponse_isTruncated = (ListResourceRecordSetsResponse -> Bool)
-> (ListResourceRecordSetsResponse
    -> Bool -> ListResourceRecordSetsResponse)
-> Lens' ListResourceRecordSetsResponse Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSetsResponse' {Bool
isTruncated :: Bool
$sel:isTruncated:ListResourceRecordSetsResponse' :: ListResourceRecordSetsResponse -> Bool
isTruncated} -> Bool
isTruncated) (\s :: ListResourceRecordSetsResponse
s@ListResourceRecordSetsResponse' {} Bool
a -> ListResourceRecordSetsResponse
s {$sel:isTruncated:ListResourceRecordSetsResponse' :: Bool
isTruncated = Bool
a} :: ListResourceRecordSetsResponse)

-- | The maximum number of records you requested.
listResourceRecordSetsResponse_maxItems :: Lens.Lens' ListResourceRecordSetsResponse Prelude.Text
listResourceRecordSetsResponse_maxItems :: (Text -> f Text)
-> ListResourceRecordSetsResponse
-> f ListResourceRecordSetsResponse
listResourceRecordSetsResponse_maxItems = (ListResourceRecordSetsResponse -> Text)
-> (ListResourceRecordSetsResponse
    -> Text -> ListResourceRecordSetsResponse)
-> Lens
     ListResourceRecordSetsResponse
     ListResourceRecordSetsResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceRecordSetsResponse' {Text
maxItems :: Text
$sel:maxItems:ListResourceRecordSetsResponse' :: ListResourceRecordSetsResponse -> Text
maxItems} -> Text
maxItems) (\s :: ListResourceRecordSetsResponse
s@ListResourceRecordSetsResponse' {} Text
a -> ListResourceRecordSetsResponse
s {$sel:maxItems:ListResourceRecordSetsResponse' :: Text
maxItems = Text
a} :: ListResourceRecordSetsResponse)

instance
  Prelude.NFData
    ListResourceRecordSetsResponse