Class: Google::Apis::TravelimpactmodelV1::Scope3FlightSegment

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Scope3FlightSegment

Returns a new instance of Scope3FlightSegment.



892
893
894
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 892

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cabin_classString

Required. The cabin class of the flight. Corresponds to the JSON property cabinClass

Returns:

  • (String)


831
832
833
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 831

def cabin_class
  @cabin_class
end

#carrier_codeString

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

Returns:

  • (String)


840
841
842
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 840

def carrier_code
  @carrier_code
end

#departure_dateGoogle::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



852
853
854
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 852

def departure_date
  @departure_date
end

#destinationString

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

Returns:

  • (String)


862
863
864
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 862

def destination
  @destination
end

#distance_kmFixnum

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

Returns:

  • (Fixnum)


869
870
871
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 869

def distance_km
  @distance_km
end

#flight_numberFixnum

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

Returns:

  • (Fixnum)


880
881
882
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 880

def flight_number
  @flight_number
end

#originString

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

Returns:

  • (String)


890
891
892
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 890

def origin
  @origin
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



897
898
899
900
901
902
903
904
905
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 897

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