Skip to content

Commit 01d9146

Browse files
feat: Automated regeneration of travelimpactmodel v1 client (googleapis#23375)
Auto-created at 2025-06-08 10:53:28 +0000 using the toys pull request generator.
1 parent 57b8721 commit 01d9146

File tree

6 files changed

+224
-12
lines changed

6 files changed

+224
-12
lines changed

api_names_out.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354871,6 +354871,13 @@
354871354871
"/travelimpactmodel:v1/ComputeFlightEmissionsResponse/flightEmissions": flight_emissions
354872354872
"/travelimpactmodel:v1/ComputeFlightEmissionsResponse/flightEmissions/flight_emission": flight_emission
354873354873
"/travelimpactmodel:v1/ComputeFlightEmissionsResponse/modelVersion": model_version
354874+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsRequest": compute_typical_flight_emissions_request
354875+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsRequest/markets": markets
354876+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsRequest/markets/market": market
354877+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsResponse": compute_typical_flight_emissions_response
354878+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsResponse/modelVersion": model_version
354879+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsResponse/typicalFlightEmissions": typical_flight_emissions
354880+
"/travelimpactmodel:v1/ComputeTypicalFlightEmissionsResponse/typicalFlightEmissions/typical_flight_emission": typical_flight_emission
354874354881
"/travelimpactmodel:v1/Date": date
354875354882
"/travelimpactmodel:v1/Date/day": day
354876354883
"/travelimpactmodel:v1/Date/month": month
@@ -354889,15 +354896,22 @@
354889354896
"/travelimpactmodel:v1/FlightWithEmissions": flight_with_emissions
354890354897
"/travelimpactmodel:v1/FlightWithEmissions/emissionsGramsPerPax": emissions_grams_per_pax
354891354898
"/travelimpactmodel:v1/FlightWithEmissions/flight": flight
354899+
"/travelimpactmodel:v1/Market": market
354900+
"/travelimpactmodel:v1/Market/destination": destination
354901+
"/travelimpactmodel:v1/Market/origin": origin
354892354902
"/travelimpactmodel:v1/ModelVersion": model_version
354893354903
"/travelimpactmodel:v1/ModelVersion/dated": dated
354894354904
"/travelimpactmodel:v1/ModelVersion/major": major
354895354905
"/travelimpactmodel:v1/ModelVersion/minor": minor
354896354906
"/travelimpactmodel:v1/ModelVersion/patch": patch
354907+
"/travelimpactmodel:v1/TypicalFlightEmissions": typical_flight_emissions
354908+
"/travelimpactmodel:v1/TypicalFlightEmissions/emissionsGramsPerPax": emissions_grams_per_pax
354909+
"/travelimpactmodel:v1/TypicalFlightEmissions/market": market
354897354910
"/travelimpactmodel:v1/fields": fields
354898354911
"/travelimpactmodel:v1/key": key
354899354912
"/travelimpactmodel:v1/quotaUser": quota_user
354900354913
"/travelimpactmodel:v1/travelimpactmodel.flights.computeFlightEmissions": compute_flight_emissions
354914+
"/travelimpactmodel:v1/travelimpactmodel.flights.computeTypicalFlightEmissions": compute_typical_flight_emissions
354901354915
"/urlshortener:v1/AnalyticsSnapshot": analytics_snapshot
354902354916
"/urlshortener:v1/AnalyticsSnapshot/browsers": browsers
354903354917
"/urlshortener:v1/AnalyticsSnapshot/browsers/browser": browser

generated/google-apis-travelimpactmodel_v1/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release history for google-apis-travelimpactmodel_v1
22

3+
### v0.8.0 (2025-06-08)
4+
5+
* Regenerated from discovery document revision 20250605
6+
* Regenerated using generator version 0.18.0
7+
38
### v0.7.0 (2025-05-04)
49

510
* Regenerated using generator version 0.17.0

generated/google-apis-travelimpactmodel_v1/lib/google/apis/travelimpactmodel_v1/classes.rb

Lines changed: 100 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ComputeFlightEmissionsResponse
5151
attr_accessor :flight_emissions
5252

5353
# Travel Impact Model version. For more information about the model versioning
54-
# see https://github.com/google/travel-impact-model/#versioning.
54+
# see [GitHub](https://github.com/google/travel-impact-model/#versioning).
5555
# Corresponds to the JSON property `modelVersion`
5656
# @return [Google::Apis::TravelimpactmodelV1::ModelVersion]
5757
attr_accessor :model_version
@@ -67,6 +67,52 @@ def update!(**args)
6767
end
6868
end
6969

70+
# A list of pair of airports (markets) to request the typical emissions for.
71+
class ComputeTypicalFlightEmissionsRequest
72+
include Google::Apis::Core::Hashable
73+
74+
# Required. Request the typical flight emissions estimates for this market pair.
75+
# A maximum of 1000 markets can be requested.
76+
# Corresponds to the JSON property `markets`
77+
# @return [Array<Google::Apis::TravelimpactmodelV1::Market>]
78+
attr_accessor :markets
79+
80+
def initialize(**args)
81+
update!(**args)
82+
end
83+
84+
# Update properties of this object
85+
def update!(**args)
86+
@markets = args[:markets] if args.key?(:markets)
87+
end
88+
end
89+
90+
# The response includes the emissions but also the model version.
91+
class ComputeTypicalFlightEmissionsResponse
92+
include Google::Apis::Core::Hashable
93+
94+
# Travel Impact Model version. For more information about the model versioning
95+
# see [GitHub](https://github.com/google/travel-impact-model/#versioning).
96+
# Corresponds to the JSON property `modelVersion`
97+
# @return [Google::Apis::TravelimpactmodelV1::ModelVersion]
98+
attr_accessor :model_version
99+
100+
# Market's Typical Flight Emissions requested.
101+
# Corresponds to the JSON property `typicalFlightEmissions`
102+
# @return [Array<Google::Apis::TravelimpactmodelV1::TypicalFlightEmissions>]
103+
attr_accessor :typical_flight_emissions
104+
105+
def initialize(**args)
106+
update!(**args)
107+
end
108+
109+
# Update properties of this object
110+
def update!(**args)
111+
@model_version = args[:model_version] if args.key?(:model_version)
112+
@typical_flight_emissions = args[:typical_flight_emissions] if args.key?(:typical_flight_emissions)
113+
end
114+
end
115+
70116
# Represents a whole or partial calendar date, such as a birthday. The time of
71117
# day and time zone are either specified elsewhere or are insignificant. The
72118
# date is relative to the Gregorian Calendar. This can represent one of the
@@ -230,8 +276,33 @@ def update!(**args)
230276
end
231277
end
232278

279+
# A pair of airports.
280+
class Market
281+
include Google::Apis::Core::Hashable
282+
283+
# Required. IATA airport code for flight destination, e.g. "JFK".
284+
# Corresponds to the JSON property `destination`
285+
# @return [String]
286+
attr_accessor :destination
287+
288+
# Required. IATA airport code for flight origin, e.g. "LHR".
289+
# Corresponds to the JSON property `origin`
290+
# @return [String]
291+
attr_accessor :origin
292+
293+
def initialize(**args)
294+
update!(**args)
295+
end
296+
297+
# Update properties of this object
298+
def update!(**args)
299+
@destination = args[:destination] if args.key?(:destination)
300+
@origin = args[:origin] if args.key?(:origin)
301+
end
302+
end
303+
233304
# Travel Impact Model version. For more information about the model versioning
234-
# see https://github.com/google/travel-impact-model/#versioning.
305+
# see [GitHub](https://github.com/google/travel-impact-model/#versioning).
235306
class ModelVersion
236307
include Google::Apis::Core::Hashable
237308

@@ -244,8 +315,8 @@ class ModelVersion
244315
# Major versions: Major changes to methodology (e.g. adding new data sources to
245316
# the model that lead to major output changes). Such changes will be infrequent
246317
# and announced well in advance. Might involve API version changes, which will
247-
# respect guidelines in https://cloud.google.com/endpoints/docs/openapi/
248-
# versioning-an-api#backwards-incompatible
318+
# respect [Google Cloud API guidelines](https://cloud.google.com/endpoints/docs/
319+
# openapi/versioning-an-api#backwards-incompatible)
249320
# Corresponds to the JSON property `major`
250321
# @return [Fixnum]
251322
attr_accessor :major
@@ -274,6 +345,31 @@ def update!(**args)
274345
@patch = args[:patch] if args.key?(:patch)
275346
end
276347
end
348+
349+
# Typical flight emission estimates for a certain market
350+
class TypicalFlightEmissions
351+
include Google::Apis::Core::Hashable
352+
353+
# Grouped emissions per seating class results.
354+
# Corresponds to the JSON property `emissionsGramsPerPax`
355+
# @return [Google::Apis::TravelimpactmodelV1::EmissionsGramsPerPax]
356+
attr_accessor :emissions_grams_per_pax
357+
358+
# A pair of airports.
359+
# Corresponds to the JSON property `market`
360+
# @return [Google::Apis::TravelimpactmodelV1::Market]
361+
attr_accessor :market
362+
363+
def initialize(**args)
364+
update!(**args)
365+
end
366+
367+
# Update properties of this object
368+
def update!(**args)
369+
@emissions_grams_per_pax = args[:emissions_grams_per_pax] if args.key?(:emissions_grams_per_pax)
370+
@market = args[:market] if args.key?(:market)
371+
end
372+
end
277373
end
278374
end
279375
end

generated/google-apis-travelimpactmodel_v1/lib/google/apis/travelimpactmodel_v1/gem_version.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module Google
1616
module Apis
1717
module TravelimpactmodelV1
1818
# Version of the google-apis-travelimpactmodel_v1 gem
19-
GEM_VERSION = "0.7.0"
19+
GEM_VERSION = "0.8.0"
2020

2121
# Version of the code generator used to generate this client
22-
GENERATOR_VERSION = "0.17.0"
22+
GENERATOR_VERSION = "0.18.0"
2323

2424
# Revision of the discovery document this client was generated from
25-
REVISION = "20250224"
25+
REVISION = "20250605"
2626
end
2727
end
2828
end

generated/google-apis-travelimpactmodel_v1/lib/google/apis/travelimpactmodel_v1/representations.rb

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ class Representation < Google::Apis::Core::JsonRepresentation; end
3434
include Google::Apis::Core::JsonObjectSupport
3535
end
3636

37+
class ComputeTypicalFlightEmissionsRequest
38+
class Representation < Google::Apis::Core::JsonRepresentation; end
39+
40+
include Google::Apis::Core::JsonObjectSupport
41+
end
42+
43+
class ComputeTypicalFlightEmissionsResponse
44+
class Representation < Google::Apis::Core::JsonRepresentation; end
45+
46+
include Google::Apis::Core::JsonObjectSupport
47+
end
48+
3749
class Date
3850
class Representation < Google::Apis::Core::JsonRepresentation; end
3951

@@ -58,12 +70,24 @@ class Representation < Google::Apis::Core::JsonRepresentation; end
5870
include Google::Apis::Core::JsonObjectSupport
5971
end
6072

73+
class Market
74+
class Representation < Google::Apis::Core::JsonRepresentation; end
75+
76+
include Google::Apis::Core::JsonObjectSupport
77+
end
78+
6179
class ModelVersion
6280
class Representation < Google::Apis::Core::JsonRepresentation; end
6381

6482
include Google::Apis::Core::JsonObjectSupport
6583
end
6684

85+
class TypicalFlightEmissions
86+
class Representation < Google::Apis::Core::JsonRepresentation; end
87+
88+
include Google::Apis::Core::JsonObjectSupport
89+
end
90+
6791
class ComputeFlightEmissionsRequest
6892
# @private
6993
class Representation < Google::Apis::Core::JsonRepresentation
@@ -82,6 +106,24 @@ class Representation < Google::Apis::Core::JsonRepresentation
82106
end
83107
end
84108

109+
class ComputeTypicalFlightEmissionsRequest
110+
# @private
111+
class Representation < Google::Apis::Core::JsonRepresentation
112+
collection :markets, as: 'markets', class: Google::Apis::TravelimpactmodelV1::Market, decorator: Google::Apis::TravelimpactmodelV1::Market::Representation
113+
114+
end
115+
end
116+
117+
class ComputeTypicalFlightEmissionsResponse
118+
# @private
119+
class Representation < Google::Apis::Core::JsonRepresentation
120+
property :model_version, as: 'modelVersion', class: Google::Apis::TravelimpactmodelV1::ModelVersion, decorator: Google::Apis::TravelimpactmodelV1::ModelVersion::Representation
121+
122+
collection :typical_flight_emissions, as: 'typicalFlightEmissions', class: Google::Apis::TravelimpactmodelV1::TypicalFlightEmissions, decorator: Google::Apis::TravelimpactmodelV1::TypicalFlightEmissions::Representation
123+
124+
end
125+
end
126+
85127
class Date
86128
# @private
87129
class Representation < Google::Apis::Core::JsonRepresentation
@@ -123,6 +165,14 @@ class Representation < Google::Apis::Core::JsonRepresentation
123165
end
124166
end
125167

168+
class Market
169+
# @private
170+
class Representation < Google::Apis::Core::JsonRepresentation
171+
property :destination, as: 'destination'
172+
property :origin, as: 'origin'
173+
end
174+
end
175+
126176
class ModelVersion
127177
# @private
128178
class Representation < Google::Apis::Core::JsonRepresentation
@@ -132,6 +182,16 @@ class Representation < Google::Apis::Core::JsonRepresentation
132182
property :patch, as: 'patch'
133183
end
134184
end
185+
186+
class TypicalFlightEmissions
187+
# @private
188+
class Representation < Google::Apis::Core::JsonRepresentation
189+
property :emissions_grams_per_pax, as: 'emissionsGramsPerPax', class: Google::Apis::TravelimpactmodelV1::EmissionsGramsPerPax, decorator: Google::Apis::TravelimpactmodelV1::EmissionsGramsPerPax::Representation
190+
191+
property :market, as: 'market', class: Google::Apis::TravelimpactmodelV1::Market, decorator: Google::Apis::TravelimpactmodelV1::Market::Representation
192+
193+
end
194+
end
135195
end
136196
end
137197
end

generated/google-apis-travelimpactmodel_v1/lib/google/apis/travelimpactmodel_v1/service.rb

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ def initialize
5252
end
5353

5454
# Stateless method to retrieve emission estimates. Details on how emission
55-
# estimates are computed: https://github.com/google/travel-impact-model The
56-
# response will contain all entries that match the input flight legs, in the
57-
# same order. If there are no estimates available for a certain flight leg, the
58-
# response will return the flight leg object with empty emission fields. The
59-
# request will still be considered successful. Reasons for missing emission
55+
# estimates are computed are in [GitHub](https://github.com/google/travel-impact-
56+
# model) The response will contain all entries that match the input flight legs,
57+
# in the same order. If there are no estimates available for a certain flight
58+
# leg, the response will return the flight leg object with empty emission fields.
59+
# The request will still be considered successful. Reasons for missing emission
6060
# estimates include: * The flight is unknown to the server. * The input flight
6161
# leg is missing one or more identifiers. * The flight date is in the past. *
6262
# The aircraft type is not supported by the model. * Missing seat configuration.
@@ -90,6 +90,43 @@ def compute_flight_emissions(compute_flight_emissions_request_object = nil, fiel
9090
command.query['quotaUser'] = quota_user unless quota_user.nil?
9191
execute_or_queue_command(command, &block)
9292
end
93+
94+
# Retrieves typical flight emissions estimates between two airports, also known
95+
# as a market. If there are no estimates available for a certain market, the
96+
# response will return the market object with empty emission fields. The request
97+
# will still be considered successful. Details on how the typical emissions
98+
# estimates are computed are on [GitHub](https://github.com/google/travel-impact-
99+
# model/blob/main/projects/typical_flight_emissions.md). The request can contain
100+
# up to 1000 markets. If the request has more than 1000 markets, it will fail
101+
# with an INVALID_ARGUMENT error.
102+
# @param [Google::Apis::TravelimpactmodelV1::ComputeTypicalFlightEmissionsRequest] compute_typical_flight_emissions_request_object
103+
# @param [String] fields
104+
# Selector specifying which fields to include in a partial response.
105+
# @param [String] quota_user
106+
# Available to use for quota purposes for server-side applications. Can be any
107+
# arbitrary string assigned to a user, but should not exceed 40 characters.
108+
# @param [Google::Apis::RequestOptions] options
109+
# Request-specific options
110+
#
111+
# @yield [result, err] Result & error if block supplied
112+
# @yieldparam result [Google::Apis::TravelimpactmodelV1::ComputeTypicalFlightEmissionsResponse] parsed result object
113+
# @yieldparam err [StandardError] error object if request failed
114+
#
115+
# @return [Google::Apis::TravelimpactmodelV1::ComputeTypicalFlightEmissionsResponse]
116+
#
117+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
118+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
119+
# @raise [Google::Apis::AuthorizationError] Authorization is required
120+
def compute_typical_flight_emissions(compute_typical_flight_emissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
121+
command = make_simple_command(:post, 'v1/flights:computeTypicalFlightEmissions', options)
122+
command.request_representation = Google::Apis::TravelimpactmodelV1::ComputeTypicalFlightEmissionsRequest::Representation
123+
command.request_object = compute_typical_flight_emissions_request_object
124+
command.response_representation = Google::Apis::TravelimpactmodelV1::ComputeTypicalFlightEmissionsResponse::Representation
125+
command.response_class = Google::Apis::TravelimpactmodelV1::ComputeTypicalFlightEmissionsResponse
126+
command.query['fields'] = fields unless fields.nil?
127+
command.query['quotaUser'] = quota_user unless quota_user.nil?
128+
execute_or_queue_command(command, &block)
129+
end
93130

94131
protected
95132

0 commit comments

Comments
 (0)