{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_maxItems,
    listGeoLocations_startContinentCode,
    listGeoLocations_startCountryCode,
    listGeoLocations_startSubdivisionCode,

    -- * 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53.Types

-- | A 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'
  { -- | (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 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,
    -- | 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 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
  }
  deriving (ListGeoLocations -> ListGeoLocations -> Bool
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]
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
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. 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:
--
-- '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@.
--
-- '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.
--
-- '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.
--
-- '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@.
newListGeoLocations ::
  ListGeoLocations
newListGeoLocations :: ListGeoLocations
newListGeoLocations =
  ListGeoLocations'
    { $sel:maxItems:ListGeoLocations' :: Maybe Text
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:startContinentCode:ListGeoLocations' :: Maybe Text
startContinentCode = forall a. Maybe a
Prelude.Nothing,
      $sel:startCountryCode:ListGeoLocations' :: Maybe Text
startCountryCode = forall a. Maybe a
Prelude.Nothing,
      $sel:startSubdivisionCode:ListGeoLocations' :: Maybe Text
startSubdivisionCode = forall a. Maybe a
Prelude.Nothing
    }

-- | (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 :: Lens' ListGeoLocations (Maybe Text)
listGeoLocations_maxItems = 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 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 :: Lens' ListGeoLocations (Maybe Text)
listGeoLocations_startContinentCode = 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)

-- | 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 :: Lens' ListGeoLocations (Maybe Text)
listGeoLocations_startCountryCode = 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 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 :: Lens' ListGeoLocations (Maybe Text)
listGeoLocations_startSubdivisionCode = 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)

instance Core.AWSRequest ListGeoLocations where
  type
    AWSResponse ListGeoLocations =
      ListGeoLocationsResponse
  request :: (Service -> Service)
-> ListGeoLocations -> Request ListGeoLocations
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListGeoLocations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGeoLocations)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> [GeoLocationDetails]
-> Bool
-> Text
-> ListGeoLocationsResponse
ListGeoLocationsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextContinentCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextCountryCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextSubdivisionCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"GeoLocationDetailsList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"GeoLocationDetails"
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"IsTruncated")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"MaxItems")
      )

instance Prelude.Hashable ListGeoLocations where
  hashWithSalt :: Int -> ListGeoLocations -> Int
hashWithSalt Int
_salt ListGeoLocations' {Maybe Text
startSubdivisionCode :: Maybe Text
startCountryCode :: Maybe Text
startContinentCode :: Maybe Text
maxItems :: Maybe Text
$sel:startSubdivisionCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:startCountryCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:startContinentCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:maxItems:ListGeoLocations' :: ListGeoLocations -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxItems
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startContinentCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startCountryCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startSubdivisionCode

instance Prelude.NFData ListGeoLocations where
  rnf :: ListGeoLocations -> ()
rnf ListGeoLocations' {Maybe Text
startSubdivisionCode :: Maybe Text
startCountryCode :: Maybe Text
startContinentCode :: Maybe Text
maxItems :: Maybe Text
$sel:startSubdivisionCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:startCountryCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:startContinentCode:ListGeoLocations' :: ListGeoLocations -> Maybe Text
$sel:maxItems:ListGeoLocations' :: ListGeoLocations -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxItems
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startContinentCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startCountryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startSubdivisionCode

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

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

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

-- | 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
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]
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
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.
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'
      { $sel:nextContinentCode:ListGeoLocationsResponse' :: Maybe Text
nextContinentCode =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextCountryCode:ListGeoLocationsResponse' :: Maybe Text
nextCountryCode = forall a. Maybe a
Prelude.Nothing,
        $sel:nextSubdivisionCode:ListGeoLocationsResponse' :: Maybe Text
nextSubdivisionCode = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListGeoLocationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:geoLocationDetailsList:ListGeoLocationsResponse' :: [GeoLocationDetails]
geoLocationDetailsList = 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 :: Lens' ListGeoLocationsResponse (Maybe Text)
listGeoLocationsResponse_nextContinentCode = 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 :: Lens' ListGeoLocationsResponse (Maybe Text)
listGeoLocationsResponse_nextCountryCode = 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 :: Lens' ListGeoLocationsResponse (Maybe Text)
listGeoLocationsResponse_nextSubdivisionCode = 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 :: Lens' ListGeoLocationsResponse Int
listGeoLocationsResponse_httpStatus = 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 :: Lens' ListGeoLocationsResponse [GeoLocationDetails]
listGeoLocationsResponse_geoLocationDetailsList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' ListGeoLocationsResponse Bool
listGeoLocationsResponse_isTruncated = 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 :: Lens' ListGeoLocationsResponse Text
listGeoLocationsResponse_maxItems = 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 where
  rnf :: ListGeoLocationsResponse -> ()
rnf ListGeoLocationsResponse' {Bool
Int
[GeoLocationDetails]
Maybe Text
Text
maxItems :: Text
isTruncated :: Bool
geoLocationDetailsList :: [GeoLocationDetails]
httpStatus :: Int
nextSubdivisionCode :: Maybe Text
nextCountryCode :: Maybe Text
nextContinentCode :: Maybe Text
$sel:maxItems:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Text
$sel:isTruncated:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Bool
$sel:geoLocationDetailsList:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> [GeoLocationDetails]
$sel:httpStatus:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Int
$sel:nextSubdivisionCode:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Maybe Text
$sel:nextCountryCode:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Maybe Text
$sel:nextContinentCode:ListGeoLocationsResponse' :: ListGeoLocationsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextContinentCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextCountryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextSubdivisionCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [GeoLocationDetails]
geoLocationDetailsList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
maxItems