@googleapis/travelimpactmodel 3.0.1 → 4.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.1.0](https://github.com/googleapis/google-api-nodejs-client/compare/travelimpactmodel-v4.0.0...travelimpactmodel-v4.1.0) (2025-07-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * **travelimpactmodel:** update the API ([daa1817](https://github.com/googleapis/google-api-nodejs-client/commit/daa1817037b417c7547ec0102b6334cbfcf53e0d))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **travelimpactmodel:** update the API ([64e7640](https://github.com/googleapis/google-api-nodejs-client/commit/64e7640295700ec18aabbe4efcf258528c5a0142))
14
+
15
+ ## [4.0.0](https://github.com/googleapis/google-api-nodejs-client/compare/travelimpactmodel-v3.0.1...travelimpactmodel-v4.0.0) (2025-06-30)
16
+
17
+
18
+ ### ⚠ BREAKING CHANGES
19
+
20
+ * upgrade to node 18
21
+
22
+ ### Features
23
+
24
+ * **travelimpactmodel:** update the API ([daa1817](https://github.com/googleapis/google-api-nodejs-client/commit/daa1817037b417c7547ec0102b6334cbfcf53e0d))
25
+ * upgrade to node 18 ([682fbb8](https://github.com/googleapis/google-api-nodejs-client/commit/682fbb869189ae92b3e9a194d37d0548af0c1f92))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **deps:** upgrade googleapis-common to 8.0.2-rc ([f4b0990](https://github.com/googleapis/google-api-nodejs-client/commit/f4b099071040cfbcfe4a2e7d487d45ee93b369e0))
31
+
3
32
  ## [3.0.1](https://github.com/googleapis/google-api-nodejs-client/compare/travelimpactmodel-v3.0.0...travelimpactmodel-v3.0.1) (2025-06-04)
4
33
 
5
34
 
package/build/v1.d.ts CHANGED
@@ -93,6 +93,28 @@ export declare namespace travelimpactmodel_v1 {
93
93
  */
94
94
  modelVersion?: Schema$ModelVersion;
95
95
  }
96
+ /**
97
+ * A list of pair of airports (markets) to request the typical emissions for.
98
+ */
99
+ export interface Schema$ComputeTypicalFlightEmissionsRequest {
100
+ /**
101
+ * Required. Request the typical flight emissions estimates for this market pair. A maximum of 1000 markets can be requested.
102
+ */
103
+ markets?: Schema$Market[];
104
+ }
105
+ /**
106
+ * The response includes the emissions but also the model version.
107
+ */
108
+ export interface Schema$ComputeTypicalFlightEmissionsResponse {
109
+ /**
110
+ * The model version under which typical flight emission estimates for all flights in this response were computed.
111
+ */
112
+ modelVersion?: Schema$ModelVersion;
113
+ /**
114
+ * Market's Typical Flight Emissions requested.
115
+ */
116
+ typicalFlightEmissions?: Schema$TypicalFlightEmissions[];
117
+ }
96
118
  /**
97
119
  * 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
98
120
  */
@@ -110,6 +132,27 @@ export declare namespace travelimpactmodel_v1 {
110
132
  */
111
133
  year?: number | null;
112
134
  }
135
+ /**
136
+ * Metadata about the EASA Flight Emissions Label.
137
+ */
138
+ export interface Schema$EasaLabelMetadata {
139
+ /**
140
+ * The date when the label expires. The label can be displayed until the end of this date.
141
+ */
142
+ labelExpiryDate?: Schema$Date;
143
+ /**
144
+ * The date when the label was issued.
145
+ */
146
+ labelIssueDate?: Schema$Date;
147
+ /**
148
+ * Version of the label.
149
+ */
150
+ labelVersion?: string | null;
151
+ /**
152
+ * 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.
153
+ */
154
+ safDiscountPercentage?: number | null;
155
+ }
113
156
  /**
114
157
  * Grouped emissions per seating class results.
115
158
  */
@@ -161,16 +204,41 @@ export declare namespace travelimpactmodel_v1 {
161
204
  */
162
205
  export interface Schema$FlightWithEmissions {
163
206
  /**
164
- * 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.
207
+ * Optional. The significance of contrails warming impact compared to the total CO2e emissions impact.
208
+ */
209
+ contrailsImpactBucket?: string | null;
210
+ /**
211
+ * Optional. Metadata about the EASA Flight Emissions Label. Only set when the emissions data source is EASA.
212
+ */
213
+ easaLabelMetadata?: Schema$EasaLabelMetadata;
214
+ /**
215
+ * 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.
165
216
  */
166
217
  emissionsGramsPerPax?: Schema$EmissionsGramsPerPax;
167
218
  /**
168
219
  * Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized.
169
220
  */
170
221
  flight?: Schema$Flight;
222
+ /**
223
+ * Optional. The source of the emissions data.
224
+ */
225
+ source?: string | null;
171
226
  }
172
227
  /**
173
- * Travel Impact Model version. For more information about the model versioning see https://github.com/google/travel-impact-model/#versioning.
228
+ * A pair of airports.
229
+ */
230
+ export interface Schema$Market {
231
+ /**
232
+ * Required. IATA airport code for flight destination, e.g. "JFK".
233
+ */
234
+ destination?: string | null;
235
+ /**
236
+ * Required. IATA airport code for flight origin, e.g. "LHR".
237
+ */
238
+ origin?: string | null;
239
+ }
240
+ /**
241
+ * Travel Impact Model version. For more information about the model versioning see [GitHub](https://github.com/google/travel-impact-model/#versioning).
174
242
  */
175
243
  export interface Schema$ModelVersion {
176
244
  /**
@@ -178,7 +246,7 @@ export declare namespace travelimpactmodel_v1 {
178
246
  */
179
247
  dated?: string | null;
180
248
  /**
181
- * 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
249
+ * 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)
182
250
  */
183
251
  major?: number | null;
184
252
  /**
@@ -190,11 +258,76 @@ export declare namespace travelimpactmodel_v1 {
190
258
  */
191
259
  patch?: number | null;
192
260
  }
261
+ /**
262
+ * Typical flight emission estimates for a certain market
263
+ */
264
+ export interface Schema$TypicalFlightEmissions {
265
+ /**
266
+ * 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).
267
+ */
268
+ emissionsGramsPerPax?: Schema$EmissionsGramsPerPax;
269
+ /**
270
+ * Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized.
271
+ */
272
+ market?: Schema$Market;
273
+ }
193
274
  export class Resource$Flights {
194
275
  context: APIRequestContext;
195
276
  constructor(context: APIRequestContext);
196
277
  /**
197
- * 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.
278
+ * 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.
279
+ * @example
280
+ * ```js
281
+ * // Before running the sample:
282
+ * // - Enable the API at:
283
+ * // https://console.developers.google.com/apis/api/travelimpactmodel.googleapis.com
284
+ * // - Login into gcloud by running:
285
+ * // ```sh
286
+ * // $ gcloud auth application-default login
287
+ * // ```
288
+ * // - Install the npm module by running:
289
+ * // ```sh
290
+ * // $ npm install googleapis
291
+ * // ```
292
+ *
293
+ * const {google} = require('googleapis');
294
+ * const travelimpactmodel = google.travelimpactmodel('v1');
295
+ *
296
+ * async function main() {
297
+ * const auth = new google.auth.GoogleAuth({
298
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
299
+ * scopes: [],
300
+ * });
301
+ *
302
+ * // Acquire an auth client, and bind it to all future calls
303
+ * const authClient = await auth.getClient();
304
+ * google.options({auth: authClient});
305
+ *
306
+ * // Do the magic
307
+ * const res = await travelimpactmodel.flights.computeFlightEmissions({
308
+ * // Request body metadata
309
+ * requestBody: {
310
+ * // request body parameters
311
+ * // {
312
+ * // "flights": []
313
+ * // }
314
+ * },
315
+ * });
316
+ * console.log(res.data);
317
+ *
318
+ * // Example response
319
+ * // {
320
+ * // "flightEmissions": [],
321
+ * // "modelVersion": {}
322
+ * // }
323
+ * }
324
+ *
325
+ * main().catch(e => {
326
+ * console.error(e);
327
+ * throw e;
328
+ * });
329
+ *
330
+ * ```
198
331
  *
199
332
  * @param params - Parameters for request
200
333
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -207,6 +340,72 @@ export declare namespace travelimpactmodel_v1 {
207
340
  computeFlightEmissions(params: Params$Resource$Flights$Computeflightemissions, options: MethodOptions | BodyResponseCallback<Schema$ComputeFlightEmissionsResponse>, callback: BodyResponseCallback<Schema$ComputeFlightEmissionsResponse>): void;
208
341
  computeFlightEmissions(params: Params$Resource$Flights$Computeflightemissions, callback: BodyResponseCallback<Schema$ComputeFlightEmissionsResponse>): void;
209
342
  computeFlightEmissions(callback: BodyResponseCallback<Schema$ComputeFlightEmissionsResponse>): void;
343
+ /**
344
+ * 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.
345
+ * @example
346
+ * ```js
347
+ * // Before running the sample:
348
+ * // - Enable the API at:
349
+ * // https://console.developers.google.com/apis/api/travelimpactmodel.googleapis.com
350
+ * // - Login into gcloud by running:
351
+ * // ```sh
352
+ * // $ gcloud auth application-default login
353
+ * // ```
354
+ * // - Install the npm module by running:
355
+ * // ```sh
356
+ * // $ npm install googleapis
357
+ * // ```
358
+ *
359
+ * const {google} = require('googleapis');
360
+ * const travelimpactmodel = google.travelimpactmodel('v1');
361
+ *
362
+ * async function main() {
363
+ * const auth = new google.auth.GoogleAuth({
364
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
365
+ * scopes: [],
366
+ * });
367
+ *
368
+ * // Acquire an auth client, and bind it to all future calls
369
+ * const authClient = await auth.getClient();
370
+ * google.options({auth: authClient});
371
+ *
372
+ * // Do the magic
373
+ * const res = await travelimpactmodel.flights.computeTypicalFlightEmissions({
374
+ * // Request body metadata
375
+ * requestBody: {
376
+ * // request body parameters
377
+ * // {
378
+ * // "markets": []
379
+ * // }
380
+ * },
381
+ * });
382
+ * console.log(res.data);
383
+ *
384
+ * // Example response
385
+ * // {
386
+ * // "modelVersion": {},
387
+ * // "typicalFlightEmissions": []
388
+ * // }
389
+ * }
390
+ *
391
+ * main().catch(e => {
392
+ * console.error(e);
393
+ * throw e;
394
+ * });
395
+ *
396
+ * ```
397
+ *
398
+ * @param params - Parameters for request
399
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
400
+ * @param callback - Optional callback that handles the response.
401
+ * @returns A promise if used with async/await, or void if used with a callback.
402
+ */
403
+ computeTypicalFlightEmissions(params: Params$Resource$Flights$Computetypicalflightemissions, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
404
+ computeTypicalFlightEmissions(params?: Params$Resource$Flights$Computetypicalflightemissions, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ComputeTypicalFlightEmissionsResponse>>;
405
+ computeTypicalFlightEmissions(params: Params$Resource$Flights$Computetypicalflightemissions, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
406
+ computeTypicalFlightEmissions(params: Params$Resource$Flights$Computetypicalflightemissions, options: MethodOptions | BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>, callback: BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>): void;
407
+ computeTypicalFlightEmissions(params: Params$Resource$Flights$Computetypicalflightemissions, callback: BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>): void;
408
+ computeTypicalFlightEmissions(callback: BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>): void;
210
409
  }
211
410
  export interface Params$Resource$Flights$Computeflightemissions extends StandardParameters {
212
411
  /**
@@ -214,5 +413,11 @@ export declare namespace travelimpactmodel_v1 {
214
413
  */
215
414
  requestBody?: Schema$ComputeFlightEmissionsRequest;
216
415
  }
416
+ export interface Params$Resource$Flights$Computetypicalflightemissions extends StandardParameters {
417
+ /**
418
+ * Request body metadata
419
+ */
420
+ requestBody?: Schema$ComputeTypicalFlightEmissionsRequest;
421
+ }
217
422
  export {};
218
423
  }
package/build/v1.js CHANGED
@@ -78,6 +78,38 @@ var travelimpactmodel_v1;
78
78
  return (0, googleapis_common_1.createAPIRequest)(parameters);
79
79
  }
80
80
  }
81
+ computeTypicalFlightEmissions(paramsOrCallback, optionsOrCallback, callback) {
82
+ let params = (paramsOrCallback ||
83
+ {});
84
+ let options = (optionsOrCallback || {});
85
+ if (typeof paramsOrCallback === 'function') {
86
+ callback = paramsOrCallback;
87
+ params = {};
88
+ options = {};
89
+ }
90
+ if (typeof optionsOrCallback === 'function') {
91
+ callback = optionsOrCallback;
92
+ options = {};
93
+ }
94
+ const rootUrl = options.rootUrl || 'https://travelimpactmodel.googleapis.com/';
95
+ const parameters = {
96
+ options: Object.assign({
97
+ url: (rootUrl + '/v1/flights:computeTypicalFlightEmissions').replace(/([^:]\/)\/+/g, '$1'),
98
+ method: 'POST',
99
+ apiVersion: '',
100
+ }, options),
101
+ params,
102
+ requiredParams: [],
103
+ pathParams: [],
104
+ context: this.context,
105
+ };
106
+ if (callback) {
107
+ (0, googleapis_common_1.createAPIRequest)(parameters, callback);
108
+ }
109
+ else {
110
+ return (0, googleapis_common_1.createAPIRequest)(parameters);
111
+ }
112
+ }
81
113
  }
82
114
  travelimpactmodel_v1.Resource$Flights = Resource$Flights;
83
115
  })(travelimpactmodel_v1 = exports.travelimpactmodel_v1 || (exports.travelimpactmodel_v1 = {}));
package/build/v1.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"v1.js","sourceRoot":"","sources":["../v1.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEjC,uDAAuD;AACvD,sDAAsD;AACtD,0DAA0D;AAC1D,oDAAoD;AACpD,4CAA4C;AAE5C,yDAe2B;AAG3B,IAAiB,oBAAoB,CAiUpC;AAjUD,WAAiB,oBAAoB;IAgEnC;;;;;;;;;;OAUG;IACH,MAAa,iBAAiB;QAI5B,YAAY,OAAsB,EAAE,MAA2B;YAC7D,IAAI,CAAC,OAAO,GAAG;gBACb,QAAQ,EAAE,OAAO,IAAI,EAAE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AG;gBACjB,OAAO,EAAE,MAAM,CAAC,MAAM,CACpB;oBACE,GAAG,EAAE,CACH,OAAO,GAAG,2CAA2C,CACtD,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC;oBAC/B,MAAM,EAAE,MAAM;oBACd,UAAU,EAAE,EAAE;iBACf,EACD,OAAO,CACR;gBACD,MAAM;gBACN,cAAc,EAAE,EAAE;gBAClB,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC;YACF,IAAI,QAAQ,EAAE;gBACZ,IAAA,oCAAgB,EACd,UAAU,EACV,QAAyC,CAC1C,CAAC;aACH;iBAAM;gBACL,OAAO,IAAA,oCAAgB,EACrB,UAAU,CACX,CAAC;aACH;QACH,CAAC;KACF;IApTY,qCAAgB,mBAoT5B,CAAA;AAgBH,CAAC,EAtmBgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAsmBpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@googleapis/travelimpactmodel",
3
- "version": "3.0.1",
3
+ "version": "4.1.0",
4
4
  "description": "travelimpactmodel",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
package/v1.ts CHANGED
@@ -146,6 +146,28 @@ export namespace travelimpactmodel_v1 {
146
146
  */
147
147
  modelVersion?: Schema$ModelVersion;
148
148
  }
149
+ /**
150
+ * A list of pair of airports (markets) to request the typical emissions for.
151
+ */
152
+ export interface Schema$ComputeTypicalFlightEmissionsRequest {
153
+ /**
154
+ * Required. Request the typical flight emissions estimates for this market pair. A maximum of 1000 markets can be requested.
155
+ */
156
+ markets?: Schema$Market[];
157
+ }
158
+ /**
159
+ * The response includes the emissions but also the model version.
160
+ */
161
+ export interface Schema$ComputeTypicalFlightEmissionsResponse {
162
+ /**
163
+ * The model version under which typical flight emission estimates for all flights in this response were computed.
164
+ */
165
+ modelVersion?: Schema$ModelVersion;
166
+ /**
167
+ * Market's Typical Flight Emissions requested.
168
+ */
169
+ typicalFlightEmissions?: Schema$TypicalFlightEmissions[];
170
+ }
149
171
  /**
150
172
  * 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
151
173
  */
@@ -163,6 +185,27 @@ export namespace travelimpactmodel_v1 {
163
185
  */
164
186
  year?: number | null;
165
187
  }
188
+ /**
189
+ * Metadata about the EASA Flight Emissions Label.
190
+ */
191
+ export interface Schema$EasaLabelMetadata {
192
+ /**
193
+ * The date when the label expires. The label can be displayed until the end of this date.
194
+ */
195
+ labelExpiryDate?: Schema$Date;
196
+ /**
197
+ * The date when the label was issued.
198
+ */
199
+ labelIssueDate?: Schema$Date;
200
+ /**
201
+ * Version of the label.
202
+ */
203
+ labelVersion?: string | null;
204
+ /**
205
+ * 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.
206
+ */
207
+ safDiscountPercentage?: number | null;
208
+ }
166
209
  /**
167
210
  * Grouped emissions per seating class results.
168
211
  */
@@ -214,16 +257,41 @@ export namespace travelimpactmodel_v1 {
214
257
  */
215
258
  export interface Schema$FlightWithEmissions {
216
259
  /**
217
- * 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.
260
+ * Optional. The significance of contrails warming impact compared to the total CO2e emissions impact.
261
+ */
262
+ contrailsImpactBucket?: string | null;
263
+ /**
264
+ * Optional. Metadata about the EASA Flight Emissions Label. Only set when the emissions data source is EASA.
265
+ */
266
+ easaLabelMetadata?: Schema$EasaLabelMetadata;
267
+ /**
268
+ * 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.
218
269
  */
219
270
  emissionsGramsPerPax?: Schema$EmissionsGramsPerPax;
220
271
  /**
221
272
  * Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized.
222
273
  */
223
274
  flight?: Schema$Flight;
275
+ /**
276
+ * Optional. The source of the emissions data.
277
+ */
278
+ source?: string | null;
279
+ }
280
+ /**
281
+ * A pair of airports.
282
+ */
283
+ export interface Schema$Market {
284
+ /**
285
+ * Required. IATA airport code for flight destination, e.g. "JFK".
286
+ */
287
+ destination?: string | null;
288
+ /**
289
+ * Required. IATA airport code for flight origin, e.g. "LHR".
290
+ */
291
+ origin?: string | null;
224
292
  }
225
293
  /**
226
- * Travel Impact Model version. For more information about the model versioning see https://github.com/google/travel-impact-model/#versioning.
294
+ * Travel Impact Model version. For more information about the model versioning see [GitHub](https://github.com/google/travel-impact-model/#versioning).
227
295
  */
228
296
  export interface Schema$ModelVersion {
229
297
  /**
@@ -231,7 +299,7 @@ export namespace travelimpactmodel_v1 {
231
299
  */
232
300
  dated?: string | null;
233
301
  /**
234
- * 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
302
+ * 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)
235
303
  */
236
304
  major?: number | null;
237
305
  /**
@@ -243,6 +311,19 @@ export namespace travelimpactmodel_v1 {
243
311
  */
244
312
  patch?: number | null;
245
313
  }
314
+ /**
315
+ * Typical flight emission estimates for a certain market
316
+ */
317
+ export interface Schema$TypicalFlightEmissions {
318
+ /**
319
+ * 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).
320
+ */
321
+ emissionsGramsPerPax?: Schema$EmissionsGramsPerPax;
322
+ /**
323
+ * Required. Matches the flight identifiers in the request. Note: all IATA codes are capitalized.
324
+ */
325
+ market?: Schema$Market;
326
+ }
246
327
 
247
328
  export class Resource$Flights {
248
329
  context: APIRequestContext;
@@ -251,7 +332,59 @@ export namespace travelimpactmodel_v1 {
251
332
  }
252
333
 
253
334
  /**
254
- * 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.
335
+ * 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.
336
+ * @example
337
+ * ```js
338
+ * // Before running the sample:
339
+ * // - Enable the API at:
340
+ * // https://console.developers.google.com/apis/api/travelimpactmodel.googleapis.com
341
+ * // - Login into gcloud by running:
342
+ * // ```sh
343
+ * // $ gcloud auth application-default login
344
+ * // ```
345
+ * // - Install the npm module by running:
346
+ * // ```sh
347
+ * // $ npm install googleapis
348
+ * // ```
349
+ *
350
+ * const {google} = require('googleapis');
351
+ * const travelimpactmodel = google.travelimpactmodel('v1');
352
+ *
353
+ * async function main() {
354
+ * const auth = new google.auth.GoogleAuth({
355
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
356
+ * scopes: [],
357
+ * });
358
+ *
359
+ * // Acquire an auth client, and bind it to all future calls
360
+ * const authClient = await auth.getClient();
361
+ * google.options({auth: authClient});
362
+ *
363
+ * // Do the magic
364
+ * const res = await travelimpactmodel.flights.computeFlightEmissions({
365
+ * // Request body metadata
366
+ * requestBody: {
367
+ * // request body parameters
368
+ * // {
369
+ * // "flights": []
370
+ * // }
371
+ * },
372
+ * });
373
+ * console.log(res.data);
374
+ *
375
+ * // Example response
376
+ * // {
377
+ * // "flightEmissions": [],
378
+ * // "modelVersion": {}
379
+ * // }
380
+ * }
381
+ *
382
+ * main().catch(e => {
383
+ * console.error(e);
384
+ * throw e;
385
+ * });
386
+ *
387
+ * ```
255
388
  *
256
389
  * @param params - Parameters for request
257
390
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -347,6 +480,159 @@ export namespace travelimpactmodel_v1 {
347
480
  );
348
481
  }
349
482
  }
483
+
484
+ /**
485
+ * 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.
486
+ * @example
487
+ * ```js
488
+ * // Before running the sample:
489
+ * // - Enable the API at:
490
+ * // https://console.developers.google.com/apis/api/travelimpactmodel.googleapis.com
491
+ * // - Login into gcloud by running:
492
+ * // ```sh
493
+ * // $ gcloud auth application-default login
494
+ * // ```
495
+ * // - Install the npm module by running:
496
+ * // ```sh
497
+ * // $ npm install googleapis
498
+ * // ```
499
+ *
500
+ * const {google} = require('googleapis');
501
+ * const travelimpactmodel = google.travelimpactmodel('v1');
502
+ *
503
+ * async function main() {
504
+ * const auth = new google.auth.GoogleAuth({
505
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
506
+ * scopes: [],
507
+ * });
508
+ *
509
+ * // Acquire an auth client, and bind it to all future calls
510
+ * const authClient = await auth.getClient();
511
+ * google.options({auth: authClient});
512
+ *
513
+ * // Do the magic
514
+ * const res = await travelimpactmodel.flights.computeTypicalFlightEmissions({
515
+ * // Request body metadata
516
+ * requestBody: {
517
+ * // request body parameters
518
+ * // {
519
+ * // "markets": []
520
+ * // }
521
+ * },
522
+ * });
523
+ * console.log(res.data);
524
+ *
525
+ * // Example response
526
+ * // {
527
+ * // "modelVersion": {},
528
+ * // "typicalFlightEmissions": []
529
+ * // }
530
+ * }
531
+ *
532
+ * main().catch(e => {
533
+ * console.error(e);
534
+ * throw e;
535
+ * });
536
+ *
537
+ * ```
538
+ *
539
+ * @param params - Parameters for request
540
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
541
+ * @param callback - Optional callback that handles the response.
542
+ * @returns A promise if used with async/await, or void if used with a callback.
543
+ */
544
+ computeTypicalFlightEmissions(
545
+ params: Params$Resource$Flights$Computetypicalflightemissions,
546
+ options: StreamMethodOptions
547
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
548
+ computeTypicalFlightEmissions(
549
+ params?: Params$Resource$Flights$Computetypicalflightemissions,
550
+ options?: MethodOptions
551
+ ): Promise<
552
+ GaxiosResponseWithHTTP2<Schema$ComputeTypicalFlightEmissionsResponse>
553
+ >;
554
+ computeTypicalFlightEmissions(
555
+ params: Params$Resource$Flights$Computetypicalflightemissions,
556
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
557
+ callback: BodyResponseCallback<Readable>
558
+ ): void;
559
+ computeTypicalFlightEmissions(
560
+ params: Params$Resource$Flights$Computetypicalflightemissions,
561
+ options:
562
+ | MethodOptions
563
+ | BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>,
564
+ callback: BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>
565
+ ): void;
566
+ computeTypicalFlightEmissions(
567
+ params: Params$Resource$Flights$Computetypicalflightemissions,
568
+ callback: BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>
569
+ ): void;
570
+ computeTypicalFlightEmissions(
571
+ callback: BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>
572
+ ): void;
573
+ computeTypicalFlightEmissions(
574
+ paramsOrCallback?:
575
+ | Params$Resource$Flights$Computetypicalflightemissions
576
+ | BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>
577
+ | BodyResponseCallback<Readable>,
578
+ optionsOrCallback?:
579
+ | MethodOptions
580
+ | StreamMethodOptions
581
+ | BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>
582
+ | BodyResponseCallback<Readable>,
583
+ callback?:
584
+ | BodyResponseCallback<Schema$ComputeTypicalFlightEmissionsResponse>
585
+ | BodyResponseCallback<Readable>
586
+ ):
587
+ | void
588
+ | Promise<
589
+ GaxiosResponseWithHTTP2<Schema$ComputeTypicalFlightEmissionsResponse>
590
+ >
591
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
592
+ let params = (paramsOrCallback ||
593
+ {}) as Params$Resource$Flights$Computetypicalflightemissions;
594
+ let options = (optionsOrCallback || {}) as MethodOptions;
595
+
596
+ if (typeof paramsOrCallback === 'function') {
597
+ callback = paramsOrCallback;
598
+ params = {} as Params$Resource$Flights$Computetypicalflightemissions;
599
+ options = {};
600
+ }
601
+
602
+ if (typeof optionsOrCallback === 'function') {
603
+ callback = optionsOrCallback;
604
+ options = {};
605
+ }
606
+
607
+ const rootUrl =
608
+ options.rootUrl || 'https://travelimpactmodel.googleapis.com/';
609
+ const parameters = {
610
+ options: Object.assign(
611
+ {
612
+ url: (
613
+ rootUrl + '/v1/flights:computeTypicalFlightEmissions'
614
+ ).replace(/([^:]\/)\/+/g, '$1'),
615
+ method: 'POST',
616
+ apiVersion: '',
617
+ },
618
+ options
619
+ ),
620
+ params,
621
+ requiredParams: [],
622
+ pathParams: [],
623
+ context: this.context,
624
+ };
625
+ if (callback) {
626
+ createAPIRequest<Schema$ComputeTypicalFlightEmissionsResponse>(
627
+ parameters,
628
+ callback as BodyResponseCallback<unknown>
629
+ );
630
+ } else {
631
+ return createAPIRequest<Schema$ComputeTypicalFlightEmissionsResponse>(
632
+ parameters
633
+ );
634
+ }
635
+ }
350
636
  }
351
637
 
352
638
  export interface Params$Resource$Flights$Computeflightemissions
@@ -356,4 +642,11 @@ export namespace travelimpactmodel_v1 {
356
642
  */
357
643
  requestBody?: Schema$ComputeFlightEmissionsRequest;
358
644
  }
645
+ export interface Params$Resource$Flights$Computetypicalflightemissions
646
+ extends StandardParameters {
647
+ /**
648
+ * Request body metadata
649
+ */
650
+ requestBody?: Schema$ComputeTypicalFlightEmissionsRequest;
651
+ }
359
652
  }