{-# 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.ListGeoLocations
-- 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 supported geographic locations.
--
-- Countries are listed first, and continents are listed last. If Amazon
-- Route 53 supports subdivisions for a country (for example, states or
-- provinces), the subdivisions for that country are listed in alphabetical
-- order immediately after the corresponding country.
--
-- Route 53 does not perform authorization for this API because it
-- retrieves information that is already available to the public.
--
-- For a list of supported geolocation codes, see the
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_GeoLocation.html GeoLocation>
-- data type.
module Amazonka.Route53.ListGeoLocations
  ( -- * Creating a Request
    ListGeoLocations (..),
    newListGeoLocations,

    -- * Request Lenses
    listGeoLocations_startSubdivisionCode,
    listGeoLocations_maxItems,
    listGeoLocations_startCountryCode,
    listGeoLocations_startContinentCode,

    -- * Destructuring the Response
    ListGeoLocationsResponse (..),
    newListGeoLocationsResponse,

    -- * Response Lenses
    listGeoLocationsResponse_nextContinentCode,
    listGeoLocationsResponse_nextCountryCode,
    listGeoLocationsResponse_nextSubdivisionCode,
    listGeoLocationsResponse_httpStatus,
    listGeoLocationsResponse_geoLocationDetailsList,
    listGeoLocationsResponse_isTruncated,
    listGeoLocationsResponse_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 get a list of geographic locations that Amazon Route 53
-- supports for geolocation resource record sets.
--
-- /See:/ 'newListGeoLocations' smart constructor.
data ListGeoLocations = ListGeoLocations'
  { -- | The code for the state of the United States with which you want to start
    -- listing locations that Amazon Route 53 supports for geolocation. If
    -- Route 53 has already returned a page or more of results, if
    -- @IsTruncated@ is @true@, and if @NextSubdivisionCode@ from the previous
    -- response has a value, enter that value in @startsubdivisioncode@ to
    -- return the next page of results.
    --
    -- To list subdivisions (U.S. states), you must include both
    -- @startcountrycode@ and @startsubdivisioncode@.
    ListGeoLocations -> Maybe Text
startSubdivisionCode :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The maximum number of geolocations to be included in the
    -- response body for this request. If more than @maxitems@ geolocations
    -- remain to be listed, then the value of the @IsTruncated@ element in the
    -- response is @true@.
    ListGeoLocations -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
    -- | The code for the country with which you want to start listing locations
    -- that Amazon Route 53 supports for geolocation. If Route 53 has already
    -- returned a page or more of results, if @IsTruncated@ is @true@, and if
    -- @NextCountryCode@ from the previous response has a value, enter that
    -- value in @startcountrycode@ to return the next page of results.
    ListGeoLocations -> Maybe Text
startCountryCode :: Prelude.Maybe Prelude.Text,
    -- | The code for the continent with which you want to start listing
    -- locations that Amazon Route 53 supports for geolocation. If Route 53 has
    -- already returned a page or more of results, if @IsTruncated@ is true,
    -- and if @NextContinentCode@ from the previous response has a value, enter
    -- that value in @startcontinentcode@ to return the next page of results.
    --
    -- Include @startcontinentcode@ only if you want to list continents. Don\'t
    -- include @startcontinentcode@ when you\'re listing countries or countries
    -- with their subdivisions.
    ListGeoLocations -> Maybe Text
startContinentCode :: Prelude.Maybe Prelude.Text
  }
  deriving (ListGeoLocations -> ListGeoLocations -> Bool
(ListGeoLocations -> ListGeoLocations -> Bool)
-> (ListGeoLocations -> ListGeoLocations -> Bool)
-> Eq ListGeoLocations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGeoLocations -> ListGeoLocations -> Bool
$c/= :: ListGeoLocations -> ListGeoLocations -> Bool
== :: ListGeoLocations -> ListGeoLocations -> Bool
$c== :: ListGeoLocations -> ListGeoLocations -> Bool
Prelude.Eq, ReadPrec [ListGeoLocations]
ReadPrec ListGeoLocations
Int -> ReadS ListGeoLocations
ReadS [ListGeoLocations]
(Int -> ReadS ListGeoLocations)
-> ReadS [ListGeoLocations]
-> ReadPrec ListGeoLocations
-> ReadPrec [ListGeoLocations]
-> Read ListGeoLocations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGeoLocations]
$creadListPrec :: ReadPrec [ListGeoLocations]
readPrec :: ReadPrec ListGeoLocations
$creadPrec :: ReadPrec ListGeoLocations
readList :: ReadS [ListGeoLocations]
$creadList :: ReadS [ListGeoLocations]
readsPrec :: Int -> ReadS ListGeoLocations
$creadsPrec :: Int -> ReadS ListGeoLocations
Prelude.Read, Int -> ListGeoLocations -> ShowS
[ListGeoLocations] -> ShowS
ListGeoLocations -> String
(Int -> ListGeoLocations -> ShowS)
-> (ListGeoLocations -> String)
-> ([ListGeoLocations] -> ShowS)
-> Show ListGeoLocations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGeoLocations] -> ShowS
$cshowList :: [ListGeoLocations] -> ShowS
show :: ListGeoLocations -> String
$cshow :: ListGeoLocations -> String
showsPrec :: Int -> ListGeoLocations -> ShowS
$cshowsPrec :: Int -> ListGeoLocations -> ShowS
Prelude.Show, (forall x. ListGeoLocations -> Rep ListGeoLocations x)
-> (forall x. Rep ListGeoLocations x -> ListGeoLocations)
-> Generic ListGeoLocations
forall x. Rep ListGeoLocations x -> ListGeoLocations
forall x. ListGeoLocations -> Rep ListGeoLocations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGeoLocations x -> ListGeoLocations
$cfrom :: forall x. ListGeoLocations -> Rep ListGeoLocations x
Prelude.Generic)

