Class: Google::Apis::TravelimpactmodelV1::Scope3FlightSegment
- Inherits:
-
Object
- Object
- Google::Apis::TravelimpactmodelV1::Scope3FlightSegment
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/travelimpactmodel_v1/classes.rb,
lib/google/apis/travelimpactmodel_v1/representations.rb,
lib/google/apis/travelimpactmodel_v1/representations.rb
Overview
Flight parameters with which the Scope 3 emissions are fetched.
Instance Attribute Summary collapse
-
#cabin_class ⇒ String
Required.
-
#carrier_code ⇒ String
Optional.
-
#departure_date ⇒ Google::Apis::TravelimpactmodelV1::Date
Represents a whole or partial calendar date, such as a birthday.
-
#destination ⇒ String
Optional.
-
#distance_km ⇒ Fixnum
Optional.
-
#flight_number ⇒ Fixnum
Optional.
-
#origin ⇒ String
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Scope3FlightSegment
constructor
A new instance of Scope3FlightSegment.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Scope3FlightSegment
Returns a new instance of Scope3FlightSegment.
900 901 902 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 900 def initialize(**args) update!(**args) end |
Instance Attribute Details
#cabin_class ⇒ String
Required. The cabin class of the flight.
Corresponds to the JSON property cabinClass
839 840 841 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 839 def cabin_class @cabin_class end |
#carrier_code ⇒ String
Optional. 2-character IATA carrier code, e.g. KE. This is required if specific flight
matching is desired. Otherwise, this is unused for typical flight and distance-
based emissions models. This could be both operating and marketing carrier
code (i.e. codeshare is covered).
Corresponds to the JSON property carrierCode
848 849 850 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 848 def carrier_code @carrier_code end |
#departure_date ⇒ Google::Apis::TravelimpactmodelV1::Date
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
Corresponds to the JSON property departureDate
860 861 862 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 860 def departure_date @departure_date end |
#destination ⇒ String
Optional. 3-character IATA airport code for flight destination, e.g. ICN. This is used to
match specific flight if provided alongside origin, carrier, and flight number.
If there is no match, we will first try to match the flight to a typical
flight between the provided origin and destination airports. Otherwise, we
will use the distance-based emissions model if the flight distance is provided.
Corresponds to the JSON property destination
870 871 872 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 870 def destination @destination end |
#distance_km ⇒ Fixnum
Optional. Distance in kilometers, e.g. 2423, from [1, 2.5e16) km. This is
used to match a flight to distance-based emissions when origin and destination
are not provided or there are no matching typical flights.
Corresponds to the JSON property distanceKm
877 878 879 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 877 def distance_km @distance_km end |
#flight_number ⇒ Fixnum
Optional. Up to 4-digit flight number, e.g. 71, from [1, 9999]. This is first used to match a
specific flight if a flight number is specified alongside origin, destination,
and carrier. If a flight number is not specified, we will first try to match
the flight to a typical flight between the provided origin and destination
airports. If that fails and/or origin & destination are not provided, we will
use the distance-based emissions model based on the flight distance provided.
Corresponds to the JSON property flightNumber
888 889 890 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 888 def flight_number @flight_number end |
#origin ⇒ String
Optional. 3-character IATA airport code for flight origin, e.g. YVR. This is used to match
specific flight if provided alongside destination, carrier, and flight number.
If there is no match, we will first try to match the flight to a typical
flight between the provided origin and destination airports. Otherwise, we
will use the distance-based emissions model if the flight distance is provided.
Corresponds to the JSON property origin
898 899 900 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 898 def origin @origin end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
905 906 907 908 909 910 911 912 913 |
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 905 def update!(**args) @cabin_class = args[:cabin_class] if args.key?(:cabin_class) @carrier_code = args[:carrier_code] if args.key?(:carrier_code) @departure_date = args[:departure_date] if args.key?(:departure_date) @destination = args[:destination] if args.key?(:destination) @distance_km = args[:distance_km] if args.key?(:distance_km) @flight_number = args[:flight_number] if args.key?(:flight_number) @origin = args[:origin] if args.key?(:origin) end |