google-apis-travelimpactmodel_v1 0.7.0 → 0.8.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/google/apis/travelimpactmodel_v1/classes.rb +100 -4
- data/lib/google/apis/travelimpactmodel_v1/gem_version.rb +3 -3
- data/lib/google/apis/travelimpactmodel_v1/representations.rb +60 -0
- data/lib/google/apis/travelimpactmodel_v1/service.rb +42 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e8a588877dc7686102167f97b31ac25fe570214780b584919cb2b7306944a8c
|
4
|
+
data.tar.gz: 509b1c084e39af9935202d68d5ddf542cf811aeb5e623964203fc00815e7fcd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99fd0b2c566da81c912790e5b784caa5f9a33c9fcb9c39a0e4feef7529719cdaae8940682d1eb1f43846be5328db09780e9b1bf7c7c15e1ce936e2b311fc7c7c
|
7
|
+
data.tar.gz: c99318f940bb65ea57bfdacd61a7df785da16f707c84515d76050982337885e3f5b5bff1b15c9f1648bcce268a159951abb766b0ff955b9a4ed4d499a561427d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Release history for google-apis-travelimpactmodel_v1
|
2
2
|
|
3
|
+
### v0.8.0 (2025-06-08)
|
4
|
+
|
5
|
+
* Regenerated from discovery document revision 20250605
|
6
|
+
* Regenerated using generator version 0.18.0
|
7
|
+
|
3
8
|
### v0.7.0 (2025-05-04)
|
4
9
|
|
5
10
|
* Regenerated using generator version 0.17.0
|
@@ -51,7 +51,7 @@ module Google
|
|
51
51
|
attr_accessor :flight_emissions
|
52
52
|
|
53
53
|
# 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).
|
55
55
|
# Corresponds to the JSON property `modelVersion`
|
56
56
|
# @return [Google::Apis::TravelimpactmodelV1::ModelVersion]
|
57
57
|
attr_accessor :model_version
|
@@ -67,6 +67,52 @@ module Google
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
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
|
+
|
70
116
|
# Represents a whole or partial calendar date, such as a birthday. The time of
|
71
117
|
# day and time zone are either specified elsewhere or are insignificant. The
|
72
118
|
# date is relative to the Gregorian Calendar. This can represent one of the
|
@@ -230,8 +276,33 @@ module Google
|
|
230
276
|
end
|
231
277
|
end
|
232
278
|
|
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
|
+
|
233
304
|
# 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).
|
235
306
|
class ModelVersion
|
236
307
|
include Google::Apis::Core::Hashable
|
237
308
|
|
@@ -244,8 +315,8 @@ module Google
|
|
244
315
|
# Major versions: Major changes to methodology (e.g. adding new data sources to
|
245
316
|
# the model that lead to major output changes). Such changes will be infrequent
|
246
317
|
# and announced well in advance. Might involve API version changes, which will
|
247
|
-
# respect
|
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)
|
249
320
|
# Corresponds to the JSON property `major`
|
250
321
|
# @return [Fixnum]
|
251
322
|
attr_accessor :major
|
@@ -274,6 +345,31 @@ module Google
|
|
274
345
|
@patch = args[:patch] if args.key?(:patch)
|
275
346
|
end
|
276
347
|
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
|
277
373
|
end
|
278
374
|
end
|
279
375
|
end
|
@@ -16,13 +16,13 @@ module Google
|
|
16
16
|
module Apis
|
17
17
|
module TravelimpactmodelV1
|
18
18
|
# Version of the google-apis-travelimpactmodel_v1 gem
|
19
|
-
GEM_VERSION = "0.
|
19
|
+
GEM_VERSION = "0.8.0"
|
20
20
|
|
21
21
|
# Version of the code generator used to generate this client
|
22
|
-
GENERATOR_VERSION = "0.
|
22
|
+
GENERATOR_VERSION = "0.18.0"
|
23
23
|
|
24
24
|
# Revision of the discovery document this client was generated from
|
25
|
-
REVISION = "
|
25
|
+
REVISION = "20250605"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -34,6 +34,18 @@ module Google
|
|
34
34
|
include Google::Apis::Core::JsonObjectSupport
|
35
35
|
end
|
36
36
|
|
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
|
+
|
37
49
|
class Date
|
38
50
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
51
|
|
@@ -58,12 +70,24 @@ module Google
|
|
58
70
|
include Google::Apis::Core::JsonObjectSupport
|
59
71
|
end
|
60
72
|
|
73
|
+
class Market
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
61
79
|
class ModelVersion
|
62
80
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
81
|
|
64
82
|
include Google::Apis::Core::JsonObjectSupport
|
65
83
|
end
|
66
84
|
|
85
|
+
class TypicalFlightEmissions
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
67
91
|
class ComputeFlightEmissionsRequest
|
68
92
|
# @private
|
69
93
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -82,6 +106,24 @@ module Google
|
|
82
106
|
end
|
83
107
|
end
|
84
108
|
|
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
|
+
|
85
127
|
class Date
|
86
128
|
# @private
|
87
129
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -123,6 +165,14 @@ module Google
|
|
123
165
|
end
|
124
166
|
end
|
125
167
|
|
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
|
+
|
126
176
|
class ModelVersion
|
127
177
|
# @private
|
128
178
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -132,6 +182,16 @@ module Google
|
|
132
182
|
property :patch, as: 'patch'
|
133
183
|
end
|
134
184
|
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
|
135
195
|
end
|
136
196
|
end
|
137
197
|
end
|
@@ -52,11 +52,11 @@ module Google
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Stateless method to retrieve emission estimates. Details on how emission
|
55
|
-
# estimates are computed
|
56
|
-
# response will contain all entries that match the input flight legs,
|
57
|
-
# same order. If there are no estimates available for a certain flight
|
58
|
-
# response will return the flight leg object with empty emission fields.
|
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
|
60
60
|
# estimates include: * The flight is unknown to the server. * The input flight
|
61
61
|
# leg is missing one or more identifiers. * The flight date is in the past. *
|
62
62
|
# The aircraft type is not supported by the model. * Missing seat configuration.
|
@@ -90,6 +90,43 @@ module Google
|
|
90
90
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
91
91
|
execute_or_queue_command(command, &block)
|
92
92
|
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
|
93
130
|
|
94
131
|
protected
|
95
132
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-travelimpactmodel_v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
@@ -57,7 +57,7 @@ licenses:
|
|
57
57
|
metadata:
|
58
58
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
59
59
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-travelimpactmodel_v1/CHANGELOG.md
|
60
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-travelimpactmodel_v1/v0.
|
60
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-travelimpactmodel_v1/v0.8.0
|
61
61
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-travelimpactmodel_v1
|
62
62
|
rdoc_options: []
|
63
63
|
require_paths:
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
|
-
rubygems_version: 3.6.
|
76
|
+
rubygems_version: 3.6.9
|
77
77
|
specification_version: 4
|
78
78
|
summary: Simple REST client for Travel Impact Model API V1
|
79
79
|
test_files: []
|