-- |
-- Create a value of 'ListGeoLocations' 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:
--
-- 'startSubdivisionCode', 'listGeoLocations_startSubdivisionCode' - The code for the state of the United States with which you want to start
-- listing locations that Amazon Route 53 supports for geolocation. If
-- Route 53 has already returned a page or more of results, if
-- @IsTruncated@ is @true@, and if @NextSubdivisionCode@ from the previous
-- response has a value, enter that value in @startsubdivisioncode@ to
-- return the next page of results.
--
-- To list subdivisions (U.S. states), you must include both
-- @startcountrycode@ and @startsubdivisioncode@.
--
-- 'maxItems', 'listGeoLocations_maxItems' - (Optional) The maximum number of geolocations to be included in the
-- response body for this request. If more than @maxitems@ geolocations
-- remain to be listed, then the value of the @IsTruncated@ element in the
-- response is @true@.
--
-- 'startCountryCode', 'listGeoLocations_startCountryCode' - The code for the country with which you want to start listing locations
-- that Amazon Route 53 supports for geolocation. If Route 53 has already
-- returned a page or more of results, if @IsTruncated@ is @true@, and if
-- @NextCountryCode@ from the previous response has a value, enter that
-- value in @startcountrycode@ to return the next page of results.
--
-- 'startContinentCode', 'listGeoLocations_startContinentCode' - The code for the continent with which you want to start listing
-- locations that Amazon Route 53 supports for geolocation. If Route 53 has
-- already returned a page or more of results, if @IsTruncated@ is true,
-- and if @NextContinentCode@ from the previous response has a value, enter
-- that value in @startcontinentcode@ to return the next page of results.
--
-- Include @startcontinentcode@ only if you want to list continents. Don\'t
-- include @startcontinentcode@ when you\'re listing countries or countries
-- with their subdivisions.
newListGeoLocations ::
  ListGeoLocations
newListGeoLocations :: ListGeoLocations
newListGeoLocations =
  ListGeoLocations' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ListGeoLocations
