Class: VisaAcceptanceMergedSpec::Airline

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/airline.rb

Overview

Airline Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(is_domestic: SKIP, booking_reference_number: SKIP, carrier_name: SKIP, ticket_issuer: SKIP, ticket_number: SKIP, check_digit: SKIP, restricted_ticket_indicator: SKIP, transaction_type: SKIP, extended_payment_code: SKIP, passenger_name: SKIP, customer_code: SKIP, document_type: SKIP, document_number: SKIP, document_number_of_parts: SKIP, invoice_number: SKIP, invoice_date: SKIP, additional_charges: SKIP, total_fee_amount: SKIP, clearing_sequence: SKIP, clearing_count: SKIP, total_clearing_amount: SKIP, number_of_passengers: SKIP, reservation_system_code: SKIP, process_identifier: SKIP, ticket_issue_date: SKIP, electronic_ticket_indicator: SKIP, original_ticket_number: SKIP, purchase_type: SKIP, credit_reason_indicator: SKIP, ticket_change_indicator: SKIP, plan_number: SKIP, arrival_date: SKIP, restricted_ticket_desciption: SKIP, exchange_ticket_amount: SKIP, exchange_ticket_fee_amount: SKIP, reservation_type: SKIP, boarding_fee_amount: SKIP, legs: SKIP, ancillary_information: SKIP, flight_type: SKIP, insurance_amount: SKIP, frequent_flyer_number: SKIP, third_party_status: SKIP, passenger_type: SKIP, total_insurance_amount: SKIP, additional_properties: nil) ⇒ Airline

Returns a new instance of Airline.



510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 510

