google-apis-travelimpactmodel_v1 0.9.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ccf3adb344fc1a1c6f498a25e772165629195bed89b56210434efc53b9dd9e5
4
- data.tar.gz: 4797489a766e917e19712d7ad68ee7ce3dc9d886aa22997027f939e2fd38ed33
3
+ metadata.gz: 82f49f15572a2deec549d904bd480650bc3166f2d546089d2e1fcd7da47a7c1f
4
+ data.tar.gz: 85e3761e52709d5e06ba59c643580c53663f21e14c0fc9b34908bb7086e07a7f
5
5
  SHA512:
6
- metadata.gz: e90bc66d93d93fbc0e69477301c6430d4fc2170c78136765f39b2687153143fc72dbc4fa28fdeff8a2cf0dc559f4280d8daf318a7952a351bed61050e208ed0c
7
- data.tar.gz: 45890ab3bb8a3b5ac028a926c5b8f583fb0a64a278b72d6ca25808ba955186a57ec8795c03c4ac4468b1557099a8d1bee9cf556eb146bbc4ac9f7d1aed33a85a
6
+ metadata.gz: fbfba6ccdfe5099732c62cceff5f17ee94559046e45b1c01c300f65b7cab53ee741e8efddf60a94d01e19081a7903f2d650965bb45771b40a733f8eb7d286e1f
7
+ data.tar.gz: 4a183e4533d5cbe808c4181eaa84b10df43e9d92eaadee39766712e6bd89e6d1aab8566f07879f9ccf74e7137896d0561759ab3458ab7943a8986d0ff0128877
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release history for google-apis-travelimpactmodel_v1
2
2
 
3
+ ### v0.10.0 (2025-10-12)
4
+
5
+ * Regenerated from discovery document revision 20251008
6
+
3
7
  ### v0.9.0 (2025-06-29)
4
8
 
5
9
  * Regenerated from discovery document revision 20250624
@@ -67,6 +67,58 @@ module Google
67
67
  end
68
68
  end
69
69
 
70
+ # A list of flight segments to request the Scope 3 emissions for.
71
+ class ComputeScope3FlightEmissionsRequest
72
+ include Google::Apis::Core::Hashable
73
+
74
+ # Required. Flights to return emission estimates for.
75
+ # Corresponds to the JSON property `flights`
76
+ # @return [Array<Google::Apis::TravelimpactmodelV1::Scope3FlightSegment>]
77
+ attr_accessor :flights
78
+
79
+ # Travel Impact Model version. For more information about the model versioning
80
+ # see [GitHub](https://github.com/google/travel-impact-model/#versioning).
81
+ # Corresponds to the JSON property `modelVersion`
82
+ # @return [Google::Apis::TravelimpactmodelV1::ModelVersion]
83
+ attr_accessor :model_version
84
+
85
+ def initialize(**args)
86
+ update!(**args)
87
+ end
88
+
89
+ # Update properties of this object
90
+ def update!(**args)
91
+ @flights = args[:flights] if args.key?(:flights)
92
+ @model_version = args[:model_version] if args.key?(:model_version)
93
+ end
94
+ end
95
+
96
+ # A list of flights with Scope 3 emission estimates.
97
+ class ComputeScope3FlightEmissionsResponse
98
+ include Google::Apis::Core::Hashable
99
+
100
+ # List of flight segments with emission estimates.
101
+ # Corresponds to the JSON property `flightEmissions`
102
+ # @return [Array<Google::Apis::TravelimpactmodelV1::Scope3FlightEmissions>]
103
+ attr_accessor :flight_emissions
104
+
105
+ # Travel Impact Model version. For more information about the model versioning
106
+ # see [GitHub](https://github.com/google/travel-impact-model/#versioning).
107
+ # Corresponds to the JSON property `modelVersion`
108
+ # @return [Google::Apis::TravelimpactmodelV1::ModelVersion]
109
+ attr_accessor :model_version
110
+
111
+ def initialize(**args)
112
+ update!(**args)
113
+ end
114
+
115
+ # Update properties of this object
116
+ def update!(**args)
117
+ @flight_emissions = args[:flight_emissions] if args.key?(:flight_emissions)
118
+ @model_version = args[:model_version] if args.key?(:model_version)
119
+ end
120
+ end
121
+
70
122
  # A list of pair of airports (markets) to request the typical emissions for.