ListGeoLocations'
    { $sel:startSubdivisionCode:ListGeoLocations' :: Maybe Text
startSubdivisionCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListGeoLocations' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startCountryCode:ListGeoLocations' :: Maybe Text
startCountryCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startContinentCode:ListGeoLocations' :: Maybe Text
startContinentCode = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The code for the state of the United States with which you want to start
-- listing locations that Amazon Route 53 supports for geolocation. If
-- Route 53 has already returned a page or more of results, if
-- @IsTruncated@ is @true@, and if @NextSubdivisionCode@ from the previous
-- response has a value, enter that value in @startsubdivisioncode@ to
-- return the next page of results.
--
-- To list subdivisions (U.S. states), you must include both
-- @startcountrycode@ and @startsubdivisioncode@.
listGeoLocations_startSubdivisionCode :: Lens.Lens' ListGeoLocations (Prelude.Maybe Prelude.Text)
listGeoLocations_startSubdivisionCode :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocations -> f ListGeoLocations
listGeoLocations_startSubdivisionCode = (ListGeoLocations -> Maybe Text)
-> (ListGeoLocations -> Maybe Text -> ListGeoLocations)
-> Lens ListGeoLocations ListGeoLocations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocations' {Maybe Text
startSubdivisionCode :: Maybe Text
$sel:startSubdivisionCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
startSubdivisionCode} -> Maybe Text
startSubdivisionCode) (\s :: ListGeoLocations
s@ListGeoLocations' {} Maybe Text
a -> ListGeoLocations
s {$sel:startSubdivisionCode:ListGeoLocations' :: Maybe Text
startSubdivisionCode = Maybe Text
a} :: ListGeoLocations)

-- | (Optional) The maximum number of geolocations to be included in the
-- response body for this request. If more than @maxitems@ geolocations
-- remain to be listed, then the value of the @IsTruncated@ element in the
-- response is @true@.
listGeoLocations_maxItems :: Lens.Lens' ListGeoLocations (Prelude.Maybe Prelude.Text)
listGeoLocations_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocations -> f ListGeoLocations
listGeoLocations_maxItems = (ListGeoLocations -> Maybe Text)
-> (ListGeoLocations -> Maybe Text -> ListGeoLocations)
-> Lens ListGeoLocations ListGeoLocations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocations' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListGeoLocations' :: ListGeoLocations -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListGeoLocations
s@ListGeoLocations' {} Maybe Text
a -> ListGeoLocations
s {$sel:maxItems:ListGeoLocations' :: Maybe Text
maxItems = Maybe Text
a} :: ListGeoLocations)

-- | The code for the country with which you want to start listing locations
-- that Amazon Route 53 supports for geolocation. If Route 53 has already
-- returned a page or more of results, if @IsTruncated@ is @true@, and if
-- @NextCountryCode@ from the previous response has a value, enter that
-- value in @startcountrycode@ to return the next page of results.
listGeoLocations_startCountryCode :: Lens.Lens' ListGeoLocations (Prelude.Maybe Prelude.Text)
listGeoLocations_startCountryCode :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocations -> f ListGeoLocations
listGeoLocations_startCountryCode = (ListGeoLocations -> Maybe Text)
-> (ListGeoLocations -> Maybe Text -> ListGeoLocations)
-> Lens ListGeoLocations ListGeoLocations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocations' {Maybe Text
startCountryCode :: Maybe Text
$sel:startCountryCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
startCountryCode} -> Maybe Text
startCountryCode) (\s :: ListGeoLocations
s@ListGeoLocations' {} Maybe Text
a -> ListGeoLocations
s {$sel:startCountryCode:ListGeoLocations' :: Maybe Text
startCountryCode = Maybe Text
a} :: ListGeoLocations)

