Skip to content

Commit daa1817

Browse files
feat(travelimpactmodel): update the API
#### travelimpactmodel:v1 The following keys were added: - resources.flights.methods.computeTypicalFlightEmissions.description - resources.flights.methods.computeTypicalFlightEmissions.flatPath - resources.flights.methods.computeTypicalFlightEmissions.httpMethod - resources.flights.methods.computeTypicalFlightEmissions.id - resources.flights.methods.computeTypicalFlightEmissions.parameterOrder - resources.flights.methods.computeTypicalFlightEmissions.path - resources.flights.methods.computeTypicalFlightEmissions.request.$ref - resources.flights.methods.computeTypicalFlightEmissions.response.$ref - schemas.ComputeTypicalFlightEmissionsRequest.description - schemas.ComputeTypicalFlightEmissionsRequest.id - schemas.ComputeTypicalFlightEmissionsRequest.properties.markets.description - schemas.ComputeTypicalFlightEmissionsRequest.properties.markets.items.$ref - schemas.ComputeTypicalFlightEmissionsRequest.properties.markets.type - schemas.ComputeTypicalFlightEmissionsRequest.type - schemas.ComputeTypicalFlightEmissionsResponse.description - schemas.ComputeTypicalFlightEmissionsResponse.id - schemas.ComputeTypicalFlightEmissionsResponse.properties.modelVersion.$ref - schemas.ComputeTypicalFlightEmissionsResponse.properties.modelVersion.description - schemas.ComputeTypicalFlightEmissionsResponse.properties.typicalFlightEmissions.description - schemas.ComputeTypicalFlightEmissionsResponse.properties.typicalFlightEmissions.items.$ref - schemas.ComputeTypicalFlightEmissionsResponse.properties.typicalFlightEmissions.type - schemas.ComputeTypicalFlightEmissionsResponse.type - schemas.EasaLabelMetadata.description - schemas.EasaLabelMetadata.id - schemas.EasaLabelMetadata.properties.labelExpiryDate.$ref - schemas.EasaLabelMetadata.properties.labelExpiryDate.description - schemas.EasaLabelMetadata.properties.labelIssueDate.$ref - schemas.EasaLabelMetadata.properties.labelIssueDate.description - schemas.EasaLabelMetadata.properties.labelVersion.description - schemas.EasaLabelMetadata.properties.labelVersion.type - schemas.EasaLabelMetadata.properties.safDiscountPercentage.description - schemas.EasaLabelMetadata.properties.safDiscountPercentage.format - schemas.EasaLabelMetadata.properties.safDiscountPercentage.type - schemas.EasaLabelMetadata.type - schemas.FlightWithEmissions.properties.contrailsImpactBucket.description - schemas.FlightWithEmissions.properties.contrailsImpactBucket.enum - schemas.FlightWithEmissions.properties.contrailsImpactBucket.enumDescriptions - schemas.FlightWithEmissions.properties.contrailsImpactBucket.type - schemas.FlightWithEmissions.properties.easaLabelMetadata.$ref - schemas.FlightWithEmissions.properties.easaLabelMetadata.description - schemas.FlightWithEmissions.properties.source.description - schemas.FlightWithEmissions.properties.source.enum - schemas.FlightWithEmissions.properties.source.enumDescriptions - schemas.FlightWithEmissions.properties.source.type - schemas.Market.description - schemas.Market.id - schemas.Market.properties.destination.description - schemas.Market.properties.destination.type - schemas.Market.properties.origin.description - schemas.Market.properties.origin.type - schemas.Market.type - schemas.TypicalFlightEmissions.description - schemas.TypicalFlightEmissions.id - schemas.TypicalFlightEmissions.properties.emissionsGramsPerPax.$ref - schemas.TypicalFlightEmissions.properties.emissionsGramsPerPax.description - schemas.TypicalFlightEmissions.properties.market.$ref - schemas.TypicalFlightEmissions.properties.market.description - schemas.TypicalFlightEmissions.type The following keys were changed: - resources.flights.methods.computeFlightEmissions.description - schemas.FlightWithEmissions.properties.emissionsGramsPerPax.description - schemas.ModelVersion.description - schemas.ModelVersion.properties.major.description
1 parent ca1c63e commit daa1817

File tree

2 files changed

+437
-9
lines changed

2 files changed

+437
-9
lines changed

discovery/travelimpactmodel-v1.json

