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,207 @@
|
|
|
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
|
+
# Fulfilled airline ancillary.
|
|
8
|
+
class FulfilledAirlineAncillary < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Discriminator used to identify the type of line item.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :type
|
|
15
|
+
|
|
16
|
+
# Result of the fulfillment.
|
|
17
|
+
# On `PARTIAL`, the amount that was fulfilled must be specified.
|
|
18
|
+
# @return [FulfillmentStatus]
|
|
19
|
+
attr_accessor :fulfillment_status
|
|
20
|
+
|
|
21
|
+
# Conditional property that should be sent if `fulfillmentStatus` is
|
|
22
|
+
# `PARTIAL`.
|
|
23
|
+
# `fulfilledPrice` must be less than or equal to original `price`.
|
|
24
|
+
# @return [Amount]
|
|
25
|
+
attr_accessor :fulfilled_price
|
|
26
|
+
|
|
27
|
+
# What should be shown as the title of the line item on a receipt or billing
|
|
28
|
+
# summary.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :title
|
|
31
|
+
|
|
32
|
+
# AuthorizationGroup that the line item should be part of for splitting
|
|
33
|
+
# authorizations for Aggregate Payments Payments.
|
|
34
|
+
# If this is set, there must be a matching AuthorizationGroup created in the
|
|
35
|
+
# PriceSummary.
|
|
36
|
+
# > NOTE: Items within a Bundle should not have an `authorizationGroupId`,
|
|
37
|
+
# they will use the same `authorizationGroupId` as the top-level bundle.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :authorization_group_id
|
|
40
|
+
|
|
41
|
+
# Stock Keeping Unit (SKU) is a product and service identification code for
|
|
42
|
+
# a specific product.
|
|
43
|
+
# @return [String]
|
|
44
|
+
attr_accessor :sku
|
|
45
|
+
|
|
46
|
+
# Stock Keeping Unit (SKU) is a product and service identification code for
|
|
47
|
+
# a specific product.
|
|
48
|
+
# @return [Integer]
|
|
49
|
+
attr_accessor :quantity
|
|
50
|
+
|
|
51
|
+
# An amount that is a nonnegative number, i.e. {0, 1, 2, 3, 4, 5,…}
|
|
52
|
+
# @return [NonNegativeAmount]
|
|
53
|
+
attr_accessor :unit_price
|
|
54
|
+
|
|
55
|
+
# Total Price for the line item. Should be equal to `unitPrice` *
|
|
56
|
+
# `quantity`, if `unitPrice` is specified.
|
|
57
|
+
# @return [NonNegativeAmount]
|
|
58
|
+
attr_accessor :total_price
|
|
59
|
+
|
|
60
|
+
# A mapping from model property names to API property names.
|
|
61
|
+
def self.names
|
|
62
|
+
@_hash = {} if @_hash.nil?
|
|
63
|
+
@_hash['type'] = 'type'
|
|
64
|
+
@_hash['fulfillment_status'] = 'fulfillmentStatus'
|
|
65
|
+
@_hash['fulfilled_price'] = 'fulfilledPrice'
|
|
66
|
+
@_hash['title'] = 'title'
|
|
67
|
+
@_hash['authorization_group_id'] = 'authorizationGroupId'
|
|
68
|
+
@_hash['sku'] = 'sku'
|
|
69
|
+
@_hash['quantity'] = 'quantity'
|
|
70
|
+
@_hash['unit_price'] = 'unitPrice'
|
|
71
|
+
@_hash['total_price'] = 'totalPrice'
|
|
72
|
+
@_hash
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# An array for optional fields
|
|
76
|
+
def self.optionals
|
|
77
|
+
%w[
|
|
78
|
+
fulfilled_price
|
|
79
|
+
authorization_group_id
|
|
80
|
+
]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# An array for nullable fields
|
|
84
|
+
def self.nullables
|
|
85
|
+
[]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def initialize(fulfillment_status:, title:, sku:, quantity: 1, unit_price:,
|
|
89
|
+
total_price:, fulfilled_price: SKIP,
|
|
90
|
+
authorization_group_id: SKIP, additional_properties: nil)
|
|
91
|
+
# Add additional model properties to the instance
|
|
92
|
+
additional_properties = {} if additional_properties.nil?
|
|
93
|
+
|
|
94
|
+
@type = 'AIRLINE_ANCILLARY'
|
|
95
|
+
@fulfillment_status = fulfillment_status
|
|
96
|
+
@fulfilled_price = fulfilled_price unless fulfilled_price == SKIP
|
|
97
|
+
@title = title
|
|
98
|
+
@authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
|
|
99
|
+
@sku = sku
|
|
100
|
+
@quantity = quantity
|
|
101
|
+
@unit_price = unit_price
|
|
102
|
+
@total_price = total_price
|
|
103
|
+
@additional_properties = additional_properties
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Creates an instance of the object from a hash.
|
|
107
|
+
def self.from_hash(hash)
|
|
108
|
+
return nil unless hash
|
|
109
|
+
|
|
110
|
+
# Extract variables from the hash.
|
|
111
|
+
fulfillment_status =
|
|
112
|
+
hash.key?('fulfillmentStatus') ? hash['fulfillmentStatus'] : nil
|
|
113
|
+
title = hash.key?('title') ? hash['title'] : nil
|
|
114
|
+
sku = hash.key?('sku') ? hash['sku'] : nil
|
|
115
|
+
quantity = hash['quantity'] ||= 1
|
|
116
|
+
unit_price = NonNegativeAmount.from_hash(hash['unitPrice']) if hash['unitPrice']
|
|
117
|
+
total_price = NonNegativeAmount.from_hash(hash['totalPrice']) if hash['totalPrice']
|
|
118
|
+
fulfilled_price = Amount.from_hash(hash['fulfilledPrice']) if hash['fulfilledPrice']
|
|
119
|
+
authorization_group_id =
|
|
120
|
+
hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
|
|
121
|
+
|
|
122
|
+
# Create a new hash for additional properties, removing known properties.
|
|
123
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
124
|
+
|
|
125
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
126
|
+
new_hash, proc { |value| value }
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Create object from extracted values.
|
|
130
|
+
FulfilledAirlineAncillary.new(fulfillment_status: fulfillment_status,
|
|
131
|
+
title: title,
|
|
132
|
+
sku: sku,
|
|
133
|
+
quantity: quantity,
|
|
134
|
+
unit_price: unit_price,
|
|
135
|
+
total_price: total_price,
|
|
136
|
+
fulfilled_price: fulfilled_price,
|
|
137
|
+
authorization_group_id: authorization_group_id,
|
|
138
|
+
additional_properties: additional_properties)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Validates an instance of the object from a given value.
|
|
142
|
+
# @param [FulfilledAirlineAncillary | Hash] The value against the validation is performed.
|
|
143
|
+
def self.validate(value)
|
|
144
|
+
if value.instance_of? self
|
|
145
|
+
return (
|
|
146
|
+
APIHelper.valid_type?(value.type,
|
|
147
|
+
->(val) { val.instance_of? String }) and
|
|
148
|
+
APIHelper.valid_type?(value.fulfillment_status,
|
|
149
|
+
->(val) { FulfillmentStatus.validate(val) }) and
|
|
150
|
+
APIHelper.valid_type?(value.title,
|
|
151
|
+
->(val) { val.instance_of? String }) and
|
|
152
|
+
APIHelper.valid_type?(value.sku,
|
|
153
|
+
->(val) { val.instance_of? String }) and
|
|
154
|
+
APIHelper.valid_type?(value.quantity,
|
|
155
|
+
->(val) { val.instance_of? Integer }) and
|
|
156
|
+
APIHelper.valid_type?(value.unit_price,
|
|
157
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
158
|
+
is_model_hash: true) and
|
|
159
|
+
APIHelper.valid_type?(value.total_price,
|
|
160
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
161
|
+
is_model_hash: true)
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
return false unless value.instance_of? Hash
|
|
166
|
+
|
|
167
|
+
(
|
|
168
|
+
APIHelper.valid_type?(value['type'],
|
|
169
|
+
->(val) { val.instance_of? String }) and
|
|
170
|
+
APIHelper.valid_type?(value['fulfillmentStatus'],
|
|
171
|
+
->(val) { FulfillmentStatus.validate(val) }) and
|
|
172
|
+
APIHelper.valid_type?(value['title'],
|
|
173
|
+
->(val) { val.instance_of? String }) and
|
|
174
|
+
APIHelper.valid_type?(value['sku'],
|
|
175
|
+
->(val) { val.instance_of? String }) and
|
|
176
|
+
APIHelper.valid_type?(value['quantity'],
|
|
177
|
+
->(val) { val.instance_of? Integer }) and
|
|
178
|
+
APIHelper.valid_type?(value['unitPrice'],
|
|
179
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
180
|
+
is_model_hash: true) and
|
|
181
|
+
APIHelper.valid_type?(value['totalPrice'],
|
|
182
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
183
|
+
is_model_hash: true)
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Provides a human-readable string representation of the object.
|
|
188
|
+
def to_s
|
|
189
|
+
class_name = self.class.name.split('::').last
|
|
190
|
+
"<#{class_name} type: #{@type}, fulfillment_status: #{@fulfillment_status},"\
|
|
191
|
+
" fulfilled_price: #{@fulfilled_price}, title: #{@title}, authorization_group_id:"\
|
|
192
|
+
" #{@authorization_group_id}, sku: #{@sku}, quantity: #{@quantity}, unit_price:"\
|
|
193
|
+
" #{@unit_price}, total_price: #{@total_price}, additional_properties:"\
|
|
194
|
+
" #{@additional_properties}>"
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
198
|
+
def inspect
|
|
199
|
+
class_name = self.class.name.split('::').last
|
|
200
|
+
"<#{class_name} type: #{@type.inspect}, fulfillment_status: #{@fulfillment_status.inspect},"\
|
|
201
|
+
" fulfilled_price: #{@fulfilled_price.inspect}, title: #{@title.inspect},"\
|
|
202
|
+
" authorization_group_id: #{@authorization_group_id.inspect}, sku: #{@sku.inspect},"\
|
|
203
|
+
" quantity: #{@quantity.inspect}, unit_price: #{@unit_price.inspect}, total_price:"\
|
|
204
|
+
" #{@total_price.inspect}, additional_properties: #{@additional_properties}>"
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
@@ -0,0 +1,207 @@
|
|
|
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
|
+
# Fulfilled airline fare.
|
|
8
|
+
class FulfilledAirlineFare < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Discriminator used to identify the type of line item.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :type
|
|
15
|
+
|
|
16
|
+
# Result of the fulfillment.
|
|
17
|
+
# On `PARTIAL`, the amount that was fulfilled must be specified.
|
|
18
|
+
# @return [FulfillmentStatus]
|
|
19
|
+
attr_accessor :fulfillment_status
|
|
20
|
+
|
|
21
|
+
# Conditional property that should be sent if `fulfillmentStatus` is
|
|
22
|
+
# `PARTIAL`.
|
|
23
|
+
# `fulfilledPrice` must be less than or equal to original `price`.
|
|
24
|
+
# @return [Amount]
|
|
25
|
+
attr_accessor :fulfilled_price
|
|
26
|
+
|
|
27
|
+
# What should be shown as the title of the line item on a receipt or billing
|
|
28
|
+
# summary.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :title
|
|
31
|
+
|
|
32
|
+
# AuthorizationGroup that the line item should be part of for splitting
|
|
33
|
+
# authorizations for Aggregate Payments Payments.
|
|
34
|
+
# If this is set, there must be a matching AuthorizationGroup created in the
|
|
35
|
+
# PriceSummary.
|
|
36
|
+
# > NOTE: Items within a Bundle should not have an `authorizationGroupId`,
|
|
37
|
+
# they will use the same `authorizationGroupId` as the top-level bundle.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :authorization_group_id
|
|
40
|
+
|
|
41
|
+
# Stock Keeping Unit (SKU) is a product and service identification code for
|
|
42
|
+
# a specific product.
|
|
43
|
+
# @return [String]
|
|
44
|
+
attr_accessor :sku
|
|
45
|
+
|
|
46
|
+
# Stock Keeping Unit (SKU) is a product and service identification code for
|
|
47
|
+
# a specific product.
|
|
48
|
+
# @return [Integer]
|
|
49
|
+
attr_accessor :quantity
|
|
50
|
+
|
|
51
|
+
# An amount that is a nonnegative number, i.e. {0, 1, 2, 3, 4, 5,…}
|
|
52
|
+
# @return [NonNegativeAmount]
|
|
53
|
+
attr_accessor :unit_price
|
|
54
|
+
|
|
55
|
+
# Total Price for the line item. Should be equal to `unitPrice` *
|
|
56
|
+
# `quantity`, if `unitPrice` is specified.
|
|
57
|
+
# @return [NonNegativeAmount]
|
|
58
|
+
attr_accessor :total_price
|
|
59
|
+
|
|
60
|
+
# A mapping from model property names to API property names.
|
|
61
|
+
def self.names
|
|
62
|
+
@_hash = {} if @_hash.nil?
|
|
63
|
+
@_hash['type'] = 'type'
|
|
64
|
+
@_hash['fulfillment_status'] = 'fulfillmentStatus'
|
|
65
|
+
@_hash['fulfilled_price'] = 'fulfilledPrice'
|
|
66
|
+
@_hash['title'] = 'title'
|
|
67
|
+
@_hash['authorization_group_id'] = 'authorizationGroupId'
|
|
68
|
+
@_hash['sku'] = 'sku'
|
|
69
|
+
@_hash['quantity'] = 'quantity'
|
|
70
|
+
@_hash['unit_price'] = 'unitPrice'
|
|
71
|
+
@_hash['total_price'] = 'totalPrice'
|
|
72
|
+
@_hash
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# An array for optional fields
|
|
76
|
+
def self.optionals
|
|
77
|
+
%w[
|
|
78
|
+
fulfilled_price
|
|
79
|
+
authorization_group_id
|
|
80
|
+
]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# An array for nullable fields
|
|
84
|
+
def self.nullables
|
|
85
|
+
[]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def initialize(fulfillment_status:, title:, sku:, quantity: 1, unit_price:,
|
|
89
|
+
total_price:, fulfilled_price: SKIP,
|
|
90
|
+
authorization_group_id: SKIP, additional_properties: nil)
|
|
91
|
+
# Add additional model properties to the instance
|
|
92
|
+
additional_properties = {} if additional_properties.nil?
|
|
93
|
+
|
|
94
|
+
@type = 'AIRLINE_FARE'
|
|
95
|
+
@fulfillment_status = fulfillment_status
|
|
96
|
+
@fulfilled_price = fulfilled_price unless fulfilled_price == SKIP
|
|
97
|
+
@title = title
|
|
98
|
+
@authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
|
|
99
|
+
@sku = sku
|
|
100
|
+
@quantity = quantity
|
|
101
|
+
@unit_price = unit_price
|
|
102
|
+
@total_price = total_price
|
|
103
|
+
@additional_properties = additional_properties
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Creates an instance of the object from a hash.
|
|
107
|
+
def self.from_hash(hash)
|
|
108
|
+
return nil unless hash
|
|
109
|
+
|
|
110
|
+
# Extract variables from the hash.
|
|
111
|
+
fulfillment_status =
|
|
112
|
+
hash.key?('fulfillmentStatus') ? hash['fulfillmentStatus'] : nil
|
|
113
|
+
title = hash.key?('title') ? hash['title'] : nil
|
|
114
|
+
sku = hash.key?('sku') ? hash['sku'] : nil
|
|
115
|
+
quantity = hash['quantity'] ||= 1
|
|
116
|
+
unit_price = NonNegativeAmount.from_hash(hash['unitPrice']) if hash['unitPrice']
|
|
117
|
+
total_price = NonNegativeAmount.from_hash(hash['totalPrice']) if hash['totalPrice']
|
|
118
|
+
fulfilled_price = Amount.from_hash(hash['fulfilledPrice']) if hash['fulfilledPrice']
|
|
119
|
+
authorization_group_id =
|
|
120
|
+
hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
|
|
121
|
+
|
|
122
|
+
# Create a new hash for additional properties, removing known properties.
|
|
123
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
124
|
+
|
|
125
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
126
|
+
new_hash, proc { |value| value }
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Create object from extracted values.
|
|
130
|
+
FulfilledAirlineFare.new(fulfillment_status: fulfillment_status,
|
|
131
|
+
title: title,
|
|
132
|
+
sku: sku,
|
|
133
|
+
quantity: quantity,
|
|
134
|
+
unit_price: unit_price,
|
|
135
|
+
total_price: total_price,
|
|
136
|
+
fulfilled_price: fulfilled_price,
|
|
137
|
+
authorization_group_id: authorization_group_id,
|
|
138
|
+
additional_properties: additional_properties)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Validates an instance of the object from a given value.
|
|
142
|
+
# @param [FulfilledAirlineFare | Hash] The value against the validation is performed.
|
|
143
|
+
def self.validate(value)
|
|
144
|
+
if value.instance_of? self
|
|
145
|
+
return (
|
|
146
|
+
APIHelper.valid_type?(value.type,
|
|
147
|
+
->(val) { val.instance_of? String }) and
|
|
148
|
+
APIHelper.valid_type?(value.fulfillment_status,
|
|
149
|
+
->(val) { FulfillmentStatus.validate(val) }) and
|
|
150
|
+
APIHelper.valid_type?(value.title,
|
|
151
|
+
->(val) { val.instance_of? String }) and
|
|
152
|
+
APIHelper.valid_type?(value.sku,
|
|
153
|
+
->(val) { val.instance_of? String }) and
|
|
154
|
+
APIHelper.valid_type?(value.quantity,
|
|
155
|
+
->(val) { val.instance_of? Integer }) and
|
|
156
|
+
APIHelper.valid_type?(value.unit_price,
|
|
157
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
158
|
+
is_model_hash: true) and
|
|
159
|
+
APIHelper.valid_type?(value.total_price,
|
|
160
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
161
|
+
is_model_hash: true)
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
return false unless value.instance_of? Hash
|
|
166
|
+
|
|
167
|
+
(
|
|
168
|
+
APIHelper.valid_type?(value['type'],
|
|
169
|
+
->(val) { val.instance_of? String }) and
|
|
170
|
+
APIHelper.valid_type?(value['fulfillmentStatus'],
|
|
171
|
+
->(val) { FulfillmentStatus.validate(val) }) and
|
|
172
|
+
APIHelper.valid_type?(value['title'],
|
|
173
|
+
->(val) { val.instance_of? String }) and
|
|
174
|
+
APIHelper.valid_type?(value['sku'],
|
|
175
|
+
->(val) { val.instance_of? String }) and
|
|
176
|
+
APIHelper.valid_type?(value['quantity'],
|
|
177
|
+
->(val) { val.instance_of? Integer }) and
|
|
178
|
+
APIHelper.valid_type?(value['unitPrice'],
|
|
179
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
180
|
+
is_model_hash: true) and
|
|
181
|
+
APIHelper.valid_type?(value['totalPrice'],
|
|
182
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
183
|
+
is_model_hash: true)
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Provides a human-readable string representation of the object.
|
|
188
|
+
def to_s
|
|
189
|
+
class_name = self.class.name.split('::').last
|
|
190
|
+
"<#{class_name} type: #{@type}, fulfillment_status: #{@fulfillment_status},"\
|
|
191
|
+
" fulfilled_price: #{@fulfilled_price}, title: #{@title}, authorization_group_id:"\
|
|
192
|
+
" #{@authorization_group_id}, sku: #{@sku}, quantity: #{@quantity}, unit_price:"\
|
|
193
|
+
" #{@unit_price}, total_price: #{@total_price}, additional_properties:"\
|
|
194
|
+
" #{@additional_properties}>"
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
198
|
+
def inspect
|
|
199
|
+
class_name = self.class.name.split('::').last
|
|
200
|
+
"<#{class_name} type: #{@type.inspect}, fulfillment_status: #{@fulfillment_status.inspect},"\
|
|
201
|
+
" fulfilled_price: #{@fulfilled_price.inspect}, title: #{@title.inspect},"\
|
|
202
|
+
" authorization_group_id: #{@authorization_group_id.inspect}, sku: #{@sku.inspect},"\
|
|
203
|
+
" quantity: #{@quantity.inspect}, unit_price: #{@unit_price.inspect}, total_price:"\
|
|
204
|
+
" #{@total_price.inspect}, additional_properties: #{@additional_properties}>"
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
@@ -0,0 +1,207 @@
|
|
|
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
|
+
# Fulfilled auto rental.
|
|
8
|
+
class FulfilledAutoRental < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Discriminator used to identify the type of line item.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :type
|
|
15
|
+
|
|
16
|
+
# Result of the fulfillment.
|
|
17
|
+
# On `PARTIAL`, the amount that was fulfilled must be specified.
|
|
18
|
+
# @return [FulfillmentStatus]
|
|
19
|
+
attr_accessor :fulfillment_status
|
|
20
|
+
|
|
21
|
+
# Conditional property that should be sent if `fulfillmentStatus` is
|
|
22
|
+
# `PARTIAL`.
|
|
23
|
+
# `fulfilledPrice` must be less than or equal to original `price`.
|
|
24
|
+
# @return [Amount]
|
|
25
|
+
attr_accessor :fulfilled_price
|
|
26
|
+
|
|
27
|
+
# What should be shown as the title of the line item on a receipt or billing
|
|
28
|
+
# summary.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :title
|
|
31
|
+
|
|
32
|
+
# AuthorizationGroup that the line item should be part of for splitting
|
|
33
|
+
# authorizations for Aggregate Payments Payments.
|
|
34
|
+
# If this is set, there must be a matching AuthorizationGroup created in the
|
|
35
|
+
# PriceSummary.
|
|
36
|
+
# > NOTE: Items within a Bundle should not have an `authorizationGroupId`,
|
|
37
|
+
# they will use the same `authorizationGroupId` as the top-level bundle.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :authorization_group_id
|
|
40
|
+
|
|
41
|
+
# Stock Keeping Unit (SKU) is a product and service identification code for
|
|
42
|
+
# a specific product.
|
|
43
|
+
# @return [String]
|
|
44
|
+
attr_accessor :sku
|
|
45
|
+
|
|
46
|
+
# Stock Keeping Unit (SKU) is a product and service identification code for
|
|
47
|
+
# a specific product.
|
|
48
|
+
# @return [Integer]
|
|
49
|
+
attr_accessor :quantity
|
|
50
|
+
|
|
51
|
+
# An amount that is a nonnegative number, i.e. {0, 1, 2, 3, 4, 5,…}
|
|
52
|
+
# @return [NonNegativeAmount]
|
|
53
|
+
attr_accessor :unit_price
|
|
54
|
+
|
|
55
|
+
# Total Price for the line item. Should be equal to `unitPrice` *
|
|
56
|
+
# `quantity`, if `unitPrice` is specified.
|
|
57
|
+
# @return [NonNegativeAmount]
|
|
58
|
+
attr_accessor :total_price
|
|
59
|
+
|
|
60
|
+
# A mapping from model property names to API property names.
|
|
61
|
+
def self.names
|
|
62
|
+
@_hash = {} if @_hash.nil?
|
|
63
|
+
@_hash['type'] = 'type'
|
|
64
|
+
@_hash['fulfillment_status'] = 'fulfillmentStatus'
|
|
65
|
+
@_hash['fulfilled_price'] = 'fulfilledPrice'
|
|
66
|
+
@_hash['title'] = 'title'
|
|
67
|
+
@_hash['authorization_group_id'] = 'authorizationGroupId'
|
|
68
|
+
@_hash['sku'] = 'sku'
|
|
69
|
+
@_hash['quantity'] = 'quantity'
|
|
70
|
+
@_hash['unit_price'] = 'unitPrice'
|
|
71
|
+
@_hash['total_price'] = 'totalPrice'
|
|
72
|
+
@_hash
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# An array for optional fields
|
|
76
|
+
def self.optionals
|
|
77
|
+
%w[
|
|
78
|
+
fulfilled_price
|
|
79
|
+
authorization_group_id
|
|
80
|
+
]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# An array for nullable fields
|
|
84
|
+
def self.nullables
|
|
85
|
+
[]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def initialize(fulfillment_status:, title:, sku:, quantity: 1, unit_price:,
|
|
89
|
+
total_price:, fulfilled_price: SKIP,
|
|
90
|
+
authorization_group_id: SKIP, additional_properties: nil)
|
|
91
|
+
# Add additional model properties to the instance
|
|
92
|
+
additional_properties = {} if additional_properties.nil?
|
|
93
|
+
|
|
94
|
+
@type = 'AUTO_RENTAL'
|
|
95
|
+
@fulfillment_status = fulfillment_status
|
|
96
|
+
@fulfilled_price = fulfilled_price unless fulfilled_price == SKIP
|
|
97
|
+
@title = title
|
|
98
|
+
@authorization_group_id = authorization_group_id unless authorization_group_id == SKIP
|
|
99
|
+
@sku = sku
|
|
100
|
+
@quantity = quantity
|
|
101
|
+
@unit_price = unit_price
|
|
102
|
+
@total_price = total_price
|
|
103
|
+
@additional_properties = additional_properties
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Creates an instance of the object from a hash.
|
|
107
|
+
def self.from_hash(hash)
|
|
108
|
+
return nil unless hash
|
|
109
|
+
|
|
110
|
+
# Extract variables from the hash.
|
|
111
|
+
fulfillment_status =
|
|
112
|
+
hash.key?('fulfillmentStatus') ? hash['fulfillmentStatus'] : nil
|
|
113
|
+
title = hash.key?('title') ? hash['title'] : nil
|
|
114
|
+
sku = hash.key?('sku') ? hash['sku'] : nil
|
|
115
|
+
quantity = hash['quantity'] ||= 1
|
|
116
|
+
unit_price = NonNegativeAmount.from_hash(hash['unitPrice']) if hash['unitPrice']
|
|
117
|
+
total_price = NonNegativeAmount.from_hash(hash['totalPrice']) if hash['totalPrice']
|
|
118
|
+
fulfilled_price = Amount.from_hash(hash['fulfilledPrice']) if hash['fulfilledPrice']
|
|
119
|
+
authorization_group_id =
|
|
120
|
+
hash.key?('authorizationGroupId') ? hash['authorizationGroupId'] : SKIP
|
|
121
|
+
|
|
122
|
+
# Create a new hash for additional properties, removing known properties.
|
|
123
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
124
|
+
|
|
125
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
126
|
+
new_hash, proc { |value| value }
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Create object from extracted values.
|
|
130
|
+
FulfilledAutoRental.new(fulfillment_status: fulfillment_status,
|
|
131
|
+
title: title,
|
|
132
|
+
sku: sku,
|
|
133
|
+
quantity: quantity,
|
|
134
|
+
unit_price: unit_price,
|
|
135
|
+
total_price: total_price,
|
|
136
|
+
fulfilled_price: fulfilled_price,
|
|
137
|
+
authorization_group_id: authorization_group_id,
|
|
138
|
+
additional_properties: additional_properties)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Validates an instance of the object from a given value.
|
|
142
|
+
# @param [FulfilledAutoRental | Hash] The value against the validation is performed.
|
|
143
|
+
def self.validate(value)
|
|
144
|
+
if value.instance_of? self
|
|
145
|
+
return (
|
|
146
|
+
APIHelper.valid_type?(value.type,
|
|
147
|
+
->(val) { val.instance_of? String }) and
|
|
148
|
+
APIHelper.valid_type?(value.fulfillment_status,
|
|
149
|
+
->(val) { FulfillmentStatus.validate(val) }) and
|
|
150
|
+
APIHelper.valid_type?(value.title,
|
|
151
|
+
->(val) { val.instance_of? String }) and
|
|
152
|
+
APIHelper.valid_type?(value.sku,
|
|
153
|
+
->(val) { val.instance_of? String }) and
|
|
154
|
+
APIHelper.valid_type?(value.quantity,
|
|
155
|
+
->(val) { val.instance_of? Integer }) and
|
|
156
|
+
APIHelper.valid_type?(value.unit_price,
|
|
157
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
158
|
+
is_model_hash: true) and
|
|
159
|
+
APIHelper.valid_type?(value.total_price,
|
|
160
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
161
|
+
is_model_hash: true)
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
return false unless value.instance_of? Hash
|
|
166
|
+
|
|
167
|
+
(
|
|
168
|
+
APIHelper.valid_type?(value['type'],
|
|
169
|
+
->(val) { val.instance_of? String }) and
|
|
170
|
+
APIHelper.valid_type?(value['fulfillmentStatus'],
|
|
171
|
+
->(val) { FulfillmentStatus.validate(val) }) and
|
|
172
|
+
APIHelper.valid_type?(value['title'],
|
|
173
|
+
->(val) { val.instance_of? String }) and
|
|
174
|
+
APIHelper.valid_type?(value['sku'],
|
|
175
|
+
->(val) { val.instance_of? String }) and
|
|
176
|
+
APIHelper.valid_type?(value['quantity'],
|
|
177
|
+
->(val) { val.instance_of? Integer }) and
|
|
178
|
+
APIHelper.valid_type?(value['unitPrice'],
|
|
179
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
180
|
+
is_model_hash: true) and
|
|
181
|
+
APIHelper.valid_type?(value['totalPrice'],
|
|
182
|
+
->(val) { NonNegativeAmount.validate(val) },
|
|
183
|
+
is_model_hash: true)
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Provides a human-readable string representation of the object.
|
|
188
|
+
def to_s
|
|
189
|
+
class_name = self.class.name.split('::').last
|
|
190
|
+
"<#{class_name} type: #{@type}, fulfillment_status: #{@fulfillment_status},"\
|
|
191
|
+
" fulfilled_price: #{@fulfilled_price}, title: #{@title}, authorization_group_id:"\
|
|
192
|
+
" #{@authorization_group_id}, sku: #{@sku}, quantity: #{@quantity}, unit_price:"\
|
|
193
|
+
" #{@unit_price}, total_price: #{@total_price}, additional_properties:"\
|
|
194
|
+
" #{@additional_properties}>"
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
198
|
+
def inspect
|
|
199
|
+
class_name = self.class.name.split('::').last
|
|
200
|
+
"<#{class_name} type: #{@type.inspect}, fulfillment_status: #{@fulfillment_status.inspect},"\
|
|
201
|
+
" fulfilled_price: #{@fulfilled_price.inspect}, title: #{@title.inspect},"\
|
|
202
|
+
" authorization_group_id: #{@authorization_group_id.inspect}, sku: #{@sku.inspect},"\
|
|
203
|
+
" quantity: #{@quantity.inspect}, unit_price: #{@unit_price.inspect}, total_price:"\
|
|
204
|
+
" #{@total_price.inspect}, additional_properties: #{@additional_properties}>"
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|