-- | The code for the continent with which you want to start listing
-- locations that Amazon Route 53 supports for geolocation. If Route 53 has
-- already returned a page or more of results, if @IsTruncated@ is true,
-- and if @NextContinentCode@ from the previous response has a value, enter
-- that value in @startcontinentcode@ to return the next page of results.
--
-- Include @startcontinentcode@ only if you want to list continents. Don\'t
-- include @startcontinentcode@ when you\'re listing countries or countries
-- with their subdivisions.
listGeoLocations_startContinentCode :: Lens.Lens' ListGeoLocations (Prelude.Maybe Prelude.Text)
listGeoLocations_startContinentCode :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocations -> f ListGeoLocations
listGeoLocations_startContinentCode = (ListGeoLocations -> Maybe Text)
-> (ListGeoLocations -> Maybe Text -> ListGeoLocations)
-> Lens ListGeoLocations ListGeoLocations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocations' {Maybe Text
startContinentCode :: Maybe Text
$sel:startContinentCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
startContinentCode} -> Maybe Text
startContinentCode) (\s :: ListGeoLocations
s@ListGeoLocations' {} Maybe Text
a -> ListGeoLocations
s {$sel:startContinentCode:ListGeoLocations' :: Maybe Text
startContinentCode = Maybe Text
a} :: ListGeoLocations)

instance Core.AWSRequest ListGeoLocations where
  type
    AWSResponse ListGeoLocations =
      ListGeoLocationsResponse
  request :: ListGeoLocations -> Request ListGeoLocations
request = Service -> ListGeoLocations -> Request ListGeoLocations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListGeoLocations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGeoLocations)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListGeoLocations))
-> Logger
-> Service
-> Proxy ListGeoLocations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGeoLocations)))
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
-> Maybe Text
-> Int
-> [GeoLocationDetails]
-> Bool
-> Text
-> ListGeoLocationsResponse
ListGeoLocationsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> [GeoLocationDetails]
 -> Bool
 -> Text
 -> ListGeoLocationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Int
      -> [GeoLocationDetails]
      -> Bool
      -> Text
      -> ListGeoLocationsResponse)
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
"NextContinentCode")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Int
   -> [GeoLocationDetails]
   -> Bool
   -> Text
   -> ListGeoLocationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Int
      -> [GeoLocationDetails]
      -> Bool
      -> Text
      -> ListGeoLocationsResponse)
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
"NextCountryCode")
            Either
  String
  (Maybe Text
   -> Int
   -> [GeoLocationDetails]
   -> Bool
   -> Text
   -> ListGeoLocationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [GeoLocationDetails]
      -> Bool
      -> Text
      -> ListGeoLocationsResponse)
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
"NextSubdivisionCode")
            Either
  String
  (Int
   -> [GeoLocationDetails]
   -> Bool
   -> Text
   -> ListGeoLocationsResponse)
-> Either String Int
-> Either
     String
     ([GeoLocationDetails] -> Bool -> Text -> ListGeoLocationsResponse)
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
  ([GeoLocationDetails] -> Bool -> Text -> ListGeoLocationsResponse)
-> Either String [GeoLocationDetails]
-> Either String (Bool -> Text -> ListGeoLocationsResponse)
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
"GeoLocationDetailsList"
                            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 [GeoLocationDetails])
-> Either String [GeoLocationDetails]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [GeoLocationDetails]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"GeoLocationDetails"
                        )
            Either String (Bool -> Text -> ListGeoLocationsResponse)
-> Either String Bool
-> Either String (Text -> ListGeoLocationsResponse)
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 -> ListGeoLocationsResponse)
-> Either String Text -> Either String ListGeoLocationsResponse
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 ListGeoLocations

instance Prelude.NFData ListGeoLocations

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

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

instance Core.ToQuery ListGeoLocations where
  toQuery :: ListGeoLocations -> QueryString
toQuery ListGeoLocations' {Maybe Text
startContinentCode :: Maybe Text
startCountryCode :: Maybe Text
maxItems :: Maybe Text
startSubdivisionCode :: Maybe Text
$sel:startContinentCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:startCountryCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:maxItems:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:startSubdivisionCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"startsubdivisioncode" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
startSubdivisionCode,
        ByteString