Lines changed: 140 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"flights": {
100100
"methods": {
101101
"computeFlightEmissions": {
102-
"description": "Stateless method to retrieve emission estimates. Details on how emission estimates are computed: https://github.com/google/travel-impact-model The response will contain all entries that match the input flight legs, in the same order. If there are no estimates available for a certain flight leg, the response will return the flight leg object with empty emission fields. The request will still be considered successful. Reasons for missing emission estimates include: * The flight is unknown to the server. * The input flight leg is missing one or more identifiers. * The flight date is in the past. * The aircraft type is not supported by the model. * Missing seat configuration. The request can contain up to 1000 flight legs. If the request has more than 1000 direct flights, if will fail with an INVALID_ARGUMENT error.",
102+
"description": "Stateless method to retrieve emission estimates. Details on how emission estimates are computed are in [GitHub](https://github.com/google/travel-impact-model) The response will contain all entries that match the input flight legs, in the same order. If there are no estimates available for a certain flight leg, the response will return the flight leg object with empty emission fields. The request will still be considered successful. Reasons for missing emission estimates include: * The flight is unknown to the server. * The input flight leg is missing one or more identifiers. * The flight date is in the past. * The aircraft type is not supported by the model. * Missing seat configuration. The request can contain up to 1000 flight legs. If the request has more than 1000 direct flights, if will fail with an INVALID_ARGUMENT error.",
103103
"flatPath": "v1/flights:computeFlightEmissions",
104104
"httpMethod": "POST",
105105
"id": "travelimpactmodel.flights.computeFlightEmissions",
@@ -112,11 +112,26 @@
112112
"response": {
113113
"$ref": "ComputeFlightEmissionsResponse"
114114
}
115+
},
116+
"computeTypicalFlightEmissions": {
117+
"description": "Retrieves typical flight emissions estimates between two airports, also known as a market. If there are no estimates available for a certain market, the response will return the market object with empty emission fields. The request will still be considered successful. Details on how the typical emissions estimates are computed are on [GitHub](https://github.com/google/travel-impact-model/blob/main/projects/typical_flight_emissions.md). The request can contain up to 1000 markets. If the request has more than 1000 markets, it will fail with an INVALID_ARGUMENT error.",
118+
"flatPath": "v1/flights:computeTypicalFlightEmissions",
119+
"httpMethod": "POST",
120+
"id": "travelimpactmodel.flights.computeTypicalFlightEmissions",
121+
"parameterOrder": [],
122+
"parameters": {},
123+
"path": "v1/flights:computeTypicalFlightEmissions",
124+
"request": {
125+
"$ref": "ComputeTypicalFlightEmissionsRequest"
126+
},
127+
"response": {
128+
"$ref": "ComputeTypicalFlightEmissionsResponse"
129+
}
115130
}
116131
}
117132
}
118133
},
119-
"revision": "20250224",
134+
"revision": "20250624",
120135
"rootUrl": "https://travelimpactmodel.googleapis.com/",
121136
"schemas": {
122137
"ComputeFlightEmissionsRequest": {
@@ -151,6 +166,38 @@
151166
},
152167
"type": "object"
153168
},
169+
"ComputeTypicalFlightEmissionsRequest": {
170+
"description": "A list of pair of airports (markets) to request the typical emissions for.",
171+
"id": "ComputeTypicalFlightEmissionsRequest",
172+
"properties": {
173+
"markets": {
174+
"description": "Required. Request the typical flight emissions estimates for this market pair. A maximum of 1000 markets can be requested.",
175+
"items": {
176+
"$ref": "Market"
177+
},
178+
"type": "array"
179+
}
180+
},
181+
"type": "object"
182+
},
183+
"ComputeTypicalFlightEmissionsResponse": {
184+
"description": "The response includes the emissions but also the model version.",
185+
"id": "ComputeTypicalFlightEmissionsResponse",
186+
"properties": {
187+
"modelVersion": {
188+
"$ref": "ModelVersion",
189+
"description": "The model version under which typical flight emission estimates for all flights in this response were computed."
190+
},
191+
"typicalFlightEmissions": {
192+
"description": "Market's Typical Flight Emissions requested.",
193+
"items": {
194+
"$ref": "TypicalFlightEmissions"
195+
},
196+
"type": "array"
197+
}
198+
},
199+
"type": "object"
200+
},
154201
"Date": {
155202
"description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
156203
"id": "Date",
@@ -173,6 +220,30 @@
173220
},
174221
"type": "object"
175222
},
223+
"EasaLabelMetadata": {
224+
"description": "Metadata about the EASA Flight Emissions Label.",
225+
"id": "EasaLabelMetadata",
226+
"properties": {
227+
"labelExpiryDate": {
228+
"$ref": "Date",
229+
"description": "The date when the label expires. The label can be displayed until the end of this date."
230+
},
231+
"labelIssueDate": {
232+
"$ref": "Date",
233+
"description": "The date when the label was issued."
234+
},
235+
"labelVersion": {
236+
"description": "Version of the label.",
237+
"type": "string"
238+
},
239+
"safDiscountPercentage": {
240+
"description": "Sustainable Aviation Fuel (SAF) emissions discount percentage applied to the label. It is a percentage as a decimal. The values are in the interval [0,1]. For example, 0.0021 means 0.21%. This discount and reduction in emissions are reported by the EASA label but they are not included in the CO2e estimates distributed by this API.",
241+
"format": "double",
242+
"type": "number"
243+
}
244+
},
245+
"type": "object"
246+
},
176247
"EmissionsGramsPerPax": {
177248
"description": "Grouped emissions per seating class results.",
178249
"id": "EmissionsGramsPerPax",
@@ -232,27 +303,76 @@
232303
"description": "Direct flight with emission estimates.",
233304
"id": "FlightWithEmissions",
234305
"properties": {
306+
"contrailsImpactBucket": {
307+
"description": "Optional. The significance of contrails warming impact compared to the total CO2e emissions impact.",
308+
"enum": [
309+
"CONTRAILS_IMPACT_UNSPECIFIED",
310+
"CONTRAILS_IMPACT_NEGLIGIBLE",
311+
"CONTRAILS_IMPACT_MODERATE",
312+
"CONTRAILS_IMPACT_SEVERE"
313+
],
314+
"enumDescriptions": [
315+
"The contrails impact is unspecified.",
316+
"The contrails impact is negligible compared to the total CO2e emissions.",
317+
"The contrails impact is comparable to the total CO2e emissions.",
318+
"The contrails impact is higher than the total CO2e emissions impact."
319+
],
320+
"type": "string"
321+
},
322+
"easaLabelMetadata": {
323+
"$ref": "EasaLabelMetadata",
324+
"description": "Optional. Metadata about the EASA Flight Emissions Label. Only set when the emissions data source is EASA."
325+
},
235326
"emissionsGramsPerPax": {
236327
"$ref": "EmissionsGramsPerPax",
237-
"description": "Optional. Per-passenger emission estimate numbers. Will not be present if emissions could not be computed. For the list of reasons why emissions could not be computed, see ComputeFlightEmissions. This field uses wtw emissions aka ttw_emissions_grams_per_pax + wtt_emissions_grams_per_pax."
328+
"description": "Optional. Per-passenger emission estimate numbers. Will not be present if emissions could not be computed. For the list of reasons why emissions could not be computed, see ComputeFlightEmissions."
238329
},
239330
"flight": {
240331
"$ref": "Flight",
241332
"description": "Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized."
333+
},
334+
"source": {
335+
"description": "Optional. The source of the emissions data.",
336+
"enum": [
337+
"SOURCE_UNSPECIFIED",
338+
"TIM",
339+
"EASA"
340+
],
341+
"enumDescriptions": [
342+
"The source of the emissions data is unspecified.",
343+
"The emissions data is from the Travel Impact Model.",
344+
"The emissions data is from the EASA environmental labels."
345+
],
346+
"type": "string"
347+
}
348+
},
349+
"type": "object"
350+
},
351+
"Market": {
352+
"description": "A pair of airports.",
353+
"id": "Market",
354+
"properties": {
355+
"destination": {
356+
"description": "Required. IATA airport code for flight destination, e.g. \"JFK\".",
357+
"type": "string"
358+
},
359+
"origin": {
360+
"description": "Required. IATA airport code for flight origin, e.g. \"LHR\".",
361+
"type": "string"
242362
}
243363
},
244364
"type": "object"
245365
},
246366
"ModelVersion": {
247-
"description": "Travel Impact Model version. For more information about the model versioning see https://github.com/google/travel-impact-model/#versioning.",
367+
"description": "Travel Impact Model version. For more information about the model versioning see [GitHub](https://github.com/google/travel-impact-model/#versioning).",
248368
"id": "ModelVersion",
249369
"properties": {
250370
"dated": {
251371
"description": "Dated versions: Model datasets are recreated with refreshed input data but no change to the algorithms regularly.",
252372
"type": "string"
253373
},
254374
"major": {
255-
"description": "Major versions: Major changes to methodology (e.g. adding new data sources to the model that lead to major output changes). Such changes will be infrequent and announced well in advance. Might involve API version changes, which will respect guidelines in https://cloud.google.com/endpoints/docs/openapi/versioning-an-api#backwards-incompatible",
375+
"description": "Major versions: Major changes to methodology (e.g. adding new data sources to the model that lead to major output changes). Such changes will be infrequent and announced well in advance. Might involve API version changes, which will respect [Google Cloud API guidelines](https://cloud.google.com/endpoints/docs/openapi/versioning-an-api#backwards-incompatible)",
256376
"format": "int32",
257377
"type": "integer"
258378
},
@@ -268,6 +388,21 @@
268388
}
269389
},
270390
"type": "object"
391+
},
392+
"TypicalFlightEmissions": {
393+
"description": "Typical flight emission estimates for a certain market",
394+
"id": "TypicalFlightEmissions",
395+
"properties": {
396+
"emissionsGramsPerPax": {
397+
"$ref": "EmissionsGramsPerPax",
398+
"description": "Optional. Typical flight emissions per passenger for requested market. Will not be present if a typical emissions could not be computed. For the list of reasons why typical flight emissions could not be computed, see [GitHub](https://github.com/google/travel-impact-model/blob/main/projects/typical_flight_emissions.md#step-7-validate-dataset)."
399+
},
400+
"market": {
401+
"$ref": "Market",
402+
"description": "Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized."
403+
}
404+
},
405+
"type": "object"
271406
}
272407
},
273408
"servicePath": "",

0 commit comments

Comments
 (0)