on develop help sign in
Regenerating gogol-civicinfo from updated service defintions
commit1dc8dd2aac09eb23288c8c50ac1481a8963aa029 authorBrendan Hay <brendan.g.hay@gmail.com> dateSat 11 Feb 2017, 11:36 (10 years ago) parent570e883
3 files changed+558−5
gogol-civicinfo/gen/Network/Google/CivicInfo.hs+44 gogol-civicinfo/gen/Network/Google/CivicInfo/Types.hs+44 gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs+470−5
gogol-civicinfo/gen/Network/Google/CivicInfo.hs+44
@@ -144,6 +144,14 @@ module Network.Google.CivicInfo
144144 , rirDivisions
145145 , rirOffices
146146
147+ -- ** VoterInfoSegmentResult
148+ , VoterInfoSegmentResult
149+ , voterInfoSegmentResult
150+ , visrResponse
151+ , visrGeneratedMillis
152+ , visrPostalAddress
153+ , visrRequest
154+
147155 -- ** DivisionSearchResult
148156 , DivisionSearchResult
149157 , divisionSearchResult
@@ -259,6 +267,7 @@ module Network.Google.CivicInfo
259267 -- ** VoterInfoRequest
260268 , VoterInfoRequest
261269 , voterInfoRequest
270+ , virVoterInfoSegmentResult
262271 , virContextParams
263272
264273 -- ** SimpleAddressType
@@ -277,6 +286,41 @@ module Network.Google.CivicInfo
277286 , contextParams
278287 , cpClientProFile
279288
289+ -- ** PostalAddress
290+ , PostalAddress
291+ , postalAddress
292+ , paAdministrativeAreaName
293+ , paRecipientName
294+ , paLanguageCode
295+ , paSortingCode
296+ , paPremiseName
297+ , paPostalCodeNumberExtension
298+ , paCountryNameCode
299+ , paDependentThoroughfaresConnector
300+ , paThoroughfareLeadingType
301+ , paSubAdministrativeAreaName
302+ , paThoroughfareTrailingType
303+ , paPostBoxNumber
304+ , paThoroughfarePreDirection
305+ , paLocalityName
306+ , paDependentThoroughfaresType
307+ , paThoroughfarePostDirection
308+ , paIsDisputed
309+ , paDependentThoroughfarePreDirection
310+ , paThoroughfareNumber
311+ , paDependentThoroughfaresIndicator
312+ , paDependentLocalityName
313+ , paFirmName
314+ , paCountryName
315+ , paDependentThoroughfareTrailingType
316+ , paDependentThoroughfareName
317+ , paDependentThoroughfarePostDirection
318+ , paAddressLines
319+ , paPostalCodeNumber
320+ , paThoroughfareName
321+ , paSubPremiseName
322+ , paDependentThoroughfareLeadingType
323+
280324 -- ** AdministrationRegion
281325 , AdministrationRegion
282326 , administrationRegion
gogol-civicinfo/gen/Network/Google/CivicInfo/Types.hs+44
@@ -118,6 +118,14 @@ module Network.Google.CivicInfo.Types
118118 , rirDivisions
119119 , rirOffices
120120
121+ -- * VoterInfoSegmentResult
122+ , VoterInfoSegmentResult
123+ , voterInfoSegmentResult
124+ , visrResponse
125+ , visrGeneratedMillis
126+ , visrPostalAddress
127+ , visrRequest
128+
121129 -- * DivisionSearchResult
122130 , DivisionSearchResult
123131 , divisionSearchResult
@@ -233,6 +241,7 @@ module Network.Google.CivicInfo.Types
233241 -- * VoterInfoRequest
234242 , VoterInfoRequest
235243 , voterInfoRequest
244+ , virVoterInfoSegmentResult
236245 , virContextParams
237246
238247 -- * SimpleAddressType
@@ -251,6 +260,41 @@ module Network.Google.CivicInfo.Types
251260 , contextParams
252261 , cpClientProFile
253262
263+ -- * PostalAddress
264+ , PostalAddress
265+ , postalAddress
266+ , paAdministrativeAreaName
267+ , paRecipientName
268+ , paLanguageCode
269+ , paSortingCode
270+ , paPremiseName
271+ , paPostalCodeNumberExtension
272+ , paCountryNameCode
273+ , paDependentThoroughfaresConnector
274+ , paThoroughfareLeadingType
275+ , paSubAdministrativeAreaName
276+ , paThoroughfareTrailingType
277+ , paPostBoxNumber
278+ , paThoroughfarePreDirection
279+ , paLocalityName
280+ , paDependentThoroughfaresType
281+ , paThoroughfarePostDirection
282+ , paIsDisputed
283+ , paDependentThoroughfarePreDirection
284+ , paThoroughfareNumber
285+ , paDependentThoroughfaresIndicator
286+ , paDependentLocalityName
287+ , paFirmName
288+ , paCountryName
289+ , paDependentThoroughfareTrailingType
290+ , paDependentThoroughfareName
291+ , paDependentThoroughfarePostDirection
292+ , paAddressLines
293+ , paPostalCodeNumber
294+ , paThoroughfareName
295+ , paSubPremiseName
296+ , paDependentThoroughfareLeadingType
297+
254298 -- * AdministrationRegion
255299 , AdministrationRegion
256300 , administrationRegion
gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs+470−5
@@ -899,6 +899,73 @@ instance ToJSON RepresentativeInfoResponse where
899899 ("divisions" .=) <$> _rirDivisions,
900900 ("offices" .=) <$> _rirOffices])
901901
902+--
903+-- /See:/ 'voterInfoSegmentResult' smart constructor.
904+data VoterInfoSegmentResult = VoterInfoSegmentResult'
905+ { _visrResponse :: !(Maybe VoterInfoResponse)
906+ , _visrGeneratedMillis :: !(Maybe (Textual Int64))
907+ , _visrPostalAddress :: !(Maybe PostalAddress)
908+ , _visrRequest :: !(Maybe VoterInfoRequest)
909+ } deriving (Eq,Show,Data,Typeable,Generic)
910+
911+-- | Creates a value of 'VoterInfoSegmentResult' with the minimum fields required to make a request.
912+--
913+-- Use one of the following lenses to modify other fields as desired:
914+--
915+-- * 'visrResponse'
916+--
917+-- * 'visrGeneratedMillis'
918+--
919+-- * 'visrPostalAddress'
920+--
921+-- * 'visrRequest'
922+voterInfoSegmentResult
923+ :: VoterInfoSegmentResult
924+voterInfoSegmentResult =
925+ VoterInfoSegmentResult'
926+ { _visrResponse = Nothing
927+ , _visrGeneratedMillis = Nothing
928+ , _visrPostalAddress = Nothing
929+ , _visrRequest = Nothing
930+ }
931+
932+visrResponse :: Lens' VoterInfoSegmentResult (Maybe VoterInfoResponse)
933+visrResponse
934+ = lens _visrResponse (\ s a -> s{_visrResponse = a})
935+
936+visrGeneratedMillis :: Lens' VoterInfoSegmentResult (Maybe Int64)
937+visrGeneratedMillis
938+ = lens _visrGeneratedMillis
939+ (\ s a -> s{_visrGeneratedMillis = a})
940+ . mapping _Coerce
941+
942+visrPostalAddress :: Lens' VoterInfoSegmentResult (Maybe PostalAddress)
943+visrPostalAddress
944+ = lens _visrPostalAddress
945+ (\ s a -> s{_visrPostalAddress = a})
946+
947+visrRequest :: Lens' VoterInfoSegmentResult (Maybe VoterInfoRequest)
948+visrRequest
949+ = lens _visrRequest (\ s a -> s{_visrRequest = a})
950+
951+instance FromJSON VoterInfoSegmentResult where
952+ parseJSON
953+ = withObject "VoterInfoSegmentResult"
954+ (\ o ->
955+ VoterInfoSegmentResult' <$>
956+ (o .:? "response") <*> (o .:? "generatedMillis") <*>
957+ (o .:? "postalAddress")
958+ <*> (o .:? "request"))
959+
960+instance ToJSON VoterInfoSegmentResult where
961+ toJSON VoterInfoSegmentResult'{..}
962+ = object
963+ (catMaybes
964+ [("response" .=) <$> _visrResponse,
965+ ("generatedMillis" .=) <$> _visrGeneratedMillis,
966+ ("postalAddress" .=) <$> _visrPostalAddress,
967+ ("request" .=) <$> _visrRequest])
968+
902969-- | Represents a political geographic division that matches the requested
903970-- query.
904971--
@@ -1988,22 +2055,31 @@ instance ToJSON ElectoralDistrict where
19882055-- | A request for information about a voter.
19892056--
19902057-- /See:/ 'voterInfoRequest' smart constructor.
1991−newtype VoterInfoRequest = VoterInfoRequest'
1992− { _virContextParams :: Maybe ContextParams
2058+data VoterInfoRequest = VoterInfoRequest'
2059+ { _virVoterInfoSegmentResult :: !(Maybe VoterInfoSegmentResult)
2060+ , _virContextParams :: !(Maybe ContextParams)
19932061 } deriving (Eq,Show,Data,Typeable,Generic)
19942062
19952063-- | Creates a value of 'VoterInfoRequest' with the minimum fields required to make a request.
19962064--
19972065-- Use one of the following lenses to modify other fields as desired:
19982066--
2067+-- * 'virVoterInfoSegmentResult'
2068+--
19992069-- * 'virContextParams'
20002070voterInfoRequest
20012071 :: VoterInfoRequest
20022072voterInfoRequest =
20032073 VoterInfoRequest'
2004− { _virContextParams = Nothing
2074+ { _virVoterInfoSegmentResult = Nothing
2075+ , _virContextParams = Nothing
20052076 }
20062077
2078+virVoterInfoSegmentResult :: Lens' VoterInfoRequest (Maybe VoterInfoSegmentResult)
2079+virVoterInfoSegmentResult
2080+ = lens _virVoterInfoSegmentResult
2081+ (\ s a -> s{_virVoterInfoSegmentResult = a})
2082+
20072083virContextParams :: Lens' VoterInfoRequest (Maybe ContextParams)
20082084virContextParams
20092085 = lens _virContextParams
@@ -2013,13 +2089,17 @@ instance FromJSON VoterInfoRequest where
20132089 parseJSON
20142090 = withObject "VoterInfoRequest"
20152091 (\ o ->
2016− VoterInfoRequest' <$> (o .:? "contextParams"))
2092+ VoterInfoRequest' <$>
2093+ (o .:? "voterInfoSegmentResult") <*>
2094+ (o .:? "contextParams"))
20172095
20182096instance ToJSON VoterInfoRequest where
20192097 toJSON VoterInfoRequest'{..}
20202098 = object
20212099 (catMaybes
2022− [("contextParams" .=) <$> _virContextParams])
2100+ [("voterInfoSegmentResult" .=) <$>
2101+ _virVoterInfoSegmentResult,
2102+ ("contextParams" .=) <$> _virContextParams])
20232103
20242104-- | A simple representation of an address.
20252105--
@@ -2150,6 +2230,391 @@ instance ToJSON ContextParams where
21502230 (catMaybes
21512231 [("clientProfile" .=) <$> _cpClientProFile])
21522232
2233+--
2234+-- /See:/ 'postalAddress' smart constructor.
2235+data PostalAddress = PostalAddress'
2236+ { _paAdministrativeAreaName :: !(Maybe Text)
2237+ , _paRecipientName :: !(Maybe Text)
2238+ , _paLanguageCode :: !(Maybe Text)
2239+ , _paSortingCode :: !(Maybe Text)
2240+ , _paPremiseName :: !(Maybe Text)
2241+ , _paPostalCodeNumberExtension :: !(Maybe Text)
2242+ , _paCountryNameCode :: !(Maybe Text)
2243+ , _paDependentThoroughfaresConnector :: !(Maybe Text)
2244+ , _paThoroughfareLeadingType :: !(Maybe Text)
2245+ , _paSubAdministrativeAreaName :: !(Maybe Text)
2246+ , _paThoroughfareTrailingType :: !(Maybe Text)
2247+ , _paPostBoxNumber :: !(Maybe Text)
2248+ , _paThoroughfarePreDirection :: !(Maybe Text)
2249+ , _paLocalityName :: !(Maybe Text)
2250+ , _paDependentThoroughfaresType :: !(Maybe Text)
2251+ , _paThoroughfarePostDirection :: !(Maybe Text)
2252+ , _paIsDisputed :: !(Maybe Bool)
2253+ , _paDependentThoroughfarePreDirection :: !(Maybe Text)
2254+ , _paThoroughfareNumber :: !(Maybe Text)
2255+ , _paDependentThoroughfaresIndicator :: !(Maybe Text)
2256+ , _paDependentLocalityName :: !(Maybe Text)
2257+ , _paFirmName :: !(Maybe Text)
2258+ , _paCountryName :: !(Maybe Text)
2259+ , _paDependentThoroughfareTrailingType :: !(Maybe Text)
2260+ , _paDependentThoroughfareName :: !(Maybe Text)
2261+ , _paDependentThoroughfarePostDirection :: !(Maybe Text)
2262+ , _paAddressLines :: !(Maybe [Text])
2263+ , _paPostalCodeNumber :: !(Maybe Text)
2264+ , _paThoroughfareName :: !(Maybe Text)
2265+ , _paSubPremiseName :: !(Maybe Text)
2266+ , _paDependentThoroughfareLeadingType :: !(Maybe Text)
2267+ } deriving (Eq,Show,Data,Typeable,Generic)
2268+
2269+-- | Creates a value of 'PostalAddress' with the minimum fields required to make a request.
2270+--
2271+-- Use one of the following lenses to modify other fields as desired:
2272+--
2273+-- * 'paAdministrativeAreaName'
2274+--
2275+-- * 'paRecipientName'
2276+--
2277+-- * 'paLanguageCode'
2278+--
2279+-- * 'paSortingCode'
2280+--
2281+-- * 'paPremiseName'
2282+--
2283+-- * 'paPostalCodeNumberExtension'
2284+--
2285+-- * 'paCountryNameCode'
2286+--
2287+-- * 'paDependentThoroughfaresConnector'
2288+--
2289+-- * 'paThoroughfareLeadingType'
2290+--
2291+-- * 'paSubAdministrativeAreaName'
2292+--
2293+-- * 'paThoroughfareTrailingType'
2294+--
2295+-- * 'paPostBoxNumber'
2296+--
2297+-- * 'paThoroughfarePreDirection'
2298+--
2299+-- * 'paLocalityName'
2300+--
2301+-- * 'paDependentThoroughfaresType'
2302+--
2303+-- * 'paThoroughfarePostDirection'
2304+--
2305+-- * 'paIsDisputed'
2306+--
2307+-- * 'paDependentThoroughfarePreDirection'
2308+--
2309+-- * 'paThoroughfareNumber'
2310+--
2311+-- * 'paDependentThoroughfaresIndicator'
2312+--
2313+-- * 'paDependentLocalityName'
2314+--
2315+-- * 'paFirmName'
2316+--
2317+-- * 'paCountryName'
2318+--
2319+-- * 'paDependentThoroughfareTrailingType'
2320+--
2321+-- * 'paDependentThoroughfareName'
2322+--
2323+-- * 'paDependentThoroughfarePostDirection'
2324+--
2325+-- * 'paAddressLines'
2326+--
2327+-- * 'paPostalCodeNumber'
2328+--
2329+-- * 'paThoroughfareName'
2330+--
2331+-- * 'paSubPremiseName'
2332+--
2333+-- * 'paDependentThoroughfareLeadingType'
2334+postalAddress
2335+ :: PostalAddress
2336+postalAddress =
2337+ PostalAddress'
2338+ { _paAdministrativeAreaName = Nothing
2339+ , _paRecipientName = Nothing
2340+ , _paLanguageCode = Nothing
2341+ , _paSortingCode = Nothing
2342+ , _paPremiseName = Nothing
2343+ , _paPostalCodeNumberExtension = Nothing
2344+ , _paCountryNameCode = Nothing
2345+ , _paDependentThoroughfaresConnector = Nothing
2346+ , _paThoroughfareLeadingType = Nothing
2347+ , _paSubAdministrativeAreaName = Nothing
2348+ , _paThoroughfareTrailingType = Nothing
2349+ , _paPostBoxNumber = Nothing
2350+ , _paThoroughfarePreDirection = Nothing
2351+ , _paLocalityName = Nothing
2352+ , _paDependentThoroughfaresType = Nothing
2353+ , _paThoroughfarePostDirection = Nothing
2354+ , _paIsDisputed = Nothing
2355+ , _paDependentThoroughfarePreDirection = Nothing
2356+ , _paThoroughfareNumber = Nothing
2357+ , _paDependentThoroughfaresIndicator = Nothing
2358+ , _paDependentLocalityName = Nothing
2359+ , _paFirmName = Nothing
2360+ , _paCountryName = Nothing
2361+ , _paDependentThoroughfareTrailingType = Nothing
2362+ , _paDependentThoroughfareName = Nothing
2363+ , _paDependentThoroughfarePostDirection = Nothing
2364+ , _paAddressLines = Nothing
2365+ , _paPostalCodeNumber = Nothing
2366+ , _paThoroughfareName = Nothing
2367+ , _paSubPremiseName = Nothing
2368+ , _paDependentThoroughfareLeadingType = Nothing
2369+ }
2370+
2371+paAdministrativeAreaName :: Lens' PostalAddress (Maybe Text)
2372+paAdministrativeAreaName
2373+ = lens _paAdministrativeAreaName
2374+ (\ s a -> s{_paAdministrativeAreaName = a})
2375+
2376+paRecipientName :: Lens' PostalAddress (Maybe Text)
2377+paRecipientName
2378+ = lens _paRecipientName
2379+ (\ s a -> s{_paRecipientName = a})
2380+
2381+paLanguageCode :: Lens' PostalAddress (Maybe Text)
2382+paLanguageCode
2383+ = lens _paLanguageCode
2384+ (\ s a -> s{_paLanguageCode = a})
2385+
2386+paSortingCode :: Lens' PostalAddress (Maybe Text)
2387+paSortingCode
2388+ = lens _paSortingCode
2389+ (\ s a -> s{_paSortingCode = a})
2390+
2391+paPremiseName :: Lens' PostalAddress (Maybe Text)
2392+paPremiseName
2393+ = lens _paPremiseName
2394+ (\ s a -> s{_paPremiseName = a})
2395+
2396+paPostalCodeNumberExtension :: Lens' PostalAddress (Maybe Text)
2397+paPostalCodeNumberExtension
2398+ = lens _paPostalCodeNumberExtension
2399+ (\ s a -> s{_paPostalCodeNumberExtension = a})
2400+
2401+paCountryNameCode :: Lens' PostalAddress (Maybe Text)
2402+paCountryNameCode
2403+ = lens _paCountryNameCode
2404+ (\ s a -> s{_paCountryNameCode = a})
2405+
2406+paDependentThoroughfaresConnector :: Lens' PostalAddress (Maybe Text)
2407+paDependentThoroughfaresConnector
2408+ = lens _paDependentThoroughfaresConnector
2409+ (\ s a -> s{_paDependentThoroughfaresConnector = a})
2410+
2411+paThoroughfareLeadingType :: Lens' PostalAddress (Maybe Text)
2412+paThoroughfareLeadingType
2413+ = lens _paThoroughfareLeadingType
2414+ (\ s a -> s{_paThoroughfareLeadingType = a})
2415+
2416+paSubAdministrativeAreaName :: Lens' PostalAddress (Maybe Text)
2417+paSubAdministrativeAreaName
2418+ = lens _paSubAdministrativeAreaName
2419+ (\ s a -> s{_paSubAdministrativeAreaName = a})
2420+
2421+paThoroughfareTrailingType :: Lens' PostalAddress (Maybe Text)
2422+paThoroughfareTrailingType
2423+ = lens _paThoroughfareTrailingType
2424+ (\ s a -> s{_paThoroughfareTrailingType = a})
2425+
2426+paPostBoxNumber :: Lens' PostalAddress (Maybe Text)
2427+paPostBoxNumber
2428+ = lens _paPostBoxNumber
2429+ (\ s a -> s{_paPostBoxNumber = a})
2430+
2431+paThoroughfarePreDirection :: Lens' PostalAddress (Maybe Text)
2432+paThoroughfarePreDirection
2433+ = lens _paThoroughfarePreDirection
2434+ (\ s a -> s{_paThoroughfarePreDirection = a})
2435+
2436+paLocalityName :: Lens' PostalAddress (Maybe Text)
2437+paLocalityName
2438+ = lens _paLocalityName
2439+ (\ s a -> s{_paLocalityName = a})
2440+
2441+paDependentThoroughfaresType :: Lens' PostalAddress (Maybe Text)
2442+paDependentThoroughfaresType
2443+ = lens _paDependentThoroughfaresType
2444+ (\ s a -> s{_paDependentThoroughfaresType = a})
2445+
2446+paThoroughfarePostDirection :: Lens' PostalAddress (Maybe Text)
2447+paThoroughfarePostDirection
2448+ = lens _paThoroughfarePostDirection
2449+ (\ s a -> s{_paThoroughfarePostDirection = a})
2450+
2451+paIsDisputed :: Lens' PostalAddress (Maybe Bool)
2452+paIsDisputed
2453+ = lens _paIsDisputed (\ s a -> s{_paIsDisputed = a})
2454+
2455+paDependentThoroughfarePreDirection :: Lens' PostalAddress (Maybe Text)
2456+paDependentThoroughfarePreDirection
2457+ = lens _paDependentThoroughfarePreDirection
2458+ (\ s a ->
2459+ s{_paDependentThoroughfarePreDirection = a})
2460+
2461+paThoroughfareNumber :: Lens' PostalAddress (Maybe Text)
2462+paThoroughfareNumber
2463+ = lens _paThoroughfareNumber
2464+ (\ s a -> s{_paThoroughfareNumber = a})
2465+
2466+paDependentThoroughfaresIndicator :: Lens' PostalAddress (Maybe Text)
2467+paDependentThoroughfaresIndicator
2468+ = lens _paDependentThoroughfaresIndicator
2469+ (\ s a -> s{_paDependentThoroughfaresIndicator = a})
2470+
2471+paDependentLocalityName :: Lens' PostalAddress (Maybe Text)
2472+paDependentLocalityName
2473+ = lens _paDependentLocalityName
2474+ (\ s a -> s{_paDependentLocalityName = a})
2475+
2476+paFirmName :: Lens' PostalAddress (Maybe Text)
2477+paFirmName
2478+ = lens _paFirmName (\ s a -> s{_paFirmName = a})
2479+
2480+paCountryName :: Lens' PostalAddress (Maybe Text)
2481+paCountryName
2482+ = lens _paCountryName
2483+ (\ s a -> s{_paCountryName = a})
2484+
2485+paDependentThoroughfareTrailingType :: Lens' PostalAddress (Maybe Text)
2486+paDependentThoroughfareTrailingType
2487+ = lens _paDependentThoroughfareTrailingType
2488+ (\ s a ->
2489+ s{_paDependentThoroughfareTrailingType = a})
2490+
2491+paDependentThoroughfareName :: Lens' PostalAddress (Maybe Text)
2492+paDependentThoroughfareName
2493+ = lens _paDependentThoroughfareName
2494+ (\ s a -> s{_paDependentThoroughfareName = a})
2495+
2496+paDependentThoroughfarePostDirection :: Lens' PostalAddress (Maybe Text)
2497+paDependentThoroughfarePostDirection
2498+ = lens _paDependentThoroughfarePostDirection
2499+ (\ s a ->
2500+ s{_paDependentThoroughfarePostDirection = a})
2501+
2502+paAddressLines :: Lens' PostalAddress [Text]
2503+paAddressLines
2504+ = lens _paAddressLines
2505+ (\ s a -> s{_paAddressLines = a})
2506+ . _Default
2507+ . _Coerce
2508+
2509+paPostalCodeNumber :: Lens' PostalAddress (Maybe Text)
2510+paPostalCodeNumber
2511+ = lens _paPostalCodeNumber
2512+ (\ s a -> s{_paPostalCodeNumber = a})
2513+
2514+paThoroughfareName :: Lens' PostalAddress (Maybe Text)
2515+paThoroughfareName
2516+ = lens _paThoroughfareName
2517+ (\ s a -> s{_paThoroughfareName = a})
2518+
2519+paSubPremiseName :: Lens' PostalAddress (Maybe Text)
2520+paSubPremiseName
2521+ = lens _paSubPremiseName
2522+ (\ s a -> s{_paSubPremiseName = a})
2523+
2524+paDependentThoroughfareLeadingType :: Lens' PostalAddress (Maybe Text)
2525+paDependentThoroughfareLeadingType
2526+ = lens _paDependentThoroughfareLeadingType
2527+ (\ s a -> s{_paDependentThoroughfareLeadingType = a})
2528+
2529+instance FromJSON PostalAddress where
2530+ parseJSON
2531+ = withObject "PostalAddress"
2532+ (\ o ->
2533+ PostalAddress' <$>
2534+ (o .:? "administrativeAreaName") <*>
2535+ (o .:? "recipientName")
2536+ <*> (o .:? "languageCode")
2537+ <*> (o .:? "sortingCode")
2538+ <*> (o .:? "premiseName")
2539+ <*> (o .:? "postalCodeNumberExtension")
2540+ <*> (o .:? "countryNameCode")
2541+ <*> (o .:? "dependentThoroughfaresConnector")
2542+ <*> (o .:? "thoroughfareLeadingType")
2543+ <*> (o .:? "subAdministrativeAreaName")
2544+ <*> (o .:? "thoroughfareTrailingType")
2545+ <*> (o .:? "postBoxNumber")
2546+ <*> (o .:? "thoroughfarePreDirection")
2547+ <*> (o .:? "localityName")
2548+ <*> (o .:? "dependentThoroughfaresType")
2549+ <*> (o .:? "thoroughfarePostDirection")
2550+ <*> (o .:? "isDisputed")
2551+ <*> (o .:? "dependentThoroughfarePreDirection")
2552+ <*> (o .:? "thoroughfareNumber")
2553+ <*> (o .:? "dependentThoroughfaresIndicator")
2554+ <*> (o .:? "dependentLocalityName")
2555+ <*> (o .:? "firmName")
2556+ <*> (o .:? "countryName")
2557+ <*> (o .:? "dependentThoroughfareTrailingType")
2558+ <*> (o .:? "dependentThoroughfareName")
2559+ <*> (o .:? "dependentThoroughfarePostDirection")
2560+ <*> (o .:? "addressLines" .!= mempty)
2561+ <*> (o .:? "postalCodeNumber")
2562+ <*> (o .:? "thoroughfareName")
2563+ <*> (o .:? "subPremiseName")
2564+ <*> (o .:? "dependentThoroughfareLeadingType"))
2565+
2566+instance ToJSON PostalAddress where
2567+ toJSON PostalAddress'{..}
2568+ = object
2569+ (catMaybes
2570+ [("administrativeAreaName" .=) <$>
2571+ _paAdministrativeAreaName,
2572+ ("recipientName" .=) <$> _paRecipientName,
2573+ ("languageCode" .=) <$> _paLanguageCode,
2574+ ("sortingCode" .=) <$> _paSortingCode,
2575+ ("premiseName" .=) <$> _paPremiseName,
2576+ ("postalCodeNumberExtension" .=) <$>
2577+ _paPostalCodeNumberExtension,
2578+ ("countryNameCode" .=) <$> _paCountryNameCode,
2579+ ("dependentThoroughfaresConnector" .=) <$>
2580+ _paDependentThoroughfaresConnector,
2581+ ("thoroughfareLeadingType" .=) <$>
2582+ _paThoroughfareLeadingType,
2583+ ("subAdministrativeAreaName" .=) <$>
2584+ _paSubAdministrativeAreaName,
2585+ ("thoroughfareTrailingType" .=) <$>
2586+ _paThoroughfareTrailingType,
2587+ ("postBoxNumber" .=) <$> _paPostBoxNumber,
2588+ ("thoroughfarePreDirection" .=) <$>
2589+ _paThoroughfarePreDirection,
2590+ ("localityName" .=) <$> _paLocalityName,
2591+ ("dependentThoroughfaresType" .=) <$>
2592+ _paDependentThoroughfaresType,
2593+ ("thoroughfarePostDirection" .=) <$>
2594+ _paThoroughfarePostDirection,
2595+ ("isDisputed" .=) <$> _paIsDisputed,
2596+ ("dependentThoroughfarePreDirection" .=) <$>
2597+ _paDependentThoroughfarePreDirection,
2598+ ("thoroughfareNumber" .=) <$> _paThoroughfareNumber,
2599+ ("dependentThoroughfaresIndicator" .=) <$>
2600+ _paDependentThoroughfaresIndicator,
2601+ ("dependentLocalityName" .=) <$>
2602+ _paDependentLocalityName,
2603+ ("firmName" .=) <$> _paFirmName,
2604+ ("countryName" .=) <$> _paCountryName,
2605+ ("dependentThoroughfareTrailingType" .=) <$>
2606+ _paDependentThoroughfareTrailingType,
2607+ ("dependentThoroughfareName" .=) <$>
2608+ _paDependentThoroughfareName,
2609+ ("dependentThoroughfarePostDirection" .=) <$>
2610+ _paDependentThoroughfarePostDirection,
2611+ ("addressLines" .=) <$> _paAddressLines,
2612+ ("postalCodeNumber" .=) <$> _paPostalCodeNumber,
2613+ ("thoroughfareName" .=) <$> _paThoroughfareName,
2614+ ("subPremiseName" .=) <$> _paSubPremiseName,
2615+ ("dependentThoroughfareLeadingType" .=) <$>
2616+ _paDependentThoroughfareLeadingType])
2617+
21532618-- | Describes information about a regional election administrative area.
21542619--
21552620-- /See:/ 'administrationRegion' smart constructor.