def initialize(is_domestic: SKIP, booking_reference_number: SKIP,
               carrier_name: SKIP, ticket_issuer: SKIP, ticket_number: SKIP,
               check_digit: SKIP, restricted_ticket_indicator: SKIP,
               transaction_type: SKIP, extended_payment_code: SKIP,
               passenger_name: SKIP, customer_code: SKIP,
               document_type: SKIP, document_number: SKIP,
               document_number_of_parts: SKIP, invoice_number: SKIP,
               invoice_date: SKIP, additional_charges: SKIP,
               total_fee_amount: SKIP, clearing_sequence: SKIP,
               clearing_count: SKIP, total_clearing_amount: SKIP,
               number_of_passengers: SKIP, reservation_system_code: SKIP,
               process_identifier: SKIP, ticket_issue_date: SKIP,
               electronic_ticket_indicator: SKIP,
               original_ticket_number: SKIP, purchase_type: SKIP,
               credit_reason_indicator: SKIP, ticket_change_indicator: SKIP,
               plan_number: SKIP, arrival_date: SKIP,
               restricted_ticket_desciption: SKIP,
               exchange_ticket_amount: SKIP,
               exchange_ticket_fee_amount: SKIP, reservation_type: SKIP,
               boarding_fee_amount: SKIP, legs: SKIP,
               ancillary_information: SKIP, flight_type: SKIP,
               insurance_amount: SKIP, frequent_flyer_number: SKIP,
               third_party_status: SKIP, passenger_type: SKIP,
               total_insurance_amount: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @is_domestic = is_domestic unless is_domestic == SKIP
  @booking_reference_number = booking_reference_number unless booking_reference_number == SKIP
  @carrier_name = carrier_name unless carrier_name == SKIP
  @ticket_issuer = ticket_issuer unless ticket_issuer == SKIP
  @ticket_number = ticket_number unless ticket_number == SKIP
  @check_digit = check_digit unless check_digit == SKIP
  unless restricted_ticket_indicator == SKIP
    @restricted_ticket_indicator =
      restricted_ticket_indicator
  end
  @transaction_type = transaction_type unless transaction_type == SKIP
  @extended_payment_code = extended_payment_code unless extended_payment_code == SKIP
  @passenger_name = passenger_name unless passenger_name == SKIP
  @customer_code = customer_code unless customer_code == SKIP
  @document_type = document_type unless document_type == SKIP
  @document_number = document_number unless document_number == SKIP
  @document_number_of_parts = document_number_of_parts unless document_number_of_parts == SKIP
  @invoice_number = invoice_number unless invoice_number == SKIP
  @invoice_date = invoice_date unless invoice_date == SKIP
  @additional_charges = additional_charges unless additional_charges == SKIP
  @total_fee_amount = total_fee_amount unless total_fee_amount == SKIP
  @clearing_sequence = clearing_sequence unless clearing_sequence == SKIP
  @clearing_count = clearing_count unless clearing_count == SKIP
  @total_clearing_amount = total_clearing_amount unless total_clearing_amount == SKIP
  @number_of_passengers = number_of_passengers unless number_of_passengers == SKIP
  @reservation_system_code = reservation_system_code unless reservation_system_code == SKIP
  @process_identifier = process_identifier unless process_identifier == SKIP
  @ticket_issue_date = ticket_issue_date unless ticket_issue_date == SKIP
  unless electronic_ticket_indicator == SKIP
    @electronic_ticket_indicator =
      electronic_ticket_indicator
  end
  @original_ticket_number = original_ticket_number unless original_ticket_number == SKIP
  @purchase_type = purchase_type unless purchase_type == SKIP
  @credit_reason_indicator = credit_reason_indicator unless credit_reason_indicator == SKIP
  @ticket_change_indicator = ticket_change_indicator unless ticket_change_indicator == SKIP
  @plan_number = plan_number unless plan_number == SKIP
  @arrival_date = arrival_date unless arrival_date == SKIP
  unless restricted_ticket_desciption == SKIP
    @restricted_ticket_desciption =
      restricted_ticket_desciption
  end
  @exchange_ticket_amount = exchange_ticket_amount unless exchange_ticket_amount == SKIP
  unless exchange_ticket_fee_amount == SKIP
    @exchange_ticket_fee_amount =
      exchange_ticket_fee_amount
  end
  @reservation_type = reservation_type unless reservation_type == SKIP
  @boarding_fee_amount = boarding_fee_amount unless boarding_fee_amount == SKIP
  @legs = legs unless legs == SKIP
  @ancillary_information = ancillary_information unless ancillary_information == SKIP
  @flight_type = flight_type unless flight_type == SKIP
  @insurance_amount = insurance_amount unless insurance_amount == SKIP
  @frequent_flyer_number = frequent_flyer_number unless frequent_flyer_number == SKIP
  @third_party_status = third_party_status unless third_party_status == SKIP
  @passenger_type = passenger_type unless passenger_type == SKIP
  @total_insurance_amount = total_insurance_amount unless total_insurance_amount == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#additional_chargesString

Description of the charge if the charge does not involve an airline ticket. For example: Excess baggage.

Returns:

  • (String)


213
214
215
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 213

def additional_charges
  @additional_charges
end

#ancillary_informationAncillaryInformation

Boarding fee.



368
369
370
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 368

def ancillary_information
  @ancillary_information
end

#arrival_dateString

Date of arrival for the last leg of the trip. Format: MMDDYYYY English characters only. Optional request field.

Returns:

  • (String)


335
336
337
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 335

def arrival_date
  @arrival_date
end

#boarding_fee_amountString

Boarding fee.

Returns:

  • (String)


360
361
362
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 360

def boarding_fee_amount
  @boarding_fee_amount
end

#booking_reference_numberString

Reference number for the airline booking. Required if ticket numbers are not issued.

Returns:

  • (String)


22
23
24
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 22

def booking_reference_number
  @booking_reference_number
end

#carrier_nameString

Airline that generated the ticket. Format: English characters only. Optional request field.

Returns:

  • (String)


28
29
30
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 28

def carrier_name
  @carrier_name
end

#check_digitString

Check digit for the ticket number. Visa Acceptance recommends that you validate the check digit. With Discover and Diners Club, a valid ticket number has these characteristics:

  • The value is numeric.
  • The first three digits are a valid IATA2 license plate carrier code.
  • The last digit is a check digit or zero (0).
  • All remaining digits are nonzero.

Returns:

  • (String)


54
55
56
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 54

def check_digit
  @check_digit
end

#clearing_countString

Total number of clearing messages associated with the authorization request. Format: English characters only. Optional request field.

Returns:

  • (String)


237
238
239
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 237

def clearing_count
  @clearing_count
end

#clearing_sequenceString

Number that identifies the clearing message when multiple clearing messages are allowed per authorized transaction. Each clearing message linked to one authorization request must include a unique clearing sequence number between 1 and the total number of clearing records. Format: English characters only. Optional request field.

Returns:

  • (String)


230
231
232
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 230

def clearing_sequence
  @clearing_sequence
end

#credit_reason_indicatorString

Reason for the credit. Possible values:

  • A: Cancellation of the ancillary passenger transport purchase.
  • B: Cancellation of the airline ticket and the passenger transport ancillary purchase.
  • C: Cancellation of the airline ticket.
  • O: Other.
  • P: Partial refund of the airline ticket. Format: English characters only. Optional request field.

Returns:

  • (String)


312
313
314
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 312

def credit_reason_indicator
  @credit_reason_indicator
end

#customer_codeString

Reference number or code that identifies the cardholder. 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.

Returns:

  • (String)


98
99
100
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 98

def customer_code
  @customer_code
end

#document_numberString

The field is not currently supported.

Returns:

  • (String)


192
193
194
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 192

def document_number
  @document_number
end

#document_number_of_partsInteger

The field is not currently supported.

Returns:

  • (Integer)


196
197
198
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 196

def document_number_of_parts
  @document_number_of_parts
end

#document_typeString

Airline document type code that specifies the purpose of the transaction. Format: English characters only. Optional request field.

Code Description
01 Passenger ticket
02 Additional collection
03 Excess baggage
04 Miscellaneous charge order (MCO) or prepaid ticket authorization
05 Special service ticket
06 Supported refund
07 Unsupported refund
08 Lost ticket application
09 Tour order voucher
10 Ticket by mail
11 Undercharge adjustment
12 Group ticket
13 Exchange adjustment
14 SPD or air freight
15 In-flight adjustment
16 Agency passenger ticket
17 Agency tour order or voucher
18 Agency miscellaneous charge order (MCO)
19 Agency exchange order
20 Agency group ticket
21 Debit adjustment for duplicate refund or use
22 In-flight merchandise order
23 Catalogue merchandise order
24 In-flight phone charges
25 Frequent flyer fee or purchase
26 Kennel charge
27 Animal transportation charge
28 Firearms case
29 Upgrade charge
30 Credit for unused transportation
31 Credit for class of service adjustment
32 Credit for denied boarding
33 Credit for miscellaneous refund
34 Credit for lost ticket refund
35 Credit for exchange refund
36 Credit for overcharge adjustment
37 Credit for multiple Unused tickets
38 Exchange order
39 Self-service ticket
41 In-flight duty-free purchase
42 Senior citizen discount booklets
43 Club membership fee
44 Coupon book
45 In-flight charges
46 Tour deposit
47 Frequent flyer overnight delivery charge
48 Frequent flyer fulfillment
49 Small package delivery
50 Vendor sale
51 Miscellaneous taxes or fees
52 Travel agency fee
60 Vendor refund or credit
64 Duty free sale
65 Preferred seat upgrade
66 Cabin upgrade
67 Lounge or club access or day pass
68 Agent assisted reservation or ticketing fee
69 Ticket change or cancel fee
70 Trip insurance
71 Unaccompanied minor
72 Standby fee
73 Curbside baggage
74 In-flight medical equipment
75 Ticket or pass print fee
76 Checked sporting or special equipment
77 Dry ice fee
78 Mail or postage fee
79 Club membership fee or temporary trial
80 Frequent flyer activation or reinstatement
81 Gift certificate
82 Onboard or in-flight prepaid voucher
83 Optional services fee
84 Advance purchase for excess baggage
85 Advance purchase for preferred seat upgrade
86 Advance purchase for cabin upgrade
87 Advance purchase for optional services
88 WiFi
89 Packages
90 In-flight entertainment or internet access
91 Overweight bag fee
92 Sleep sets
93 Special purchase fee

Returns:

  • (String)


188
189
190
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 188

def document_type
  @document_type
end

#electronic_ticket_indicatorTrueClass | FalseClass

Flag that indicates whether an electronic ticket was issued. Possible values:

  • true
  • false Optional request field.

Returns:

  • (TrueClass | FalseClass)


284
285
286
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 284

def electronic_ticket_indicator
  @electronic_ticket_indicator
end

#exchange_ticket_amountString

Amount of the exchanged ticket. Format: English characters only.

Returns:

  • (String)


346
347
348
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 346

def exchange_ticket_amount
  @exchange_ticket_amount
end

#exchange_ticket_fee_amountString

Fee for exchanging the ticket. Format: English characters only. Optional request field.

Returns:

  • (String)


352
353
354
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 352

def exchange_ticket_fee_amount
  @exchange_ticket_fee_amount
end

#extended_payment_codeString

The field is not currently supported.

Returns:

  • (String)


78
79
80
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 78

def extended_payment_code
  @extended_payment_code
end

#flight_typeString

Specifies the type of flight. One way (0) Return (1) Transit (2) Transit & Return (3) Multi-City (4)

Returns:

  • (String)


377
378
379
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 377

def flight_type
  @flight_type
end

#frequent_flyer_numberString

The consumer’s frequent flyer number. Leave 0 if there is no frequent flyer number

Returns:

  • (String)


386
387
388
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 386

def frequent_flyer_number
  @frequent_flyer_number
end

#insurance_amountString

The total cost of the flight insurance. Example: 10000.00

Returns:

  • (String)


381
382
383
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 381

def insurance_amount
  @insurance_amount
end

#invoice_dateInteger

Invoice date. The format is YYYYMMDD. If this value is included in the request, it is used in the creation of the invoice number. See "Invoice Number,"

Returns:

  • (Integer)


207
208
209
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 207

def invoice_date
  @invoice_date
end

#invoice_numberString

Invoice number for the airline transaction.

Returns:

  • (String)


200
201
202
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 200

def invoice_number
  @invoice_number
end

#is_domesticString

Specifies if the flight is: Domestic (01) International (02) If Y then 01 else 02

Returns:

  • (String)


17
18
19
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 17

def is_domestic
  @is_domestic
end

#legsArray[Leg]

Boarding fee.

Returns:



364
365
366
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 364

def legs
  @legs
end

#number_of_passengersInteger

Number of passengers for whom the ticket was issued. Format: English characters only. Optional request field.

Returns:

  • (Integer)


253
254
255
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 253

def number_of_passengers
  @number_of_passengers
end

#original_ticket_numberString

Original ticket number when the transaction is for a replacement ticket.

Returns:

  • (String)


288
289
290
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 288

def original_ticket_number
  @original_ticket_number
end

#passenger_nameString

Name of the passenger to whom the ticket was issued. This will always be a single passenger's name. If there are more than one passengers, provide only the primary passenger's name. Do not include special characters such as commas, hyphens, or apostrophes. Only ASCII characters are supported. Format: English characters only. Optional request field.

Returns:

  • (String)


89
90
91
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 89

def passenger_name
  @passenger_name
end

#passenger_typeString

List of passenger types in a booking code: A (Adult) C (Child) Comma separated values for total number of passenger

Returns:

  • (String)


397
398
399
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 397

def passenger_type
  @passenger_type
end

#plan_numberString

Plan number based on the fare. This value is provided by the airline. Format: English characters only. Optional request field.

Returns:

  • (String)


328
329
330
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 328

def plan_number
  @plan_number
end

#process_identifierString

Airline process identifier. This value is the airline’s three-digit IATA1 code which is used to process extended payment airline tickets.

Returns:

  • (String)


269
270
271
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 269

def process_identifier
  @process_identifier
end

#purchase_typeString

Type of purchase. Possible values:

  • EXC: Exchange ticket
  • MSC: Miscellaneous (not a ticket purchase and not a transaction related to an exchange ticket)
  • REF: Refund
  • TKT: Ticket Format: English characters only. Optional request field.

Returns:

  • (String)


299
300
301
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 299

def purchase_type
  @purchase_type
end

#reservation_system_codeString

Code that specifies the computerized reservation system used to make the reservation and purchase the ticket. 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.

Returns:

  • (String)


263
264
265
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 263

def reservation_system_code
  @reservation_system_code
end

#reservation_typeString

The field is not currently supported.

Returns:

  • (String)


356
357
358
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 356

def reservation_type
  @reservation_type
end

#restricted_ticket_desciptionString

Text that describes the ticket limitations, such as nonrefundable. Format: English characters only. Optional request field.

Returns:

  • (String)


341
342
343
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 341

def restricted_ticket_desciption
  @restricted_ticket_desciption
end

#restricted_ticket_indicatorInteger

Flag that indicates whether or not the ticket is restricted (nonrefundable). Possible values:

  • 0: No restriction (refundable)
  • 1: Restricted (nonrefundable) 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.

Returns:

  • (Integer)


67
68
69
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 67

def restricted_ticket_indicator
  @restricted_ticket_indicator
end

#third_party_statusString

Specifies if the travel agent joins the flight (0) or not (1)

Returns:

  • (String)


390
391
392
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 390

def third_party_status
  @third_party_status
end

#ticket_change_indicatorString

Type of update. Possible values:

  • C: Change to the existing ticket.
  • N: New ticket. Format: English characters only Optional request field.

Returns:

  • (String)


321
322
323
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 321

def ticket_change_indicator
  @ticket_change_indicator
end

#ticket_issue_dateString

Date on which the transaction occurred. Format: YYYYMMDD Format: English characters only. Optional request field.

Returns:

  • (String)


276
277
278
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 276

def ticket_issue_date
  @ticket_issue_date
end

#ticket_issuerTicketIssuer

Airline that generated the ticket. Format: English characters only. Optional request field.

Returns:



34
35
36
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 34

def ticket_issuer
  @ticket_issuer
end

#ticket_numberString

Ticket 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.

Returns:

  • (String)


43
44
45
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 43

def ticket_number
  @ticket_number
end

#total_clearing_amountString

Total clearing amount for all transactions in the clearing count set. This value cannot exceed 99999999999999999999 (twenty 9s). Format: English characters only. If this field is not set and if the total amount from the original authorization is not NULL, the total clearing amount is set to the total amount from the original authorization.

Returns:

  • (String)


247
248
249
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 247

def total_clearing_amount
  @total_clearing_amount
end

#total_fee_amountString

Total fee for the ticket. This value cannot exceed 99999999999999999999 (twenty 9s). Format: English characters only. Optional request field.

Returns:

  • (String)


220
221
222
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 220

def total_fee_amount
  @total_fee_amount
end

#total_insurance_amountString

Total insurance amount. We have per leg and not total

Returns:

  • (String)


401
402
403
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 401

def total_insurance_amount
  @total_insurance_amount
end

#transaction_typeInteger

Type of charge. Possible values:

  • 01: Charge is for an airline ticket
  • 02: Charge is for an item that is not an airline ticket

Returns:

  • (Integer)


74
75
76
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 74

def transaction_type
  @transaction_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 598

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_domestic = hash.key?('isDomestic') ? hash['isDomestic'] : SKIP
  booking_reference_number =
    hash.key?('bookingReferenceNumber') ? hash['bookingReferenceNumber'] : SKIP
  carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
  ticket_issuer = TicketIssuer.from_hash(hash['ticketIssuer']) if hash['ticketIssuer']
  ticket_number = hash.key?('ticketNumber') ? hash['ticketNumber'] : SKIP
  check_digit = hash.key?('checkDigit') ? hash['checkDigit'] : SKIP
  restricted_ticket_indicator =
    hash.key?('restrictedTicketIndicator') ? hash['restrictedTicketIndicator'] : SKIP
  transaction_type =
    hash.key?('transactionType') ? hash['transactionType'] : SKIP
  extended_payment_code =
    hash.key?('extendedPaymentCode') ? hash['extendedPaymentCode'] : SKIP
  passenger_name = hash.key?('passengerName') ? hash['passengerName'] : SKIP
  customer_code = hash.key?('customerCode') ? hash['customerCode'] : SKIP
  document_type = hash.key?('documentType') ? hash['documentType'] : SKIP
  document_number =
    hash.key?('documentNumber') ? hash['documentNumber'] : SKIP
  document_number_of_parts =
    hash.key?('documentNumberOfParts') ? hash['documentNumberOfParts'] : SKIP
  invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP
  invoice_date = hash.key?('invoiceDate') ? hash['invoiceDate'] : SKIP
  additional_charges =
    hash.key?('additionalCharges') ? hash['additionalCharges'] : SKIP
  total_fee_amount =
    hash.key?('totalFeeAmount') ? hash['totalFeeAmount'] : SKIP
  clearing_sequence =
    hash.key?('clearingSequence') ? hash['clearingSequence'] : SKIP
  clearing_count = hash.key?('clearingCount') ? hash['clearingCount'] : SKIP
  total_clearing_amount =
    hash.key?('totalClearingAmount') ? hash['totalClearingAmount'] : SKIP
  number_of_passengers =
    hash.key?('numberOfPassengers') ? hash['numberOfPassengers'] : SKIP
  reservation_system_code =
    hash.key?('reservationSystemCode') ? hash['reservationSystemCode'] : SKIP
  process_identifier =
    hash.key?('processIdentifier') ? hash['processIdentifier'] : SKIP
  ticket_issue_date =
    hash.key?('ticketIssueDate') ? hash['ticketIssueDate'] : SKIP
  electronic_ticket_indicator =
    hash.key?('electronicTicketIndicator') ? hash['electronicTicketIndicator'] : SKIP
  original_ticket_number =
    hash.key?('originalTicketNumber') ? hash['originalTicketNumber'] : SKIP
  purchase_type = hash.key?('purchaseType') ? hash['purchaseType'] : SKIP
  credit_reason_indicator =
    hash.key?('creditReasonIndicator') ? hash['creditReasonIndicator'] : SKIP
  ticket_change_indicator =
    hash.key?('ticketChangeIndicator') ? hash['ticketChangeIndicator'] : SKIP
  plan_number = hash.key?('planNumber') ? hash['planNumber'] : SKIP
  arrival_date = hash.key?('arrivalDate') ? hash['arrivalDate'] : SKIP
  restricted_ticket_desciption =
    hash.key?('restrictedTicketDesciption') ? hash['restrictedTicketDesciption'] : SKIP
  exchange_ticket_amount =
    hash.key?('exchangeTicketAmount') ? hash['exchangeTicketAmount'] : SKIP
  exchange_ticket_fee_amount =
    hash.key?('exchangeTicketFeeAmount') ? hash['exchangeTicketFeeAmount'] : SKIP
  reservation_type =
    hash.key?('reservationType') ? hash['reservationType'] : SKIP
  boarding_fee_amount =
    hash.key?('boardingFeeAmount') ? hash['boardingFeeAmount'] : SKIP
  # Parameter is an array, so we need to iterate through it
  legs = nil
  unless hash['legs'].nil?
    legs = []
    hash['legs'].each do |structure|
      legs << (Leg.from_hash(structure) if structure)
    end
  end

  legs = SKIP unless hash.key?('legs')
  ancillary_information = AncillaryInformation.from_hash(hash['ancillaryInformation']) if
    hash['ancillaryInformation']
  flight_type = hash.key?('flightType') ? hash['flightType'] : SKIP
  insurance_amount =
    hash.key?('insuranceAmount') ? hash['insuranceAmount'] : SKIP
  frequent_flyer_number =
    hash.key?('frequentFlyerNumber') ? hash['frequentFlyerNumber'] : SKIP
  third_party_status =
    hash.key?('thirdPartyStatus') ? hash['thirdPartyStatus'] : SKIP
  passenger_type = hash.key?('passengerType') ? hash['passengerType'] : SKIP
  total_insurance_amount =
    hash.key?('totalInsuranceAmount') ? hash['totalInsuranceAmount'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Airline.new(is_domestic: is_domestic,
              booking_reference_number: booking_reference_number,
              carrier_name: carrier_name,
              ticket_issuer: ticket_issuer,
              ticket_number: ticket_number,
              check_digit: check_digit,
              restricted_ticket_indicator: restricted_ticket_indicator,
              transaction_type: transaction_type,
              extended_payment_code: extended_payment_code,
              passenger_name: passenger_name,
              customer_code: customer_code,
              document_type: document_type,
              document_number: document_number,
              document_number_of_parts: document_number_of_parts,
              invoice_number: invoice_number,
              invoice_date: invoice_date,
              additional_charges: additional_charges,
              total_fee_amount: total_fee_amount,
              clearing_sequence: clearing_sequence,
              clearing_count: clearing_count,
              total_clearing_amount: total_clearing_amount,
              number_of_passengers: number_of_passengers,
              reservation_system_code: reservation_system_code,
              process_identifier: process_identifier,
              ticket_issue_date: ticket_issue_date,
              electronic_ticket_indicator: electronic_ticket_indicator,
              original_ticket_number: original_ticket_number,
              purchase_type: purchase_type,
              credit_reason_indicator: credit_reason_indicator,
              ticket_change_indicator: ticket_change_indicator,
              plan_number: plan_number,
              arrival_date: arrival_date,
              restricted_ticket_desciption: restricted_ticket_desciption,
              exchange_ticket_amount: exchange_ticket_amount,
              exchange_ticket_fee_amount: exchange_ticket_fee_amount,
              reservation_type: reservation_type,
              boarding_fee_amount: boarding_fee_amount,
              legs: legs,
              ancillary_information: ancillary_information,
              flight_type: flight_type,
              insurance_amount: insurance_amount,
              frequent_flyer_number: frequent_flyer_number,
              third_party_status: third_party_status,
              passenger_type: passenger_type,
              total_insurance_amount: total_insurance_amount,
              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



404
405
406
407
408
409
410
411
412
413
414
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
452
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 404

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_domestic'] = 'isDomestic'
  @_hash['booking_reference_number'] = 'bookingReferenceNumber'
  @_hash['carrier_name'] = 'carrierName'
  @_hash['ticket_issuer'] = 'ticketIssuer'
  @_hash['ticket_number'] = 'ticketNumber'
  @_hash['check_digit'] = 'checkDigit'
  @_hash['restricted_ticket_indicator'] = 'restrictedTicketIndicator'
  @_hash['transaction_type'] = 'transactionType'
  @_hash['extended_payment_code'] = 'extendedPaymentCode'
  @_hash['passenger_name'] = 'passengerName'
  @_hash['customer_code'] = 'customerCode'
  @_hash['document_type'] = 'documentType'
  @_hash['document_number'] = 'documentNumber'
  @_hash['document_number_of_parts'] = 'documentNumberOfParts'
  @_hash['invoice_number'] = 'invoiceNumber'
  @_hash['invoice_date'] = 'invoiceDate'
  @_hash['additional_charges'] = 'additionalCharges'
  @_hash['total_fee_amount'] = 'totalFeeAmount'
  @_hash['clearing_sequence'] = 'clearingSequence'
  @_hash['clearing_count'] = 'clearingCount'
  @_hash['total_clearing_amount'] = 'totalClearingAmount'
  @_hash['number_of_passengers'] = 'numberOfPassengers'
  @_hash['reservation_system_code'] = 'reservationSystemCode'
  @_hash['process_identifier'] = 'processIdentifier'
  @_hash['ticket_issue_date'] = 'ticketIssueDate'
  @_hash['electronic_ticket_indicator'] = 'electronicTicketIndicator'
  @_hash['original_ticket_number'] = 'originalTicketNumber'
  @_hash['purchase_type'] = 'purchaseType'
  @_hash['credit_reason_indicator'] = 'creditReasonIndicator'
  @_hash['ticket_change_indicator'] = 'ticketChangeIndicator'
  @_hash['plan_number'] = 'planNumber'
  @_hash['arrival_date'] = 'arrivalDate'
  @_hash['restricted_ticket_desciption'] = 'restrictedTicketDesciption'
  @_hash['exchange_ticket_amount'] = 'exchangeTicketAmount'
  @_hash['exchange_ticket_fee_amount'] = 'exchangeTicketFeeAmount'
  @_hash['reservation_type'] = 'reservationType'
  @_hash['boarding_fee_amount'] = 'boardingFeeAmount'
  @_hash['legs'] = 'legs'
  @_hash['ancillary_information'] = 'ancillaryInformation'
  @_hash['flight_type'] = 'flightType'
  @_hash['insurance_amount'] = 'insuranceAmount'
  @_hash['frequent_flyer_number'] = 'frequentFlyerNumber'
  @_hash['third_party_status'] = 'thirdPartyStatus'
  @_hash['passenger_type'] = 'passengerType'
  @_hash['total_insurance_amount'] = 'totalInsuranceAmount'
  @_hash
end

.nullablesObject

An array for nullable fields



506
507
508
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 506

def self.nullables
  []
end

.optionalsObject

An array for optional fields



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 455

def self.optionals
  %w[
    is_domestic
    booking_reference_number
    carrier_name
    ticket_issuer
    ticket_number
    check_digit
    restricted_ticket_indicator
    transaction_type
    extended_payment_code
    passenger_name
    customer_code
    document_type
    document_number
    document_number_of_parts
    invoice_number
    invoice_date
    additional_charges
    total_fee_amount
    clearing_sequence
    clearing_count
    total_clearing_amount
    number_of_passengers
    reservation_system_code
    process_identifier
    ticket_issue_date
    electronic_ticket_indicator
    original_ticket_number
    purchase_type
    credit_reason_indicator
    ticket_change_indicator
    plan_number
    arrival_date
    restricted_ticket_desciption
    exchange_ticket_amount
    exchange_ticket_fee_amount
    reservation_type
    boarding_fee_amount
    legs
    ancillary_information
    flight_type
    insurance_amount
    frequent_flyer_number
    third_party_status
    passenger_type
    total_insurance_amount
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 773

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} is_domestic: #{@is_domestic.inspect}, booking_reference_number:"\
  " #{@booking_reference_number.inspect}, carrier_name: #{@carrier_name.inspect},"\
  " ticket_issuer: #{@ticket_issuer.inspect}, ticket_number: #{@ticket_number.inspect},"\
  " check_digit: #{@check_digit.inspect}, restricted_ticket_indicator:"\
  " #{@restricted_ticket_indicator.inspect}, transaction_type: #{@transaction_type.inspect},"\
  " extended_payment_code: #{@extended_payment_code.inspect}, passenger_name:"\
  " #{@passenger_name.inspect}, customer_code: #{@customer_code.inspect}, document_type:"\
  " #{@document_type.inspect}, document_number: #{@document_number.inspect},"\
  " document_number_of_parts: #{@document_number_of_parts.inspect}, invoice_number:"\
  " #{@invoice_number.inspect}, invoice_date: #{@invoice_date.inspect}, additional_charges:"\
  " #{@additional_charges.inspect}, total_fee_amount: #{@total_fee_amount.inspect},"\
  " clearing_sequence: #{@clearing_sequence.inspect}, clearing_count:"\
  " #{@clearing_count.inspect}, total_clearing_amount: #{@total_clearing_amount.inspect},"\
  " number_of_passengers: #{@number_of_passengers.inspect}, reservation_system_code:"\
  " #{@reservation_system_code.inspect}, process_identifier: #{@process_identifier.inspect},"\
  " ticket_issue_date: #{@ticket_issue_date.inspect}, electronic_ticket_indicator:"\
  " #{@electronic_ticket_indicator.inspect}, original_ticket_number:"\
  " #{@original_ticket_number.inspect}, purchase_type: #{@purchase_type.inspect},"\
  " credit_reason_indicator: #{@credit_reason_indicator.inspect}, ticket_change_indicator:"\
  " #{@ticket_change_indicator.inspect}, plan_number: #{@plan_number.inspect}, arrival_date:"\
  " #{@arrival_date.inspect}, restricted_ticket_desciption:"\
  " #{@restricted_ticket_desciption.inspect}, exchange_ticket_amount:"\
  " #{@exchange_ticket_amount.inspect}, exchange_ticket_fee_amount:"\
  " #{@exchange_ticket_fee_amount.inspect}, reservation_type: #{@reservation_type.inspect},"\
  " boarding_fee_amount: #{@boarding_fee_amount.inspect}, legs: #{@legs.inspect},"\
  " ancillary_information: #{@ancillary_information.inspect}, flight_type:"\
  " #{@flight_type.inspect}, insurance_amount: #{@insurance_amount.inspect},"\
  " frequent_flyer_number: #{@frequent_flyer_number.inspect}, third_party_status:"\
  " #{@third_party_status.inspect}, passenger_type: #{@passenger_type.inspect},"\
  " total_insurance_amount: #{@total_insurance_amount.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
# File 'lib/visa_acceptance_merged_spec/models/airline.rb', line 742

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} is_domestic: #{@is_domestic}, booking_reference_number:"\
  " #{@booking_reference_number}, carrier_name: #{@carrier_name}, ticket_issuer:"\
  " #{@ticket_issuer}, ticket_number: #{@ticket_number}, check_digit: #{@check_digit},"\
  " restricted_ticket_indicator: #{@restricted_ticket_indicator}, transaction_type:"\
  " #{@transaction_type}, extended_payment_code: #{@extended_payment_code}, passenger_name:"\
  " #{@passenger_name}, customer_code: #{@customer_code}, document_type: #{@document_type},"\
  " document_number: #{@document_number}, document_number_of_parts:"\
  " #{@document_number_of_parts}, invoice_number: #{@invoice_number}, invoice_date:"\
  " #{@invoice_date}, additional_charges: #{@additional_charges}, total_fee_amount:"\
  " #{@total_fee_amount}, clearing_sequence: #{@clearing_sequence}, clearing_count:"\
  " #{@clearing_count}, total_clearing_amount: #{@total_clearing_amount},"\
  " number_of_passengers: #{@number_of_passengers}, reservation_system_code:"\
  " #{@reservation_system_code}, process_identifier: #{@process_identifier},"\
  " ticket_issue_date: #{@ticket_issue_date}, electronic_ticket_indicator:"\
  " #{@electronic_ticket_indicator}, original_ticket_number: #{@original_ticket_number},"\
  " purchase_type: #{@purchase_type}, credit_reason_indicator: #{@credit_reason_indicator},"\
  " ticket_change_indicator: #{@ticket_change_indicator}, plan_number: #{@plan_number},"\
  " arrival_date: #{@arrival_date}, restricted_ticket_desciption:"\
  " #{@restricted_ticket_desciption}, exchange_ticket_amount: #{@exchange_ticket_amount},"\
  " exchange_ticket_fee_amount: #{@exchange_ticket_fee_amount}, reservation_type:"\
  " #{@reservation_type}, boarding_fee_amount: #{@boarding_fee_amount}, legs: #{@legs},"\
  " ancillary_information: #{@ancillary_information}, flight_type: #{@flight_type},"\
  " insurance_amount: #{@insurance_amount}, frequent_flyer_number: #{@frequent_flyer_number},"\
  " third_party_status: #{@third_party_status}, passenger_type: #{@passenger_type},"\
  " total_insurance_amount: #{@total_insurance_amount}, additional_properties:"\
  " #{@additional_properties}>"
end