Skip to content

Commit 1123c3d

Browse files
1 parent be26a19 commit 1123c3d

File tree

8 files changed

+784
-6
lines changed

8 files changed

+784
-6
lines changed

clients/google-api-services-travelimpactmodel/v1/2.0.0/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file:
2222
<dependency>
2323
<groupId>com.google.apis</groupId>
2424
<artifactId>google-api-services-travelimpactmodel</artifactId>
25-
<version>v1-rev20250624-2.0.0</version>
25+
<version>v1-rev20251007-2.0.0</version>
2626
</dependency>
2727
</dependencies>
2828
</project>
@@ -35,7 +35,7 @@ repositories {
3535
mavenCentral()
3636
}
3737
dependencies {
38-
implementation 'com.google.apis:google-api-services-travelimpactmodel:v1-rev20250624-2.0.0'
38+
implementation 'com.google.apis:google-api-services-travelimpactmodel:v1-rev20251007-2.0.0'
3939
}
4040
```
4141

clients/google-api-services-travelimpactmodel/v1/2.0.0/com/google/api/services/travelimpactmodel/v1/TravelImpactModel.java

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,156 @@ public ComputeFlightEmissions set(String parameterName, Object value) {
269269
return (ComputeFlightEmissions) super.set(parameterName, value);
270270
}
271271
}
272+
/**
273+
* Stateless method to retrieve GHG emissions estimates for a set of flight segments for Scope 3
274+
* reporting. The response will contain all entries that match the input Scope3FlightSegment flight
275+
* segments, in the same order provided. The estimates will be computed using the following
276+
* cascading logic (using the first one that is available): 1. TIM-based emissions given origin,
277+
* destination, carrier, flightNumber, departureDate, and cabinClass. 2. Typical flight emissions
278+
* given origin, destination, year in departureDate, and cabinClass. 3. Distance-based emissions
279+
* calculated using distanceKm, year in departureDate, and cabinClass. If there are no estimates
280+
* available for a certain flight with any of the three methods, the response will return a
281+
* Scope3FlightEmissions object with empty emission fields. The request will still be considered
282+
* successful. Generally, missing emissions estimates occur when the flight is unknown to the server
283+
* (e.g. no specific flight exists, or typical flight emissions are not available for the requested
284+
* pair). The request will fail with an `INVALID_ARGUMENT` error if: * The request contains more
285+
* than 1,000 flight legs. * The input flight leg is missing one or more identifiers. For example,
286+
* missing origin/destination without a valid distance for TIM_EMISSIONS or TYPICAL_FLIGHT_EMISSIONS
287+
* type matching, or missing distance for a DISTANCE_BASED_EMISSIONS type matching (if you want to
288+
* fallback to distance-based emissions or want a distance-based emissions estimate, you need to
289+
* specify a distance). * The flight date is before 2019 (Scope 3 data is only available for 2019
290+
* and after). * The flight distance is not between 0 and 25,000,000,000,000,000 km. * Missing cabin
291+
* class. Because the request is processed with fallback logic, it is possible that misconfigured
292+
* requests return valid emissions estimates using fallback methods. For example, if a request has
293+
* the wrong flight number but specifies the origin and destination, the request will still succeed,
294+
* but the returned emissions will be based solely on the typical flight emissions. Similarly, if a
295+
* request is missing the origin for a typical flight emissions request, but specifies a valid
296+
* distance, the request could succeed based solely on the distance-based emissions. Consequently,
297+
* one should check the source of the returned emissions (source) to confirm the results are as
298+
* expected.
299+
*
300+
* Create a request for the method "flights.computeScope3FlightEmissions".
301+
*
302+
* This request holds the parameters needed by the travelimpactmodel server. After setting any
303+
* optional parameters, call the {@link ComputeScope3FlightEmissions#execute()} method to invoke the
304+
* remote operation.
305+
*
306+
* @param content the {@link com.google.api.services.travelimpactmodel.v1.model.ComputeScope3FlightEmissionsRequest}
307+
* @return the request
308+
*/
309+
public ComputeScope3FlightEmissions computeScope3FlightEmissions(com.google.api.services.travelimpactmodel.v1.model.ComputeScope3FlightEmissionsRequest content) throws java.io.IOException {
310+
ComputeScope3FlightEmissions result = new ComputeScope3FlightEmissions(content);
311+
initialize(result);
312+
return result;
313+
}
314+
315+
public class ComputeScope3FlightEmissions extends TravelImpactModelRequest<com.google.api.services.travelimpactmodel.v1.model.ComputeScope3FlightEmissionsResponse> {
316+
317+
private static final String REST_PATH = "v1/flights:computeScope3FlightEmissions";
318+
319+
/**
320+
* Stateless method to retrieve GHG emissions estimates for a set of flight segments for Scope 3
321+
* reporting. The response will contain all entries that match the input Scope3FlightSegment
322+
* flight segments, in the same order provided. The estimates will be computed using the following
323+
* cascading logic (using the first one that is available): 1. TIM-based emissions given origin,
324+
* destination, carrier, flightNumber, departureDate, and cabinClass. 2. Typical flight emissions
325+
* given origin, destination, year in departureDate, and cabinClass. 3. Distance-based emissions
326+
* calculated using distanceKm, year in departureDate, and cabinClass. If there are no estimates
327+
* available for a certain flight with any of the three methods, the response will return a
328+
* Scope3FlightEmissions object with empty emission fields. The request will still be considered
329+
* successful. Generally, missing emissions estimates occur when the flight is unknown to the
330+
* server (e.g. no specific flight exists, or typical flight emissions are not available for the
331+
* requested pair). The request will fail with an `INVALID_ARGUMENT` error if: * The request
332+
* contains more than 1,000 flight legs. * The input flight leg is missing one or more
333+
* identifiers. For example, missing origin/destination without a valid distance for TIM_EMISSIONS
334+
* or TYPICAL_FLIGHT_EMISSIONS type matching, or missing distance for a DISTANCE_BASED_EMISSIONS
335+
* type matching (if you want to fallback to distance-based emissions or want a distance-based
336+
* emissions estimate, you need to specify a distance). * The flight date is before 2019 (Scope 3
337+
* data is only available for 2019 and after). * The flight distance is not between 0 and
338+
* 25,000,000,000,000,000 km. * Missing cabin class. Because the request is processed with
339+
* fallback logic, it is possible that misconfigured requests return valid emissions estimates
340+
* using fallback methods. For example, if a request has the wrong flight number but specifies the
341+
* origin and destination, the request will still succeed, but the returned emissions will be
342+
* based solely on the typical flight emissions. Similarly, if a request is missing the origin for
343+
* a typical flight emissions request, but specifies a valid distance, the request could succeed
344+
* based solely on the distance-based emissions. Consequently, one should check the source of the
345+
* returned emissions (source) to confirm the results are as expected.
346+
*
347+
* Create a request for the method "flights.computeScope3FlightEmissions".
348+
*
349+
* This request holds the parameters needed by the the travelimpactmodel server. After setting
350+
* any optional parameters, call the {@link ComputeScope3FlightEmissions#execute()} method to
351+
* invoke the remote operation. <p> {@link ComputeScope3FlightEmissions#initialize(com.google.api.
352+
* client.googleapis.services.AbstractGoogleClientRequest)} must be called to initialize this
353+
* instance immediately after invoking the constructor. </p>
354+
*
355+
* @param content the {@link com.google.api.services.travelimpactmodel.v1.model.ComputeScope3FlightEmissionsRequest}
356+
* @since 1.13
357+
*/
358+
protected ComputeScope3FlightEmissions(com.google.api.services.travelimpactmodel.v1.model.ComputeScope3FlightEmissionsRequest content) {
359+
super(TravelImpactModel.this, "POST", REST_PATH, content, com.google.api.services.travelimpactmodel.v1.model.ComputeScope3FlightEmissionsResponse.class);
360+
}
361+
362+
@Override
363+
public ComputeScope3FlightEmissions set$Xgafv(java.lang.String $Xgafv) {
364+
return (ComputeScope3FlightEmissions) super.set$Xgafv($Xgafv);
365+
}
366+
367+
@Override
368+
public ComputeScope3FlightEmissions setAccessToken(java.lang.String accessToken) {
369+
return (ComputeScope3FlightEmissions) super.setAccessToken(accessToken);
370+
}
371+
372+
@Override
373+
public ComputeScope3FlightEmissions setAlt(java.lang.String alt) {
374+
return (ComputeScope3FlightEmissions) super.setAlt(alt);
375+
}
376+
377+
@Override
378+
public ComputeScope3FlightEmissions setCallback(java.lang.String callback) {
379+
return (ComputeScope3FlightEmissions) super.setCallback(callback);
380+
}
381+
382+
@Override
383+
public ComputeScope3FlightEmissions setFields(java.lang.String fields) {
384+
return (ComputeScope3FlightEmissions) super.setFields(fields);
385+
}
386+
387+
@Override
388+
public ComputeScope3FlightEmissions setKey(java.lang.String key) {
389+
return (ComputeScope3FlightEmissions) super.setKey(key);
390+
}
391+
392+
@Override
393+
public ComputeScope3FlightEmissions setOauthToken(java.lang.String oauthToken) {
394+
return (ComputeScope3FlightEmissions) super.setOauthToken(oauthToken);
395+
}
396+
397+
@Override
398+
public ComputeScope3FlightEmissions setPrettyPrint(java.lang.Boolean prettyPrint) {
399+
return (ComputeScope3FlightEmissions) super.setPrettyPrint(prettyPrint);
400+
}
401+
402+
@Override
403+
public ComputeScope3FlightEmissions setQuotaUser(java.lang.String quotaUser) {
404+
return (ComputeScope3FlightEmissions) super.setQuotaUser(quotaUser);
405+
}
406+
407+
@Override
408+
public ComputeScope3FlightEmissions setUploadType(java.lang.String uploadType) {
409+
return (ComputeScope3FlightEmissions) super.setUploadType(uploadType);
410+
}
411+
412+
@Override
413+
public ComputeScope3FlightEmissions setUploadProtocol(java.lang.String uploadProtocol) {
414+
return (ComputeScope3FlightEmissions) super.setUploadProtocol(uploadProtocol);
415+
}
416+
417+
@Override
418+
public ComputeScope3FlightEmissions set(String parameterName, Object value) {
419+
return (ComputeScope3FlightEmissions) super.set(parameterName, value);
420+
}
421+
}
272422
/**
273423
* Retrieves typical flight emissions estimates between two airports, also known as a market. If
274424
* there are no estimates available for a certain market, the response will return the market object
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
3+
* in compliance with the License. You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under the License
8+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9+
* or implied. See the License for the specific language governing permissions and limitations under
10+
* the License.
11+
*/
12+
/*
13+
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
14+
* Modify at your own risk.
15+
*/
16+
17+
package com.google.api.services.travelimpactmodel.v1.model;
18+
19+
/**
20+
* A list of flight segments to request the Scope 3 emissions for.
21+
*
22+
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
23+
* transmitted over HTTP when working with the Travel Impact Model API. For a detailed explanation
24+
* see:
25+
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
26+
* </p>
27+
*
28+
* @author Google, Inc.
29+
*/
30+
@SuppressWarnings("javadoc")
31+
public final class ComputeScope3FlightEmissionsRequest extends com.google.api.client.json.GenericJson {
32+
33+
/**
34+
* Required. Flights to return emission estimates for.
35+
* The value may be {@code null}.
36+
*/
37+
@com.google.api.client.util.Key
38+
private java.util.List<Scope3FlightSegment> flights;
39+
40+
/**
41+
* Optional. The model version under which emission estimates for all flights in this request were
42+
* computed.
43+
* The value may be {@code null}.
44+
*/
45+
@com.google.api.client.util.Key
46+
private ModelVersion modelVersion;
47+
48+
/**
49+
* Required. Flights to return emission estimates for.
50+
* @return value or {@code null} for none
51+
*/
52+
public java.util.List<Scope3FlightSegment> getFlights() {
53+
return flights;
54+
}
55+
56+
/**
57+
* Required. Flights to return emission estimates for.
58+
* @param flights flights or {@code null} for none
59+
*/
60+
public ComputeScope3FlightEmissionsRequest setFlights(java.util.List<Scope3FlightSegment> flights) {
61+
this.flights = flights;
62+
return this;
63+
}
64+
65+
/**
66+
* Optional. The model version under which emission estimates for all flights in this request were
67+
* computed.
68+
* @return value or {@code null} for none
69+
*/
70+
public ModelVersion getModelVersion() {
71+
return modelVersion;
72+
}
73+
74+
/**
75+
* Optional. The model version under which emission estimates for all flights in this request were
76+
* computed.
77+
* @param modelVersion modelVersion or {@code null} for none
78+
*/
79+
public ComputeScope3FlightEmissionsRequest setModelVersion(ModelVersion modelVersion) {
80+
this.modelVersion = modelVersion;
81+
return this;
82+
}
83+
84+
@Override
85+
public ComputeScope3FlightEmissionsRequest set(String fieldName, Object value) {
86+
return (ComputeScope3FlightEmissionsRequest) super.set(fieldName, value);
87+
}
88+
89+
@Override
90+
public ComputeScope3FlightEmissionsRequest clone() {
91+
return (ComputeScope3FlightEmissionsRequest) super.clone();
92+
}
93+
94+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
3+
* in compliance with the License. You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under the License
8+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9+
* or implied. See the License for the specific language governing permissions and limitations under
10+
* the License.
11+
*/
12+
/*
13+
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
14+
* Modify at your own risk.
15+
*/
16+
17+
package com.google.api.services.travelimpactmodel.v1.model;
18+
19+
/**
20+
* A list of flights with Scope 3 emission estimates.
21+
*
22+
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
23+
* transmitted over HTTP when working with the Travel Impact Model API. For a detailed explanation
24+
* see:
25+
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
26+
* </p>
27+
*
28+
* @author Google, Inc.
29+
*/
30+
@SuppressWarnings("javadoc")
31+
public final class ComputeScope3FlightEmissionsResponse extends com.google.api.client.json.GenericJson {
32+
33+
/**
34+
* List of flight segments with emission estimates.
35+
* The value may be {@code null}.
36+
*/
37+
@com.google.api.client.util.Key
38+
private java.util.List<Scope3FlightEmissions> flightEmissions;
39+
40+
/**
41+
* The model version under which emission estimates for all flights in this response were
42+
* computed.
43+
* The value may be {@code null}.
44+
*/
45+
@com.google.api.client.util.Key
46+
private ModelVersion modelVersion;
47+
48+
/**
49+
* List of flight segments with emission estimates.
50+
* @return value or {@code null} for none
51+
*/
52+
public java.util.List<Scope3FlightEmissions> getFlightEmissions() {
53+
return flightEmissions;
54+
}
55+
56+
/**
57+
* List of flight segments with emission estimates.
58+
* @param flightEmissions flightEmissions or {@code null} for none
59+
*/
60+
public ComputeScope3FlightEmissionsResponse setFlightEmissions(java.util.List<Scope3FlightEmissions> flightEmissions) {
61+
this.flightEmissions = flightEmissions;
62+
return this;
63+
}
64+
65+
/**
66+
* The model version under which emission estimates for all flights in this response were
67+
* computed.
68+
* @return value or {@code null} for none
69+
*/
70+
public ModelVersion getModelVersion() {
71+
return modelVersion;
72+
}
73+
74+
/**
75+
* The model version under which emission estimates for all flights in this response were
76+
* computed.
77+
* @param modelVersion modelVersion or {@code null} for none
78+
*/
79+
public ComputeScope3FlightEmissionsResponse setModelVersion(ModelVersion modelVersion) {
80+
this.modelVersion = modelVersion;
81+
return this;
82+
}
83+
84+
@Override
85+
public ComputeScope3FlightEmissionsResponse set(String fieldName, Object value) {
86+
return (ComputeScope3FlightEmissionsResponse) super.set(fieldName, value);
87+
}
88+
89+
@Override
90+
public ComputeScope3FlightEmissionsResponse clone() {
91+
return (ComputeScope3FlightEmissionsResponse) super.clone();
92+
}
93+
94+
}

0 commit comments

Comments
 (0)