"maxitems" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxItems,
        ByteString
"startcountrycode" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
startCountryCode,
        ByteString
"startcontinentcode" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
startContinentCode
      ]

-- | A complex type containing the response information for the request.
--
-- /See:/ 'newListGeoLocationsResponse' smart constructor.
data ListGeoLocationsResponse = ListGeoLocationsResponse'
  { -- | If @IsTruncated@ is @true@, you can make a follow-up request to display
    -- more locations. Enter the value of @NextContinentCode@ in the
    -- @startcontinentcode@ parameter in another @ListGeoLocations@ request.
    ListGeoLocationsResponse -> Maybe Text
nextContinentCode :: Prelude.Maybe Prelude.Text,
    -- | If @IsTruncated@ is @true@, you can make a follow-up request to display
    -- more locations. Enter the value of @NextCountryCode@ in the
    -- @startcountrycode@ parameter in another @ListGeoLocations@ request.
    ListGeoLocationsResponse -> Maybe Text
nextCountryCode :: Prelude.Maybe Prelude.Text,
    -- | If @IsTruncated@ is @true@, you can make a follow-up request to display
    -- more locations. Enter the value of @NextSubdivisionCode@ in the
    -- @startsubdivisioncode@ parameter in another @ListGeoLocations@ request.
    ListGeoLocationsResponse -> Maybe Text
nextSubdivisionCode :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListGeoLocationsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains one @GeoLocationDetails@ element for each
    -- location that Amazon Route 53 supports for geolocation.
    ListGeoLocationsResponse -> [GeoLocationDetails]
geoLocationDetailsList :: [GeoLocationDetails],
    -- | A value that indicates whether more locations remain to be listed after
    -- the last location in this response. If so, the value of @IsTruncated@ is
    -- @true@. To get more values, submit another request and include the
    -- values of @NextContinentCode@, @NextCountryCode@, and
    -- @NextSubdivisionCode@ in the @startcontinentcode@, @startcountrycode@,
    -- and @startsubdivisioncode@, as applicable.
    ListGeoLocationsResponse -> Bool
isTruncated :: Prelude.Bool,
    -- | The value that you specified for @MaxItems@ in the request.
    ListGeoLocationsResponse -> Text
maxItems :: Prelude.Text
  }
  deriving (ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool
(ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool)
-> (ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool)
-> Eq ListGeoLocationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool
$c/= :: ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool
== :: ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool
$c== :: ListGeoLocationsResponse -> ListGeoLocationsResponse -> Bool
Prelude.Eq, ReadPrec [ListGeoLocationsResponse]
ReadPrec ListGeoLocationsResponse
Int -> ReadS ListGeoLocationsResponse
ReadS [ListGeoLocationsResponse]
(Int -> ReadS ListGeoLocationsResponse)
-> ReadS [ListGeoLocationsResponse]
-> ReadPrec ListGeoLocationsResponse
-> ReadPrec [ListGeoLocationsResponse]
-> Read ListGeoLocationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGeoLocationsResponse]
$creadListPrec :: ReadPrec [ListGeoLocationsResponse]
readPrec :: ReadPrec ListGeoLocationsResponse
$creadPrec :: ReadPrec ListGeoLocationsResponse
readList :: ReadS [ListGeoLocationsResponse]
$creadList :: ReadS [ListGeoLocationsResponse]
readsPrec :: Int -> ReadS ListGeoLocationsResponse
$creadsPrec :: Int -> ReadS ListGeoLocationsResponse
Prelude.Read, Int -> ListGeoLocationsResponse -> ShowS
[ListGeoLocationsResponse] -> ShowS
ListGeoLocationsResponse -> String
(Int -> ListGeoLocationsResponse -> ShowS)
-> (ListGeoLocationsResponse -> String)
-> ([ListGeoLocationsResponse] -> ShowS)
-> Show ListGeoLocationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGeoLocationsResponse] -> ShowS
$cshowList :: [ListGeoLocationsResponse] -> ShowS
show :: ListGeoLocationsResponse -> String
$cshow :: ListGeoLocationsResponse -> String
showsPrec :: Int -> ListGeoLocationsResponse -> ShowS
$cshowsPrec :: Int -> ListGeoLocationsResponse -> ShowS
Prelude.Show, (forall x.
 ListGeoLocationsResponse -> Rep ListGeoLocationsResponse x)
