Class: CyberSource::Ptsv2paymentsTravelInformationTransitAirlineLegs
- Inherits:
-
Object
- Object
- CyberSource::Ptsv2paymentsTravelInformationTransitAirlineLegs
- Defined in:
- lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb
Instance Attribute Summary collapse
-
#_class ⇒ Object
IATA code for the class of service for this leg of the trip.
-
#arrival_time ⇒ Object
Time of arrival for this leg of the trip.
-
#arrival_time_meridian ⇒ Object
AM or PM for the arrival time for this leg of the trip.
-
#carrier_code ⇒ Object
IATA code for the carrier for this leg of the trip.
-
#conjunction_ticket ⇒ Object
Ticket that contains additional coupons for this leg of the trip on an itinerary that has more than four segments.
-
#coupon_number ⇒ Object
Coupon number.
-
#depart_tax_amount ⇒ Object
Amount of departure tax for this leg of the trip.
-
#departure_date ⇒ Object
Departure date for the first leg of the trip.
-
#departure_time ⇒ Object
Time of departure for this leg of the trip.
-
#departure_time_meridian ⇒ Object
AM or PM for the departure time.
-
#destination_airport_code ⇒ Object
IATA code for the destination airport for this leg of the trip.
-
#endorsements_restrictions ⇒ Object
Notes or notations about endorsements and restrictions for this leg of the trip.
-
#exchange_ticket_number ⇒ Object
New ticket number that is issued when the ticket is exchanged for this leg of the trip.
-
#fare_basis ⇒ Object
Code for the fare basis for this leg of the trip.
-
#fee_amount ⇒ Object
Fee for this leg of the trip, such as an airport fee or country fee.
-
#flight_number ⇒ Object
Flight number for this leg of the trip.
-
#originating_airport_code ⇒ Object
IATA code for the originating airport for this leg of the trip.
-
#stopover_indicator ⇒ Object
Code that indicates whether a stopover is allowed on this leg of the trip.
-
#tax_amount ⇒ Object
Tax for this leg of the trip.
-
#total_fare_amount ⇒ Object
Total fare for this leg of the trip.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.json_map ⇒ Object
Attribute mapping from JSON key to ruby-style variable name.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Ptsv2paymentsTravelInformationTransitAirlineLegs
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Ptsv2paymentsTravelInformationTransitAirlineLegs
Initializes the object
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 156 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 |
Instance Attribute Details
#_class ⇒ Object
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.
26 27 28 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 26 def _class @_class end |
#arrival_time ⇒ Object
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.
59 60 61 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 59 def arrival_time @arrival_time end |
#arrival_time_meridian ⇒ Object
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.
62 63 64 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 62 def arrival_time_meridian @arrival_time_meridian end |
#carrier_code ⇒ Object
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.
17 18 19 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 17 def carrier_code @carrier_code end |
#conjunction_ticket ⇒ Object
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.
44 45 46 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 44 def conjunction_ticket @conjunction_ticket end |
#coupon_number ⇒ Object
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.
50 51 52 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 50 def coupon_number @coupon_number end |
#depart_tax_amount ⇒ Object
Amount of departure tax for this leg of the trip.
41 42 43 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 41 def depart_tax_amount @depart_tax_amount end |
#departure_date ⇒ Object
Departure date for the first leg of the trip. Format: ‘YYYYMMDD`. Format: English characters only. Optional request field for travel legs.
32 33 34 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 32 def departure_date @departure_date end |
#departure_time ⇒ Object
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.
53 54 55 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 53 def departure_time @departure_time end |
#departure_time_meridian ⇒ Object
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.
56 57 58 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 56 def departure_time_meridian @departure_time_meridian end |
#destination_airport_code ⇒ Object
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.
35 36 37 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 35 def destination_airport_code @destination_airport_code end |
#endorsements_restrictions ⇒ Object
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.
65 66 67 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 65 def endorsements_restrictions @endorsements_restrictions end |
#exchange_ticket_number ⇒ Object
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.
47 48 49 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 47 def exchange_ticket_number @exchange_ticket_number end |
#fare_basis ⇒ Object
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
38 39 40 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 38 def fare_basis @fare_basis end |
#fee_amount ⇒ Object
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.
71 72 73 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 71 def fee_amount @fee_amount end |
#flight_number ⇒ Object
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.
20 21 22 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 20 def flight_number @flight_number end |
#originating_airport_code ⇒ Object
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.
23 24 25 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 23 def originating_airport_code @originating_airport_code end |
#stopover_indicator ⇒ Object
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.
29 30 31 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 29 def stopover_indicator @stopover_indicator end |
#tax_amount ⇒ Object
Tax for this leg of the trip. Format: English characters only. Optional request field for travel legs.
74 75 76 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 74 def tax_amount @tax_amount end |
#total_fare_amount ⇒ Object
Total fare for this leg of the trip. Format: English characters only. Optional request field for travel legs.
68 69 70 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 68 def total_fare_amount @total_fare_amount end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 77 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 |
.json_map ⇒ Object
Attribute mapping from JSON key to ruby-style variable name.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 103 def self.json_map { :'carrier_code' => :'carrier_code', :'flight_number' => :'flight_number', :'originating_airport_code' => :'originating_airport_code', :'_class' => :'_class', :'stopover_indicator' => :'stopover_indicator', :'departure_date' => :'departure_date', :'destination_airport_code' => :'destination_airport_code', :'fare_basis' => :'fare_basis', :'depart_tax_amount' => :'depart_tax_amount', :'conjunction_ticket' => :'conjunction_ticket', :'exchange_ticket_number' => :'exchange_ticket_number', :'coupon_number' => :'coupon_number', :'departure_time' => :'departure_time', :'departure_time_meridian' => :'departure_time_meridian', :'arrival_time' => :'arrival_time', :'arrival_time_meridian' => :'arrival_time_meridian', :'endorsements_restrictions' => :'endorsements_restrictions', :'total_fare_amount' => :'total_fare_amount', :'fee_amount' => :'fee_amount', :'tax_amount' => :'tax_amount' } end |
.swagger_types ⇒ Object
Attribute type mapping.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 129 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 |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 354 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 |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 415 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 |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
481 482 483 484 485 486 487 488 489 490 491 492 493 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 481 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 394 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("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{self.class.json_map[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 |
#eql?(o) ⇒ Boolean
381 382 383 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 381 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
387 388 389 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 387 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 |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
245 246 247 248 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 245 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
461 462 463 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 461 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
467 468 469 470 471 472 473 474 475 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 467 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 |
#to_s ⇒ String
Returns the string representation of the object
455 456 457 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 455 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
252 253 254 |
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 252 def valid? true end |