71
123
  class ComputeTypicalFlightEmissionsRequest
72
124
  include Google::Apis::Core::Hashable
@@ -420,6 +472,137 @@ module Google
420
472
  end
421
473
  end
422
474
 
475
+ # Scope 3 flight with emission estimates.
476
+ class Scope3FlightEmissions
477
+ include Google::Apis::Core::Hashable
478
+
479
+ # Flight parameters with which the Scope 3 emissions are fetched.
480
+ # Corresponds to the JSON property `flight`
481
+ # @return [Google::Apis::TravelimpactmodelV1::Scope3FlightSegment]
482
+ attr_accessor :flight
483
+
484
+ # Optional. The source of the emissions data.
485
+ # Corresponds to the JSON property `source`
486
+ # @return [String]
487
+ attr_accessor :source
488
+
489
+ # Optional. Tank-to-wake flight emissions per passenger based on the requested
490
+ # info.
491
+ # Corresponds to the JSON property `ttwEmissionsGramsPerPax`
492
+ # @return [Fixnum]
493
+ attr_accessor :ttw_emissions_grams_per_pax
494
+
495
+ # Optional. Well-to-tank flight emissions per passenger based on the requested
496
+ # info.
497
+ # Corresponds to the JSON property `wttEmissionsGramsPerPax`
498
+ # @return [Fixnum]
499
+ attr_accessor :wtt_emissions_grams_per_pax
500
+
501
+ # Optional. Total flight emissions (sum of well-to-tank and tank-to-wake) per
502
+ # passenger based on the requested info. This is the total emissions and unless
503
+ # you have specific reasons for using TTW or WTT emissions, you should use this
504
+ # number.
505
+ # Corresponds to the JSON property `wtwEmissionsGramsPerPax`
506
+ # @return [Fixnum]
507
+ attr_accessor :wtw_emissions_grams_per_pax
508
+
509
+ def initialize(**args)
510
+ update!(**args)
511
+ end
512
+
513
+ # Update properties of this object
514
+ def update!(**args)
515
+ @flight = args[:flight] if args.key?(:flight)
516
+ @source = args[:source] if args.key?(:source)
517
+ @ttw_emissions_grams_per_pax = args[:ttw_emissions_grams_per_pax] if args.key?(:ttw_emissions_grams_per_pax)
518
+ @wtt_emissions_grams_per_pax = args[:wtt_emissions_grams_per_pax] if args.key?(:wtt_emissions_grams_per_pax)
519
+ @wtw_emissions_grams_per_pax = args[:wtw_emissions_grams_per_pax] if args.key?(:wtw_emissions_grams_per_pax)
520
+ end
521
+ end
522
+
523
+ # Flight parameters with which the Scope 3 emissions are fetched.
524
+ class Scope3FlightSegment
525
+ include Google::Apis::Core::Hashable
526
+
527
+ # Required. The cabin class of the flight.
528
+ # Corresponds to the JSON property `cabinClass`
529
+ # @return [String]
530
+ attr_accessor :cabin_class
531
+
532
+ # Optional. IATA carrier code, e.g. `KE`. This is required if specific flight
533
+ # matching is desired. Otherwise, this is unused for typical flight and distance-
534
+ # based emissions models. This could be both operating and marketing carrier
535
+ # code (i.e. codeshare is covered).
536
+ # Corresponds to the JSON property `carrierCode`
537
+ # @return [String]
538
+ attr_accessor :carrier_code
539
+
540
+ # Represents a whole or partial calendar date, such as a birthday. The time of
541
+ # day and time zone are either specified elsewhere or are insignificant. The
542
+ # date is relative to the Gregorian Calendar. This can represent one of the
543
+ # following: * A full date, with non-zero year, month, and day values. * A month
544
+ # and day, with a zero year (for example, an anniversary). * A year on its own,
545
+ # with a zero month and a zero day. * A year and month, with a zero day (for
546
+ # example, a credit card expiration date). Related types: * google.type.
547
+ # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
548
+ # Corresponds to the JSON property `departureDate`
549
+ # @return [Google::Apis::TravelimpactmodelV1::Date]
550
+ attr_accessor :departure_date
551
+
552
+ # Optional. IATA airport code for flight destination, e.g. `ICN`. This is used
553
+ # to match specific flight if provided alongside origin, carrier, and flight
554
+ # number. If there is no match, we will first try to match the flight to a
555
+ # typical flight between the provided origin and destination airports. Otherwise,
556
+ # we will use the distance-based emissions model if the flight distance is
557
+ # provided.
558
+ # Corresponds to the JSON property `destination`
559
+ # @return [String]
560
+ attr_accessor :destination
561
+
562
+ # Optional. Distance in kilometers, e.g. `2423`. This is used to match a flight
563
+ # to distance-based emissions when origin and destination are not provided or
564
+ # there are no matching typical flights. This field supports values between 0
565
+ # and 2.5e16 km.
566
+ # Corresponds to the JSON property `distanceKm`
567
+ # @return [Fixnum]
568
+ attr_accessor :distance_km
569
+
570
+ # Optional. Flight number, e.g. `71`. This is first used to match a specific
571
+ # flight if a flight number is specified alongside origin, destination, and
572
+ # carrier. If a flight number is not specified, we will first try to match the
573
+ # flight to a typical flight between the provided origin and destination
574
+ # airports. If that fails and/or origin & destination are not provided, we will
575
+ # use the distance-based emissions model based on the flight distance provided.
576
+ # Corresponds to the JSON property `flightNumber`
577
+ # @return [Fixnum]
578
+ attr_accessor :flight_number
579
+
580
+ # Optional. IATA airport code for flight origin, e.g. `YVR`. This is used to
581
+ # match specific flight if provided alongside destination, carrier, and flight
582
+ # number. If there is no match, we will first try to match the flight to a
583
+ # typical flight between the provided origin and destination airports. Otherwise,
584
+ # we will use the distance-based emissions model if the flight distance is
585
+ # provided.
586
+ # Corresponds to the JSON property `origin`
587
+ # @return [String]
588
+ attr_accessor :origin
589
+
590
+ def initialize(**args)
591
+ update!(**args)
592
+ end
593
+
594
+ # Update properties of this object
595
+ def update!(**args)
596
+ @cabin_class = args[:cabin_class] if args.key?(:cabin_class)
597
+ @carrier_code = args[:carrier_code] if args.key?(:carrier_code)
598
+ @departure_date = args[:departure_date] if args.key?(:departure_date)
599
+ @destination = args[:destination] if args.key?(:destination)
600
+ @distance_km = args[:distance_km] if args.key?(:distance_km)
601
+ @flight_number = args[:flight_number] if args.key?(:flight_number)
602
+ @origin = args[:origin] if args.key?(:origin)
603
+ end
604
+ end
605
+
423
606
  # Typical flight emission estimates for a certain market