-> (forall x.
    Rep ListGeoLocationsResponse x -> ListGeoLocationsResponse)
-> Generic ListGeoLocationsResponse
forall x.
Rep ListGeoLocationsResponse x -> ListGeoLocationsResponse
forall x.
ListGeoLocationsResponse -> Rep ListGeoLocationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGeoLocationsResponse x -> ListGeoLocationsResponse
$cfrom :: forall x.
ListGeoLocationsResponse -> Rep ListGeoLocationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGeoLocationsResponse' 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:
--
-- 'nextContinentCode', 'listGeoLocationsResponse_nextContinentCode' - If @IsTruncated@ is @true@, you can make a follow-up request to display
-- more locations. Enter the value of @NextContinentCode@ in the
-- @startcontinentcode@ parameter in another @ListGeoLocations@ request.
--
-- 'nextCountryCode', 'listGeoLocationsResponse_nextCountryCode' - If @IsTruncated@ is @true@, you can make a follow-up request to display
-- more locations. Enter the value of @NextCountryCode@ in the
-- @startcountrycode@ parameter in another @ListGeoLocations@ request.
--
-- 'nextSubdivisionCode', 'listGeoLocationsResponse_nextSubdivisionCode' - If @IsTruncated@ is @true@, you can make a follow-up request to display
-- more locations. Enter the value of @NextSubdivisionCode@ in the
-- @startsubdivisioncode@ parameter in another @ListGeoLocations@ request.
--
-- 'httpStatus', 'listGeoLocationsResponse_httpStatus' - The response's http status code.
--
-- 'geoLocationDetailsList', 'listGeoLocationsResponse_geoLocationDetailsList' - A complex type that contains one @GeoLocationDetails@ element for each
-- location that Amazon Route 53 supports for geolocation.
--
-- 'isTruncated', 'listGeoLocationsResponse_isTruncated' - A value that indicates whether more locations remain to be listed after
-- the last location in this response. If so, the value of @IsTruncated@ is
-- @true@. To get more values, submit another request and include the
-- values of @NextContinentCode@, @NextCountryCode@, and
-- @NextSubdivisionCode@ in the @startcontinentcode@, @startcountrycode@,
-- and @startsubdivisioncode@, as applicable.
--
-- 'maxItems', 'listGeoLocationsResponse_maxItems' - The value that you specified for @MaxItems@ in the request.
newListGeoLocationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'isTruncated'
  Prelude.Bool ->
  -- | 'maxItems'
  Prelude.Text ->
  ListGeoLocationsResponse
newListGeoLocationsResponse :: Int -> Bool -> Text -> ListGeoLocationsResponse
newListGeoLocationsResponse
  Int
pHttpStatus_
  Bool
pIsTruncated_
  Text
pMaxItems_ =
    ListGeoLocationsResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> [GeoLocationDetails]
-> Bool
-> Text
-> ListGeoLocationsResponse
ListGeoLocationsResponse'
      { $sel:nextContinentCode:ListGeoLocationsResponse' :: Maybe Text
nextContinentCode =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextCountryCode:ListGeoLocationsResponse' :: Maybe Text
nextCountryCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextSubdivisionCode:ListGeoLocationsResponse' :: Maybe Text
nextSubdivisionCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListGeoLocationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:geoLocationDetailsList:ListGeoLocationsResponse' :: [GeoLocationDetails]
geoLocationDetailsList = [GeoLocationDetails]
forall a. Monoid a => a
Prelude.mempty,
        $sel:isTruncated:ListGeoLocationsResponse' :: Bool
isTruncated = Bool
pIsTruncated_,
        $sel:maxItems:ListGeoLocationsResponse' :: Text
maxItems = Text
pMaxItems_
      }

