{-# 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.Location.Types.Place where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types.PlaceGeometry
import qualified Amazonka.Prelude as Prelude
data Place = Place'
{
Place -> Maybe Text
municipality :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
addressNumber :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
postalCode :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
country :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
street :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
subRegion :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
label :: Prelude.Maybe Prelude.Text,
Place -> Maybe Text
neighborhood :: Prelude.Maybe Prelude.Text,
Place -> PlaceGeometry
geometry :: PlaceGeometry
}
deriving (Place -> Place -> Bool
(Place -> Place -> Bool) -> (Place -> Place -> Bool) -> Eq Place
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Place -> Place -> Bool
$c/= :: Place -> Place -> Bool
== :: Place -> Place -> Bool
$c== :: Place -> Place -> Bool
Prelude.Eq, Int -> Place -> ShowS
[Place] -> ShowS
Place -> String
(Int -> Place -> ShowS)
-> (Place -> String) -> ([Place] -> ShowS) -> Show Place
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Place] -> ShowS
$cshowList :: [Place] -> ShowS
show :: Place -> String
$cshow :: Place -> String
showsPrec :: Int -> Place -> ShowS
$cshowsPrec :: Int -> Place -> ShowS
Prelude.Show, (forall x. Place -> Rep Place x)
-> (forall x. Rep Place x -> Place) -> Generic Place
forall x. Rep Place x -> Place
forall x. Place -> Rep Place x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Place x -> Place
$cfrom :: forall x. Place -> Rep Place x
Prelude.Generic)
newPlace ::
PlaceGeometry ->
Place
newPlace :: PlaceGeometry -> Place
newPlace PlaceGeometry
pGeometry_ =
Place' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place
Place'
{ $sel:municipality:Place' :: Maybe Text
municipality = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressNumber:Place' :: Maybe Text
addressNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:postalCode:Place' :: Maybe Text
postalCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:country:Place' :: Maybe Text
country = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:street:Place' :: Maybe Text
street = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subRegion:Place' :: Maybe Text
subRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:Place' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:label:Place' :: Maybe Text
label = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:neighborhood:Place' :: Maybe Text
neighborhood = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:geometry:Place' :: PlaceGeometry
geometry = PlaceGeometry
pGeometry_
}
place_municipality :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_municipality :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_municipality = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
municipality :: Maybe Text
$sel:municipality:Place' :: Place -> Maybe Text
municipality} -> Maybe Text
municipality) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:municipality:Place' :: Maybe Text
municipality = Maybe Text
a} :: Place)
place_addressNumber :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_addressNumber :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_addressNumber = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
addressNumber :: Maybe Text
$sel:addressNumber:Place' :: Place -> Maybe Text
addressNumber} -> Maybe Text
addressNumber) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:addressNumber:Place' :: Maybe Text
addressNumber = Maybe Text
a} :: Place)
place_postalCode :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_postalCode :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_postalCode = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
postalCode :: Maybe Text
$sel:postalCode:Place' :: Place -> Maybe Text
postalCode} -> Maybe Text
postalCode) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:postalCode:Place' :: Maybe Text
postalCode = Maybe Text
a} :: Place)
place_country :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_country :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_country = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
country :: Maybe Text
$sel:country:Place' :: Place -> Maybe Text
country} -> Maybe Text
country) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:country:Place' :: Maybe Text
country = Maybe Text
a} :: Place)
place_street :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_street :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_street = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
street :: Maybe Text
$sel:street:Place' :: Place -> Maybe Text
street} -> Maybe Text
street) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:street:Place' :: Maybe Text
street = Maybe Text
a} :: Place)
place_subRegion :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_subRegion :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_subRegion = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
subRegion :: Maybe Text
$sel:subRegion:Place' :: Place -> Maybe Text
subRegion} -> Maybe Text
subRegion) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:subRegion:Place' :: Maybe Text
subRegion = Maybe Text
a} :: Place)
place_region :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_region :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_region = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
region :: Maybe Text
$sel:region:Place' :: Place -> Maybe Text
region} -> Maybe Text
region) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:region:Place' :: Maybe Text
region = Maybe Text
a} :: Place)
place_label :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_label :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_label = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
label :: Maybe Text
$sel:label:Place' :: Place -> Maybe Text
label} -> Maybe Text
label) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:label:Place' :: Maybe Text
label = Maybe Text
a} :: Place)
place_neighborhood :: Lens.Lens' Place (Prelude.Maybe Prelude.Text)
place_neighborhood :: (Maybe Text -> f (Maybe Text)) -> Place -> f Place
place_neighborhood = (Place -> Maybe Text)
-> (Place -> Maybe Text -> Place)
-> Lens Place Place (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {Maybe Text
neighborhood :: Maybe Text
$sel:neighborhood:Place' :: Place -> Maybe Text
neighborhood} -> Maybe Text
neighborhood) (\s :: Place
s@Place' {} Maybe Text
a -> Place
s {$sel:neighborhood:Place' :: Maybe Text
neighborhood = Maybe Text
a} :: Place)
place_geometry :: Lens.Lens' Place PlaceGeometry
place_geometry :: (PlaceGeometry -> f PlaceGeometry) -> Place -> f Place
place_geometry = (Place -> PlaceGeometry)
-> (Place -> PlaceGeometry -> Place)
-> Lens Place Place PlaceGeometry PlaceGeometry
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Place' {PlaceGeometry
geometry :: PlaceGeometry
$sel:geometry:Place' :: Place -> PlaceGeometry
geometry} -> PlaceGeometry
geometry) (\s :: Place
s@Place' {} PlaceGeometry
a -> Place
s {$sel:geometry:Place' :: PlaceGeometry
geometry = PlaceGeometry
a} :: Place)
instance Core.FromJSON Place where
parseJSON :: Value -> Parser Place
parseJSON =
String -> (Object -> Parser Place) -> Value -> Parser Place
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Place"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place
Place'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Municipality")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AddressNumber")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PostalCode")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Country")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Street")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PlaceGeometry
-> Place)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PlaceGeometry -> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubRegion")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> PlaceGeometry -> Place)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PlaceGeometry -> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Region")
Parser (Maybe Text -> Maybe Text -> PlaceGeometry -> Place)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PlaceGeometry -> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Label")
Parser (Maybe Text -> PlaceGeometry -> Place)
-> Parser (Maybe Text) -> Parser (PlaceGeometry -> Place)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Neighborhood")
Parser (PlaceGeometry -> Place)
-> Parser PlaceGeometry -> Parser Place
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PlaceGeometry
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Geometry")
)
instance Prelude.Hashable Place
instance Prelude.NFData Place