424
607
  class TypicalFlightEmissions
425
608
  include Google::Apis::Core::Hashable
@@ -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.9.0"
19
+ GEM_VERSION = "0.10.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
22
  GENERATOR_VERSION = "0.18.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20250624"
25
+ REVISION = "20251008"
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 ComputeScope3FlightEmissionsRequest
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class ComputeScope3FlightEmissionsResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
37
49
  class ComputeTypicalFlightEmissionsRequest
38
50
  class Representation < Google::Apis::Core::JsonRepresentation; end
39
51
 
@@ -88,6 +100,18 @@ module Google
88
100
  include Google::Apis::Core::JsonObjectSupport
89
101
  end
90
102
 
103
+ class Scope3FlightEmissions
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class Scope3FlightSegment
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
91
115
  class TypicalFlightEmissions
92
116
  class Representation < Google::Apis::Core::JsonRepresentation; end
93
117
 
@@ -112,6 +136,26 @@ module Google
112
136
  end
113
137
  end
114
138
 
139
+ class ComputeScope3FlightEmissionsRequest
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ collection :flights, as: 'flights', class: Google::Apis::TravelimpactmodelV1::Scope3FlightSegment, decorator: Google::Apis::TravelimpactmodelV1::Scope3FlightSegment::Representation
143
+
144
+ property :model_version, as: 'modelVersion', class: Google::Apis::TravelimpactmodelV1::ModelVersion, decorator: Google::Apis::TravelimpactmodelV1::ModelVersion::Representation
145
+
146
+ end
147
+ end
148
+
149
+ class ComputeScope3FlightEmissionsResponse
150
+ # @private
151
+ class Representation < Google::Apis::Core::JsonRepresentation
152
+ collection :flight_emissions, as: 'flightEmissions', class: Google::Apis::TravelimpactmodelV1::Scope3FlightEmissions, decorator: Google::Apis::TravelimpactmodelV1::Scope3FlightEmissions::Representation
153
+
154
+ property :model_version, as: 'modelVersion', class: Google::Apis::TravelimpactmodelV1::ModelVersion, decorator: Google::Apis::TravelimpactmodelV1::ModelVersion::Representation
155
+
156
+ end
157
+ end
158
+
115
159
  class ComputeTypicalFlightEmissionsRequest