-- | If @IsTruncated@ is @true@, you can make a follow-up request to display
-- more locations. Enter the value of @NextContinentCode@ in the
-- @startcontinentcode@ parameter in another @ListGeoLocations@ request.
listGeoLocationsResponse_nextContinentCode :: Lens.Lens' ListGeoLocationsResponse (Prelude.Maybe Prelude.Text)
listGeoLocationsResponse_nextContinentCode :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocationsResponse -> f ListGeoLocationsResponse
listGeoLocationsResponse_nextContinentCode = (ListGeoLocationsResponse -> Maybe Text)
-> (ListGeoLocationsResponse
    -> Maybe Text -> ListGeoLocationsResponse)
-> Lens
     ListGeoLocationsResponse
     ListGeoLocationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocationsResponse' {Maybe Text
nextContinentCode :: Maybe Text
$sel:nextContinentCode:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Maybe Text
nextContinentCode} -> Maybe Text
nextContinentCode) (\s :: ListGeoLocationsResponse
s@ListGeoLocationsResponse' {} Maybe Text
a -> ListGeoLocationsResponse
s {$sel:nextContinentCode:ListGeoLocationsResponse' :: Maybe Text
nextContinentCode = Maybe Text
a} :: ListGeoLocationsResponse)

-- | If @IsTruncated@ is @true@, you can make a follow-up request to display
-- more locations. Enter the value of @NextCountryCode@ in the
-- @startcountrycode@ parameter in another @ListGeoLocations@ request.
listGeoLocationsResponse_nextCountryCode :: Lens.Lens' ListGeoLocationsResponse (Prelude.Maybe Prelude.Text)
listGeoLocationsResponse_nextCountryCode :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocationsResponse -> f ListGeoLocationsResponse
listGeoLocationsResponse_nextCountryCode = (ListGeoLocationsResponse -> Maybe Text)
-> (ListGeoLocationsResponse
    -> Maybe Text -> ListGeoLocationsResponse)
-> Lens
     ListGeoLocationsResponse
     ListGeoLocationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocationsResponse' {Maybe Text
nextCountryCode :: Maybe Text
$sel:nextCountryCode:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Maybe Text
nextCountryCode} -> Maybe Text
nextCountryCode) (\s :: ListGeoLocationsResponse
s@ListGeoLocationsResponse' {} Maybe Text
a -> ListGeoLocationsResponse
s {$sel:nextCountryCode:ListGeoLocationsResponse' :: Maybe Text
nextCountryCode = Maybe Text
a} :: ListGeoLocationsResponse)

-- | If @IsTruncated@ is @true@, you can make a follow-up request to display
-- more locations. Enter the value of @NextSubdivisionCode@ in the
-- @startsubdivisioncode@ parameter in another @ListGeoLocations@ request.
listGeoLocationsResponse_nextSubdivisionCode :: Lens.Lens' ListGeoLocationsResponse (Prelude.Maybe Prelude.Text)
listGeoLocationsResponse_nextSubdivisionCode :: (Maybe Text -> f (Maybe Text))
-> ListGeoLocationsResponse -> f ListGeoLocationsResponse
listGeoLocationsResponse_nextSubdivisionCode = (ListGeoLocationsResponse -> Maybe Text)
-> (ListGeoLocationsResponse
    -> Maybe Text -> ListGeoLocationsResponse)
-> Lens
     ListGeoLocationsResponse
     ListGeoLocationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocationsResponse' {Maybe Text
