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.



591
592
593
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 591

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)


530
531
532
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 530

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)


539
540
541
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 539

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



551
552
553
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 551

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)


561
562
563
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 561

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)


568
569
570
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 568

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)


579
580
581
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 579

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)


589
590
591
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 589

def origin
  @origin
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



596
597
598
599
600
601
602
603
604
# File 'lib/google/apis/travelimpactmodel_v1/classes.rb', line 596

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