apimatic-cp-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 +178 -0
- data/bin/console +15 -0
- data/lib/cell_point_api/api_helper.rb +10 -0
- data/lib/cell_point_api/apis/apple_pay_api.rb +51 -0
- data/lib/cell_point_api/apis/authentication_api.rb +81 -0
- data/lib/cell_point_api/apis/base_api.rb +67 -0
- data/lib/cell_point_api/apis/bulk_api.rb +93 -0
- data/lib/cell_point_api/apis/cards_api.rb +104 -0
- data/lib/cell_point_api/apis/notes_api.rb +66 -0
- data/lib/cell_point_api/apis/oauth_authorization_api.rb +44 -0
- data/lib/cell_point_api/apis/orders_api.rb +483 -0
- data/lib/cell_point_api/apis/payment_methods_api.rb +57 -0
- data/lib/cell_point_api/apis/proxy_api.rb +91 -0
- data/lib/cell_point_api/apis/transactions_api.rb +546 -0
- data/lib/cell_point_api/apis/wallet_api.rb +39 -0
- data/lib/cell_point_api/client.rb +145 -0
- data/lib/cell_point_api/configuration.rb +180 -0
- data/lib/cell_point_api/events/callbacks/callbacks_handler.rb +37 -0
- data/lib/cell_point_api/events/unknown_event.rb +32 -0
- data/lib/cell_point_api/exceptions/api_exception.rb +21 -0
- data/lib/cell_point_api/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/cell_point_api/exceptions/problem_exception.rb +75 -0
- data/lib/cell_point_api/http/api_response.rb +19 -0
- data/lib/cell_point_api/http/auth/cpd_issued_jwt.rb +156 -0
- data/lib/cell_point_api/http/auth/merchant_issued_jwt.rb +53 -0
- data/lib/cell_point_api/http/http_call_back.rb +10 -0
- data/lib/cell_point_api/http/http_method_enum.rb +10 -0
- data/lib/cell_point_api/http/http_request.rb +10 -0
- data/lib/cell_point_api/http/http_response.rb +10 -0
- data/lib/cell_point_api/http/proxy_settings.rb +22 -0
- data/lib/cell_point_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/cell_point_api/logging/sdk_logger.rb +17 -0
- data/lib/cell_point_api/models/account.rb +168 -0
- data/lib/cell_point_api/models/account_status.rb +52 -0
- data/lib/cell_point_api/models/account_type.rb +44 -0
- data/lib/cell_point_api/models/action_base.rb +74 -0
- data/lib/cell_point_api/models/action_completion_response.rb +77 -0
- data/lib/cell_point_api/models/action_result_status.rb +40 -0
- data/lib/cell_point_api/models/action_type.rb +36 -0
- data/lib/cell_point_api/models/activity.rb +244 -0
- data/lib/cell_point_api/models/activity_data.rb +127 -0
- data/lib/cell_point_api/models/address_verification_status.rb +56 -0
- data/lib/cell_point_api/models/airline_ancillary.rb +244 -0
- data/lib/cell_point_api/models/airline_ancillary_data.rb +120 -0
- data/lib/cell_point_api/models/airline_fare.rb +348 -0
- data/lib/cell_point_api/models/airline_fare_data.rb +217 -0
- data/lib/cell_point_api/models/airline_industry_data.rb +152 -0
- data/lib/cell_point_api/models/airport.rb +144 -0
- data/lib/cell_point_api/models/amount.rb +105 -0
- data/lib/cell_point_api/models/ancillary_details.rb +366 -0
- data/lib/cell_point_api/models/apple_pay_config.rb +83 -0
- data/lib/cell_point_api/models/apple_pay_instrument_apple_pay_node.rb +119 -0
- data/lib/cell_point_api/models/apple_pay_payment_instrument.rb +123 -0
- data/lib/cell_point_api/models/apple_tokenized_token.rb +143 -0
- data/lib/cell_point_api/models/audience.rb +36 -0
- data/lib/cell_point_api/models/authorization.rb +145 -0
- data/lib/cell_point_api/models/authorization_group.rb +99 -0
- data/lib/cell_point_api/models/authorization_group1.rb +216 -0
- data/lib/cell_point_api/models/authorization_group_full.rb +193 -0
- data/lib/cell_point_api/models/authorize_order_by_id_post201_response.rb +128 -0
- data/lib/cell_point_api/models/auto_rental.rb +195 -0
- data/lib/cell_point_api/models/auto_rental_data.rb +76 -0
- data/lib/cell_point_api/models/auto_rental_industry_data.rb +182 -0
- data/lib/cell_point_api/models/base_model.rb +110 -0
- data/lib/cell_point_api/models/bin.rb +73 -0
- data/lib/cell_point_api/models/breadcrumb.rb +86 -0
- data/lib/cell_point_api/models/browser_info.rb +114 -0
- data/lib/cell_point_api/models/bundle.rb +195 -0
- data/lib/cell_point_api/models/bundled_activity.rb +229 -0
- data/lib/cell_point_api/models/bundled_airline_ancillary.rb +226 -0
- data/lib/cell_point_api/models/bundled_airline_fare.rb +330 -0
- data/lib/cell_point_api/models/bundled_auto_rental.rb +176 -0
- data/lib/cell_point_api/models/bundled_discount.rb +132 -0
- data/lib/cell_point_api/models/bundled_item_base.rb +123 -0
- data/lib/cell_point_api/models/bundled_lodging_reservation.rb +176 -0
- data/lib/cell_point_api/models/bundled_product.rb +161 -0
- data/lib/cell_point_api/models/buyer.rb +129 -0
- data/lib/cell_point_api/models/buyer_fingerprint.rb +125 -0
- data/lib/cell_point_api/models/buyer_history.rb +199 -0
- data/lib/cell_point_api/models/cancel.rb +109 -0
- data/lib/cell_point_api/models/cancelled_payment_transactions.rb +84 -0
- data/lib/cell_point_api/models/capabilities.rb +77 -0
- data/lib/cell_point_api/models/capture.rb +84 -0
- data/lib/cell_point_api/models/capture_payment_response.rb +159 -0
- data/lib/cell_point_api/models/card.rb +131 -0
- data/lib/cell_point_api/models/card_config.rb +105 -0
- data/lib/cell_point_api/models/card_identification.rb +126 -0
- data/lib/cell_point_api/models/card_instrument_card_node.rb +232 -0
- data/lib/cell_point_api/models/card_number.rb +122 -0
- data/lib/cell_point_api/models/card_payment_instrument.rb +136 -0
- data/lib/cell_point_api/models/card_scheme.rb +63 -0
- data/lib/cell_point_api/models/card_scheme_configuration.rb +87 -0
- data/lib/cell_point_api/models/carrier.rb +82 -0
- data/lib/cell_point_api/models/category.rb +36 -0
- data/lib/cell_point_api/models/client_assertion.rb +135 -0
- data/lib/cell_point_api/models/close.rb +89 -0
- data/lib/cell_point_api/models/close_refund_response.rb +73 -0
- data/lib/cell_point_api/models/closed_payment_transactions.rb +83 -0
- data/lib/cell_point_api/models/codeshare.rb +87 -0
- data/lib/cell_point_api/models/complete_person_name.rb +120 -0
- data/lib/cell_point_api/models/completion_redirect.rb +93 -0
- data/lib/cell_point_api/models/configuration.rb +86 -0
- data/lib/cell_point_api/models/contact_data.rb +82 -0
- data/lib/cell_point_api/models/cpu.rb +74 -0
- data/lib/cell_point_api/models/device_os.rb +60 -0
- data/lib/cell_point_api/models/discount.rb +150 -0
- data/lib/cell_point_api/models/discount_data.rb +83 -0
- data/lib/cell_point_api/models/driver.rb +86 -0
- data/lib/cell_point_api/models/external_transaction.rb +227 -0
- data/lib/cell_point_api/models/externally_tokenized_card.rb +81 -0
- data/lib/cell_point_api/models/failover.rb +105 -0
- data/lib/cell_point_api/models/failure_category.rb +62 -0
- data/lib/cell_point_api/models/failure_module.rb +58 -0
- data/lib/cell_point_api/models/fingerprint.rb +82 -0
- data/lib/cell_point_api/models/fraud_assessment.rb +163 -0
- data/lib/cell_point_api/models/fulfilled_activity.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_airline_ancillary.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_airline_fare.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_auto_rental.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_bundle.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_discount.rb +178 -0
- data/lib/cell_point_api/models/fulfilled_line_item_base.rb +177 -0
- data/lib/cell_point_api/models/fulfilled_lodging_reservation.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_order.rb +148 -0
- data/lib/cell_point_api/models/fulfilled_product.rb +207 -0
- data/lib/cell_point_api/models/fulfilled_tax_line.rb +162 -0
- data/lib/cell_point_api/models/fulfillment_data.rb +90 -0
- data/lib/cell_point_api/models/fulfillment_status.rb +41 -0
- data/lib/cell_point_api/models/funding_type.rb +40 -0
- data/lib/cell_point_api/models/gender.rb +40 -0
- data/lib/cell_point_api/models/hpp_data.rb +155 -0
- data/lib/cell_point_api/models/identifying_document.rb +159 -0
- data/lib/cell_point_api/models/identifying_document_type.rb +60 -0
- data/lib/cell_point_api/models/industry_data.rb +124 -0
- data/lib/cell_point_api/models/informational_price_row.rb +97 -0
- data/lib/cell_point_api/models/informational_price_section.rb +104 -0
- data/lib/cell_point_api/models/itinerary_type.rb +47 -0
- data/lib/cell_point_api/models/journey_segment.rb +83 -0
- data/lib/cell_point_api/models/line_item_base.rb +101 -0
- data/lib/cell_point_api/models/line_item_type.rb +60 -0
- data/lib/cell_point_api/models/links.rb +86 -0
- data/lib/cell_point_api/models/location.rb +153 -0
- data/lib/cell_point_api/models/lodging_industry_data.rb +216 -0
- data/lib/cell_point_api/models/lodging_reservation.rb +195 -0
- data/lib/cell_point_api/models/lodging_reservation_data.rb +76 -0
- data/lib/cell_point_api/models/loyalty_account.rb +103 -0
- data/lib/cell_point_api/models/network_info.rb +76 -0
- data/lib/cell_point_api/models/non_negative_amount.rb +105 -0
- data/lib/cell_point_api/models/non_positive_amount.rb +105 -0
- data/lib/cell_point_api/models/note.rb +139 -0
- data/lib/cell_point_api/models/note_request.rb +90 -0
- data/lib/cell_point_api/models/oauth_provider_error.rb +62 -0
- data/lib/cell_point_api/models/oauth_scope_cpd_issued_jwt.rb +158 -0
- data/lib/cell_point_api/models/oauth_token.rb +96 -0
- data/lib/cell_point_api/models/order.rb +414 -0
- data/lib/cell_point_api/models/order_canceled_reason.rb +56 -0
- data/lib/cell_point_api/models/order_core.rb +343 -0
- data/lib/cell_point_api/models/order_extended.rb +150 -0
- data/lib/cell_point_api/models/order_payment_summary.rb +117 -0
- data/lib/cell_point_api/models/order_status.rb +161 -0
- data/lib/cell_point_api/models/order_status_type.rb +58 -0
- data/lib/cell_point_api/models/order_transactions.rb +88 -0
- data/lib/cell_point_api/models/owner.rb +131 -0
- data/lib/cell_point_api/models/page_type.rb +26 -0
- data/lib/cell_point_api/models/passenger.rb +229 -0
- data/lib/cell_point_api/models/password_change_type.rb +41 -0
- data/lib/cell_point_api/models/pay_pal_action.rb +129 -0
- data/lib/cell_point_api/models/pay_pal_payment_instrument.rb +88 -0
- data/lib/cell_point_api/models/payment_data.rb +102 -0
- data/lib/cell_point_api/models/payment_data_header.rb +94 -0
- data/lib/cell_point_api/models/payment_data_version.rb +26 -0
- data/lib/cell_point_api/models/payment_field.rb +68 -0
- data/lib/cell_point_api/models/payment_instrument_base.rb +87 -0
- data/lib/cell_point_api/models/payment_method.rb +52 -0
- data/lib/cell_point_api/models/payment_methods_for_order_get200_response.rb +157 -0
- data/lib/cell_point_api/models/payment_methods_search_vouchers_post200_response.rb +82 -0
- data/lib/cell_point_api/models/payment_processor.rb +121 -0
- data/lib/cell_point_api/models/payment_status.rb +122 -0
- data/lib/cell_point_api/models/payment_transaction.rb +605 -0
- data/lib/cell_point_api/models/payment_transaction_authorized_amount.rb +105 -0
- data/lib/cell_point_api/models/payment_transaction_canceled_amount.rb +105 -0
- data/lib/cell_point_api/models/payment_transaction_captured_amount.rb +105 -0
- data/lib/cell_point_api/models/payment_transaction_pending_authorize_amount.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_pending_cancel_amount.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_pending_capture_amount.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_processing_fee.rb +106 -0
- data/lib/cell_point_api/models/payment_transaction_refunded_amount.rb +105 -0
- data/lib/cell_point_api/models/payments_v1_bulks_response.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_orders_payments_retry_failed_refunds_request.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_refunds_closures_request.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_refunds_retry_failed_refunds_request.rb +74 -0
- data/lib/cell_point_api/models/payments_v1_schemes_response.rb +76 -0
- data/lib/cell_point_api/models/paypal_config.rb +94 -0
- data/lib/cell_point_api/models/person.rb +161 -0
- data/lib/cell_point_api/models/person_name.rb +89 -0
- data/lib/cell_point_api/models/phone.rb +132 -0
- data/lib/cell_point_api/models/pk_payment_method.rb +111 -0
- data/lib/cell_point_api/models/pk_payment_token.rb +94 -0
- data/lib/cell_point_api/models/postal_address.rb +217 -0
- data/lib/cell_point_api/models/price_summary.rb +191 -0
- data/lib/cell_point_api/models/product.rb +179 -0
- data/lib/cell_point_api/models/product_data.rb +104 -0
- data/lib/cell_point_api/models/property.rb +110 -0
- data/lib/cell_point_api/models/provider.rb +129 -0
- data/lib/cell_point_api/models/psp.rb +26 -0
- data/lib/cell_point_api/models/redirect_action.rb +116 -0
- data/lib/cell_point_api/models/refund_item.rb +310 -0
- data/lib/cell_point_api/models/refund_method.rb +36 -0
- data/lib/cell_point_api/models/refund_order_group_post201_response.rb +91 -0
- data/lib/cell_point_api/models/refund_reason.rb +104 -0
- data/lib/cell_point_api/models/refund_request.rb +161 -0
- data/lib/cell_point_api/models/refund_status.rb +44 -0
- data/lib/cell_point_api/models/refund_transaction.rb +311 -0
- data/lib/cell_point_api/models/refund_transaction_amount.rb +105 -0
- data/lib/cell_point_api/models/refund_type.rb +38 -0
- data/lib/cell_point_api/models/related_payment.rb +106 -0
- data/lib/cell_point_api/models/related_refund.rb +106 -0
- data/lib/cell_point_api/models/rental_location.rb +226 -0
- data/lib/cell_point_api/models/retry_refund_response.rb +73 -0
- data/lib/cell_point_api/models/reward.rb +101 -0
- data/lib/cell_point_api/models/room.rb +100 -0
- data/lib/cell_point_api/models/sales_channel.rb +36 -0
- data/lib/cell_point_api/models/save_pk_payment_token_request.rb +83 -0
- data/lib/cell_point_api/models/save_wallet_payment_token_request.rb +83 -0
- data/lib/cell_point_api/models/screen.rb +97 -0
- data/lib/cell_point_api/models/search_vouchers_request.rb +119 -0
- data/lib/cell_point_api/models/security_code.rb +83 -0
- data/lib/cell_point_api/models/security_code_match_status.rb +50 -0
- data/lib/cell_point_api/models/status.rb +43 -0
- data/lib/cell_point_api/models/status1.rb +52 -0
- data/lib/cell_point_api/models/summary.rb +82 -0
- data/lib/cell_point_api/models/tax.rb +134 -0
- data/lib/cell_point_api/models/taxes_and_fees_breakdown_page.rb +82 -0
- data/lib/cell_point_api/models/token_post200_response.rb +96 -0
- data/lib/cell_point_api/models/tokenized_card.rb +229 -0
- data/lib/cell_point_api/models/tokenized_card_with_contact_data.rb +247 -0
- data/lib/cell_point_api/models/tokenized_data.rb +169 -0
- data/lib/cell_point_api/models/total_row.rb +83 -0
- data/lib/cell_point_api/models/transaction_action.rb +108 -0
- data/lib/cell_point_api/models/transaction_action_result.rb +94 -0
- data/lib/cell_point_api/models/transaction_base.rb +132 -0
- data/lib/cell_point_api/models/transaction_failure.rb +222 -0
- data/lib/cell_point_api/models/travel_journey.rb +139 -0
- data/lib/cell_point_api/models/travel_leg.rb +194 -0
- data/lib/cell_point_api/models/trigger_bulk_request.rb +83 -0
- data/lib/cell_point_api/models/type.rb +67 -0
- data/lib/cell_point_api/models/type1.rb +47 -0
- data/lib/cell_point_api/models/type2.rb +40 -0
- data/lib/cell_point_api/models/type3.rb +41 -0
- data/lib/cell_point_api/models/type4.rb +56 -0
- data/lib/cell_point_api/models/type5.rb +78 -0
- data/lib/cell_point_api/models/uplift_config.rb +73 -0
- data/lib/cell_point_api/models/uplift_payment_instrument.rb +102 -0
- data/lib/cell_point_api/models/vehicle.rb +139 -0
- data/lib/cell_point_api/models/voucher_config.rb +92 -0
- data/lib/cell_point_api/models/voucher_issuer.rb +26 -0
- data/lib/cell_point_api/models/voucher_payment_instrument.rb +233 -0
- data/lib/cell_point_api/models/voucher_payment_instrument_node.rb +198 -0
- data/lib/cell_point_api/models/voucher_type.rb +36 -0
- data/lib/cell_point_api/models/wallet_instrument_wallet_node.rb +136 -0
- data/lib/cell_point_api/models/wallet_payment_instrument.rb +123 -0
- data/lib/cell_point_api/models/wallet_tokenized_token.rb +148 -0
- data/lib/cell_point_api/models/wallet_tokenized_token_identification.rb +75 -0
- data/lib/cell_point_api/models/wallet_type.rb +36 -0
- data/lib/cell_point_api/utilities/date_time_helper.rb +11 -0
- data/lib/cell_point_api/utilities/file_wrapper.rb +28 -0
- data/lib/cell_point_api/utilities/union_type_lookup.rb +260 -0
- data/lib/cell_point_api.rb +301 -0
- metadata +354 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Identification document types.
|
|
8
|
+
class IdentifyingDocumentType
|
|
9
|
+
IDENTIFYING_DOCUMENT_TYPE = [
|
|
10
|
+
# TODO: Write general description for PASSPORT
|
|
11
|
+
PASSPORT = 'PASSPORT'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for ID_CARD
|
|
14
|
+
ID_CARD = 'ID_CARD'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for DRIVING_LICENSE
|
|
17
|
+
DRIVING_LICENSE = 'DRIVING_LICENSE'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for SOCIAL_SECURITY_NUMBER
|
|
20
|
+
SOCIAL_SECURITY_NUMBER = 'SOCIAL_SECURITY_NUMBER'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for TAX_IDENTIFICATION_NUMBER
|
|
23
|
+
TAX_IDENTIFICATION_NUMBER = 'TAX_IDENTIFICATION_NUMBER'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for NATIONAL_INSURANCE_NUMBER
|
|
26
|
+
NATIONAL_INSURANCE_NUMBER = 'NATIONAL_INSURANCE_NUMBER'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for NATIONAL_IDENTITY_CARD
|
|
29
|
+
NATIONAL_IDENTITY_CARD = 'NATIONAL_IDENTITY_CARD'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for OTHER
|
|
32
|
+
OTHER = 'OTHER'.freeze
|
|
33
|
+
].freeze
|
|
34
|
+
|
|
35
|
+
def self.validate(value)
|
|
36
|
+
return false if value.nil?
|
|
37
|
+
|
|
38
|
+
IDENTIFYING_DOCUMENT_TYPE.include?(value)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.from_value(value, default_value = PASSPORT)
|
|
42
|
+
return default_value if value.nil?
|
|
43
|
+
|
|
44
|
+
str = value.to_s.strip
|
|
45
|
+
|
|
46
|
+
case str.downcase
|
|
47
|
+
when 'passport' then PASSPORT
|
|
48
|
+
when 'id_card' then ID_CARD
|
|
49
|
+
when 'driving_license' then DRIVING_LICENSE
|
|
50
|
+
when 'social_security_number' then SOCIAL_SECURITY_NUMBER
|
|
51
|
+
when 'tax_identification_number' then TAX_IDENTIFICATION_NUMBER
|
|
52
|
+
when 'national_insurance_number' then NATIONAL_INSURANCE_NUMBER
|
|
53
|
+
when 'national_identity_card' then NATIONAL_IDENTITY_CARD
|
|
54
|
+
when 'other' then OTHER
|
|
55
|
+
else
|
|
56
|
+
default_value
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Industry specific data required based on agreements between merchant and
|
|
8
|
+
# acquirers and for fraud detection.
|
|
9
|
+
class IndustryData < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [Array[AirlineIndustryData]]
|
|
15
|
+
attr_accessor :airline_data
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [Array[LodgingIndustryData]]
|
|
19
|
+
attr_accessor :lodging_data
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for this method
|
|
22
|
+
# @return [Array[AutoRentalIndustryData]]
|
|
23
|
+
attr_accessor :auto_rental_data
|
|
24
|
+
|
|
25
|
+
# A mapping from model property names to API property names.
|
|
26
|
+
def self.names
|
|
27
|
+
@_hash = {} if @_hash.nil?
|
|
28
|
+
@_hash['airline_data'] = 'airlineData'
|
|
29
|
+
@_hash['lodging_data'] = 'lodgingData'
|
|
30
|
+
@_hash['auto_rental_data'] = 'autoRentalData'
|
|
31
|
+
@_hash
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for optional fields
|
|
35
|
+
def self.optionals
|
|
36
|
+
%w[
|
|
37
|
+
airline_data
|
|
38
|
+
lodging_data
|
|
39
|
+
auto_rental_data
|
|
40
|
+
]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(airline_data: SKIP, lodging_data: SKIP,
|
|
49
|
+
auto_rental_data: SKIP, additional_properties: nil)
|
|
50
|
+
# Add additional model properties to the instance
|
|
51
|
+
additional_properties = {} if additional_properties.nil?
|
|
52
|
+
|
|
53
|
+
@airline_data = airline_data unless airline_data == SKIP
|
|
54
|
+
@lodging_data = lodging_data unless lodging_data == SKIP
|
|
55
|
+
@auto_rental_data = auto_rental_data unless auto_rental_data == SKIP
|
|
56
|
+
@additional_properties = additional_properties
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Creates an instance of the object from a hash.
|
|
60
|
+
def self.from_hash(hash)
|
|
61
|
+
return nil unless hash
|
|
62
|
+
|
|
63
|
+
# Extract variables from the hash.
|
|
64
|
+
# Parameter is an array, so we need to iterate through it
|
|
65
|
+
airline_data = nil
|
|
66
|
+
unless hash['airlineData'].nil?
|
|
67
|
+
airline_data = []
|
|
68
|
+
hash['airlineData'].each do |structure|
|
|
69
|
+
airline_data << (AirlineIndustryData.from_hash(structure) if structure)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
airline_data = SKIP unless hash.key?('airlineData')
|
|
74
|
+
# Parameter is an array, so we need to iterate through it
|
|
75
|
+
lodging_data = nil
|
|
76
|
+
unless hash['lodgingData'].nil?
|
|
77
|
+
lodging_data = []
|
|
78
|
+
hash['lodgingData'].each do |structure|
|
|
79
|
+
lodging_data << (LodgingIndustryData.from_hash(structure) if structure)
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
lodging_data = SKIP unless hash.key?('lodgingData')
|
|
84
|
+
# Parameter is an array, so we need to iterate through it
|
|
85
|
+
auto_rental_data = nil
|
|
86
|
+
unless hash['autoRentalData'].nil?
|
|
87
|
+
auto_rental_data = []
|
|
88
|
+
hash['autoRentalData'].each do |structure|
|
|
89
|
+
auto_rental_data << (AutoRentalIndustryData.from_hash(structure) if structure)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
auto_rental_data = SKIP unless hash.key?('autoRentalData')
|
|
94
|
+
|
|
95
|
+
# Create a new hash for additional properties, removing known properties.
|
|
96
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
97
|
+
|
|
98
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
99
|
+
new_hash, proc { |value| value }
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
# Create object from extracted values.
|
|
103
|
+
IndustryData.new(airline_data: airline_data,
|
|
104
|
+
lodging_data: lodging_data,
|
|
105
|
+
auto_rental_data: auto_rental_data,
|
|
106
|
+
additional_properties: additional_properties)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Provides a human-readable string representation of the object.
|
|
110
|
+
def to_s
|
|
111
|
+
class_name = self.class.name.split('::').last
|
|
112
|
+
"<#{class_name} airline_data: #{@airline_data}, lodging_data: #{@lodging_data},"\
|
|
113
|
+
" auto_rental_data: #{@auto_rental_data}, additional_properties: #{@additional_properties}>"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
117
|
+
def inspect
|
|
118
|
+
class_name = self.class.name.split('::').last
|
|
119
|
+
"<#{class_name} airline_data: #{@airline_data.inspect}, lodging_data:"\
|
|
120
|
+
" #{@lodging_data.inspect}, auto_rental_data: #{@auto_rental_data.inspect},"\
|
|
121
|
+
" additional_properties: #{@additional_properties}>"
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Row to show for informational pricing.
|
|
8
|
+
class InformationalPriceRow < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Text to show the buyer, informing them of the title informational price
|
|
13
|
+
# row.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :title
|
|
16
|
+
|
|
17
|
+
# The amount an item costs.
|
|
18
|
+
# @return [Amount]
|
|
19
|
+
attr_accessor :amount
|
|
20
|
+
|
|
21
|
+
# Optional descriptor that should appear with the amount.
|
|
22
|
+
# This descriptor may not be available everywhere, depending on the design
|
|
23
|
+
# of the page.
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :amount_descriptor
|
|
26
|
+
|
|
27
|
+
# A mapping from model property names to API property names.
|
|
28
|
+
def self.names
|
|
29
|
+
@_hash = {} if @_hash.nil?
|
|
30
|
+
@_hash['title'] = 'title'
|
|
31
|
+
@_hash['amount'] = 'amount'
|
|
32
|
+
@_hash['amount_descriptor'] = 'amountDescriptor'
|
|
33
|
+
@_hash
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for optional fields
|
|
37
|
+
def self.optionals
|
|
38
|
+
%w[
|
|
39
|
+
amount_descriptor
|
|
40
|
+
]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(title:, amount:, amount_descriptor: SKIP,
|
|
49
|
+
additional_properties: nil)
|
|
50
|
+
# Add additional model properties to the instance
|
|
51
|
+
additional_properties = {} if additional_properties.nil?
|
|
52
|
+
|
|
53
|
+
@title = title
|
|
54
|
+
@amount = amount
|
|
55
|
+
@amount_descriptor = amount_descriptor unless amount_descriptor == SKIP
|
|
56
|
+
@additional_properties = additional_properties
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Creates an instance of the object from a hash.
|
|
60
|
+
def self.from_hash(hash)
|
|
61
|
+
return nil unless hash
|
|
62
|
+
|
|
63
|
+
# Extract variables from the hash.
|
|
64
|
+
title = hash.key?('title') ? hash['title'] : nil
|
|
65
|
+
amount = Amount.from_hash(hash['amount']) if hash['amount']
|
|
66
|
+
amount_descriptor =
|
|
67
|
+
hash.key?('amountDescriptor') ? hash['amountDescriptor'] : SKIP
|
|
68
|
+
|
|
69
|
+
# Create a new hash for additional properties, removing known properties.
|
|
70
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
71
|
+
|
|
72
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
73
|
+
new_hash, proc { |value| value }
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Create object from extracted values.
|
|
77
|
+
InformationalPriceRow.new(title: title,
|
|
78
|
+
amount: amount,
|
|
79
|
+
amount_descriptor: amount_descriptor,
|
|
80
|
+
additional_properties: additional_properties)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Provides a human-readable string representation of the object.
|
|
84
|
+
def to_s
|
|
85
|
+
class_name = self.class.name.split('::').last
|
|
86
|
+
"<#{class_name} title: #{@title}, amount: #{@amount}, amount_descriptor:"\
|
|
87
|
+
" #{@amount_descriptor}, additional_properties: #{@additional_properties}>"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
91
|
+
def inspect
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} title: #{@title.inspect}, amount: #{@amount.inspect}, amount_descriptor:"\
|
|
94
|
+
" #{@amount_descriptor.inspect}, additional_properties: #{@additional_properties}>"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Section of the informational price breakdown.
|
|
8
|
+
class InformationalPriceSection < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Optional type of row that can be passed.
|
|
13
|
+
# Depending on where this displayed, this field may or may not be used.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :type
|
|
16
|
+
|
|
17
|
+
# Optional type of row that can be passed.
|
|
18
|
+
# Depending on where this displayed, this field may or may not be used.
|
|
19
|
+
# @return [Array[InformationalPriceRow]]
|
|
20
|
+
attr_accessor :rows
|
|
21
|
+
|
|
22
|
+
# Optional type of row that can be passed.
|
|
23
|
+
# Depending on where this displayed, this field may or may not be used.
|
|
24
|
+
# @return [TotalRow]
|
|
25
|
+
attr_accessor :total_row
|
|
26
|
+
|
|
27
|
+
# A mapping from model property names to API property names.
|
|
28
|
+
def self.names
|
|
29
|
+
@_hash = {} if @_hash.nil?
|
|
30
|
+
@_hash['type'] = 'type'
|
|
31
|
+
@_hash['rows'] = 'rows'
|
|
32
|
+
@_hash['total_row'] = 'totalRow'
|
|
33
|
+
@_hash
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for optional fields
|
|
37
|
+
def self.optionals
|
|
38
|
+
%w[
|
|
39
|
+
type
|
|
40
|
+
]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(rows:, total_row:, type: SKIP, additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@type = type unless type == SKIP
|
|
53
|
+
@rows = rows
|
|
54
|
+
@total_row = total_row
|
|
55
|
+
@additional_properties = additional_properties
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Creates an instance of the object from a hash.
|
|
59
|
+
def self.from_hash(hash)
|
|
60
|
+
return nil unless hash
|
|
61
|
+
|
|
62
|
+
# Extract variables from the hash.
|
|
63
|
+
# Parameter is an array, so we need to iterate through it
|
|
64
|
+
rows = nil
|
|
65
|
+
unless hash['rows'].nil?
|
|
66
|
+
rows = []
|
|
67
|
+
hash['rows'].each do |structure|
|
|
68
|
+
rows << (InformationalPriceRow.from_hash(structure) if structure)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
rows = nil unless hash.key?('rows')
|
|
73
|
+
total_row = TotalRow.from_hash(hash['totalRow']) if hash['totalRow']
|
|
74
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
InformationalPriceSection.new(rows: rows,
|
|
85
|
+
total_row: total_row,
|
|
86
|
+
type: type,
|
|
87
|
+
additional_properties: additional_properties)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a human-readable string representation of the object.
|
|
91
|
+
def to_s
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} type: #{@type}, rows: #{@rows}, total_row: #{@total_row},"\
|
|
94
|
+
" additional_properties: #{@additional_properties}>"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
98
|
+
def inspect
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} type: #{@type.inspect}, rows: #{@rows.inspect}, total_row:"\
|
|
101
|
+
" #{@total_row.inspect}, additional_properties: #{@additional_properties}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Type of itinerary being booked for travel. <table> <thead> <tr>
|
|
8
|
+
# <th>Itinerary Type</th> <th>Description</th> </tr> </thead> <tbody>
|
|
9
|
+
# <tr> <td>ONE_WAY</td> <td>Only a single journey is being taken, with
|
|
10
|
+
# no return journey booked.</td> </tr> <tr> <td>ROUND_TRIP</td>
|
|
11
|
+
# <td>Two journeys are being booked, one outbound and one inbound. Final
|
|
12
|
+
# inbound journey will be returning to where the traveler started.</td>
|
|
13
|
+
# </tr> <tr> <td>MULTI_CITY</td> <td>Multiple journeys are being
|
|
14
|
+
# booked at once between various cities.</td> </tr> </tbody> </table>
|
|
15
|
+
class ItineraryType
|
|
16
|
+
ITINERARY_TYPE = [
|
|
17
|
+
# TODO: Write general description for ONE_WAY
|
|
18
|
+
ONE_WAY = 'ONE_WAY'.freeze,
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for ROUND_TRIP
|
|
21
|
+
ROUND_TRIP = 'ROUND_TRIP'.freeze,
|
|
22
|
+
|
|
23
|
+
# TODO: Write general description for MULTI_CITY
|
|
24
|
+
MULTI_CITY = 'MULTI_CITY'.freeze
|
|
25
|
+
].freeze
|
|
26
|
+
|
|
27
|
+
def self.validate(value)
|
|
28
|
+
return false if value.nil?
|
|
29
|
+
|
|
30
|
+
ITINERARY_TYPE.include?(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.from_value(value, default_value = ONE_WAY)
|
|
34
|
+
return default_value if value.nil?
|
|
35
|
+
|
|
36
|
+
str = value.to_s.strip
|
|
37
|
+
|
|
38
|
+
case str.downcase
|
|
39
|
+
when 'one_way' then ONE_WAY
|
|
40
|
+
when 'round_trip' then ROUND_TRIP
|
|
41
|
+
when 'multi_city' then MULTI_CITY
|
|
42
|
+
else
|
|
43
|
+
default_value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Segment of the journey. Given an the following `ItineraryType`, here are
|
|
8
|
+
# the example JourneySegment to use: <table> <thead> <tr> <th>Itinerary
|
|
9
|
+
# Type</th> <th>Journey Segment</th> <th>Description</th> </tr>
|
|
10
|
+
# </thead> <tbody> <tr> <td>ONE_WAY</td> <td>OUTBOUND</td>
|
|
11
|
+
# <td>Single Journey</td> </tr> <tr> <td>ROUND_TRIP</td>
|
|
12
|
+
# <td>OUTBOUND</td> <td>First Journey, leaving.</td> </tr> <tr>
|
|
13
|
+
# <td>ROUND_TRIP</td> <td>INBOUND</td> <td>Second Journey,
|
|
14
|
+
# returning.</td> </tr> <tr> <td>MULTI_CITY</td>
|
|
15
|
+
# <td>MULTI_CITY_1</td> <td>First Journey </td> </tr> <tr>
|
|
16
|
+
# <td>MULTI_CITY</td> <td>MULTI_CITY_2</td> <td>Second Journey </td>
|
|
17
|
+
# </tr> <tr> <td>MULTI_CITY</td> <td>MULTI_CITY_3</td> <td>Third
|
|
18
|
+
# Journey </td> </tr> </tbody> </table>
|
|
19
|
+
class JourneySegment
|
|
20
|
+
JOURNEY_SEGMENT = [
|
|
21
|
+
# TODO: Write general description for OUTBOUND
|
|
22
|
+
OUTBOUND = 'OUTBOUND'.freeze,
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for INBOUND
|
|
25
|
+
INBOUND = 'INBOUND'.freeze,
|
|
26
|
+
|
|
27
|
+
# TODO: Write general description for MULTI_CITY_1
|
|
28
|
+
MULTI_CITY_1 = 'MULTI_CITY_1'.freeze,
|
|
29
|
+
|
|
30
|
+
# TODO: Write general description for MULTI_CITY_2
|
|
31
|
+
MULTI_CITY_2 = 'MULTI_CITY_2'.freeze,
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for MULTI_CITY_3
|
|
34
|
+
MULTI_CITY_3 = 'MULTI_CITY_3'.freeze,
|
|
35
|
+
|
|
36
|
+
# TODO: Write general description for MULTI_CITY_4
|
|
37
|
+
MULTI_CITY_4 = 'MULTI_CITY_4'.freeze,
|
|
38
|
+
|
|
39
|
+
# TODO: Write general description for MULTI_CITY_5
|
|
40
|
+
MULTI_CITY_5 = 'MULTI_CITY_5'.freeze,
|
|
41
|
+
|
|
42
|
+
# TODO: Write general description for MULTI_CITY_6
|
|
43
|
+
MULTI_CITY_6 = 'MULTI_CITY_6'.freeze,
|
|
44
|
+
|
|
45
|
+
# TODO: Write general description for MULTI_CITY_7
|
|
46
|
+
MULTI_CITY_7 = 'MULTI_CITY_7'.freeze,
|
|
47
|
+
|
|
48
|
+
# TODO: Write general description for MULTI_CITY_8
|
|
49
|
+
MULTI_CITY_8 = 'MULTI_CITY_8'.freeze,
|
|
50
|
+
|
|
51
|
+
# TODO: Write general description for MULTI_CITY_9
|
|
52
|
+
MULTI_CITY_9 = 'MULTI_CITY_9'.freeze
|
|
53
|
+
].freeze
|
|
54
|
+
|
|
55
|
+
def self.validate(value)
|
|
56
|
+
return false if value.nil?
|
|
57
|
+
|
|
58
|
+
JOURNEY_SEGMENT.include?(value)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def self.from_value(value, default_value = OUTBOUND)
|
|
62
|
+
return default_value if value.nil?
|
|
63
|
+
|
|
64
|
+
str = value.to_s.strip
|
|
65
|
+
|
|
66
|
+
case str.downcase
|
|
67
|
+
when 'outbound' then OUTBOUND
|
|
68
|
+
when 'inbound' then INBOUND
|
|
69
|
+
when 'multi_city_1' then MULTI_CITY_1
|
|
70
|
+
when 'multi_city_2' then MULTI_CITY_2
|
|
71
|
+
when 'multi_city_3' then MULTI_CITY_3
|
|
72
|
+
when 'multi_city_4' then MULTI_CITY_4
|
|
73
|
+
when 'multi_city_5' then MULTI_CITY_5
|
|
74
|
+
when 'multi_city_6' then MULTI_CITY_6
|
|
75
|
+
when 'multi_city_7' then MULTI_CITY_7
|
|
76
|
+
when 'multi_city_8' then MULTI_CITY_8
|
|
77
|
+
when 'multi_city_9' then MULTI_CITY_9
|
|
78
|
+
else
|
|
79
|
+
default_value
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# Line item base. Represents the common fields shared across all billable
|
|
8
|
+
# items on an order.
|
|
9
|
+
class LineItemBase < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# What should be shown as the title of the line item on a receipt or billing
|
|
14
|
+
# summary.
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :title
|
|
17
|
+
|
|
18
|
+
# The type of line item.
|
|
19
|
+
# @return [LineItemType]
|
|
20
|
+
attr_accessor :type
|
|
21
|
+
|
|
22
|
+
# AuthorizationGroup that the line item should be part of for splitting
|
|
23
|
+
# authorizations for Aggregate Payments Payments.
|
|
24
|
+
# If this is set, there must be a matching AuthorizationGroup created in the
|
|
25
|
+
# PriceSummary.
|
|
26
|
+
# > NOTE: Items within a Bundle should not have an `authorizationGroupId`,
|
|
27
|
+
# they will use the same `authorizationGroupId` as the top-level bundle.
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :authorization_group_id
|
|
30
|
+
|
|
31
|
+
# A mapping from model property names to API property names.
|
|
32
|
+
def self.names
|
|
33
|
+
@_hash = {} if @_hash.nil?
|
|
34
|
+
@_hash['title'] = 'title'
|
|
35
|
+
@_hash['type'] = 'type'
|
|
36
|
+
@_hash['authorization_group_id'] = 'authorizationGroupId'
|
|
37
|
+
@_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for optional fields
|
|
41
|
+
def self.optionals
|
|
42
|
+
%w[
|
|
43
|
+
authorization_group_id
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# An array for nullable fields
|
|
48
|
+
def self.nullables
|
|
49
|
+
[]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def initialize(title:, type:, authorization_group_id: SKIP,
|
|
53
|
+
additional_properties: nil)
|
|
54
|
+
# Add additional model properties to the instance
|
|
55
|
+
additional_properties = {} if additional_properties.nil?
|
|
56
|
+
|
|
57
|
+
@title = title
|
|
58
|
+
@type = type
|
|
59
|
+
@authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
|
|
60
|
+
@additional_properties = additional_properties
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Creates an instance of the object from a hash.
|
|
64
|
+
def self.from_hash(hash)
|
|
65
|
+
return nil unless hash
|
|
66
|
+
|
|
67
|
+
# Extract variables from the hash.
|
|
68
|
+
title = hash.key?('title') ? hash['title'] : nil
|
|
69
|
+
type = hash.key?('type') ? hash['type'] : nil
|
|
70
|
+
authorization_group_id =
|
|
71
|
+
hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
|
|
72
|
+
|
|
73
|
+
# Create a new hash for additional properties, removing known properties.
|
|
74
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
75
|
+
|
|
76
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
77
|
+
new_hash, proc { |value| value }
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
# Create object from extracted values.
|
|
81
|
+
LineItemBase.new(title: title,
|
|
82
|
+
type: type,
|
|
83
|
+
authorization_group_id: authorization_group_id,
|
|
84
|
+
additional_properties: additional_properties)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Provides a human-readable string representation of the object.
|
|
88
|
+
def to_s
|
|
89
|
+
class_name = self.class.name.split('::').last
|
|
90
|
+
"<#{class_name} title: #{@title}, type: #{@type}, authorization_group_id:"\
|
|
91
|
+
" #{@authorization_group_id}, additional_properties: #{@additional_properties}>"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
95
|
+
def inspect
|
|
96
|
+
class_name = self.class.name.split('::').last
|
|
97
|
+
"<#{class_name} title: #{@title.inspect}, type: #{@type.inspect}, authorization_group_id:"\
|
|
98
|
+
" #{@authorization_group_id.inspect}, additional_properties: #{@additional_properties}>"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# cell_point_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module CellPointApi
|
|
7
|
+
# The type of line item.
|
|
8
|
+
class LineItemType
|
|
9
|
+
LINE_ITEM_TYPE = [
|
|
10
|
+
# TODO: Write general description for ACTIVITY
|
|
11
|
+
ACTIVITY = 'ACTIVITY'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for AIRLINE_ANCILLARY
|
|
14
|
+
AIRLINE_ANCILLARY = 'AIRLINE_ANCILLARY'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for AIRLINE_FARE
|
|
17
|
+
AIRLINE_FARE = 'AIRLINE_FARE'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for AUTO_RENTAL
|
|
20
|
+
AUTO_RENTAL = 'AUTO_RENTAL'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for BUNDLE
|
|
23
|
+
BUNDLE = 'BUNDLE'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for DISCOUNT
|
|
26
|
+
DISCOUNT = 'DISCOUNT'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for LODGING_RESERVATION
|
|
29
|
+
LODGING_RESERVATION = 'LODGING_RESERVATION'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for PRODUCT
|
|
32
|
+
PRODUCT = 'PRODUCT'.freeze
|
|
33
|
+
].freeze
|
|
34
|
+
|
|
35
|
+
def self.validate(value)
|
|
36
|
+
return false if value.nil?
|
|
37
|
+
|
|
38
|
+
LINE_ITEM_TYPE.include?(value)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.from_value(value, default_value = ACTIVITY)
|
|
42
|
+
return default_value if value.nil?
|
|
43
|
+
|
|
44
|
+
str = value.to_s.strip
|
|
45
|
+
|
|
46
|
+
case str.downcase
|
|
47
|
+
when 'activity' then ACTIVITY
|
|
48
|
+
when 'airline_ancillary' then AIRLINE_ANCILLARY
|
|
49
|
+
when 'airline_fare' then AIRLINE_FARE
|
|
50
|
+
when 'auto_rental' then AUTO_RENTAL
|
|
51
|
+
when 'bundle' then BUNDLE
|
|
52
|
+
when 'discount' then DISCOUNT
|
|
53
|
+
when 'lodging_reservation' then LODGING_RESERVATION
|
|
54
|
+
when 'product' then PRODUCT
|
|
55
|
+
else
|
|
56
|
+
default_value
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|