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,67 @@
|
|
|
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 <table> <thead> <tr> <th>Line Item
|
|
8
|
+
# Type</th> <th>Description</th> </tr> </thead> <tbody> <tr>
|
|
9
|
+
# <td>ACTIVITY</td> <td>Activities, such as tours, museum tickets,
|
|
10
|
+
# etc.</td> </tr> <tr> <td>AIRLINE_ANCILLARY</td>
|
|
11
|
+
# <td>Ancillary services offered by airlines, such as baggage fees, seat
|
|
12
|
+
# upgrades, etc.</td> </tr> <tr> <td>AIRLINE_FARE</td>
|
|
13
|
+
# <td>Fares for a flight.</td> </tr> <tr> <td>AUTO_RENTAL</td>
|
|
14
|
+
# <td>Auto rental</td> </tr> <tr> <td>DISCOUNT</td>
|
|
15
|
+
# <td>Discount</td> </tr> <tr> <td>LODGING_RESERVATION</td>
|
|
16
|
+
# <td>Bookings of a room at a hotel, hostel, etc.</td> </tr> <tr>
|
|
17
|
+
# <td>PRODUCT</td> <td>Product is a catch-all for any other line item
|
|
18
|
+
# type not listed here.</td> </tr> </tbody> </table>
|
|
19
|
+
class Type
|
|
20
|
+
TYPE = [
|
|
21
|
+
# TODO: Write general description for ACTIVITY
|
|
22
|
+
ACTIVITY = 'ACTIVITY'.freeze,
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for AIRLINE_ANCILLARY
|
|
25
|
+
AIRLINE_ANCILLARY = 'AIRLINE_ANCILLARY'.freeze,
|
|
26
|
+
|
|
27
|
+
# TODO: Write general description for AIRLINE_FARE
|
|
28
|
+
AIRLINE_FARE = 'AIRLINE_FARE'.freeze,
|
|
29
|
+
|
|
30
|
+
# TODO: Write general description for AUTO_RENTAL
|
|
31
|
+
AUTO_RENTAL = 'AUTO_RENTAL'.freeze,
|
|
32
|
+
|
|
33
|
+
# TODO: Write general description for DISCOUNT
|
|
34
|
+
DISCOUNT = 'DISCOUNT'.freeze,
|
|
35
|
+
|
|
36
|
+
# TODO: Write general description for LODGING_RESERVATION
|
|
37
|
+
LODGING_RESERVATION = 'LODGING_RESERVATION'.freeze,
|
|
38
|
+
|
|
39
|
+
# TODO: Write general description for PRODUCT
|
|
40
|
+
PRODUCT = 'PRODUCT'.freeze
|
|
41
|
+
].freeze
|
|
42
|
+
|
|
43
|
+
def self.validate(value)
|
|
44
|
+
return false if value.nil?
|
|
45
|
+
|
|
46
|
+
TYPE.include?(value)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def self.from_value(value, default_value = ACTIVITY)
|
|
50
|
+
return default_value if value.nil?
|
|
51
|
+
|
|
52
|
+
str = value.to_s.strip
|
|
53
|
+
|
|
54
|
+
case str.downcase
|
|
55
|
+
when 'activity' then ACTIVITY
|
|
56
|
+
when 'airline_ancillary' then AIRLINE_ANCILLARY
|
|
57
|
+
when 'airline_fare' then AIRLINE_FARE
|
|
58
|
+
when 'auto_rental' then AUTO_RENTAL
|
|
59
|
+
when 'discount' then DISCOUNT
|
|
60
|
+
when 'lodging_reservation' then LODGING_RESERVATION
|
|
61
|
+
when 'product' then PRODUCT
|
|
62
|
+
else
|
|
63
|
+
default_value
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
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 transaction that can be performed. <table> <tbody> <tr>
|
|
8
|
+
# <td>PAYMENT</td> <td> A standard payment transaction processed by
|
|
9
|
+
# CellPoint. <br/><br/> This is the default type and represents a typical
|
|
10
|
+
# payment flow. </td> </tr> <tr> <td>EXTERNAL</td> <td> An external
|
|
11
|
+
# transaction is one that is not processed by CellPoint, but by an external
|
|
12
|
+
# third-party. <br/><br/> CellPoint takes no part in this transaction and
|
|
13
|
+
# is not responsible for the state. <br/><br/> This type of transaction
|
|
14
|
+
# will purely be created as an indicator to our system and in our reporting
|
|
15
|
+
# applications, that a transaction has happened externally. <br/><br/> For
|
|
16
|
+
# the purposes of checking if an order is fully paid for, we will count
|
|
17
|
+
# external transactions towards the completion. </td> </tr> </tbody>
|
|
18
|
+
# </table> > NOTE: By default, this will be a standard Payment.
|
|
19
|
+
class Type1
|
|
20
|
+
TYPE1 = [
|
|
21
|
+
# TODO: Write general description for PAYMENT
|
|
22
|
+
PAYMENT = 'PAYMENT'.freeze,
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for EXTERNAL
|
|
25
|
+
EXTERNAL = 'EXTERNAL'.freeze
|
|
26
|
+
].freeze
|
|
27
|
+
|
|
28
|
+
def self.validate(value)
|
|
29
|
+
return false if value.nil?
|
|
30
|
+
|
|
31
|
+
TYPE1.include?(value)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.from_value(value, default_value = PAYMENT)
|
|
35
|
+
return default_value if value.nil?
|
|
36
|
+
|
|
37
|
+
str = value.to_s.strip
|
|
38
|
+
|
|
39
|
+
case str.downcase
|
|
40
|
+
when 'payment' then PAYMENT
|
|
41
|
+
when 'external' then EXTERNAL
|
|
42
|
+
else
|
|
43
|
+
default_value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
# Discriminator used to identify the type of transaction.
|
|
8
|
+
class Type2
|
|
9
|
+
TYPE2 = [
|
|
10
|
+
# TODO: Write general description for PAYMENT
|
|
11
|
+
PAYMENT = 'PAYMENT'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for REFUND
|
|
14
|
+
REFUND = 'REFUND'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for EXTERNAL
|
|
17
|
+
EXTERNAL = 'EXTERNAL'.freeze
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
def self.validate(value)
|
|
21
|
+
return false if value.nil?
|
|
22
|
+
|
|
23
|
+
TYPE2.include?(value)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = PAYMENT)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'payment' then PAYMENT
|
|
33
|
+
when 'refund' then REFUND
|
|
34
|
+
when 'external' then EXTERNAL
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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 fraud assessment being performed. Options: <table> <thead>
|
|
8
|
+
# <tr> <th>Type</th> <th>Description</th> </tr>
|
|
9
|
+
# </thead> <tbody> <tr> <td>PRE_AUTHORIZATION</td>
|
|
10
|
+
# <td>Assessment is performed before authorization.</td> </tr>
|
|
11
|
+
# <tr> <td>POST_AUTHORIZATION</td> <td>Assessment is performed
|
|
12
|
+
# after authorization.</td> </tr> </tbody> </table>
|
|
13
|
+
class Type3
|
|
14
|
+
TYPE3 = [
|
|
15
|
+
# TODO: Write general description for PRE_AUTHORIZATION
|
|
16
|
+
PRE_AUTHORIZATION = 'PRE_AUTHORIZATION'.freeze,
|
|
17
|
+
|
|
18
|
+
# TODO: Write general description for POST_AUTHORIZATION
|
|
19
|
+
POST_AUTHORIZATION = 'POST_AUTHORIZATION'.freeze
|
|
20
|
+
].freeze
|
|
21
|
+
|
|
22
|
+
def self.validate(value)
|
|
23
|
+
return false if value.nil?
|
|
24
|
+
|
|
25
|
+
TYPE3.include?(value)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.from_value(value, default_value = PRE_AUTHORIZATION)
|
|
29
|
+
return default_value if value.nil?
|
|
30
|
+
|
|
31
|
+
str = value.to_s.strip
|
|
32
|
+
|
|
33
|
+
case str.downcase
|
|
34
|
+
when 'pre_authorization' then PRE_AUTHORIZATION
|
|
35
|
+
when 'post_authorization' then POST_AUTHORIZATION
|
|
36
|
+
else
|
|
37
|
+
default_value
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
# Type4.
|
|
8
|
+
class Type4
|
|
9
|
+
TYPE4 = [
|
|
10
|
+
# TODO: Write general description for CANCEL
|
|
11
|
+
CANCEL = 'CANCEL'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CAPTURE
|
|
14
|
+
CAPTURE = 'CAPTURE'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for REFUND
|
|
17
|
+
REFUND = 'REFUND'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for CLOSE
|
|
20
|
+
CLOSE = 'CLOSE'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for RECONCILIATION
|
|
23
|
+
RECONCILIATION = 'RECONCILIATION'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for POST_AUTH_FRAUD_CHECK
|
|
26
|
+
POST_AUTH_FRAUD_CHECK = 'POST_AUTH_FRAUD_CHECK'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for REFUND_RETRY
|
|
29
|
+
REFUND_RETRY = 'REFUND_RETRY'.freeze
|
|
30
|
+
].freeze
|
|
31
|
+
|
|
32
|
+
def self.validate(value)
|
|
33
|
+
return false if value.nil?
|
|
34
|
+
|
|
35
|
+
TYPE4.include?(value)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.from_value(value, default_value = CANCEL)
|
|
39
|
+
return default_value if value.nil?
|
|
40
|
+
|
|
41
|
+
str = value.to_s.strip
|
|
42
|
+
|
|
43
|
+
case str.downcase
|
|
44
|
+
when 'cancel' then CANCEL
|
|
45
|
+
when 'capture' then CAPTURE
|
|
46
|
+
when 'refund' then REFUND
|
|
47
|
+
when 'close' then CLOSE
|
|
48
|
+
when 'reconciliation' then RECONCILIATION
|
|
49
|
+
when 'post_auth_fraud_check' then POST_AUTH_FRAUD_CHECK
|
|
50
|
+
when 'refund_retry' then REFUND_RETRY
|
|
51
|
+
else
|
|
52
|
+
default_value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
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. Note that while in [Create
|
|
8
|
+
# Order](#tag/Orders/operation/create-order), there are additional fields with
|
|
9
|
+
# certain types of line items, on fulfillment -- as this data is already known
|
|
10
|
+
# from [Create Order](#tag/Orders/operation/create-order), it is unnecessary.
|
|
11
|
+
# Anything other than a `Discount`, just requires the level of details of a
|
|
12
|
+
# normal `Product` type. <table> <thead> <tr> <th>Line Item
|
|
13
|
+
# Type</th> <th>Description</th> </tr> </thead> <tbody> <tr>
|
|
14
|
+
# <td>ACTIVITY</td> <td>Activities, such as tours, museum tickets,
|
|
15
|
+
# etc.</td> </tr> <tr> <td>AIRLINE_ANCILLARY</td>
|
|
16
|
+
# <td>Ancillary services offered by airlines, such as baggage fees, seat
|
|
17
|
+
# upgrades, etc.</td> </tr> <tr> <td>AIRLINE_FARE</td>
|
|
18
|
+
# <td>Fares for a flight.</td> </tr> <tr> <td>AUTO_RENTAL</td>
|
|
19
|
+
# <td>Auto rental</td> </tr> <tr> <td>BUNDLE</td>
|
|
20
|
+
# <td>A collection of line items and products have been packaged together into
|
|
21
|
+
# a single unit.</td> </tr> <tr> <td>DISCOUNT</td>
|
|
22
|
+
# <td>Discount</td> </tr> <tr> <td>LODGING_RESERVATION</td>
|
|
23
|
+
# <td>Bookings of a room at a hotel, hostel, etc.</td> </tr> <tr>
|
|
24
|
+
# <td>PRODUCT</td> <td>Product is a catch-all for any other line item
|
|
25
|
+
# type not listed here.</td> </tr> </tbody> </table>
|
|
26
|
+
class Type5
|
|
27
|
+
TYPE5 = [
|
|
28
|
+
# TODO: Write general description for ACTIVITY
|
|
29
|
+
ACTIVITY = 'ACTIVITY'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for AIRLINE_ANCILLARY
|
|
32
|
+
AIRLINE_ANCILLARY = 'AIRLINE_ANCILLARY'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for AIRLINE_FARE
|
|
35
|
+
AIRLINE_FARE = 'AIRLINE_FARE'.freeze,
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for AUTO_RENTAL
|
|
38
|
+
AUTO_RENTAL = 'AUTO_RENTAL'.freeze,
|
|
39
|
+
|
|
40
|
+
# TODO: Write general description for BUNDLE
|
|
41
|
+
BUNDLE = 'BUNDLE'.freeze,
|
|
42
|
+
|
|
43
|
+
# TODO: Write general description for DISCOUNT
|
|
44
|
+
DISCOUNT = 'DISCOUNT'.freeze,
|
|
45
|
+
|
|
46
|
+
# TODO: Write general description for LODGING_RESERVATION
|
|
47
|
+
LODGING_RESERVATION = 'LODGING_RESERVATION'.freeze,
|
|
48
|
+
|
|
49
|
+
# TODO: Write general description for PRODUCT
|
|
50
|
+
PRODUCT = 'PRODUCT'.freeze
|
|
51
|
+
].freeze
|
|
52
|
+
|
|
53
|
+
def self.validate(value)
|
|
54
|
+
return false if value.nil?
|
|
55
|
+
|
|
56
|
+
TYPE5.include?(value)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def self.from_value(value, default_value = ACTIVITY)
|
|
60
|
+
return default_value if value.nil?
|
|
61
|
+
|
|
62
|
+
str = value.to_s.strip
|
|
63
|
+
|
|
64
|
+
case str.downcase
|
|
65
|
+
when 'activity' then ACTIVITY
|
|
66
|
+
when 'airline_ancillary' then AIRLINE_ANCILLARY
|
|
67
|
+
when 'airline_fare' then AIRLINE_FARE
|
|
68
|
+
when 'auto_rental' then AUTO_RENTAL
|
|
69
|
+
when 'bundle' then BUNDLE
|
|
70
|
+
when 'discount' then DISCOUNT
|
|
71
|
+
when 'lodging_reservation' then LODGING_RESERVATION
|
|
72
|
+
when 'product' then PRODUCT
|
|
73
|
+
else
|
|
74
|
+
default_value
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
# Configuration for Uplift.
|
|
8
|
+
class UpliftConfig < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Merchant's Uplift client ID
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :up_id
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['up_id'] = 'upId'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
[]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for nullable fields
|
|
29
|
+
def self.nullables
|
|
30
|
+
[]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def initialize(up_id:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@up_id = up_id
|
|
38
|
+
@additional_properties = additional_properties
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates an instance of the object from a hash.
|
|
42
|
+
def self.from_hash(hash)
|
|
43
|
+
return nil unless hash
|
|
44
|
+
|
|
45
|
+
# Extract variables from the hash.
|
|
46
|
+
up_id = hash.key?('upId') ? hash['upId'] : nil
|
|
47
|
+
|
|
48
|
+
# Create a new hash for additional properties, removing known properties.
|
|
49
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
50
|
+
|
|
51
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
52
|
+
new_hash, proc { |value| value }
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Create object from extracted values.
|
|
56
|
+
UpliftConfig.new(up_id: up_id,
|
|
57
|
+
additional_properties: additional_properties)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Provides a human-readable string representation of the object.
|
|
61
|
+
def to_s
|
|
62
|
+
class_name = self.class.name.split('::').last
|
|
63
|
+
"<#{class_name} up_id: #{@up_id}, additional_properties: #{@additional_properties}>"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
67
|
+
def inspect
|
|
68
|
+
class_name = self.class.name.split('::').last
|
|
69
|
+
"<#{class_name} up_id: #{@up_id.inspect}, additional_properties:"\
|
|
70
|
+
" #{@additional_properties}>"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
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 Uplift payment instrument used in the transaction.
|
|
8
|
+
class UpliftPaymentInstrument < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Discriminator for Uplift payment instrument.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :method
|
|
15
|
+
|
|
16
|
+
# Merchant's Uplift client ID
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :up_id
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['method'] = 'method'
|
|
24
|
+
@_hash['up_id'] = 'upId'
|
|
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(up_id:, additional_properties: nil)
|
|
39
|
+
# Add additional model properties to the instance
|
|
40
|
+
additional_properties = {} if additional_properties.nil?
|
|
41
|
+
|
|
42
|
+
@method = 'UPLIFT'
|
|
43
|
+
@up_id = up_id
|
|
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
|
+
up_id = hash.key?('upId') ? hash['upId'] : nil
|
|
53
|
+
|
|
54
|
+
# Create a new hash for additional properties, removing known properties.
|
|
55
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
56
|
+
|
|
57
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
58
|
+
new_hash, proc { |value| value }
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Create object from extracted values.
|
|
62
|
+
UpliftPaymentInstrument.new(up_id: up_id,
|
|
63
|
+
additional_properties: additional_properties)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Validates an instance of the object from a given value.
|
|
67
|
+
# @param [UpliftPaymentInstrument | Hash] The value against the validation is performed.
|
|
68
|
+
def self.validate(value)
|
|
69
|
+
if value.instance_of? self
|
|
70
|
+
return (
|
|
71
|
+
APIHelper.valid_type?(value.method,
|
|
72
|
+
->(val) { val.instance_of? String }) and
|
|
73
|
+
APIHelper.valid_type?(value.up_id,
|
|
74
|
+
->(val) { val.instance_of? String })
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
return false unless value.instance_of? Hash
|
|
79
|
+
|
|
80
|
+
(
|
|
81
|
+
APIHelper.valid_type?(value['method'],
|
|
82
|
+
->(val) { val.instance_of? String }) and
|
|
83
|
+
APIHelper.valid_type?(value['upId'],
|
|
84
|
+
->(val) { val.instance_of? String })
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a human-readable string representation of the object.
|
|
89
|
+
def to_s
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} method: #{@method}, up_id: #{@up_id}, additional_properties:"\
|
|
92
|
+
" #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
96
|
+
def inspect
|
|
97
|
+
class_name = self.class.name.split('::').last
|
|
98
|
+
"<#{class_name} method: #{@method.inspect}, up_id: #{@up_id.inspect},"\
|
|
99
|
+
" additional_properties: #{@additional_properties}>"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
# A vehicle that is being rented from an automobile rental company.
|
|
8
|
+
class Vehicle < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :description
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for this method
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :vehicle_type
|
|
19
|
+
|
|
20
|
+
# TODO: Write general description for this method
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :manufacturer
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for this method
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :model
|
|
27
|
+
|
|
28
|
+
# Number of doors the vehicle has.
|
|
29
|
+
# @return [Integer]
|
|
30
|
+
attr_accessor :num_doors
|
|
31
|
+
|
|
32
|
+
# Number of passengers (excluding driver) that the vehicle can hold.
|
|
33
|
+
# > Example: A four seat car can hold 3 passengers.
|
|
34
|
+
# @return [Integer]
|
|
35
|
+
attr_accessor :passenger_capacity
|
|
36
|
+
|
|
37
|
+
# If vehicle has air conditioning.
|
|
38
|
+
# @return [TrueClass | FalseClass]
|
|
39
|
+
attr_accessor :airconditioned
|
|
40
|
+
|
|
41
|
+
# A mapping from model property names to API property names.
|
|
42
|
+
def self.names
|
|
43
|
+
@_hash = {} if @_hash.nil?
|
|
44
|
+
@_hash['description'] = 'description'
|
|
45
|
+
@_hash['vehicle_type'] = 'vehicleType'
|
|
46
|
+
@_hash['manufacturer'] = 'manufacturer'
|
|
47
|
+
@_hash['model'] = 'model'
|
|
48
|
+
@_hash['num_doors'] = 'numDoors'
|
|
49
|
+
@_hash['passenger_capacity'] = 'passengerCapacity'
|
|
50
|
+
@_hash['airconditioned'] = 'airconditioned'
|
|
51
|
+
@_hash
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for optional fields
|
|
55
|
+
def self.optionals
|
|
56
|
+
%w[
|
|
57
|
+
vehicle_type
|
|
58
|
+
manufacturer
|
|
59
|
+
model
|
|
60
|
+
num_doors
|
|
61
|
+
passenger_capacity
|
|
62
|
+
airconditioned
|
|
63
|
+
]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# An array for nullable fields
|
|
67
|
+
def self.nullables
|
|
68
|
+
[]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def initialize(description:, vehicle_type: SKIP, manufacturer: SKIP,
|
|
72
|
+
model: SKIP, num_doors: SKIP, passenger_capacity: SKIP,
|
|
73
|
+
airconditioned: SKIP, additional_properties: nil)
|
|
74
|
+
# Add additional model properties to the instance
|
|
75
|
+
additional_properties = {} if additional_properties.nil?
|
|
76
|
+
|
|
77
|
+
@description = description
|
|
78
|
+
@vehicle_type = vehicle_type unless vehicle_type == SKIP
|
|
79
|
+
@manufacturer = manufacturer unless manufacturer == SKIP
|
|
80
|
+
@model = model unless model == SKIP
|
|
81
|
+
@num_doors = num_doors unless num_doors == SKIP
|
|
82
|
+
@passenger_capacity = passenger_capacity unless passenger_capacity == SKIP
|
|
83
|
+
@airconditioned = airconditioned unless airconditioned == SKIP
|
|
84
|
+
@additional_properties = additional_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Creates an instance of the object from a hash.
|
|
88
|
+
def self.from_hash(hash)
|
|
89
|
+
return nil unless hash
|
|
90
|
+
|
|
91
|
+
# Extract variables from the hash.
|
|
92
|
+
description = hash.key?('description') ? hash['description'] : nil
|
|
93
|
+
vehicle_type = hash.key?('vehicleType') ? hash['vehicleType'] : SKIP
|
|
94
|
+
manufacturer = hash.key?('manufacturer') ? hash['manufacturer'] : SKIP
|
|
95
|
+
model = hash.key?('model') ? hash['model'] : SKIP
|
|
96
|
+
num_doors = hash.key?('numDoors') ? hash['numDoors'] : SKIP
|
|
97
|
+
passenger_capacity =
|
|
98
|
+
hash.key?('passengerCapacity') ? hash['passengerCapacity'] : SKIP
|
|
99
|
+
airconditioned =
|
|
100
|
+
hash.key?('airconditioned') ? hash['airconditioned'] : SKIP
|
|
101
|
+
|
|
102
|
+
# Create a new hash for additional properties, removing known properties.
|
|
103
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
104
|
+
|
|
105
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
106
|
+
new_hash, proc { |value| value }
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Create object from extracted values.
|
|
110
|
+
Vehicle.new(description: description,
|
|
111
|
+
vehicle_type: vehicle_type,
|
|
112
|
+
manufacturer: manufacturer,
|
|
113
|
+
model: model,
|
|
114
|
+
num_doors: num_doors,
|
|
115
|
+
passenger_capacity: passenger_capacity,
|
|
116
|
+
airconditioned: airconditioned,
|
|
117
|
+
additional_properties: additional_properties)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Provides a human-readable string representation of the object.
|
|
121
|
+
def to_s
|
|
122
|
+
class_name = self.class.name.split('::').last
|
|
123
|
+
"<#{class_name} description: #{@description}, vehicle_type: #{@vehicle_type}, manufacturer:"\
|
|
124
|
+
" #{@manufacturer}, model: #{@model}, num_doors: #{@num_doors}, passenger_capacity:"\
|
|
125
|
+
" #{@passenger_capacity}, airconditioned: #{@airconditioned}, additional_properties:"\
|
|
126
|
+
" #{@additional_properties}>"
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
130
|
+
def inspect
|
|
131
|
+
class_name = self.class.name.split('::').last
|
|
132
|
+
"<#{class_name} description: #{@description.inspect}, vehicle_type:"\
|
|
133
|
+
" #{@vehicle_type.inspect}, manufacturer: #{@manufacturer.inspect}, model:"\
|
|
134
|
+
" #{@model.inspect}, num_doors: #{@num_doors.inspect}, passenger_capacity:"\
|
|
135
|
+
" #{@passenger_capacity.inspect}, airconditioned: #{@airconditioned.inspect},"\
|
|
136
|
+
" additional_properties: #{@additional_properties}>"
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|