class CyberSource::Ptsv2paymentsTravelInformationTransitAirlineLegs
Attributes
IATA code for the class of service for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Time of arrival for this leg of the trip. The format is military time and HHMM: If not all zeros, then the hours must be `00-23` and the minutes must be `00-59` Format: English characters only. Optional request field for travel legs.
AM or PM for the arrival time for this leg of the trip. Possible values: - `A`: 12:00 midnight to 11:59 a.m. - `P`: 12:00 noon to 11:59 p.m. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
IATA code for the carrier for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Ticket that contains additional coupons for this leg of the trip on an itinerary that has more than four segments. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Coupon number. Each leg on the ticket requires a separate coupon, and each coupon is identified by the coupon number. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Amount of departure tax for this leg of the trip.
Departure date for the first leg of the trip. Format: `YYYYMMDD`. Format: English characters only. Optional request field for travel legs.
Time of departure for this leg of the trip. The format is military time and HHMM: If not all zeros, then the hours must be `00-23` and the minutes must be `00-59`. Format: English characters only. Optional request field for travel legs.
AM or PM for the departure time. Possible values: - A: 12:00 midnight to 11:59 a.m. - P: 12:00 noon to 11:59 p.m Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
IATA code for the destination airport for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Notes or notations about endorsements and restrictions for this leg of the trip. Endorsements can be notations added by the travel agency, including mandatory government-required notations such as value added tax. Restrictions are limitations for the ticket based on the type of fare, such as a nonrefundable ticket or a 3-day minimum stay. Format: English characters only. Optional request field for travel legs.
New ticket number that is issued when the ticket is exchanged for this leg of the trip. Restrictions are limitations for the ticket based on the type of fare, such as a nonrefundable ticket or a 3-day minimum stay. Format: English characters only. Optional request field for travel legs.
Code for the fare basis for this leg of the trip. The fare basis is assigned by the carriers and indicates a particular ticket type, such as business class or discounted/nonrefundable. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Format: English characters only. Optional request field for travel legs.auto_rental_regular_mileage_cost
Fee for this leg of the trip, such as an airport fee or country fee. Format: English characters only. Optional request field for travel legs.
Flight number for this leg of the trip. Restrictions are limitations for the ticket based on the type of fare, such as a nonrefundable ticket or a 3-day minimum stay. Format: English characters only. Optional request field for travel legs.
IATA code for the originating airport for this leg of the trip. Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Code that indicates whether a stopover is allowed on this leg of the trip. Possible values: - `O` (capital letter “O”) (default): Stopover allowed - `X` (capital letter “X”): Stopover not allowed Format: English characters only. Restricted string data type that indicates a sequence of letters, numbers, and spaces; special characters are not included. Optional request field for travel legs.
Tax for this leg of the trip. Format: English characters only. Optional request field for travel legs.
Total fare for this leg of the trip. Format: English characters only. Optional request field for travel legs.
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 78 def self.attribute_map { :'carrier_code' => :'carrierCode', :'flight_number' => :'flightNumber', :'originating_airport_code' => :'originatingAirportCode', :'_class' => :'class', :'stopover_indicator' => :'stopoverIndicator', :'departure_date' => :'departureDate', :'destination_airport_code' => :'destinationAirportCode', :'fare_basis' => :'fareBasis', :'depart_tax_amount' => :'departTaxAmount', :'conjunction_ticket' => :'conjunctionTicket', :'exchange_ticket_number' => :'exchangeTicketNumber', :'coupon_number' => :'couponNumber', :'departure_time' => :'departureTime', :'departure_time_meridian' => :'departureTimeMeridian', :'arrival_time' => :'arrivalTime', :'arrival_time_meridian' => :'arrivalTimeMeridian', :'endorsements_restrictions' => :'endorsementsRestrictions', :'total_fare_amount' => :'totalFareAmount', :'fee_amount' => :'feeAmount', :'tax_amount' => :'taxAmount' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 131 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'carrierCode') self.carrier_code = attributes[:'carrierCode'] end if attributes.has_key?(:'flightNumber') self.flight_number = attributes[:'flightNumber'] end if attributes.has_key?(:'originatingAirportCode') self.originating_airport_code = attributes[:'originatingAirportCode'] end if attributes.has_key?(:'class') self._class = attributes[:'class'] end if attributes.has_key?(:'stopoverIndicator') self.stopover_indicator = attributes[:'stopoverIndicator'] end if attributes.has_key?(:'departureDate') self.departure_date = attributes[:'departureDate'] end if attributes.has_key?(:'destinationAirportCode') self.destination_airport_code = attributes[:'destinationAirportCode'] end if attributes.has_key?(:'fareBasis') self.fare_basis = attributes[:'fareBasis'] end if attributes.has_key?(:'departTaxAmount') self.depart_tax_amount = attributes[:'departTaxAmount'] end if attributes.has_key?(:'conjunctionTicket') self.conjunction_ticket = attributes[:'conjunctionTicket'] end if attributes.has_key?(:'exchangeTicketNumber') self.exchange_ticket_number = attributes[:'exchangeTicketNumber'] end if attributes.has_key?(:'couponNumber') self.coupon_number = attributes[:'couponNumber'] end if attributes.has_key?(:'departureTime') self.departure_time = attributes[:'departureTime'] end if attributes.has_key?(:'departureTimeMeridian') self.departure_time_meridian = attributes[:'departureTimeMeridian'] end if attributes.has_key?(:'arrivalTime') self.arrival_time = attributes[:'arrivalTime'] end if attributes.has_key?(:'arrivalTimeMeridian') self.arrival_time_meridian = attributes[:'arrivalTimeMeridian'] end if attributes.has_key?(:'endorsementsRestrictions') self.endorsements_restrictions = attributes[:'endorsementsRestrictions'] end if attributes.has_key?(:'totalFareAmount') self.total_fare_amount = attributes[:'totalFareAmount'] end if attributes.has_key?(:'feeAmount') self.fee_amount = attributes[:'feeAmount'] end if attributes.has_key?(:'taxAmount') self.tax_amount = attributes[:'taxAmount'] end end
Attribute type mapping.
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 104 def self.swagger_types { :'carrier_code' => :'String', :'flight_number' => :'String', :'originating_airport_code' => :'String', :'_class' => :'String', :'stopover_indicator' => :'Integer', :'departure_date' => :'Integer', :'destination_airport_code' => :'String', :'fare_basis' => :'String', :'depart_tax_amount' => :'String', :'conjunction_ticket' => :'String', :'exchange_ticket_number' => :'String', :'coupon_number' => :'String', :'departure_time' => :'Integer', :'departure_time_meridian' => :'String', :'arrival_time' => :'Integer', :'arrival_time_meridian' => :'String', :'endorsements_restrictions' => :'String', :'total_fare_amount' => :'String', :'fee_amount' => :'String', :'tax_amount' => :'String' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object
to be compared
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 329 def ==(o) return true if self.equal?(o) self.class == o.class && carrier_code == o.carrier_code && flight_number == o.flight_number && originating_airport_code == o.originating_airport_code && _class == o._class && stopover_indicator == o.stopover_indicator && departure_date == o.departure_date && destination_airport_code == o.destination_airport_code && fare_basis == o.fare_basis && depart_tax_amount == o.depart_tax_amount && conjunction_ticket == o.conjunction_ticket && exchange_ticket_number == o.exchange_ticket_number && coupon_number == o.coupon_number && departure_time == o.departure_time && departure_time_meridian == o.departure_time_meridian && arrival_time == o.arrival_time && arrival_time_meridian == o.arrival_time_meridian && endorsements_restrictions == o.endorsements_restrictions && total_fare_amount == o.total_fare_amount && fee_amount == o.fee_amount && tax_amount == o.tax_amount end
Custom attribute writer method with validation @param [Object] _class Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 251 def _class=(_class) @_class = _class end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 390 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = CyberSource.const_get(type).new temp_model.build_from_hash(value) end end
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 456 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
Custom attribute writer method with validation @param [Object] arrival_time_meridian
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 299 def arrival_time_meridian=(arrival_time_meridian) @arrival_time_meridian = arrival_time_meridian end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 369 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
Custom attribute writer method with validation @param [Object] carrier_code
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 233 def carrier_code=(carrier_code) @carrier_code = carrier_code end
Custom attribute writer method with validation @param [Object] conjunction_ticket
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 275 def conjunction_ticket=(conjunction_ticket) @conjunction_ticket = conjunction_ticket end
Custom attribute writer method with validation @param [Object] coupon_number
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 287 def coupon_number=(coupon_number) @coupon_number = coupon_number end
Custom attribute writer method with validation @param [Object] depart_tax_amount
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 269 def depart_tax_amount=(depart_tax_amount) @depart_tax_amount = depart_tax_amount end
Custom attribute writer method with validation @param [Object] departure_time_meridian
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 293 def departure_time_meridian=(departure_time_meridian) @departure_time_meridian = departure_time_meridian end
Custom attribute writer method with validation @param [Object] destination_airport_code
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 257 def destination_airport_code=(destination_airport_code) @destination_airport_code = destination_airport_code end
Custom attribute writer method with validation @param [Object] endorsements_restrictions
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 305 def endorsements_restrictions=(endorsements_restrictions) @endorsements_restrictions = endorsements_restrictions end
@see the `==` method @param [Object] Object
to be compared
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 356 def eql?(o) self == o end
Custom attribute writer method with validation @param [Object] exchange_ticket_number
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 281 def exchange_ticket_number=(exchange_ticket_number) @exchange_ticket_number = exchange_ticket_number end
Custom attribute writer method with validation @param [Object] fare_basis
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 263 def fare_basis=(fare_basis) @fare_basis = fare_basis end
Custom attribute writer method with validation @param [Object] fee_amount
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 317 def fee_amount=(fee_amount) @fee_amount = fee_amount end
Custom attribute writer method with validation @param [Object] flight_number
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 239 def flight_number=(flight_number) @flight_number = flight_number end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 362 def hash [carrier_code, flight_number, originating_airport_code, _class, stopover_indicator, departure_date, destination_airport_code, fare_basis, depart_tax_amount, conjunction_ticket, exchange_ticket_number, coupon_number, departure_time, departure_time_meridian, arrival_time, arrival_time_meridian, endorsements_restrictions, total_fare_amount, fee_amount, tax_amount].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 220 def list_invalid_properties invalid_properties = Array.new invalid_properties end
Custom attribute writer method with validation @param [Object] originating_airport_code
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 245 def originating_airport_code=(originating_airport_code) @originating_airport_code = originating_airport_code end
Custom attribute writer method with validation @param [Object] tax_amount
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 323 def tax_amount=(tax_amount) @tax_amount = tax_amount end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 442 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 430 def to_s to_hash.to_s end
Custom attribute writer method with validation @param [Object] total_fare_amount
Value to be assigned
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 311 def total_fare_amount=(total_fare_amount) @total_fare_amount = total_fare_amount end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb, line 227 def valid? true end