apimatic-bcd-travel-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +180 -0
- data/bin/console +15 -0
- data/lib/bcd_travel_api/api_helper.rb +10 -0
- data/lib/bcd_travel_api/apis/air_api.rb +138 -0
- data/lib/bcd_travel_api/apis/air_availability_return_flight_api.rb +31 -0
- data/lib/bcd_travel_api/apis/air_fare_search_optional_services_api.rb +31 -0
- data/lib/bcd_travel_api/apis/air_fare_search_select_seat_api.rb +53 -0
- data/lib/bcd_travel_api/apis/air_fare_search_simple_api.rb +195 -0
- data/lib/bcd_travel_api/apis/base_api.rb +67 -0
- data/lib/bcd_travel_api/apis/cars_api.rb +563 -0
- data/lib/bcd_travel_api/apis/hotels_api.rb +930 -0
- data/lib/bcd_travel_api/apis/retrieve_versions_api.rb +32 -0
- data/lib/bcd_travel_api/apis/search_expenses_api.rb +88 -0
- data/lib/bcd_travel_api/apis/v20_api.rb +72 -0
- data/lib/bcd_travel_api/apis/v21_api.rb +535 -0
- data/lib/bcd_travel_api/client.rb +136 -0
- data/lib/bcd_travel_api/configuration.rb +205 -0
- data/lib/bcd_travel_api/exceptions/api_exception.rb +21 -0
- data/lib/bcd_travel_api/http/api_response.rb +19 -0
- data/lib/bcd_travel_api/http/auth/basic.rb +62 -0
- data/lib/bcd_travel_api/http/auth/bearer.rb +53 -0
- data/lib/bcd_travel_api/http/http_call_back.rb +10 -0
- data/lib/bcd_travel_api/http/http_method_enum.rb +10 -0
- data/lib/bcd_travel_api/http/http_request.rb +10 -0
- data/lib/bcd_travel_api/http/http_response.rb +10 -0
- data/lib/bcd_travel_api/http/proxy_settings.rb +22 -0
- data/lib/bcd_travel_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/bcd_travel_api/logging/sdk_logger.rb +17 -0
- data/lib/bcd_travel_api/models/address.rb +74 -0
- data/lib/bcd_travel_api/models/address1.rb +111 -0
- data/lib/bcd_travel_api/models/address3.rb +109 -0
- data/lib/bcd_travel_api/models/address32.rb +75 -0
- data/lib/bcd_travel_api/models/address33.rb +103 -0
- data/lib/bcd_travel_api/models/address5.rb +100 -0
- data/lib/bcd_travel_api/models/air.rb +108 -0
- data/lib/bcd_travel_api/models/air1.rb +108 -0
- data/lib/bcd_travel_api/models/air16.rb +100 -0
- data/lib/bcd_travel_api/models/air2.rb +108 -0
- data/lib/bcd_travel_api/models/airavailabilityrequest.rb +164 -0
- data/lib/bcd_travel_api/models/airbookrequest.rb +350 -0
- data/lib/bcd_travel_api/models/aircancel_reservation_request4.rb +161 -0
- data/lib/bcd_travel_api/models/aircancel_reservationrefundquoteconfirmrequest.rb +164 -0
- data/lib/bcd_travel_api/models/aircomplete_verification_request.rb +146 -0
- data/lib/bcd_travel_api/models/airdocuments_issue_request.rb +163 -0
- data/lib/bcd_travel_api/models/airfare_rules_request.rb +155 -0
- data/lib/bcd_travel_api/models/airfare_search_request.rb +243 -0
- data/lib/bcd_travel_api/models/airget_checkout_data_request.rb +177 -0
- data/lib/bcd_travel_api/models/airpricingavailabilityrequest.rb +222 -0
- data/lib/bcd_travel_api/models/airpricingavailabilityrequest1.rb +231 -0
- data/lib/bcd_travel_api/models/airpricingfare_searchrequest.rb +214 -0
- data/lib/bcd_travel_api/models/airretrieve_reservations_list_request.rb +172 -0
- data/lib/bcd_travel_api/models/airseat_map_request.rb +175 -0
- data/lib/bcd_travel_api/models/arrival_location.rb +82 -0
- data/lib/bcd_travel_api/models/base_fare.rb +91 -0
- data/lib/bcd_travel_api/models/base_fare1.rb +119 -0
- data/lib/bcd_travel_api/models/base_fare2.rb +91 -0
- data/lib/bcd_travel_api/models/base_model.rb +110 -0
- data/lib/bcd_travel_api/models/billing_address.rb +110 -0
- data/lib/bcd_travel_api/models/booking_data.rb +73 -0
- data/lib/bcd_travel_api/models/broker.rb +82 -0
- data/lib/bcd_travel_api/models/broker16.rb +82 -0
- data/lib/bcd_travel_api/models/car.rb +91 -0
- data/lib/bcd_travel_api/models/car1.rb +91 -0
- data/lib/bcd_travel_api/models/car16.rb +83 -0
- data/lib/bcd_travel_api/models/car2.rb +91 -0
- data/lib/bcd_travel_api/models/card_detail.rb +104 -0
- data/lib/bcd_travel_api/models/carsbookcardrequest.rb +310 -0
- data/lib/bcd_travel_api/models/carsbookguaranteerequest.rb +236 -0
- data/lib/bcd_travel_api/models/carsbookvoucherrequest.rb +266 -0
- data/lib/bcd_travel_api/models/carscancel_reservation_request1.rb +163 -0
- data/lib/bcd_travel_api/models/carsdirect_sell_bookcardrequest.rb +362 -0
- data/lib/bcd_travel_api/models/carsdirect_sell_bookno_paymentrequest.rb +307 -0
- data/lib/bcd_travel_api/models/carsmodify_reservation_request.rb +215 -0
- data/lib/bcd_travel_api/models/carsretrieve_reservations_list_request.rb +172 -0
- data/lib/bcd_travel_api/models/client_reportable_datum.rb +82 -0
- data/lib/bcd_travel_api/models/content_type.rb +26 -0
- data/lib/bcd_travel_api/models/cruise_ferry.rb +91 -0
- data/lib/bcd_travel_api/models/departure_location.rb +82 -0
- data/lib/bcd_travel_api/models/document.rb +150 -0
- data/lib/bcd_travel_api/models/drop_off_location.rb +122 -0
- data/lib/bcd_travel_api/models/drop_off_location1.rb +118 -0
- data/lib/bcd_travel_api/models/drop_off_location16.rb +83 -0
- data/lib/bcd_travel_api/models/drop_off_location2.rb +82 -0
- data/lib/bcd_travel_api/models/end_location_address.rb +109 -0
- data/lib/bcd_travel_api/models/fare.rb +117 -0
- data/lib/bcd_travel_api/models/fare2.rb +119 -0
- data/lib/bcd_travel_api/models/fare3.rb +119 -0
- data/lib/bcd_travel_api/models/fare5.rb +91 -0
- data/lib/bcd_travel_api/models/ff_number.rb +82 -0
- data/lib/bcd_travel_api/models/filter.rb +185 -0
- data/lib/bcd_travel_api/models/filter1.rb +74 -0
- data/lib/bcd_travel_api/models/filter10.rb +74 -0
- data/lib/bcd_travel_api/models/filter11.rb +75 -0
- data/lib/bcd_travel_api/models/filter12.rb +75 -0
- data/lib/bcd_travel_api/models/filter13.rb +74 -0
- data/lib/bcd_travel_api/models/filter14.rb +75 -0
- data/lib/bcd_travel_api/models/filter15.rb +75 -0
- data/lib/bcd_travel_api/models/filter2.rb +74 -0
- data/lib/bcd_travel_api/models/filter3.rb +74 -0
- data/lib/bcd_travel_api/models/filter4.rb +75 -0
- data/lib/bcd_travel_api/models/filter6.rb +75 -0
- data/lib/bcd_travel_api/models/filter8.rb +75 -0
- data/lib/bcd_travel_api/models/generate_oauth_20_token.rb +91 -0
- data/lib/bcd_travel_api/models/get_configurations_post_request.rb +193 -0
- data/lib/bcd_travel_api/models/get_versionsbytrip_id.rb +99 -0
- data/lib/bcd_travel_api/models/guest.rb +82 -0
- data/lib/bcd_travel_api/models/hotel.rb +91 -0
- data/lib/bcd_travel_api/models/hotel1.rb +91 -0
- data/lib/bcd_travel_api/models/hotel16.rb +83 -0
- data/lib/bcd_travel_api/models/hotel2.rb +91 -0
- data/lib/bcd_travel_api/models/hotelsbookrequest.rb +418 -0
- data/lib/bcd_travel_api/models/hotelsbookrequest1.rb +445 -0
- data/lib/bcd_travel_api/models/hotelscancel_reservation_request.rb +153 -0
- data/lib/bcd_travel_api/models/hotelsrebookrequest.rb +214 -0
- data/lib/bcd_travel_api/models/hotelsrebookrequest1.rb +231 -0
- data/lib/bcd_travel_api/models/hotelsupdate_reservation_details_request.rb +153 -0
- data/lib/bcd_travel_api/models/hotelsupdate_reservation_details_request1.rb +164 -0
- data/lib/bcd_travel_api/models/leg.rb +166 -0
- data/lib/bcd_travel_api/models/leg1.rb +168 -0
- data/lib/bcd_travel_api/models/leg2.rb +156 -0
- data/lib/bcd_travel_api/models/leg3.rb +160 -0
- data/lib/bcd_travel_api/models/leg33.rb +164 -0
- data/lib/bcd_travel_api/models/leg34.rb +143 -0
- data/lib/bcd_travel_api/models/leg4.rb +154 -0
- data/lib/bcd_travel_api/models/leg6.rb +143 -0
- data/lib/bcd_travel_api/models/line_item.rb +109 -0
- data/lib/bcd_travel_api/models/line_item1.rb +119 -0
- data/lib/bcd_travel_api/models/location.rb +73 -0
- data/lib/bcd_travel_api/models/location16.rb +73 -0
- data/lib/bcd_travel_api/models/misc.rb +91 -0
- data/lib/bcd_travel_api/models/misc10.rb +83 -0
- data/lib/bcd_travel_api/models/options.rb +84 -0
- data/lib/bcd_travel_api/models/origin_destination.rb +134 -0
- data/lib/bcd_travel_api/models/origin_destination1.rb +108 -0
- data/lib/bcd_travel_api/models/passenger.rb +104 -0
- data/lib/bcd_travel_api/models/passport.rb +102 -0
- data/lib/bcd_travel_api/models/payment.rb +137 -0
- data/lib/bcd_travel_api/models/payment1.rb +141 -0
- data/lib/bcd_travel_api/models/payment2.rb +121 -0
- data/lib/bcd_travel_api/models/payment3.rb +111 -0
- data/lib/bcd_travel_api/models/pickup_location.rb +122 -0
- data/lib/bcd_travel_api/models/pickup_location1.rb +118 -0
- data/lib/bcd_travel_api/models/pickup_location16.rb +83 -0
- data/lib/bcd_travel_api/models/pickup_location2.rb +82 -0
- data/lib/bcd_travel_api/models/ping_getresponse.rb +72 -0
- data/lib/bcd_travel_api/models/pingrequest.rb +126 -0
- data/lib/bcd_travel_api/models/pingrequest2.rb +146 -0
- data/lib/bcd_travel_api/models/products.rb +129 -0
- data/lib/bcd_travel_api/models/products1.rb +117 -0
- data/lib/bcd_travel_api/models/products16.rb +111 -0
- data/lib/bcd_travel_api/models/products2.rb +107 -0
- data/lib/bcd_travel_api/models/rail.rb +91 -0
- data/lib/bcd_travel_api/models/rail1.rb +91 -0
- data/lib/bcd_travel_api/models/rail16.rb +82 -0
- data/lib/bcd_travel_api/models/rail2.rb +91 -0
- data/lib/bcd_travel_api/models/reservation.rb +223 -0
- data/lib/bcd_travel_api/models/reservation1.rb +239 -0
- data/lib/bcd_travel_api/models/reservation2.rb +170 -0
- data/lib/bcd_travel_api/models/reservation3.rb +193 -0
- data/lib/bcd_travel_api/models/reservation4.rb +201 -0
- data/lib/bcd_travel_api/models/reservation56.rb +220 -0
- data/lib/bcd_travel_api/models/reservation57.rb +219 -0
- data/lib/bcd_travel_api/models/reservation6.rb +240 -0
- data/lib/bcd_travel_api/models/reservation8.rb +220 -0
- data/lib/bcd_travel_api/models/reservation9.rb +239 -0
- data/lib/bcd_travel_api/models/result.rb +299 -0
- data/lib/bcd_travel_api/models/result1.rb +267 -0
- data/lib/bcd_travel_api/models/result16.rb +295 -0
- data/lib/bcd_travel_api/models/result2.rb +295 -0
- data/lib/bcd_travel_api/models/search_expenses.rb +111 -0
- data/lib/bcd_travel_api/models/search_expenses_request.rb +99 -0
- data/lib/bcd_travel_api/models/search_expensesbyaccount_id.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyaccount_id_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbybooking_date_time.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbybooking_date_time_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbybooking_date_timerange.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbybooking_date_timerange_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbycalculated_ticket_status.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbycalculated_ticket_status_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbycustomer_number.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbycustomer_number_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyglobal_customer_number.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyglobal_customer_number_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyhas_transaction.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyhas_transaction_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyinvoice_date_time.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyinvoice_date_time_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyinvoice_date_timerange.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyinvoice_date_timerange_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyinvoice_number.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyinvoice_number_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbylast_modified_date_time.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbylast_modified_date_time_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbylast_modified_date_timerange.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbylast_modified_date_timerange_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyrecord_locator.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyrecord_locator_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbyticket_status.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbyticket_status_request.rb +90 -0
- data/lib/bcd_travel_api/models/search_expensesbytraveler_email.rb +111 -0
- data/lib/bcd_travel_api/models/search_expensesbytraveler_email_request.rb +90 -0
- data/lib/bcd_travel_api/models/segment_option.rb +85 -0
- data/lib/bcd_travel_api/models/seller.rb +83 -0
- data/lib/bcd_travel_api/models/seller16.rb +72 -0
- data/lib/bcd_travel_api/models/sort.rb +86 -0
- data/lib/bcd_travel_api/models/specific_flight.rb +82 -0
- data/lib/bcd_travel_api/models/start_location_address.rb +109 -0
- data/lib/bcd_travel_api/models/taxis.rb +145 -0
- data/lib/bcd_travel_api/models/taxis1.rb +132 -0
- data/lib/bcd_travel_api/models/taxis3.rb +143 -0
- data/lib/bcd_travel_api/models/taxis4.rb +130 -0
- data/lib/bcd_travel_api/models/ticket.rb +334 -0
- data/lib/bcd_travel_api/models/ticket1.rb +156 -0
- data/lib/bcd_travel_api/models/ticket2.rb +244 -0
- data/lib/bcd_travel_api/models/ticket3.rb +156 -0
- data/lib/bcd_travel_api/models/ticket32.rb +337 -0
- data/lib/bcd_travel_api/models/ticket33.rb +156 -0
- data/lib/bcd_travel_api/models/ticket4.rb +337 -0
- data/lib/bcd_travel_api/models/ticket5.rb +156 -0
- data/lib/bcd_travel_api/models/time_restriction.rb +90 -0
- data/lib/bcd_travel_api/models/tour.rb +91 -0
- data/lib/bcd_travel_api/models/traveler.rb +91 -0
- data/lib/bcd_travel_api/models/traveler1.rb +110 -0
- data/lib/bcd_travel_api/models/traveler3.rb +91 -0
- data/lib/bcd_travel_api/models/traveler4.rb +120 -0
- data/lib/bcd_travel_api/models/traveler_name.rb +82 -0
- data/lib/bcd_travel_api/utilities/date_time_helper.rb +11 -0
- data/lib/bcd_travel_api/utilities/file_wrapper.rb +28 -0
- data/lib/bcd_travel_api/utilities/union_type_lookup.rb +128 -0
- data/lib/bcd_travel_api.rb +270 -0
- metadata +316 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# bcd_travel_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BcdTravelApi
|
|
7
|
+
# Document Model.
|
|
8
|
+
class Document < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :document_number
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :booking_type
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [Fare]
|
|
22
|
+
attr_accessor :fare
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [Fare]
|
|
26
|
+
attr_accessor :base_fare
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for this method
|
|
29
|
+
# @return [Array[Object]]
|
|
30
|
+
attr_accessor :line_items
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['document_number'] = 'documentNumber'
|
|
36
|
+
@_hash['booking_type'] = 'bookingType'
|
|
37
|
+
@_hash['fare'] = 'fare'
|
|
38
|
+
@_hash['base_fare'] = 'baseFare'
|
|
39
|
+
@_hash['line_items'] = 'lineItems'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(document_number:, booking_type:, fare:, base_fare:,
|
|
54
|
+
line_items:, additional_properties: nil)
|
|
55
|
+
# Add additional model properties to the instance
|
|
56
|
+
additional_properties = {} if additional_properties.nil?
|
|
57
|
+
|
|
58
|
+
@document_number = document_number
|
|
59
|
+
@booking_type = booking_type
|
|
60
|
+
@fare = fare
|
|
61
|
+
@base_fare = base_fare
|
|
62
|
+
@line_items = line_items
|
|
63
|
+
@additional_properties = additional_properties
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Creates an instance of the object from a hash.
|
|
67
|
+
def self.from_hash(hash)
|
|
68
|
+
return nil unless hash
|
|
69
|
+
|
|
70
|
+
# Extract variables from the hash.
|
|
71
|
+
document_number =
|
|
72
|
+
hash.key?('documentNumber') ? hash['documentNumber'] : nil
|
|
73
|
+
booking_type = hash.key?('bookingType') ? hash['bookingType'] : nil
|
|
74
|
+
fare = Fare.from_hash(hash['fare']) if hash['fare']
|
|
75
|
+
base_fare = Fare.from_hash(hash['baseFare']) if hash['baseFare']
|
|
76
|
+
line_items = hash.key?('lineItems') ? APIHelper.deserialize_union_type(
|
|
77
|
+
UnionTypeLookUp.get(:DocumentLineItems), hash['lineItems']
|
|
78
|
+
) : nil
|
|
79
|
+
|
|
80
|
+
# Create a new hash for additional properties, removing known properties.
|
|
81
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
82
|
+
|
|
83
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
84
|
+
new_hash, proc { |value| value }
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Create object from extracted values.
|
|
88
|
+
Document.new(document_number: document_number,
|
|
89
|
+
booking_type: booking_type,
|
|
90
|
+
fare: fare,
|
|
91
|
+
base_fare: base_fare,
|
|
92
|
+
line_items: line_items,
|
|
93
|
+
additional_properties: additional_properties)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Validates an instance of the object from a given value.
|
|
97
|
+
# @param [Document | Hash] The value against the validation is performed.
|
|
98
|
+
def self.validate(value)
|
|
99
|
+
if value.instance_of? self
|
|
100
|
+
return (
|
|
101
|
+
APIHelper.valid_type?(value.document_number,
|
|
102
|
+
->(val) { val.instance_of? String }) and
|
|
103
|
+
APIHelper.valid_type?(value.booking_type,
|
|
104
|
+
->(val) { val.instance_of? String }) and
|
|
105
|
+
APIHelper.valid_type?(value.fare,
|
|
106
|
+
->(val) { Fare.validate(val) },
|
|
107
|
+
is_model_hash: true) and
|
|
108
|
+
APIHelper.valid_type?(value.base_fare,
|
|
109
|
+
->(val) { Fare.validate(val) },
|
|
110
|
+
is_model_hash: true) and
|
|
111
|
+
UnionTypeLookUp.get(:DocumentLineItems)
|
|
112
|
+
.validate(value.line_items)
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
return false unless value.instance_of? Hash
|
|
117
|
+
|
|
118
|
+
(
|
|
119
|
+
APIHelper.valid_type?(value['documentNumber'],
|
|
120
|
+
->(val) { val.instance_of? String }) and
|
|
121
|
+
APIHelper.valid_type?(value['bookingType'],
|
|
122
|
+
->(val) { val.instance_of? String }) and
|
|
123
|
+
APIHelper.valid_type?(value['fare'],
|
|
124
|
+
->(val) { Fare.validate(val) },
|
|
125
|
+
is_model_hash: true) and
|
|
126
|
+
APIHelper.valid_type?(value['baseFare'],
|
|
127
|
+
->(val) { Fare.validate(val) },
|
|
128
|
+
is_model_hash: true) and
|
|
129
|
+
UnionTypeLookUp.get(:DocumentLineItems)
|
|
130
|
+
.validate(value['lineItems'])
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Provides a human-readable string representation of the object.
|
|
135
|
+
def to_s
|
|
136
|
+
class_name = self.class.name.split('::').last
|
|
137
|
+
"<#{class_name} document_number: #{@document_number}, booking_type: #{@booking_type}, fare:"\
|
|
138
|
+
" #{@fare}, base_fare: #{@base_fare}, line_items: #{@line_items}, additional_properties:"\
|
|
139
|
+
" #{@additional_properties}>"
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
143
|
+
def inspect
|
|
144
|
+
class_name = self.class.name.split('::').last
|
|
145
|
+
"<#{class_name} document_number: #{@document_number.inspect}, booking_type:"\
|
|
146
|
+
" #{@booking_type.inspect}, fare: #{@fare.inspect}, base_fare: #{@base_fare.inspect},"\
|
|
147
|
+
" line_items: #{@line_items.inspect}, additional_properties: #{@additional_properties}>"
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# bcd_travel_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BcdTravelApi
|
|
7
|
+
# DropOffLocation Model.
|
|
8
|
+
class DropOffLocation < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :address1
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :country_code
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :address2
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :city
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for this method
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :region
|
|
31
|
+
|
|
32
|
+
# TODO: Write general description for this method
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :postal_code
|
|
35
|
+
|
|
36
|
+
# A mapping from model property names to API property names.
|
|
37
|
+
def self.names
|
|
38
|
+
@_hash = {} if @_hash.nil?
|
|
39
|
+
@_hash['address1'] = 'address1'
|
|
40
|
+
@_hash['country_code'] = 'countryCode'
|
|
41
|
+
@_hash['address2'] = 'address2'
|
|
42
|
+
@_hash['city'] = 'city'
|
|
43
|
+
@_hash['region'] = 'region'
|
|
44
|
+
@_hash['postal_code'] = 'postalCode'
|
|
45
|
+
@_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for optional fields
|
|
49
|
+
def self.optionals
|
|
50
|
+
%w[
|
|
51
|
+
address2
|
|
52
|
+
city
|
|
53
|
+
region
|
|
54
|
+
postal_code
|
|
55
|
+
]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# An array for nullable fields
|
|
59
|
+
def self.nullables
|
|
60
|
+
[]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def initialize(address1:, country_code:, address2: SKIP, city: SKIP,
|
|
64
|
+
region: SKIP, postal_code: SKIP, additional_properties: nil)
|
|
65
|
+
# Add additional model properties to the instance
|
|
66
|
+
additional_properties = {} if additional_properties.nil?
|
|
67
|
+
|
|
68
|
+
@address1 = address1
|
|
69
|
+
@country_code = country_code
|
|
70
|
+
@address2 = address2 unless address2 == SKIP
|
|
71
|
+
@city = city unless city == SKIP
|
|
72
|
+
@region = region unless region == SKIP
|
|
73
|
+
@postal_code = postal_code unless postal_code == SKIP
|
|
74
|
+
@additional_properties = additional_properties
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Creates an instance of the object from a hash.
|
|
78
|
+
def self.from_hash(hash)
|
|
79
|
+
return nil unless hash
|
|
80
|
+
|
|
81
|
+
# Extract variables from the hash.
|
|
82
|
+
address1 = hash.key?('address1') ? hash['address1'] : nil
|
|
83
|
+
country_code = hash.key?('countryCode') ? hash['countryCode'] : nil
|
|
84
|
+
address2 = hash.key?('address2') ? hash['address2'] : SKIP
|
|
85
|
+
city = hash.key?('city') ? hash['city'] : SKIP
|
|
86
|
+
region = hash.key?('region') ? hash['region'] : SKIP
|
|
87
|
+
postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
|
|
88
|
+
|
|
89
|
+
# Create a new hash for additional properties, removing known properties.
|
|
90
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
91
|
+
|
|
92
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
93
|
+
new_hash, proc { |value| value }
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Create object from extracted values.
|
|
97
|
+
DropOffLocation.new(address1: address1,
|
|
98
|
+
country_code: country_code,
|
|
99
|
+
address2: address2,
|
|
100
|
+
city: city,
|
|
101
|
+
region: region,
|
|
102
|
+
postal_code: postal_code,
|
|
103
|
+
additional_properties: additional_properties)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Provides a human-readable string representation of the object.
|
|
107
|
+
def to_s
|
|
108
|
+
class_name = self.class.name.split('::').last
|
|
109
|
+
"<#{class_name} address1: #{@address1}, country_code: #{@country_code}, address2:"\
|
|
110
|
+
" #{@address2}, city: #{@city}, region: #{@region}, postal_code: #{@postal_code},"\
|
|
111
|
+
" additional_properties: #{@additional_properties}>"
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
115
|
+
def inspect
|
|
116
|
+
class_name = self.class.name.split('::').last
|
|
117
|
+
"<#{class_name} address1: #{@address1.inspect}, country_code: #{@country_code.inspect},"\
|
|
118
|
+
" address2: #{@address2.inspect}, city: #{@city.inspect}, region: #{@region.inspect},"\
|
|
119
|
+
" postal_code: #{@postal_code.inspect}, additional_properties: #{@additional_properties}>"
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# bcd_travel_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BcdTravelApi
|
|
7
|
+
# DropOffLocation1 Model.
|
|
8
|
+
class DropOffLocation1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :address1
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :address2
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :country_code
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :city
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for this method
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :region
|
|
31
|
+
|
|
32
|
+
# TODO: Write general description for this method
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :postal_code
|
|
35
|
+
|
|
36
|
+
# A mapping from model property names to API property names.
|
|
37
|
+
def self.names
|
|
38
|
+
@_hash = {} if @_hash.nil?
|
|
39
|
+
@_hash['address1'] = 'address1'
|
|
40
|
+
@_hash['address2'] = 'address2'
|
|
41
|
+
@_hash['country_code'] = 'countryCode'
|
|
42
|
+
@_hash['city'] = 'city'
|
|
43
|
+
@_hash['region'] = 'region'
|
|
44
|
+
@_hash['postal_code'] = 'postalCode'
|
|
45
|
+
@_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for optional fields
|
|
49
|
+
def self.optionals
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# An array for nullable fields
|
|
54
|
+
def self.nullables
|
|
55
|
+
[]
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def initialize(address1:, address2:, country_code:, city:, region:,
|
|
59
|
+
postal_code:, additional_properties: nil)
|
|
60
|
+
# Add additional model properties to the instance
|
|
61
|
+
additional_properties = {} if additional_properties.nil?
|
|
62
|
+
|
|
63
|
+
@address1 = address1
|
|
64
|
+
@address2 = address2
|
|
65
|
+
@country_code = country_code
|
|
66
|
+
@city = city
|
|
67
|
+
@region = region
|
|
68
|
+
@postal_code = postal_code
|
|
69
|
+
@additional_properties = additional_properties
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
address1 = hash.key?('address1') ? hash['address1'] : nil
|
|
78
|
+
address2 = hash.key?('address2') ? hash['address2'] : nil
|
|
79
|
+
country_code = hash.key?('countryCode') ? hash['countryCode'] : nil
|
|
80
|
+
city = hash.key?('city') ? hash['city'] : nil
|
|
81
|
+
region = hash.key?('region') ? hash['region'] : nil
|
|
82
|
+
postal_code = hash.key?('postalCode') ? hash['postalCode'] : nil
|
|
83
|
+
|
|
84
|
+
# Create a new hash for additional properties, removing known properties.
|
|
85
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
86
|
+
|
|
87
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
88
|
+
new_hash, proc { |value| value }
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
# Create object from extracted values.
|
|
92
|
+
DropOffLocation1.new(address1: address1,
|
|
93
|
+
address2: address2,
|
|
94
|
+
country_code: country_code,
|
|
95
|
+
city: city,
|
|
96
|
+
region: region,
|
|
97
|
+
postal_code: postal_code,
|
|
98
|
+
additional_properties: additional_properties)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Provides a human-readable string representation of the object.
|
|
102
|
+
def to_s
|
|
103
|
+
class_name = self.class.name.split('::').last
|
|
104
|
+
"<#{class_name} address1: #{@address1}, address2: #{@address2}, country_code:"\
|
|
105
|
+
" #{@country_code}, city: #{@city}, region: #{@region}, postal_code: #{@postal_code},"\
|
|
106
|
+
" additional_properties: #{@additional_properties}>"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
110
|
+
def inspect
|
|
111
|
+
class_name = self.class.name.split('::').last
|
|
112
|
+
"<#{class_name} address1: #{@address1.inspect}, address2: #{@address2.inspect},"\
|
|
113
|
+
" country_code: #{@country_code.inspect}, city: #{@city.inspect}, region:"\
|
|
114
|
+
" #{@region.inspect}, postal_code: #{@postal_code.inspect}, additional_properties:"\
|
|
115
|
+
" #{@additional_properties}>"
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# bcd_travel_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BcdTravelApi
|
|
7
|
+
# DropOffLocation16 Model.
|
|
8
|
+
class DropOffLocation16 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :address1
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :address_country_code
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['address1'] = 'address1'
|
|
24
|
+
@_hash['address_country_code'] = 'addressCountryCode'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(address1:, address_country_code:, additional_properties: nil)
|
|
39
|
+
# Add additional model properties to the instance
|
|
40
|
+
additional_properties = {} if additional_properties.nil?
|
|
41
|
+
|
|
42
|
+
@address1 = address1
|
|
43
|
+
@address_country_code = address_country_code
|
|
44
|
+
@additional_properties = additional_properties
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Creates an instance of the object from a hash.
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
# Extract variables from the hash.
|
|
52
|
+
address1 = hash.key?('address1') ? hash['address1'] : nil
|
|
53
|
+
address_country_code =
|
|
54
|
+
hash.key?('addressCountryCode') ? hash['addressCountryCode'] : nil
|
|
55
|
+
|
|
56
|
+
# Create a new hash for additional properties, removing known properties.
|
|
57
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
58
|
+
|
|
59
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
60
|
+
new_hash, proc { |value| value }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
DropOffLocation16.new(address1: address1,
|
|
65
|
+
address_country_code: address_country_code,
|
|
66
|
+
additional_properties: additional_properties)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} address1: #{@address1}, address_country_code: #{@address_country_code},"\
|
|
73
|
+
" additional_properties: #{@additional_properties}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} address1: #{@address1.inspect}, address_country_code:"\
|
|
80
|
+
" #{@address_country_code.inspect}, additional_properties: #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# bcd_travel_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BcdTravelApi
|
|
7
|
+
# DropOffLocation2 Model.
|
|
8
|
+
class DropOffLocation2 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :address1
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :country_code
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['address1'] = 'address1'
|
|
24
|
+
@_hash['country_code'] = 'countryCode'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for nullable fields
|
|
34
|
+
def self.nullables
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def initialize(address1:, country_code:, additional_properties: nil)
|
|
39
|
+
# Add additional model properties to the instance
|
|
40
|
+
additional_properties = {} if additional_properties.nil?
|
|
41
|
+
|
|
42
|
+
@address1 = address1
|
|
43
|
+
@country_code = country_code
|
|
44
|
+
@additional_properties = additional_properties
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Creates an instance of the object from a hash.
|
|
48
|
+
def self.from_hash(hash)
|
|
49
|
+
return nil unless hash
|
|
50
|
+
|
|
51
|
+
# Extract variables from the hash.
|
|
52
|
+
address1 = hash.key?('address1') ? hash['address1'] : nil
|
|
53
|
+
country_code = hash.key?('countryCode') ? hash['countryCode'] : nil
|
|
54
|
+
|
|
55
|
+
# Create a new hash for additional properties, removing known properties.
|
|
56
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
57
|
+
|
|
58
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
59
|
+
new_hash, proc { |value| value }
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Create object from extracted values.
|
|
63
|
+
DropOffLocation2.new(address1: address1,
|
|
64
|
+
country_code: country_code,
|
|
65
|
+
additional_properties: additional_properties)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Provides a human-readable string representation of the object.
|
|
69
|
+
def to_s
|
|
70
|
+
class_name = self.class.name.split('::').last
|
|
71
|
+
"<#{class_name} address1: #{@address1}, country_code: #{@country_code},"\
|
|
72
|
+
" additional_properties: #{@additional_properties}>"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
76
|
+
def inspect
|
|
77
|
+
class_name = self.class.name.split('::').last
|
|
78
|
+
"<#{class_name} address1: #{@address1.inspect}, country_code: #{@country_code.inspect},"\
|
|
79
|
+
" additional_properties: #{@additional_properties}>"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# bcd_travel_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module BcdTravelApi
|
|
7
|
+
# EndLocationAddress Model.
|
|
8
|
+
class EndLocationAddress < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :address1
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :address2
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :country_code
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :city
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for this method
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :postal_code
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['address1'] = 'address1'
|
|
36
|
+
@_hash['address2'] = 'address2'
|
|
37
|
+
@_hash['country_code'] = 'countryCode'
|
|
38
|
+
@_hash['city'] = 'city'
|
|
39
|
+
@_hash['postal_code'] = 'postalCode'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(address1:, address2:, country_code:, city:, postal_code:,
|
|
54
|
+
additional_properties: nil)
|
|
55
|
+
# Add additional model properties to the instance
|
|
56
|
+
additional_properties = {} if additional_properties.nil?
|
|
57
|
+
|
|
58
|
+
@address1 = address1
|
|
59
|
+
@address2 = address2
|
|
60
|
+
@country_code = country_code
|
|
61
|
+
@city = city
|
|
62
|
+
@postal_code = postal_code
|
|
63
|
+
@additional_properties = additional_properties
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Creates an instance of the object from a hash.
|
|
67
|
+
def self.from_hash(hash)
|
|
68
|
+
return nil unless hash
|
|
69
|
+
|
|
70
|
+
# Extract variables from the hash.
|
|
71
|
+
address1 = hash.key?('address1') ? hash['address1'] : nil
|
|
72
|
+
address2 = hash.key?('address2') ? hash['address2'] : nil
|
|
73
|
+
country_code = hash.key?('countryCode') ? hash['countryCode'] : nil
|
|
74
|
+
city = hash.key?('city') ? hash['city'] : nil
|
|
75
|
+
postal_code = hash.key?('postalCode') ? hash['postalCode'] : nil
|
|
76
|
+
|
|
77
|
+
# Create a new hash for additional properties, removing known properties.
|
|
78
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
79
|
+
|
|
80
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
81
|
+
new_hash, proc { |value| value }
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
EndLocationAddress.new(address1: address1,
|
|
86
|
+
address2: address2,
|
|
87
|
+
country_code: country_code,
|
|
88
|
+
city: city,
|
|
89
|
+
postal_code: postal_code,
|
|
90
|
+
additional_properties: additional_properties)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Provides a human-readable string representation of the object.
|
|
94
|
+
def to_s
|
|
95
|
+
class_name = self.class.name.split('::').last
|
|
96
|
+
"<#{class_name} address1: #{@address1}, address2: #{@address2}, country_code:"\
|
|
97
|
+
" #{@country_code}, city: #{@city}, postal_code: #{@postal_code}, additional_properties:"\
|
|
98
|
+
" #{@additional_properties}>"
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
102
|
+
def inspect
|
|
103
|
+
class_name = self.class.name.split('::').last
|
|
104
|
+
"<#{class_name} address1: #{@address1.inspect}, address2: #{@address2.inspect},"\
|
|
105
|
+
" country_code: #{@country_code.inspect}, city: #{@city.inspect}, postal_code:"\
|
|
106
|
+
" #{@postal_code.inspect}, additional_properties: #{@additional_properties}>"
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|