{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Route53.Types.GeoLocation 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 Amazonka.Route53.Internal
data GeoLocation = GeoLocation'
{
GeoLocation -> Maybe Text
continentCode :: Prelude.Maybe Prelude.Text,
GeoLocation -> Maybe Text
countryCode :: Prelude.Maybe Prelude.Text,
GeoLocation -> Maybe Text
subdivisionCode :: Prelude.Maybe Prelude.Text
}
deriving (GeoLocation -> GeoLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeoLocation -> GeoLocation -> Bool
$c/= :: GeoLocation -> GeoLocation -> Bool
== :: GeoLocation -> GeoLocation -> Bool
$c== :: GeoLocation -> GeoLocation -> Bool
Prelude.Eq, ReadPrec [GeoLocation]
ReadPrec GeoLocation
Int -> ReadS GeoLocation
ReadS [GeoLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GeoLocation]
$creadListPrec :: ReadPrec [GeoLocation]
readPrec :: ReadPrec GeoLocation
$creadPrec :: ReadPrec GeoLocation
readList :: ReadS [GeoLocation]
$creadList :: ReadS [GeoLocation]
readsPrec :: Int -> ReadS GeoLocation
$creadsPrec :: Int -> ReadS GeoLocation
Prelude.Read, Int -> GeoLocation -> ShowS
[GeoLocation] -> ShowS
GeoLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeoLocation] -> ShowS
$cshowList :: [GeoLocation] -> ShowS
show :: GeoLocation -> String
$cshow :: GeoLocation -> String
showsPrec :: Int -> GeoLocation -> ShowS
$cshowsPrec :: Int -> GeoLocation -> ShowS
Prelude.Show, forall x. Rep GeoLocation x -> GeoLocation
forall x. GeoLocation -> Rep GeoLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GeoLocation x -> GeoLocation
$cfrom :: forall x. GeoLocation -> Rep GeoLocation x
Prelude.Generic)
newGeoLocation ::
GeoLocation
newGeoLocation :: GeoLocation
newGeoLocation =
GeoLocation'
{ $sel:continentCode:GeoLocation' :: Maybe Text
continentCode = forall a. Maybe a
Prelude.Nothing,
$sel:countryCode:GeoLocation' :: Maybe Text
countryCode = forall a. Maybe a
Prelude.Nothing,
$sel:subdivisionCode:GeoLocation' :: Maybe Text
subdivisionCode = forall a. Maybe a
Prelude.Nothing
}
geoLocation_continentCode :: Lens.Lens' GeoLocation (Prelude.Maybe Prelude.Text)
geoLocation_continentCode :: Lens' GeoLocation (Maybe Text)
geoLocation_continentCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoLocation' {Maybe Text
continentCode :: Maybe Text
$sel:continentCode:GeoLocation' :: GeoLocation -> Maybe Text
continentCode} -> Maybe Text
continentCode) (\s :: GeoLocation
s@GeoLocation' {} Maybe Text
a -> GeoLocation
s {$sel:continentCode:GeoLocation' :: Maybe Text
continentCode = Maybe Text
a} :: GeoLocation)
geoLocation_countryCode :: Lens.Lens' GeoLocation (Prelude.Maybe Prelude.Text)
geoLocation_countryCode :: Lens' GeoLocation (Maybe Text)
geoLocation_countryCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoLocation' {Maybe Text
countryCode :: Maybe Text
$sel:countryCode:GeoLocation' :: GeoLocation -> Maybe Text
countryCode} -> Maybe Text
countryCode) (\s :: GeoLocation
s@GeoLocation' {} Maybe Text
a -> GeoLocation
s {$sel:countryCode:GeoLocation' :: Maybe Text
countryCode = Maybe Text
a} :: GeoLocation)
geoLocation_subdivisionCode :: Lens.Lens' GeoLocation (Prelude.Maybe Prelude.Text)
geoLocation_subdivisionCode :: Lens' GeoLocation (Maybe Text)
geoLocation_subdivisionCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoLocation' {Maybe Text
subdivisionCode :: Maybe Text
$sel:subdivisionCode:GeoLocation' :: GeoLocation -> Maybe Text
subdivisionCode} -> Maybe Text
subdivisionCode) (\s :: GeoLocation
s@GeoLocation' {} Maybe Text
a -> GeoLocation
s {$sel:subdivisionCode:GeoLocation' :: Maybe Text
subdivisionCode = Maybe Text
a} :: GeoLocation)
instance Data.FromXML GeoLocation where
parseXML :: [Node] -> Either String GeoLocation
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Maybe Text -> GeoLocation
GeoLocation'
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
"ContinentCode")
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
"CountryCode")
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
"SubdivisionCode")
instance Prelude.Hashable GeoLocation where
hashWithSalt :: Int -> GeoLocation -> Int
hashWithSalt Int
_salt GeoLocation' {Maybe Text
subdivisionCode :: Maybe Text
countryCode :: Maybe Text
continentCode :: Maybe Text
$sel:subdivisionCode:GeoLocation' :: GeoLocation -> Maybe Text
$sel:countryCode:GeoLocation' :: GeoLocation -> Maybe Text
$sel:continentCode:GeoLocation' :: GeoLocation -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
continentCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
countryCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subdivisionCode
instance Prelude.NFData GeoLocation where
rnf :: GeoLocation -> ()
rnf GeoLocation' {Maybe Text
subdivisionCode :: Maybe Text
countryCode :: Maybe Text
continentCode :: Maybe Text
$sel:subdivisionCode:GeoLocation' :: GeoLocation -> Maybe Text
$sel:countryCode:GeoLocation' :: GeoLocation -> Maybe Text
$sel:continentCode:GeoLocation' :: GeoLocation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
continentCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
countryCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subdivisionCode
instance Data.ToXML GeoLocation where
toXML :: GeoLocation -> XML
toXML GeoLocation' {Maybe Text
subdivisionCode :: Maybe Text
countryCode :: Maybe Text
continentCode :: Maybe Text
$sel:subdivisionCode:GeoLocation' :: GeoLocation -> Maybe Text
$sel:countryCode:GeoLocation' :: GeoLocation -> Maybe Text
$sel:continentCode:GeoLocation' :: GeoLocation -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"ContinentCode" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
continentCode,
Name
"CountryCode" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
countryCode,
Name
"SubdivisionCode" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
subdivisionCode
]