@vepler/sdk 2.30.2 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +90 -85
  2. package/dist/commonjs/funcs/areasGetCoverage.d.ts +24 -0
  3. package/dist/commonjs/funcs/areasGetCoverage.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/areasGetCoverage.js +130 -0
  5. package/dist/commonjs/funcs/areasGetCoverage.js.map +1 -0
  6. package/dist/commonjs/funcs/metricsGetMetricValues.js +9 -8
  7. package/dist/commonjs/funcs/metricsGetMetricValues.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/sdk/areas.d.ts +13 -0
  11. package/dist/commonjs/sdk/areas.d.ts.map +1 -1
  12. package/dist/commonjs/sdk/areas.js +16 -0
  13. package/dist/commonjs/sdk/areas.js.map +1 -1
  14. package/dist/commonjs/sdk/models/errors/getareacoverage.d.ts +156 -0
  15. package/dist/commonjs/sdk/models/errors/getareacoverage.d.ts.map +1 -0
  16. package/dist/commonjs/sdk/models/errors/getareacoverage.js +153 -0
  17. package/dist/commonjs/sdk/models/errors/getareacoverage.js.map +1 -0
  18. package/dist/commonjs/sdk/models/errors/index.d.ts +1 -0
  19. package/dist/commonjs/sdk/models/errors/index.d.ts.map +1 -1
  20. package/dist/commonjs/sdk/models/errors/index.js +1 -0
  21. package/dist/commonjs/sdk/models/errors/index.js.map +1 -1
  22. package/dist/commonjs/sdk/models/operations/getareacoverage.d.ts +408 -0
  23. package/dist/commonjs/sdk/models/operations/getareacoverage.d.ts.map +1 -0
  24. package/dist/commonjs/sdk/models/operations/getareacoverage.js +343 -0
  25. package/dist/commonjs/sdk/models/operations/getareacoverage.js.map +1 -0
  26. package/dist/commonjs/sdk/models/operations/getmetricvalues.d.ts +36 -85
  27. package/dist/commonjs/sdk/models/operations/getmetricvalues.d.ts.map +1 -1
  28. package/dist/commonjs/sdk/models/operations/getmetricvalues.js +12 -70
  29. package/dist/commonjs/sdk/models/operations/getmetricvalues.js.map +1 -1
  30. package/dist/commonjs/sdk/models/operations/index.d.ts +1 -0
  31. package/dist/commonjs/sdk/models/operations/index.d.ts.map +1 -1
  32. package/dist/commonjs/sdk/models/operations/index.js +1 -0
  33. package/dist/commonjs/sdk/models/operations/index.js.map +1 -1
  34. package/dist/esm/funcs/areasGetCoverage.d.ts +24 -0
  35. package/dist/esm/funcs/areasGetCoverage.d.ts.map +1 -0
  36. package/dist/esm/funcs/areasGetCoverage.js +94 -0
  37. package/dist/esm/funcs/areasGetCoverage.js.map +1 -0
  38. package/dist/esm/funcs/metricsGetMetricValues.js +9 -8
  39. package/dist/esm/funcs/metricsGetMetricValues.js.map +1 -1
  40. package/dist/esm/lib/config.d.ts +2 -2
  41. package/dist/esm/lib/config.js +2 -2
  42. package/dist/esm/sdk/areas.d.ts +13 -0
  43. package/dist/esm/sdk/areas.d.ts.map +1 -1
  44. package/dist/esm/sdk/areas.js +16 -0
  45. package/dist/esm/sdk/areas.js.map +1 -1
  46. package/dist/esm/sdk/models/errors/getareacoverage.d.ts +156 -0
  47. package/dist/esm/sdk/models/errors/getareacoverage.d.ts.map +1 -0
  48. package/dist/esm/sdk/models/errors/getareacoverage.js +114 -0
  49. package/dist/esm/sdk/models/errors/getareacoverage.js.map +1 -0
  50. package/dist/esm/sdk/models/errors/index.d.ts +1 -0
  51. package/dist/esm/sdk/models/errors/index.d.ts.map +1 -1
  52. package/dist/esm/sdk/models/errors/index.js +1 -0
  53. package/dist/esm/sdk/models/errors/index.js.map +1 -1
  54. package/dist/esm/sdk/models/operations/getareacoverage.d.ts +408 -0
  55. package/dist/esm/sdk/models/operations/getareacoverage.d.ts.map +1 -0
  56. package/dist/esm/sdk/models/operations/getareacoverage.js +303 -0
  57. package/dist/esm/sdk/models/operations/getareacoverage.js.map +1 -0
  58. package/dist/esm/sdk/models/operations/getmetricvalues.d.ts +36 -85
  59. package/dist/esm/sdk/models/operations/getmetricvalues.d.ts.map +1 -1
  60. package/dist/esm/sdk/models/operations/getmetricvalues.js +11 -69
  61. package/dist/esm/sdk/models/operations/getmetricvalues.js.map +1 -1
  62. package/dist/esm/sdk/models/operations/index.d.ts +1 -0
  63. package/dist/esm/sdk/models/operations/index.d.ts.map +1 -1
  64. package/dist/esm/sdk/models/operations/index.js +1 -0
  65. package/dist/esm/sdk/models/operations/index.js.map +1 -1
  66. package/package.json +1 -1
  67. package/src/funcs/areasGetCoverage.ts +193 -0
  68. package/src/funcs/metricsGetMetricValues.ts +9 -8
  69. package/src/lib/config.ts +2 -2
  70. package/src/sdk/areas.ts +24 -0
  71. package/src/sdk/models/errors/getareacoverage.ts +264 -0
  72. package/src/sdk/models/errors/index.ts +1 -0
  73. package/src/sdk/models/operations/getareacoverage.ts +530 -0
  74. package/src/sdk/models/operations/getmetricvalues.ts +48 -102
  75. package/src/sdk/models/operations/index.ts +1 -0
