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,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
|
+
# Buyer screen data.
|
|
8
|
+
class Screen < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The total width of the buyer's device screen in pixels.
|
|
13
|
+
# This should be obtained by using the browser's `screen.width` property.
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
attr_accessor :screen_width
|
|
16
|
+
|
|
17
|
+
# The total height of the buyer's device screen in pixels.
|
|
18
|
+
# This should be obtained by using the browser's `screen.height` property.
|
|
19
|
+
# @return [Integer]
|
|
20
|
+
attr_accessor :screen_height
|
|
21
|
+
|
|
22
|
+
# The color depth of the buyer's browser in bits per pixel.
|
|
23
|
+
# This should be obtained by using the browser's `screen.colorDepth`
|
|
24
|
+
# property.
|
|
25
|
+
# Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth."
|
|
26
|
+
# @return [Integer]
|
|
27
|
+
attr_accessor :color_depth
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['screen_width'] = 'screenWidth'
|
|
33
|
+
@_hash['screen_height'] = 'screenHeight'
|
|
34
|
+
@_hash['color_depth'] = 'colorDepth'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
[]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for nullable fields
|
|
44
|
+
def self.nullables
|
|
45
|
+
[]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def initialize(screen_width:, screen_height:, color_depth:,
|
|
49
|
+
additional_properties: nil)
|
|
50
|
+
# Add additional model properties to the instance
|
|
51
|
+
additional_properties = {} if additional_properties.nil?
|
|
52
|
+
|
|
53
|
+
@screen_width = screen_width
|
|
54
|
+
@screen_height = screen_height
|
|
55
|
+
@color_depth = color_depth
|
|
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
|
+
screen_width = hash.key?('screenWidth') ? hash['screenWidth'] : nil
|
|
65
|
+
screen_height = hash.key?('screenHeight') ? hash['screenHeight'] : nil
|
|
66
|
+
color_depth = hash.key?('colorDepth') ? hash['colorDepth'] : nil
|
|
67
|
+
|
|
68
|
+
# Create a new hash for additional properties, removing known properties.
|
|
69
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
70
|
+
|
|
71
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
72
|
+
new_hash, proc { |value| value }
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# Create object from extracted values.
|
|
76
|
+
Screen.new(screen_width: screen_width,
|
|
77
|
+
screen_height: screen_height,
|
|
78
|
+
color_depth: color_depth,
|
|
79
|
+
additional_properties: additional_properties)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Provides a human-readable string representation of the object.
|
|
83
|
+
def to_s
|
|
84
|
+
class_name = self.class.name.split('::').last
|
|
85
|
+
"<#{class_name} screen_width: #{@screen_width}, screen_height: #{@screen_height},"\
|
|
86
|
+
" color_depth: #{@color_depth}, additional_properties: #{@additional_properties}>"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
90
|
+
def inspect
|
|
91
|
+
class_name = self.class.name.split('::').last
|
|
92
|
+
"<#{class_name} screen_width: #{@screen_width.inspect}, screen_height:"\
|
|
93
|
+
" #{@screen_height.inspect}, color_depth: #{@color_depth.inspect}, additional_properties:"\
|
|
94
|
+
" #{@additional_properties}>"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
# Search vouchers request.
|
|
8
|
+
class SearchVouchersRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Identifier for an order.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :order_id
|
|
15
|
+
|
|
16
|
+
# List of owners with issued vouchers
|
|
17
|
+
# @return [Array[PersonName]]
|
|
18
|
+
attr_accessor :owners
|
|
19
|
+
|
|
20
|
+
# Issuer of the voucher
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_reader :issuer
|
|
23
|
+
|
|
24
|
+
# Type of voucher
|
|
25
|
+
# @return [VoucherType]
|
|
26
|
+
attr_accessor :voucher_type
|
|
27
|
+
|
|
28
|
+
# Reference for identifying an order.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :merchant_order_reference
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['order_id'] = 'orderId'
|
|
36
|
+
@_hash['owners'] = 'owners'
|
|
37
|
+
@_hash['issuer'] = 'issuer'
|
|
38
|
+
@_hash['voucher_type'] = 'voucherType'
|
|
39
|
+
@_hash['merchant_order_reference'] = 'merchantOrderReference'
|
|
40
|
+
@_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# An array for optional fields
|
|
44
|
+
def self.optionals
|
|
45
|
+
%w[
|
|
46
|
+
order_id
|
|
47
|
+
]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for nullable fields
|
|
51
|
+
def self.nullables
|
|
52
|
+
[]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize(owners:, voucher_type:, merchant_order_reference:,
|
|
56
|
+
order_id: SKIP, additional_properties: nil)
|
|
57
|
+
# Add additional model properties to the instance
|
|
58
|
+
additional_properties = {} if additional_properties.nil?
|
|
59
|
+
|
|
60
|
+
@order_id = order_id unless order_id == SKIP
|
|
61
|
+
@owners = owners
|
|
62
|
+
@issuer = 'SWAV_PAYMENT_GATEWAY'
|
|
63
|
+
@voucher_type = voucher_type
|
|
64
|
+
@merchant_order_reference = merchant_order_reference
|
|
65
|
+
@additional_properties = additional_properties
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Creates an instance of the object from a hash.
|
|
69
|
+
def self.from_hash(hash)
|
|
70
|
+
return nil unless hash
|
|
71
|
+
|
|
72
|
+
# Extract variables from the hash.
|
|
73
|
+
# Parameter is an array, so we need to iterate through it
|
|
74
|
+
owners = nil
|
|
75
|
+
unless hash['owners'].nil?
|
|
76
|
+
owners = []
|
|
77
|
+
hash['owners'].each do |structure|
|
|
78
|
+
owners << (PersonName.from_hash(structure) if structure)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
owners = nil unless hash.key?('owners')
|
|
83
|
+
voucher_type = hash.key?('voucherType') ? hash['voucherType'] : nil
|
|
84
|
+
merchant_order_reference =
|
|
85
|
+
hash.key?('merchantOrderReference') ? hash['merchantOrderReference'] : nil
|
|
86
|
+
order_id = hash.key?('orderId') ? hash['orderId'] : SKIP
|
|
87
|
+
|
|
88
|
+
# Create a new hash for additional properties, removing known properties.
|
|
89
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
90
|
+
|
|
91
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
92
|
+
new_hash, proc { |value| value }
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# Create object from extracted values.
|
|
96
|
+
SearchVouchersRequest.new(owners: owners,
|
|
97
|
+
voucher_type: voucher_type,
|
|
98
|
+
merchant_order_reference: merchant_order_reference,
|
|
99
|
+
order_id: order_id,
|
|
100
|
+
additional_properties: additional_properties)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Provides a human-readable string representation of the object.
|
|
104
|
+
def to_s
|
|
105
|
+
class_name = self.class.name.split('::').last
|
|
106
|
+
"<#{class_name} order_id: #{@order_id}, owners: #{@owners}, issuer: #{@issuer},"\
|
|
107
|
+
" voucher_type: #{@voucher_type}, merchant_order_reference: #{@merchant_order_reference},"\
|
|
108
|
+
" additional_properties: #{@additional_properties}>"
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
112
|
+
def inspect
|
|
113
|
+
class_name = self.class.name.split('::').last
|
|
114
|
+
"<#{class_name} order_id: #{@order_id.inspect}, owners: #{@owners.inspect}, issuer:"\
|
|
115
|
+
" #{@issuer.inspect}, voucher_type: #{@voucher_type.inspect}, merchant_order_reference:"\
|
|
116
|
+
" #{@merchant_order_reference.inspect}, additional_properties: #{@additional_properties}>"
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
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
|
+
# Configuration related to card security codes (e.g. CVVs).
|
|
8
|
+
class SecurityCode < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Exact number of digts that the security code should be.
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
attr_accessor :digits
|
|
15
|
+
|
|
16
|
+
# If the card's security code is required.
|
|
17
|
+
# Some card schemes, like UATP do not use security codes.
|
|
18
|
+
# @return [TrueClass | FalseClass]
|
|
19
|
+
attr_accessor :required
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['digits'] = 'digits'
|
|
25
|
+
@_hash['required'] = 'required'
|
|
26
|
+
@_hash
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# An array for optional fields
|
|
30
|
+
def self.optionals
|
|
31
|
+
[]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for nullable fields
|
|
35
|
+
def self.nullables
|
|
36
|
+
[]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def initialize(digits:, required:, additional_properties: nil)
|
|
40
|
+
# Add additional model properties to the instance
|
|
41
|
+
additional_properties = {} if additional_properties.nil?
|
|
42
|
+
|
|
43
|
+
@digits = digits
|
|
44
|
+
@required = required
|
|
45
|
+
@additional_properties = additional_properties
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Creates an instance of the object from a hash.
|
|
49
|
+
def self.from_hash(hash)
|
|
50
|
+
return nil unless hash
|
|
51
|
+
|
|
52
|
+
# Extract variables from the hash.
|
|
53
|
+
digits = hash.key?('digits') ? hash['digits'] : nil
|
|
54
|
+
required = hash.key?('required') ? hash['required'] : 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
|
+
SecurityCode.new(digits: digits,
|
|
65
|
+
required: required,
|
|
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} digits: #{@digits}, required: #{@required}, additional_properties:"\
|
|
73
|
+
" #{@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} digits: #{@digits.inspect}, required: #{@required.inspect},"\
|
|
80
|
+
" additional_properties: #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
# Security Code Status <table> <thead> <tr> <th>Security Code
|
|
8
|
+
# Status</th> <th>Description</th> </tr> </thead> <tbody> <tr>
|
|
9
|
+
# <td>MATCH</td> <td>Provided Security Code matches expected value.</td>
|
|
10
|
+
# </tr> <tr> <td>NOT_PROVIDED</td> <td>Security Code not
|
|
11
|
+
# provided.</td> </tr> <tr> <td>FAILURE</td> <td>Security Code
|
|
12
|
+
# does not match expected value.</td> </tr> <tr> <td>UNAVAILABLE</td>
|
|
13
|
+
# <td>Security Code check not available.</td> </tr> </tbody> </table>
|
|
14
|
+
class SecurityCodeMatchStatus
|
|
15
|
+
SECURITY_CODE_MATCH_STATUS = [
|
|
16
|
+
# TODO: Write general description for MATCH
|
|
17
|
+
MATCH = 'MATCH'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for NOT_PROVIDED
|
|
20
|
+
NOT_PROVIDED = 'NOT_PROVIDED'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for FAILURE
|
|
23
|
+
FAILURE = 'FAILURE'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for UNAVAILABLE
|
|
26
|
+
UNAVAILABLE = 'UNAVAILABLE'.freeze
|
|
27
|
+
].freeze
|
|
28
|
+
|
|
29
|
+
def self.validate(value)
|
|
30
|
+
return false if value.nil?
|
|
31
|
+
|
|
32
|
+
SECURITY_CODE_MATCH_STATUS.include?(value)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.from_value(value, default_value = MATCH)
|
|
36
|
+
return default_value if value.nil?
|
|
37
|
+
|
|
38
|
+
str = value.to_s.strip
|
|
39
|
+
|
|
40
|
+
case str.downcase
|
|
41
|
+
when 'match' then MATCH
|
|
42
|
+
when 'not_provided' then NOT_PROVIDED
|
|
43
|
+
when 'failure' then FAILURE
|
|
44
|
+
when 'unavailable' then UNAVAILABLE
|
|
45
|
+
else
|
|
46
|
+
default_value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
# Status of this breadcrumb item, so we can show it properly. Options: -
|
|
8
|
+
# `DONE`: Buyer has already completed this step. - `IN_PROGRESS`: Buyer is
|
|
9
|
+
# currently on this step. - `PENDING`: Buyer has yet to get to this step, it
|
|
10
|
+
# is in the future.
|
|
11
|
+
class Status
|
|
12
|
+
STATUS = [
|
|
13
|
+
# TODO: Write general description for DONE
|
|
14
|
+
DONE = 'DONE'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for IN_PROGRESS
|
|
17
|
+
IN_PROGRESS = 'IN_PROGRESS'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for PENDING
|
|
20
|
+
PENDING = 'PENDING'.freeze
|
|
21
|
+
].freeze
|
|
22
|
+
|
|
23
|
+
def self.validate(value)
|
|
24
|
+
return false if value.nil?
|
|
25
|
+
|
|
26
|
+
STATUS.include?(value)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = DONE)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'done' then DONE
|
|
36
|
+
when 'in_progress' then IN_PROGRESS
|
|
37
|
+
when 'pending' then PENDING
|
|
38
|
+
else
|
|
39
|
+
default_value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
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 status of the fraud assessment.
|
|
8
|
+
class Status1
|
|
9
|
+
STATUS1 = [
|
|
10
|
+
# TODO: Write general description for ACCEPTED
|
|
11
|
+
ACCEPTED = 'ACCEPTED'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for REJECTED
|
|
14
|
+
REJECTED = 'REJECTED'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for IN_REVIEW
|
|
17
|
+
IN_REVIEW = 'IN_REVIEW'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for REVIEW_ACCEPTED
|
|
20
|
+
REVIEW_ACCEPTED = 'REVIEW_ACCEPTED'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for REVIEW_REJECTED
|
|
23
|
+
REVIEW_REJECTED = 'REVIEW_REJECTED'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for ERROR
|
|
26
|
+
ERROR = 'ERROR'.freeze
|
|
27
|
+
].freeze
|
|
28
|
+
|
|
29
|
+
def self.validate(value)
|
|
30
|
+
return false if value.nil?
|
|
31
|
+
|
|
32
|
+
STATUS1.include?(value)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.from_value(value, default_value = ACCEPTED)
|
|
36
|
+
return default_value if value.nil?
|
|
37
|
+
|
|
38
|
+
str = value.to_s.strip
|
|
39
|
+
|
|
40
|
+
case str.downcase
|
|
41
|
+
when 'accepted' then ACCEPTED
|
|
42
|
+
when 'rejected' then REJECTED
|
|
43
|
+
when 'in_review' then IN_REVIEW
|
|
44
|
+
when 'review_accepted' then REVIEW_ACCEPTED
|
|
45
|
+
when 'review_rejected' then REVIEW_REJECTED
|
|
46
|
+
when 'error' then ERROR
|
|
47
|
+
else
|
|
48
|
+
default_value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
# Summary of the results of the bulk payment.
|
|
8
|
+
class Summary < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# TODO: Write general description for this method
|
|
13
|
+
# @return [Array[TransactionActionResult]]
|
|
14
|
+
attr_accessor :results
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['results'] = 'results'
|
|
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(results:, additional_properties: nil)
|
|
34
|
+
# Add additional model properties to the instance
|
|
35
|
+
additional_properties = {} if additional_properties.nil?
|
|
36
|
+
|
|
37
|
+
@results = results
|
|
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
|
+
# Parameter is an array, so we need to iterate through it
|
|
47
|
+
results = nil
|
|
48
|
+
unless hash['results'].nil?
|
|
49
|
+
results = []
|
|
50
|
+
hash['results'].each do |structure|
|
|
51
|
+
results << (TransactionActionResult.from_hash(structure) if structure)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
results = nil unless hash.key?('results')
|
|
56
|
+
|
|
57
|
+
# Create a new hash for additional properties, removing known properties.
|
|
58
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
59
|
+
|
|
60
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
61
|
+
new_hash, proc { |value| value }
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Create object from extracted values.
|
|
65
|
+
Summary.new(results: results,
|
|
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} results: #{@results}, 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} results: #{@results.inspect}, additional_properties:"\
|
|
79
|
+
" #{@additional_properties}>"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
# Tax.
|
|
8
|
+
class Tax < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# What should be shown as the title of the line item on a receipt or billing
|
|
13
|
+
# summary.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :title
|
|
16
|
+
|
|
17
|
+
# Code defined by government entity to identify a particular type of tax.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :code
|
|
20
|
+
|
|
21
|
+
# An amount that is a nonnegative number, i.e. {0, 1, 2, 3, 4, 5,…}
|
|
22
|
+
# @return [NonNegativeAmount]
|
|
23
|
+
attr_accessor :price
|
|
24
|
+
|
|
25
|
+
# AuthorizationGroup that the line item should be part of for splitting
|
|
26
|
+
# authorizations for Aggregate Payments.
|
|
27
|
+
# If this is set, there must be a matching AuthorizationGroup created in the
|
|
28
|
+
# PriceSummary.
|
|
29
|
+
# > NOTE: Items within a Bundle should not have an `authorizationGroupId`,
|
|
30
|
+
# they will use the same `authorizationGroupId` as the top-level bundle.
|
|
31
|
+
# @return [String]
|
|
32
|
+
attr_accessor :authorization_group_id
|
|
33
|
+
|
|
34
|
+
# A mapping from model property names to API property names.
|
|
35
|
+
def self.names
|
|
36
|
+
@_hash = {} if @_hash.nil?
|
|
37
|
+
@_hash['title'] = 'title'
|
|
38
|
+
@_hash['code'] = 'code'
|
|
39
|
+
@_hash['price'] = 'price'
|
|
40
|
+
@_hash['authorization_group_id'] = 'authorizationGroupId'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
code
|
|
48
|
+
authorization_group_id
|
|
49
|
+
]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# An array for nullable fields
|
|
53
|
+
def self.nullables
|
|
54
|
+
[]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def initialize(title:, price:, code: SKIP, authorization_group_id: SKIP,
|
|
58
|
+
additional_properties: nil)
|
|
59
|
+
# Add additional model properties to the instance
|
|
60
|
+
additional_properties = {} if additional_properties.nil?
|
|
61
|
+
|
|
62
|
+
@title = title
|
|
63
|
+
@code = code unless code == SKIP
|
|
64
|
+
@price = price
|
|
65
|
+
@authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
|
|
66
|
+
@additional_properties = additional_properties
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Creates an instance of the object from a hash.
|
|
70
|
+
def self.from_hash(hash)
|
|
71
|
+
return nil unless hash
|
|
72
|
+
|
|
73
|
+
# Extract variables from the hash.
|
|
74
|
+
title = hash.key?('title') ? hash['title'] : nil
|
|
75
|
+
price = NonNegativeAmount.from_hash(hash['price']) if hash['price']
|
|
76
|
+
code = hash.key?('code') ? hash['code'] : SKIP
|
|
77
|
+
authorization_group_id =
|
|
78
|
+
hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
|
|
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
|
+
Tax.new(title: title,
|
|
89
|
+
price: price,
|
|
90
|
+
code: code,
|
|
91
|
+
authorization_group_id: authorization_group_id,
|
|
92
|
+
additional_properties: additional_properties)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Validates an instance of the object from a given value.
|
|
96
|
+
# @param [Tax | Hash] The value against the validation is performed.
|
|
97
|
+
def self.validate(value)
|
|
98
|
+
if value.instance_of? self
|
|
99
|
+
return (
|
|
100
|
+
APIHelper.valid_type?(value.title,
|
|
101
|
+
->(val) { val.instance_of? String }) and
|
|
102
|
+
APIHelper.valid_type?(value.price,
|
|
103
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
104
|
+
is_model_hash: true)
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
return false unless value.instance_of? Hash
|
|
109
|
+
|
|
110
|
+
(
|
|
111
|
+
APIHelper.valid_type?(value['title'],
|
|
112
|
+
->(val) { val.instance_of? String }) and
|
|
113
|
+
APIHelper.valid_type?(value['price'],
|
|
114
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
115
|
+
is_model_hash: true)
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Provides a human-readable string representation of the object.
|
|
120
|
+
def to_s
|
|
121
|
+
class_name = self.class.name.split('::').last
|
|
122
|
+
"<#{class_name} title: #{@title}, code: #{@code}, price: #{@price}, authorization_group_id:"\
|
|
123
|
+
" #{@authorization_group_id}, additional_properties: #{@additional_properties}>"
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
127
|
+
def inspect
|
|
128
|
+
class_name = self.class.name.split('::').last
|
|
129
|
+
"<#{class_name} title: #{@title.inspect}, code: #{@code.inspect}, price: #{@price.inspect},"\
|
|
130
|
+
" authorization_group_id: #{@authorization_group_id.inspect}, additional_properties:"\
|
|
131
|
+
" #{@additional_properties}>"
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|