nextSubdivisionCode :: Maybe Text
$sel:nextSubdivisionCode:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Maybe Text
nextSubdivisionCode} -> Maybe Text
nextSubdivisionCode) (\s :: ListGeoLocationsResponse
s@ListGeoLocationsResponse' {} Maybe Text
a -> ListGeoLocationsResponse
s {$sel:nextSubdivisionCode:ListGeoLocationsResponse' :: Maybe Text
nextSubdivisionCode = Maybe Text
a} :: ListGeoLocationsResponse)

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

-- | A complex type that contains one @GeoLocationDetails@ element for each
-- location that Amazon Route 53 supports for geolocation.
listGeoLocationsResponse_geoLocationDetailsList :: Lens.Lens' ListGeoLocationsResponse [GeoLocationDetails]
listGeoLocationsResponse_geoLocationDetailsList :: ([GeoLocationDetails] -> f [GeoLocationDetails])
-> ListGeoLocationsResponse -> f ListGeoLocationsResponse
listGeoLocationsResponse_geoLocationDetailsList = (ListGeoLocationsResponse -> [GeoLocationDetails])
-> (ListGeoLocationsResponse
    -> [GeoLocationDetails] -> ListGeoLocationsResponse)
-> Lens
     ListGeoLocationsResponse
     ListGeoLocationsResponse
     [GeoLocationDetails]
     [GeoLocationDetails]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocationsResponse' {[GeoLocationDetails]
geoLocationDetailsList :: [GeoLocationDetails]
$sel:geoLocationDetailsList:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> [GeoLocationDetails]
geoLocationDetailsList} -> [GeoLocationDetails]
geoLocationDetailsList) (\s :: ListGeoLocationsResponse
s@ListGeoLocationsResponse' {} [GeoLocationDetails]
a -> ListGeoLocationsResponse
s {$sel:geoLocationDetailsList:ListGeoLocationsResponse' :: [GeoLocationDetails]
geoLocationDetailsList = [GeoLocationDetails]
a} :: ListGeoLocationsResponse) (([GeoLocationDetails] -> f [GeoLocationDetails])
 -> ListGeoLocationsResponse -> f ListGeoLocationsResponse)
-> (([GeoLocationDetails] -> f [GeoLocationDetails])
    -> [GeoLocationDetails] -> f [GeoLocationDetails])
-> ([GeoLocationDetails] -> f [GeoLocationDetails])
-> ListGeoLocationsResponse
-> f ListGeoLocationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GeoLocationDetails] -> f [GeoLocationDetails])
-> [GeoLocationDetails] -> f [GeoLocationDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A value that indicates whether more locations remain to be listed after
-- the last location in this response. If so, the value of @IsTruncated@ is
-- @true@. To get more values, submit another request and include the
-- values of @NextContinentCode@, @NextCountryCode@, and
-- @NextSubdivisionCode@ in the @startcontinentcode@, @startcountrycode@,
-- and @startsubdivisioncode@, as applicable.
listGeoLocationsResponse_isTruncated :: Lens.Lens' ListGeoLocationsResponse Prelude.Bool
listGeoLocationsResponse_isTruncated :: (Bool -> f Bool)
-> ListGeoLocationsResponse -> f ListGeoLocationsResponse
listGeoLocationsResponse_isTruncated = (ListGeoLocationsResponse -> Bool)
-> (ListGeoLocationsResponse -> Bool -> ListGeoLocationsResponse)
-> Lens ListGeoLocationsResponse ListGeoLocationsResponse Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeoLocationsResponse' {Bool
isTruncated :: Bool
$sel:isTruncated:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Bool
isTruncated} -> Bool
isTruncated) (\s :: ListGeoLocationsResponse
s@ListGeoLocationsResponse' {} Bool
a -> ListGeoLocationsResponse
s {$sel:isTruncated:ListGeoLocationsResponse' :: Bool
isTruncated = Bool
a} :: ListGeoLocationsResponse)

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

instance Prelude.NFData ListGeoLocationsResponse