@@ -0,0 +1,530 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../../lib/schemas.js";
7
+ import * as openEnums from "../../types/enums.js";
8
+ import { ClosedEnum, OpenEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Environmental or geographic layer type for coverage calculations
14
+ */
15
+ export const CoverageType = {
16
+ FloodRisk: "flood_risk",
17
+ NoiseRoadLden: "noise_road_lden",
18
+ NoiseRailLden: "noise_rail_lden",
19
+ NoiseIndustryLden: "noise_industry_lden",
20
+ RadonLevel: "radon_level",
21
+ Ramsar: "ramsar",
22
+ SpecialAreaConservation: "special_area_conservation",
23
+ SpecialProtectionArea: "special_protection_area",
24
+ AncientWoodland: "ancient_woodland",
25
+ NativeWoodlandSurvey: "native_woodland_survey",
26
+ AreaNaturalBeauty: "area_natural_beauty",
27
+ NationalScenicArea: "national_scenic_area",
28
+ PriorityHabitats: "priority_habitats",
29
+ ProtectedWoodlands: "protected_woodlands",
30
+ Natura2000: "natura_2000",
31
+ Aonb: "aonb",
32
+ ProtectedScenicLandscapes: "protected_scenic_landscapes",
33
+ HistoricLandfillSite: "historic_landfill_site",
34
+ WorldHeritageSite: "world_heritage_site",
35
+ ProtectedWreckSite: "protected_wreck_site",
36
+ ScheduledMonument: "scheduled_monument",
37
+ Battlefield: "battlefield",
38
+ BrownfieldLand: "brownfield_land",
39
+ GreenBelt: "green_belt",
40
+ CommonLand: "common_land",
41
+ BuiltUpArea250: "built_up_area_250",
42
+ ParcelsGb: "parcels_gb",
43
+ Building: "building",
44
+ } as const;
45
+ /**
46
+ * Environmental or geographic layer type for coverage calculations
47
+ */
48
+ export type CoverageType = ClosedEnum<typeof CoverageType>;
49
+
50
+ /**
51
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
52
+ */
53
+ export const IntersectsWith = {
54
+ Postcode: "postcode",
55
+ Outcode: "outcode",
56
+ UkOutputArea: "uk_output_area",
57
+ Lsoa21: "lsoa21",
58
+ Ward: "ward",
59
+ Parish: "parish",
60
+ LocalAuthorityDistrict: "local_authority_district",
61
+ County: "county",
62
+ Country: "country",
63
+ CountyElectoralDivision: "county_electoral_division",
64
+ DistrictBoroughUnitary: "district_borough_unitary",
65
+ DistrictBoroughUnitaryWard: "district_borough_unitary_ward",
66
+ LocalPlanningAuthority: "local_planning_authority",
67
+ CeremonialCountiesRegion: "ceremonial_counties_region",
68
+ EnglishRegion: "english_region",
69
+ CountryRegion: "country_region",
70
+ UnitaryElectoralDivision: "unitary_electoral_division",
71
+ Province: "province",
72
+ ElectoralDivision: "electoral_division",
73
+ GreaterLondonConstituency: "greater_london_constituency",
74
+ ScotlandAndWalesConstituency: "scotland_and_wales_constituency",
75
+ ScotlandAndWalesRegion: "scotland_and_wales_region",
76
+ WestminsterConstituency: "westminster_constituency",
77
+ Building: "building",
78
+ BuiltUpArea250: "built_up_area_250",
79
+ GreenBelt: "green_belt",
80
+ CommonLand: "common_land",
81
+ ParcelsGb: "parcels_gb",
82
+ FloodRisk: "flood_risk",
83
+ Ramsar: "ramsar",
84
+ Natura2000: "natura_2000",
85
+ Aonb: "aonb",
86
+ AreaNaturalBeauty: "area_natural_beauty",
87
+ NationalScenicArea: "national_scenic_area",
88
+ SpecialAreaConservation: "special_area_conservation",
89
+ SpecialProtectionArea: "special_protection_area",
90
+ AncientWoodland: "ancient_woodland",
91
+ NativeWoodlandSurvey: "native_woodland_survey",
92
+ PriorityHabitats: "priority_habitats",
93
+ ProtectedWoodlands: "protected_woodlands",
94
+ ProtectedWoodland: "protected_woodland",
95
+ ProtectedScenicLandscapes: "protected_scenic_landscapes",
96
+ WorldHeritageSite: "world_heritage_site",
97
+ ScheduledMonument: "scheduled_monument",
98
+ Battlefield: "battlefield",
99
+ ProtectedWreckSite: "protected_wreck_site",
100
+ HistoricLandfillSite: "historic_landfill_site",
101
+ RadonLevel: "radon_level",
102
+ BrownfieldLand: "brownfield_land",
103
+ NoiseRailLden: "noise_rail_lden",
104
+ NoiseRoadLden: "noise_road_lden",
105
+ NoiseIndustryLden: "noise_industry_lden",
106
+ } as const;
107
+ /**
108
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
109
+ */
110
+ export type IntersectsWith = ClosedEnum<typeof IntersectsWith>;
111
+
112
+ export type GetAreaCoverageRequest = {
113
+ /**
114
+ * Coverage layer type for environmental coverage analysis (e.g., flood_risk, noise_road_lden). Mutually exclusive with targetCode.
115
+ */
116
+ coverageType?: CoverageType | undefined;
117
+ /**
118
+ * Entity type to calculate intersection coverage for (e.g., building, parcels_gb). Only applicable with coverageType.
119
+ */
120
+ intersectsWith?: IntersectsWith | undefined;
121
+ /**
122
+ * Source geography code to analyse coverage for (e.g., E05000001 for a ward)
123
+ */
124
+ sourceCode: string;
125
+ /**
126
+ * Target geography code for geography-to-geography coverage calculation. Mutually exclusive with coverageType.
127
+ */
128
+ targetCode?: string | undefined;
129
+ };
130
+
131
+ /**
132
+ * Additional metadata about the coverage result
133
+ */
134
+ export type GetAreaCoverageMetadata = {
135
+ /**
136
+ * Category name for categorised data (e.g., high, medium, low)
137
+ */
138
+ category?: string | undefined;
139
+ /**
140
+ * Component layer types for composite coverage types
141
+ */
142
+ componentLayers?: Array<string> | undefined;
143
+ /**
144
+ * Decibel range for noise coverage (e.g., '<55dB', '55-70dB', '>70dB')
145
+ */
146
+ dbRange?: string | undefined;
147
+ /**
148
+ * Count of entities affected (for intersectsWith queries)
149
+ */
150
+ entityCount?: number | undefined;
151
+ /**
152
+ * Number of features contributing to this coverage result
153
+ */
154
+ featureCount?: number | undefined;
155
+ /**
156
+ * Total count of entities in source area (for intersectsWith queries)
157
+ */
158
+ totalEntities?: number | undefined;
159
+ };
160
+
161
+ /**
162
+ * Individual coverage calculation result
163
+ */
164
+ export type Coverage = {
165
+ /**
166
+ * Area covered in square metres
167
+ */
168
+ area: number;
169
+ /**
170
+ * Identifier for the coverage area (e.g., 'flood_risk_high', 'E06000001', '<55dB')
171
+ */
172
+ identifier: string;
173
+ /**
174
+ * Additional metadata about the coverage result
175
+ */
176
+ metadata?: GetAreaCoverageMetadata | undefined;
177
+ /**
178
+ * Coverage percentage of the relevant area (source area or intersecting entities)
179
+ */
180
+ percentage: number;
181
+ };
182
+
183
+ /**
184
+ * Environmental or geographic layer type for coverage calculations
185
+ */
186
+ export const GetAreaCoverageCoverageType = {
187
+ FloodRisk: "flood_risk",
188
+ NoiseRoadLden: "noise_road_lden",
189
+ NoiseRailLden: "noise_rail_lden",
190
+ NoiseIndustryLden: "noise_industry_lden",
191
+ RadonLevel: "radon_level",
192
+ Ramsar: "ramsar",
193
+ SpecialAreaConservation: "special_area_conservation",
194
+ SpecialProtectionArea: "special_protection_area",
195
+ AncientWoodland: "ancient_woodland",
196
+ NativeWoodlandSurvey: "native_woodland_survey",
197
+ AreaNaturalBeauty: "area_natural_beauty",
198
+ NationalScenicArea: "national_scenic_area",
199
+ PriorityHabitats: "priority_habitats",
200
+ ProtectedWoodlands: "protected_woodlands",
201
+ Natura2000: "natura_2000",
202
+ Aonb: "aonb",
203
+ ProtectedScenicLandscapes: "protected_scenic_landscapes",
204
+ HistoricLandfillSite: "historic_landfill_site",
205
+ WorldHeritageSite: "world_heritage_site",
206
+ ProtectedWreckSite: "protected_wreck_site",
207
+ ScheduledMonument: "scheduled_monument",
208
+ Battlefield: "battlefield",
209
+ BrownfieldLand: "brownfield_land",
210
+ GreenBelt: "green_belt",
211
+ CommonLand: "common_land",
212
+ BuiltUpArea250: "built_up_area_250",
213
+ ParcelsGb: "parcels_gb",
214
+ Building: "building",
215
+ } as const;
216
+ /**
217
+ * Environmental or geographic layer type for coverage calculations
218
+ */
219
+ export type GetAreaCoverageCoverageType = OpenEnum<
220
+ typeof GetAreaCoverageCoverageType
221
+ >;
222
+
223
+ /**
224
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
225
+ */
226
+ export const GetAreaCoverageIntersectsWith = {
227
+ Postcode: "postcode",
228
+ Outcode: "outcode",
229
+ UkOutputArea: "uk_output_area",
230
+ Lsoa21: "lsoa21",
231
+ Ward: "ward",
232
+ Parish: "parish",
233
+ LocalAuthorityDistrict: "local_authority_district",
234
+ County: "county",
235
+ Country: "country",
236
+ CountyElectoralDivision: "county_electoral_division",
237
+ DistrictBoroughUnitary: "district_borough_unitary",
238
+ DistrictBoroughUnitaryWard: "district_borough_unitary_ward",
239
+ LocalPlanningAuthority: "local_planning_authority",
240
+ CeremonialCountiesRegion: "ceremonial_counties_region",
241
+ EnglishRegion: "english_region",
242
+ CountryRegion: "country_region",
243
+ UnitaryElectoralDivision: "unitary_electoral_division",
244
+ Province: "province",
245
+ ElectoralDivision: "electoral_division",
246
+ GreaterLondonConstituency: "greater_london_constituency",
247
+ ScotlandAndWalesConstituency: "scotland_and_wales_constituency",
248
+ ScotlandAndWalesRegion: "scotland_and_wales_region",
249
+ WestminsterConstituency: "westminster_constituency",
250
+ Building: "building",
251
+ BuiltUpArea250: "built_up_area_250",
252
+ GreenBelt: "green_belt",
253
+ CommonLand: "common_land",
254
+ ParcelsGb: "parcels_gb",
255
+ FloodRisk: "flood_risk",
256
+ Ramsar: "ramsar",
257
+ Natura2000: "natura_2000",
258
+ Aonb: "aonb",
259
+ AreaNaturalBeauty: "area_natural_beauty",
260
+ NationalScenicArea: "national_scenic_area",
261
+ SpecialAreaConservation: "special_area_conservation",
262
+ SpecialProtectionArea: "special_protection_area",
263
+ AncientWoodland: "ancient_woodland",
264
+ NativeWoodlandSurvey: "native_woodland_survey",
265
+ PriorityHabitats: "priority_habitats",
266
+ ProtectedWoodlands: "protected_woodlands",
267
+ ProtectedWoodland: "protected_woodland",
268
+ ProtectedScenicLandscapes: "protected_scenic_landscapes",
269
+ WorldHeritageSite: "world_heritage_site",
270
+ ScheduledMonument: "scheduled_monument",
271
+ Battlefield: "battlefield",
272
+ ProtectedWreckSite: "protected_wreck_site",
273
+ HistoricLandfillSite: "historic_landfill_site",
274
+ RadonLevel: "radon_level",
275
+ BrownfieldLand: "brownfield_land",
276
+ NoiseRailLden: "noise_rail_lden",
277
+ NoiseRoadLden: "noise_road_lden",
278
+ NoiseIndustryLden: "noise_industry_lden",
279
+ } as const;
280
+ /**
281
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
282
+ */
283
+ export type GetAreaCoverageIntersectsWith = OpenEnum<
284
+ typeof GetAreaCoverageIntersectsWith
285
+ >;
286
+
287
+ /**
288
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
289
+ */
290
+ export const SourceType = {
291
+ Postcode: "postcode",
292
+ Outcode: "outcode",
293
+ UkOutputArea: "uk_output_area",
294
+ Lsoa21: "lsoa21",
295
+ Ward: "ward",
296
+ Parish: "parish",
297
+ LocalAuthorityDistrict: "local_authority_district",
298
+ County: "county",
299
+ Country: "country",
300
+ CountyElectoralDivision: "county_electoral_division",
301
+ DistrictBoroughUnitary: "district_borough_unitary",
302
+ DistrictBoroughUnitaryWard: "district_borough_unitary_ward",
303
+ LocalPlanningAuthority: "local_planning_authority",
304
+ CeremonialCountiesRegion: "ceremonial_counties_region",
305
+ EnglishRegion: "english_region",
306
+ CountryRegion: "country_region",
307
+ UnitaryElectoralDivision: "unitary_electoral_division",
308
+ Province: "province",
309
+ ElectoralDivision: "electoral_division",
310
+ GreaterLondonConstituency: "greater_london_constituency",
311
+ ScotlandAndWalesConstituency: "scotland_and_wales_constituency",
312
+ ScotlandAndWalesRegion: "scotland_and_wales_region",
313
+ WestminsterConstituency: "westminster_constituency",
314
+ Building: "building",
315
+ BuiltUpArea250: "built_up_area_250",
316
+ GreenBelt: "green_belt",
317
+ CommonLand: "common_land",
318
+ ParcelsGb: "parcels_gb",
319
+ FloodRisk: "flood_risk",
320
+ Ramsar: "ramsar",
321
+ Natura2000: "natura_2000",
322
+ Aonb: "aonb",
323
+ AreaNaturalBeauty: "area_natural_beauty",
324
+ NationalScenicArea: "national_scenic_area",
325
+ SpecialAreaConservation: "special_area_conservation",
326
+ SpecialProtectionArea: "special_protection_area",
327
+ AncientWoodland: "ancient_woodland",
328
+ NativeWoodlandSurvey: "native_woodland_survey",
329
+ PriorityHabitats: "priority_habitats",
330
+ ProtectedWoodlands: "protected_woodlands",
331
+ ProtectedWoodland: "protected_woodland",
332
+ ProtectedScenicLandscapes: "protected_scenic_landscapes",
333
+ WorldHeritageSite: "world_heritage_site",
334
+ ScheduledMonument: "scheduled_monument",
335
+ Battlefield: "battlefield",
336
+ ProtectedWreckSite: "protected_wreck_site",
337
+ HistoricLandfillSite: "historic_landfill_site",
338
+ RadonLevel: "radon_level",
339
+ BrownfieldLand: "brownfield_land",
340
+ NoiseRailLden: "noise_rail_lden",
341
+ NoiseRoadLden: "noise_road_lden",
342
+ NoiseIndustryLden: "noise_industry_lden",
343
+ } as const;
344
+ /**
345
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
346
+ */
347
+ export type SourceType = OpenEnum<typeof SourceType>;
348
+
349
+ /**
350
+ * Response containing coverage analysis for a geographic area. Returns either geography-to-geography overlap or environmental layer coverage depending on query parameters.
351
+ */
352
+ export type GetAreaCoverageResponseBody = {
353
+ /**
354
+ * Array of coverage calculation results
355
+ */
356
+ coverage: Array<Coverage>;
357
+ /**
358
+ * Environmental or geographic layer type for coverage calculations
359
+ */
360
+ coverageType?: GetAreaCoverageCoverageType | undefined;
361
+ /**
362
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
363
+ */
364
+ intersectsWith?: GetAreaCoverageIntersectsWith | undefined;
365
+ /**
366
+ * Optional message providing additional context about the response
367
+ */
368
+ message?: string | undefined;
369
+ /**
370
+ * Total area of source geography in square metres
371
+ */
372
+ sourceArea: number;
373
+ /**
374
+ * Source geography code that was analysed
375
+ */
376
+ sourceCode: string;
377
+ /**
378
+ * Human-readable name of the source geography
379
+ */
380
+ sourceName: string;
381
+ /**
382
+ * Layer type - supports postcodes, outcodes (e.g., SW1A), ONS geographies (OA21, LSOA21, LAD), HMLR INSPIRE parcels, EA/NRW/SEPA flood data, environmental designations (Natura 2000, AONB/NSA), heritage assets, and noise mapping data
383
+ */
384
+ sourceType: SourceType;
385
+ /**
386
+ * Indicates whether the request was successful
387
+ */
388
+ success: boolean;
389
+ /**
390
+ * Target geography code (for geography-to-geography queries)
391
+ */
392
+ targetCode?: string | undefined;
393
+ /**
394
+ * Target geography name (for geography-to-geography queries)
395
+ */
396
+ targetName?: string | undefined;
397
+ };
398
+
399
+ /** @internal */
400
+ export const CoverageType$outboundSchema: z.ZodNativeEnum<typeof CoverageType> =
401
+ z.nativeEnum(CoverageType);
402
+
403
+ /** @internal */
404
+ export const IntersectsWith$outboundSchema: z.ZodNativeEnum<
405
+ typeof IntersectsWith
406
+ > = z.nativeEnum(IntersectsWith);
407
+
408
+ /** @internal */
409
+ export type GetAreaCoverageRequest$Outbound = {
410
+ coverageType?: string | undefined;
411
+ intersectsWith?: string | undefined;
412
+ sourceCode: string;
413
+ targetCode?: string | undefined;
414
+ };
415
+
416
+ /** @internal */
417
+ export const GetAreaCoverageRequest$outboundSchema: z.ZodType<
418
+ GetAreaCoverageRequest$Outbound,
419
+ z.ZodTypeDef,
420
+ GetAreaCoverageRequest
421
+ > = z.object({
422
+ coverageType: CoverageType$outboundSchema.optional(),
423
+ intersectsWith: IntersectsWith$outboundSchema.optional(),
424
+ sourceCode: z.string(),
425
+ targetCode: z.string().optional(),
426
+ });
427
+
428
+ export function getAreaCoverageRequestToJSON(
429
+ getAreaCoverageRequest: GetAreaCoverageRequest,
430
+ ): string {
431
+ return JSON.stringify(
432
+ GetAreaCoverageRequest$outboundSchema.parse(getAreaCoverageRequest),
433
+ );
434
+ }
435
+
436
+ /** @internal */
437
+ export const GetAreaCoverageMetadata$inboundSchema: z.ZodType<
438
+ GetAreaCoverageMetadata,
439
+ z.ZodTypeDef,
440
+ unknown
441
+ > = z.object({
442
+ category: z.string().optional(),
443
+ componentLayers: z.array(z.string()).optional(),
444
+ dbRange: z.string().optional(),
445
+ entityCount: z.number().optional(),
446
+ featureCount: z.number().optional(),
447
+ totalEntities: z.number().optional(),
448
+ });
449
+
450
+ export function getAreaCoverageMetadataFromJSON(
451
+ jsonString: string,
452
+ ): SafeParseResult<GetAreaCoverageMetadata, SDKValidationError> {
453
+ return safeParse(
454
+ jsonString,
455
+ (x) => GetAreaCoverageMetadata$inboundSchema.parse(JSON.parse(x)),
456
+ `Failed to parse 'GetAreaCoverageMetadata' from JSON`,
457
+ );
458
+ }
459
+
460
+ /** @internal */
461
+ export const Coverage$inboundSchema: z.ZodType<
462
+ Coverage,
463
+ z.ZodTypeDef,
464
+ unknown
465
+ > = z.object({
466
+ area: z.number(),
467
+ identifier: z.string(),
468
+ metadata: z.lazy(() => GetAreaCoverageMetadata$inboundSchema).optional(),
469
+ percentage: z.number(),
470
+ });
471
+
472
+ export function coverageFromJSON(
473
+ jsonString: string,
474
+ ): SafeParseResult<Coverage, SDKValidationError> {
475
+ return safeParse(
476
+ jsonString,
477
+ (x) => Coverage$inboundSchema.parse(JSON.parse(x)),
478
+ `Failed to parse 'Coverage' from JSON`,
479
+ );
480
+ }
481
+
482
+ /** @internal */
483
+ export const GetAreaCoverageCoverageType$inboundSchema: z.ZodType<
484
+ GetAreaCoverageCoverageType,
485
+ z.ZodTypeDef,
486
+ unknown
487
+ > = openEnums.inboundSchema(GetAreaCoverageCoverageType);
488
+
489
+ /** @internal */
490
+ export const GetAreaCoverageIntersectsWith$inboundSchema: z.ZodType<
491
+ GetAreaCoverageIntersectsWith,
492
+ z.ZodTypeDef,
493
+ unknown
494
+ > = openEnums.inboundSchema(GetAreaCoverageIntersectsWith);
495
+
496
+ /** @internal */
497
+ export const SourceType$inboundSchema: z.ZodType<
498
+ SourceType,
499
+ z.ZodTypeDef,
500
+ unknown
501
+ > = openEnums.inboundSchema(SourceType);
502
+
503
+ /** @internal */
504
+ export const GetAreaCoverageResponseBody$inboundSchema: z.ZodType<
505
+ GetAreaCoverageResponseBody,
506
+ z.ZodTypeDef,
507
+ unknown
508
+ > = z.object({
509
+ coverage: z.array(z.lazy(() => Coverage$inboundSchema)),
510
+ coverageType: GetAreaCoverageCoverageType$inboundSchema.optional(),
511
+ intersectsWith: GetAreaCoverageIntersectsWith$inboundSchema.optional(),
512
+ message: z.string().optional(),
513
+ sourceArea: z.number(),
514
+ sourceCode: z.string(),
515
+ sourceName: z.string(),
516
+ sourceType: SourceType$inboundSchema,
517
+ success: z.boolean(),
518
+ targetCode: z.string().optional(),
519
+ targetName: z.string().optional(),
520
+ });
521
+
522
+ export function getAreaCoverageResponseBodyFromJSON(
523
+ jsonString: string,
524
+ ): SafeParseResult<GetAreaCoverageResponseBody, SDKValidationError> {
525
+ return safeParse(
526
+ jsonString,
527
+ (x) => GetAreaCoverageResponseBody$inboundSchema.parse(JSON.parse(x)),
528
+ `Failed to parse 'GetAreaCoverageResponseBody' from JSON`,
529
+ );
530
+ }