116
160
  # @private
117
161
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -205,6 +249,32 @@ module Google
205
249
  end
206
250
  end
207
251
 
252
+ class Scope3FlightEmissions
253
+ # @private
254
+ class Representation < Google::Apis::Core::JsonRepresentation
255
+ property :flight, as: 'flight', class: Google::Apis::TravelimpactmodelV1::Scope3FlightSegment, decorator: Google::Apis::TravelimpactmodelV1::Scope3FlightSegment::Representation
256
+
257
+ property :source, as: 'source'
258
+ property :ttw_emissions_grams_per_pax, :numeric_string => true, as: 'ttwEmissionsGramsPerPax'
259
+ property :wtt_emissions_grams_per_pax, :numeric_string => true, as: 'wttEmissionsGramsPerPax'
260
+ property :wtw_emissions_grams_per_pax, :numeric_string => true, as: 'wtwEmissionsGramsPerPax'
261
+ end
262
+ end
263
+
264
+ class Scope3FlightSegment
265
+ # @private
266
+ class Representation < Google::Apis::Core::JsonRepresentation
267
+ property :cabin_class, as: 'cabinClass'
268
+ property :carrier_code, as: 'carrierCode'
269
+ property :departure_date, as: 'departureDate', class: Google::Apis::TravelimpactmodelV1::Date, decorator: Google::Apis::TravelimpactmodelV1::Date::Representation
270
+
271
+ property :destination, as: 'destination'
272
+ property :distance_km, :numeric_string => true, as: 'distanceKm'
273
+ property :flight_number, as: 'flightNumber'
274
+ property :origin, as: 'origin'
275
+ end
276
+ end
277
+
208
278
  class TypicalFlightEmissions
209
279
  # @private
210
280
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -91,6 +91,71 @@ module Google
91
91
  execute_or_queue_command(command, &block)
92
92
  end
93
93
 
