{-# 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.Snowball.Types.Address where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Address = Address'
{
Address -> Maybe Bool
isRestricted :: Prelude.Maybe Prelude.Bool,
Address -> Maybe Text
street3 :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
landmark :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
postalCode :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
country :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
stateOrProvince :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
street2 :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
addressId :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
city :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
company :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
prefectureOrDistrict :: Prelude.Maybe Prelude.Text,
Address -> Maybe Text
street1 :: Prelude.Maybe Prelude.Text
}
deriving (Address -> Address -> Bool
(Address -> Address -> Bool)
-> (Address -> Address -> Bool) -> Eq Address
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Address -> Address -> Bool
$c/= :: Address -> Address -> Bool
== :: Address -> Address -> Bool
$c== :: Address -> Address -> Bool
Prelude.Eq, ReadPrec [Address]
ReadPrec Address
Int -> ReadS Address
ReadS [Address]
(Int -> ReadS Address)
-> ReadS [Address]
-> ReadPrec Address
-> ReadPrec [Address]
-> Read Address
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Address]
$creadListPrec :: ReadPrec [Address]
readPrec :: ReadPrec Address
$creadPrec :: ReadPrec Address
readList :: ReadS [Address]
$creadList :: ReadS [Address]
readsPrec :: Int -> ReadS Address
$creadsPrec :: Int -> ReadS Address
Prelude.Read, Int -> Address -> ShowS
[Address] -> ShowS
Address -> String
(Int -> Address -> ShowS)
-> (Address -> String) -> ([Address] -> ShowS) -> Show Address
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Address] -> ShowS
$cshowList :: [Address] -> ShowS
show :: Address -> String
$cshow :: Address -> String
showsPrec :: Int -> Address -> ShowS
$cshowsPrec :: Int -> Address -> ShowS
Prelude.Show, (forall x. Address -> Rep Address x)
-> (forall x. Rep Address x -> Address) -> Generic Address
forall x. Rep Address x -> Address
forall x. Address -> Rep Address x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Address x -> Address
$cfrom :: forall x. Address -> Rep Address x
Prelude.Generic)
newAddress ::
Address
newAddress :: Address
newAddress =
Address' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address
Address'
{ $sel:isRestricted:Address' :: Maybe Bool
isRestricted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:street3:Address' :: Maybe Text
street3 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:landmark:Address' :: Maybe Text
landmark = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:postalCode:Address' :: Maybe Text
postalCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:country:Address' :: Maybe Text
country = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stateOrProvince:Address' :: Maybe Text
stateOrProvince = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:street2:Address' :: Maybe Text
street2 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressId:Address' :: Maybe Text
addressId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:city:Address' :: Maybe Text
city = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:Address' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:company:Address' :: Maybe Text
company = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Address' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:prefectureOrDistrict:Address' :: Maybe Text
prefectureOrDistrict = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:street1:Address' :: Maybe Text
street1 = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
address_isRestricted :: Lens.Lens' Address (Prelude.Maybe Prelude.Bool)
address_isRestricted :: (Maybe Bool -> f (Maybe Bool)) -> Address -> f Address
address_isRestricted = (Address -> Maybe Bool)
-> (Address -> Maybe Bool -> Address)
-> Lens Address Address (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Bool
isRestricted :: Maybe Bool
$sel:isRestricted:Address' :: Address -> Maybe Bool
isRestricted} -> Maybe Bool
isRestricted) (\s :: Address
s@Address' {} Maybe Bool
a -> Address
s {$sel:isRestricted:Address' :: Maybe Bool
isRestricted = Maybe Bool
a} :: Address)
address_street3 :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_street3 :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_street3 = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
street3 :: Maybe Text
$sel:street3:Address' :: Address -> Maybe Text
street3} -> Maybe Text
street3) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:street3:Address' :: Maybe Text
street3 = Maybe Text
a} :: Address)
address_landmark :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_landmark :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_landmark = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
landmark :: Maybe Text
$sel:landmark:Address' :: Address -> Maybe Text
landmark} -> Maybe Text
landmark) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:landmark:Address' :: Maybe Text
landmark = Maybe Text
a} :: Address)
address_postalCode :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_postalCode :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_postalCode = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
postalCode :: Maybe Text
$sel:postalCode:Address' :: Address -> Maybe Text
postalCode} -> Maybe Text
postalCode) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:postalCode:Address' :: Maybe Text
postalCode = Maybe Text
a} :: Address)
address_country :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_country :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_country = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
country :: Maybe Text
$sel:country:Address' :: Address -> Maybe Text
country} -> Maybe Text
country) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:country:Address' :: Maybe Text
country = Maybe Text
a} :: Address)
address_stateOrProvince :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_stateOrProvince :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_stateOrProvince = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
stateOrProvince :: Maybe Text
$sel:stateOrProvince:Address' :: Address -> Maybe Text
stateOrProvince} -> Maybe Text
stateOrProvince) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:stateOrProvince:Address' :: Maybe Text
stateOrProvince = Maybe Text
a} :: Address)
address_street2 :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_street2 :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_street2 = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
street2 :: Maybe Text
$sel:street2:Address' :: Address -> Maybe Text
street2} -> Maybe Text
street2) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:street2:Address' :: Maybe Text
street2 = Maybe Text
a} :: Address)
address_addressId :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_addressId :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_addressId = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
addressId :: Maybe Text
$sel:addressId:Address' :: Address -> Maybe Text
addressId} -> Maybe Text
addressId) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:addressId:Address' :: Maybe Text
addressId = Maybe Text
a} :: Address)
address_city :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_city :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_city = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
city :: Maybe Text
$sel:city:Address' :: Address -> Maybe Text
city} -> Maybe Text
city) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:city:Address' :: Maybe Text
city = Maybe Text
a} :: Address)
address_phoneNumber :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_phoneNumber :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_phoneNumber = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:Address' :: Address -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:phoneNumber:Address' :: Maybe Text
phoneNumber = Maybe Text
a} :: Address)
address_company :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_company :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_company = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
company :: Maybe Text
$sel:company:Address' :: Address -> Maybe Text
company} -> Maybe Text
company) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:company:Address' :: Maybe Text
company = Maybe Text
a} :: Address)
address_name :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_name :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_name = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
name :: Maybe Text
$sel:name:Address' :: Address -> Maybe Text
name} -> Maybe Text
name) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:name:Address' :: Maybe Text
name = Maybe Text
a} :: Address)
address_prefectureOrDistrict :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_prefectureOrDistrict :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_prefectureOrDistrict = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
prefectureOrDistrict :: Maybe Text
$sel:prefectureOrDistrict:Address' :: Address -> Maybe Text
prefectureOrDistrict} -> Maybe Text
prefectureOrDistrict) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:prefectureOrDistrict:Address' :: Maybe Text
prefectureOrDistrict = Maybe Text
a} :: Address)
address_street1 :: Lens.Lens' Address (Prelude.Maybe Prelude.Text)
address_street1 :: (Maybe Text -> f (Maybe Text)) -> Address -> f Address
address_street1 = (Address -> Maybe Text)
-> (Address -> Maybe Text -> Address)
-> Lens Address Address (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Maybe Text
street1 :: Maybe Text
$sel:street1:Address' :: Address -> Maybe Text
street1} -> Maybe Text
street1) (\s :: Address
s@Address' {} Maybe Text
a -> Address
s {$sel:street1:Address' :: Maybe Text
street1 = Maybe Text
a} :: Address)
instance Core.FromJSON Address where
parseJSON :: Value -> Parser Address
parseJSON =
String -> (Object -> Parser Address) -> Value -> Parser Address
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Address"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address
Address'
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsRestricted")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
"Street3")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
"Landmark")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
"StateOrProvince")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
"Street2")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
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
"AddressId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Address)
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
"City")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Address)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Address)
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
"PhoneNumber")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Address)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Address)
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
"Company")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Address)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Address)
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
"Name")
Parser (Maybe Text -> Maybe Text -> Address)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Address)
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
"PrefectureOrDistrict")
Parser (Maybe Text -> Address)
-> Parser (Maybe Text) -> Parser Address
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
"Street1")
)
instance Prelude.Hashable Address
instance Prelude.NFData Address
instance Core.ToJSON Address where
toJSON :: Address -> Value
toJSON Address' {Maybe Bool
Maybe Text
street1 :: Maybe Text
prefectureOrDistrict :: Maybe Text
name :: Maybe Text
company :: Maybe Text
phoneNumber :: Maybe Text
city :: Maybe Text
addressId :: Maybe Text
street2 :: Maybe Text
stateOrProvince :: Maybe Text
country :: Maybe Text
postalCode :: Maybe Text
landmark :: Maybe Text
street3 :: Maybe Text
isRestricted :: Maybe Bool
$sel:street1:Address' :: Address -> Maybe Text
$sel:prefectureOrDistrict:Address' :: Address -> Maybe Text
$sel:name:Address' :: Address -> Maybe Text
$sel:company:Address' :: Address -> Maybe Text
$sel:phoneNumber:Address' :: Address -> Maybe Text
$sel:city:Address' :: Address -> Maybe Text
$sel:addressId:Address' :: Address -> Maybe Text
$sel:street2:Address' :: Address -> Maybe Text
$sel:stateOrProvince:Address' :: Address -> Maybe Text
$sel:country:Address' :: Address -> Maybe Text
$sel:postalCode:Address' :: Address -> Maybe Text
$sel:landmark:Address' :: Address -> Maybe Text
$sel:street3:Address' :: Address -> Maybe Text
$sel:isRestricted:Address' :: Address -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IsRestricted" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isRestricted,
(Text
"Street3" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
street3,
(Text
"Landmark" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
landmark,
(Text
"PostalCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
postalCode,
(Text
"Country" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
country,
(Text
"StateOrProvince" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
stateOrProvince,
(Text
"Street2" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
street2,
(Text
"AddressId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
addressId,
(Text
"City" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
city,
(Text
"PhoneNumber" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
phoneNumber,
(Text
"Company" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
company,
(Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"PrefectureOrDistrict" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
prefectureOrDistrict,
(Text
"Street1" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
street1
]
)