Class: CyberSource::Ptsv2paymentsTravelInformationTransitAirlineLegs

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Ptsv2paymentsTravelInformationTransitAirlineLegs

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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
# 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

Instance Attribute Details

#_classObject

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.



27
28
29
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 27

def _class
  @_class
end

#arrival_timeObject

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.



60
61
62
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 60

def arrival_time
  @arrival_time
end

#arrival_time_meridianObject

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.



63
64
65
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 63

def arrival_time_meridian
  @arrival_time_meridian
end

#carrier_codeObject

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.



18
19
20
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 18

def carrier_code
  @carrier_code
end

#conjunction_ticketObject

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.



45
46
47
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 45

def conjunction_ticket
  @conjunction_ticket
end

#coupon_numberObject

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.



51
52
53
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 51

def coupon_number
  @coupon_number
end

#depart_tax_amountObject

Amount of departure tax for this leg of the trip.



42
43
44
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 42

def depart_tax_amount
  @depart_tax_amount
end

#departure_dateObject

Departure date for the first leg of the trip. Format: ‘YYYYMMDD`. Format: English characters only. Optional request field for travel legs.



33
34
35
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 33

def departure_date
  @departure_date
end

#departure_timeObject

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.



54
55
56
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 54

def departure_time
  @departure_time
end

#departure_time_meridianObject

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.



57
58
59
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 57

def departure_time_meridian
  @departure_time_meridian
end

#destination_airport_codeObject

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.



36
37
38
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 36

def destination_airport_code
  @destination_airport_code
end

#endorsements_restrictionsObject

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.



66
67
68
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 66

def endorsements_restrictions
  @endorsements_restrictions
end

#exchange_ticket_numberObject

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.



48
49
50
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 48

def exchange_ticket_number
  @exchange_ticket_number
end

#fare_basisObject

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



39
40
41
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 39

def fare_basis
  @fare_basis
end

#fee_amountObject

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.



72
73
74
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 72

def fee_amount
  @fee_amount
end

#flight_numberObject

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.



21
22
23
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 21

def flight_number
  @flight_number
end

#originating_airport_codeObject

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.



24
25
26
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 24

def originating_airport_code
  @originating_airport_code
end

#stopover_indicatorObject

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.



30
31
32
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 30

def stopover_indicator
  @stopover_indicator
end

#tax_amountObject

Tax for this leg of the trip. Format: English characters only. Optional request field for travel legs.



75
76
77
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 75

def tax_amount
  @tax_amount
end

#total_fare_amountObject

Total fare for this leg of the trip. Format: English characters only. Optional request field for travel legs.



69
70
71
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 69

def total_fare_amount
  @total_fare_amount
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# 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

.swagger_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# 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

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# 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

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# 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

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



456
457
458
459
460
461
462
463
464
465
466
467
468
# 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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# 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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


356
357
358
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 356

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



362
363
364
# 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

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



220
221
222
223
# 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

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



436
437
438
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 436

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



442
443
444
445
446
447
448
449
450
# 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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



430
431
432
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 430

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



227
228
229
# File 'lib/cybersource_rest_client/models/ptsv2payments_travel_information_transit_airline_legs.rb', line 227

def valid?
  true
end