94
+ # Stateless method to retrieve GHG emissions estimates for a set of flight
95
+ # segments for Scope 3 reporting. The response will contain all entries that
96
+ # match the input Scope3FlightSegment flight segments, in the same order
97
+ # provided. The estimates will be computed using the following cascading logic (
98
+ # using the first one that is available): 1. TIM-based emissions given origin,
99
+ # destination, carrier, flightNumber, departureDate, and cabinClass. 2. Typical
100
+ # flight emissions given origin, destination, year in departureDate, and
101
+ # cabinClass. 3. Distance-based emissions calculated using distanceKm, year in
102
+ # departureDate, and cabinClass. If there is a future flight requested in this
103
+ # calendar year, we do not support Tier 1 emissions and will fallback to Tier 2
104
+ # or 3 emissions. If the requested future flight is in not in this calendar year,
105
+ # we will return an empty response. We recommend that for future flights,
106
+ # computeFlightEmissions API is used instead. If there are no estimates
107
+ # available for a certain flight with any of the three methods, the response
108
+ # will return a Scope3FlightEmissions object with empty emission fields. The
109
+ # request will still be considered successful. Generally, missing emissions
110
+ # estimates occur when the flight is unknown to the server (e.g. no specific
111
+ # flight exists, or typical flight emissions are not available for the requested
112
+ # pair). The request will fail with an `INVALID_ARGUMENT` error if: * The
113
+ # request contains more than 1,000 flight legs. * The input flight leg is
114
+ # missing one or more identifiers. For example, missing origin/destination
115
+ # without a valid distance for TIM_EMISSIONS or TYPICAL_FLIGHT_EMISSIONS type
116
+ # matching, or missing distance for a DISTANCE_BASED_EMISSIONS type matching (if
117
+ # you want to fallback to distance-based emissions or want a distance-based
118
+ # emissions estimate, you need to specify a distance). * The flight date is
119
+ # before 2019 (Scope 3 data is only available for 2019 and after). * The flight
120
+ # distance is 0 or lower. * Missing cabin class. Because the request is
121
+ # processed with fallback logic, it is possible that misconfigured requests
122
+ # return valid emissions estimates using fallback methods. For example, if a
123
+ # request has the wrong flight number but specifies the origin and destination,
124
+ # the request will still succeed, but the returned emissions will be based
125
+ # solely on the typical flight emissions. Similarly, if a request is missing the
126
+ # origin for a typical flight emissions request, but specifies a valid distance,
127
+ # the request could succeed based solely on the distance-based emissions.
128
+ # Consequently, one should check the source of the returned emissions (source)
129
+ # to confirm the results are as expected.
130
+ # @param [Google::Apis::TravelimpactmodelV1::ComputeScope3FlightEmissionsRequest] compute_scope3_flight_emissions_request_object
131
+ # @param [String] fields
132
+ # Selector specifying which fields to include in a partial response.
133
+ # @param [String] quota_user
134
+ # Available to use for quota purposes for server-side applications. Can be any
135
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
136
+ # @param [Google::Apis::RequestOptions] options
137
+ # Request-specific options
138
+ #
139
+ # @yield [result, err] Result & error if block supplied
140
+ # @yieldparam result [Google::Apis::TravelimpactmodelV1::ComputeScope3FlightEmissionsResponse] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::TravelimpactmodelV1::ComputeScope3FlightEmissionsResponse]
144
+ #
145
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
146
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
147
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
148
+ def compute_scope3_flight_emissions(compute_scope3_flight_emissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
149
+ command = make_simple_command(:post, 'v1/flights:computeScope3FlightEmissions', options)
150
+ command.request_representation = Google::Apis::TravelimpactmodelV1::ComputeScope3FlightEmissionsRequest::Representation
151
+ command.request_object = compute_scope3_flight_emissions_request_object
152
+ command.response_representation = Google::Apis::TravelimpactmodelV1::ComputeScope3FlightEmissionsResponse::Representation
153
+ command.response_class = Google::Apis::TravelimpactmodelV1::ComputeScope3FlightEmissionsResponse
154
+ command.query['fields'] = fields unless fields.nil?
155
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
156
+ execute_or_queue_command(command, &block)
157
+ end
158
+
94
159
  # Retrieves typical flight emissions estimates between two airports, also known
95
160
  # as a market. If there are no estimates available for a certain market, the
96
161
  # response will return the market object with empty emission fields. The request
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.9.0
4
+ version: 0.10.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.9.0
60
+ documentation_uri: https://googleapis.dev/ruby/google-apis-travelimpactmodel_v1/v0.10.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: