tremendous_ruby 5.28.0 → 5.30.0
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 +4 -4
- data/lib/tremendous/api/tremendous_api.rb +55 -52
- data/lib/tremendous/api_client.rb +7 -3
- data/lib/tremendous/api_error.rb +1 -1
- data/lib/tremendous/api_model_base.rb +88 -0
- data/lib/tremendous/configuration.rb +1 -1
- data/lib/tremendous/models/allow_email.rb +2 -75
- data/lib/tremendous/models/allow_ip.rb +2 -75
- data/lib/tremendous/models/balance_transaction.rb +2 -75
- data/lib/tremendous/models/balance_transaction_order.rb +2 -75
- data/lib/tremendous/models/balance_transaction_order_payment.rb +2 -75
- data/lib/tremendous/models/base_order_for_create.rb +2 -75
- data/lib/tremendous/models/campaign.rb +4 -77
- data/lib/tremendous/models/campaign_base.rb +4 -77
- data/lib/tremendous/models/campaign_base_products_inner.rb +102 -0
- data/lib/tremendous/models/channel.rb +1 -1
- data/lib/tremendous/models/connected_organization.rb +2 -75
- data/lib/tremendous/models/connected_organization_member.rb +2 -75
- data/lib/tremendous/models/connected_organization_member_member.rb +2 -75
- data/lib/tremendous/models/connected_organization_member_response.rb +164 -0
- data/lib/tremendous/models/connected_organization_member_response_connected_organization_member.rb +273 -0
- data/lib/tremendous/models/connected_organization_member_session.rb +2 -75
- data/lib/tremendous/models/connected_organization_member_session_response.rb +164 -0
- data/lib/tremendous/models/connected_organization_member_session_response_connected_organization_member_session.rb +310 -0
- data/lib/tremendous/models/connected_organization_organization.rb +2 -75
- data/lib/tremendous/models/{generate_reward_link403_response.rb → connected_organization_response.rb} +20 -103
- data/lib/tremendous/models/connected_organization_response_connected_organization.rb +240 -0
- data/lib/tremendous/models/create_api_key200_response.rb +2 -75
- data/lib/tremendous/models/create_api_key_request.rb +2 -75
- data/lib/tremendous/models/create_campaign200_response.rb +2 -75
- data/lib/tremendous/models/create_campaign_request.rb +4 -77
- data/lib/tremendous/models/create_connected_organization200_response.rb +2 -75
- data/lib/tremendous/models/create_connected_organization_member200_response.rb +2 -75
- data/lib/tremendous/models/create_connected_organization_member_request.rb +2 -75
- data/lib/tremendous/models/create_connected_organization_member_session200_response.rb +2 -75
- data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +2 -75
- data/lib/tremendous/models/create_connected_organization_member_session_request.rb +2 -75
- data/lib/tremendous/models/create_connected_organization_request.rb +16 -76
- data/lib/tremendous/models/create_connected_organization_request_kyb_prefill.rb +15 -78
- data/lib/tremendous/models/create_field.rb +2 -75
- data/lib/tremendous/models/create_field200_response.rb +2 -75
- data/lib/tremendous/models/create_field_request.rb +2 -75
- data/lib/tremendous/models/create_field_request_data.rb +2 -75
- data/lib/tremendous/models/create_invoice200_response.rb +2 -75
- data/lib/tremendous/models/create_invoice_request.rb +4 -77
- data/lib/tremendous/models/create_member.rb +2 -75
- data/lib/tremendous/models/create_member200_response.rb +2 -75
- data/lib/tremendous/models/create_member_request.rb +2 -75
- data/lib/tremendous/models/create_order200_response.rb +2 -75
- data/lib/tremendous/models/create_order200_response_order.rb +3 -76
- data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +2 -75
- data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +2 -75
- data/lib/tremendous/models/create_order_request.rb +3 -4
- data/lib/tremendous/models/create_organization.rb +2 -75
- data/lib/tremendous/models/create_organization200_response.rb +2 -75
- data/lib/tremendous/models/create_organization200_response_organization.rb +2 -75
- data/lib/tremendous/models/create_organization_for_response.rb +2 -75
- data/lib/tremendous/models/create_organization_properties.rb +2 -75
- data/lib/tremendous/models/create_organization_request.rb +2 -75
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +2 -75
- data/lib/tremendous/models/create_organization_response.rb +147 -0
- data/lib/tremendous/models/create_organization_response_organization.rb +282 -0
- data/lib/tremendous/models/create_report200_response.rb +2 -75
- data/lib/tremendous/models/create_report200_response_report.rb +2 -75
- data/lib/tremendous/models/create_report_request.rb +2 -75
- data/lib/tremendous/models/create_report_request_filters.rb +2 -75
- data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +2 -75
- data/lib/tremendous/models/create_report_request_filters_digital_rewards_amount.rb +2 -75
- data/lib/tremendous/models/create_report_request_filters_digital_rewards_created_at.rb +2 -75
- data/lib/tremendous/models/create_topup200_response.rb +2 -75
- data/lib/tremendous/models/create_topup_request.rb +2 -75
- data/lib/tremendous/models/create_webhook200_response.rb +2 -75
- data/lib/tremendous/models/create_webhook_request.rb +2 -75
- data/lib/tremendous/models/currency_codes.rb +1 -1
- data/lib/tremendous/models/custom_field.rb +2 -75
- data/lib/tremendous/models/delivery_details.rb +2 -75
- data/lib/tremendous/models/delivery_details_with_link.rb +2 -75
- data/lib/tremendous/models/delivery_metadata.rb +2 -75
- data/lib/tremendous/models/delivery_method.rb +1 -1
- data/lib/tremendous/models/delivery_status.rb +1 -1
- data/lib/tremendous/models/error_model.rb +2 -75
- data/lib/tremendous/models/field.rb +2 -75
- data/lib/tremendous/models/fraud_config_allow_email.rb +2 -75
- data/lib/tremendous/models/fraud_config_country.rb +2 -75
- data/lib/tremendous/models/fraud_config_country_update_list.rb +2 -75
- data/lib/tremendous/models/fraud_config_ip.rb +2 -75
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +2 -75
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +2 -75
- data/lib/tremendous/models/fraud_config_review_email.rb +2 -75
- data/lib/tremendous/models/fraud_config_review_vpn.rb +2 -75
- data/lib/tremendous/models/fraud_generic_response.rb +2 -75
- data/lib/tremendous/models/fraud_review.rb +3 -76
- data/lib/tremendous/models/fraud_review_base.rb +3 -76
- data/lib/tremendous/models/fraud_review_geo.rb +2 -75
- data/lib/tremendous/models/fraud_review_list_item.rb +3 -76
- data/lib/tremendous/models/fraud_review_reason.rb +1 -1
- data/lib/tremendous/models/fraud_review_redemption_method.rb +1 -1
- data/lib/tremendous/models/fraud_review_related_rewards.rb +2 -75
- data/lib/tremendous/models/fraud_review_risk.rb +1 -1
- data/lib/tremendous/models/fraud_review_status.rb +1 -1
- data/lib/tremendous/models/fraud_rule200_response.rb +2 -75
- data/lib/tremendous/models/fraud_rule_request.rb +2 -75
- data/lib/tremendous/models/fraud_rule_request_config.rb +3 -4
- data/lib/tremendous/models/fraud_rule_type.rb +1 -1
- data/lib/tremendous/models/fraud_rules_list_item.rb +2 -75
- data/lib/tremendous/models/funding_source.rb +3 -76
- data/lib/tremendous/models/generate_reward_link200_response.rb +2 -75
- data/lib/tremendous/models/generate_reward_link200_response_reward.rb +2 -75
- data/lib/tremendous/models/get_fraud_review200_response.rb +2 -75
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +2 -75
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +2 -75
- data/lib/tremendous/models/get_funding_source200_response.rb +2 -75
- data/lib/tremendous/models/get_member200_response.rb +2 -75
- data/lib/tremendous/models/get_member200_response_member.rb +2 -75
- data/lib/tremendous/models/get_member200_response_member_events_inner.rb +2 -75
- data/lib/tremendous/models/get_order200_response.rb +2 -75
- data/lib/tremendous/models/get_organization200_response.rb +2 -75
- data/lib/tremendous/models/get_product_response.rb +2 -75
- data/lib/tremendous/models/get_reward200_response.rb +2 -75
- data/lib/tremendous/models/inline_object.rb +2 -75
- data/lib/tremendous/models/invoice.rb +4 -77
- data/lib/tremendous/models/invoice_response.rb +164 -0
- data/lib/tremendous/models/invoice_response_invoice.rb +370 -0
- data/lib/tremendous/models/list_balance_transactions200_response.rb +2 -75
- data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner.rb +2 -75
- data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order.rb +2 -75
- data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order_payment.rb +2 -75
- data/lib/tremendous/models/list_campaigns200_response.rb +2 -75
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +4 -77
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_auto_add_product_rule.rb +2 -75
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +2 -75
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_products_inner.rb +102 -0
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +2 -75
- data/lib/tremendous/models/list_connected_organization_members200_response.rb +2 -75
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner.rb +2 -75
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +2 -75
- data/lib/tremendous/models/list_connected_organizations200_response.rb +2 -75
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner.rb +2 -75
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +2 -75
- data/lib/tremendous/models/list_fields200_response.rb +2 -75
- data/lib/tremendous/models/list_fields200_response_fields_inner.rb +2 -75
- data/lib/tremendous/models/list_fields200_response_fields_inner_data.rb +2 -75
- data/lib/tremendous/models/list_forex_response.rb +2 -75
- data/lib/tremendous/models/list_fraud_reviews200_response.rb +2 -75
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +2 -75
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner_geo.rb +2 -75
- data/lib/tremendous/models/list_fraud_rules200_response.rb +2 -75
- data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +2 -75
- data/lib/tremendous/models/list_funding_sources200_response.rb +2 -75
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +3 -76
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +17 -78
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +2 -75
- data/lib/tremendous/models/list_invoices200_response.rb +2 -75
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +4 -77
- data/lib/tremendous/models/list_members200_response.rb +2 -75
- data/lib/tremendous/models/list_members200_response_members_inner.rb +2 -75
- data/lib/tremendous/models/list_orders200_response.rb +2 -75
- data/lib/tremendous/models/list_orders200_response_orders_inner.rb +3 -76
- data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +2 -75
- data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +2 -75
- data/lib/tremendous/models/list_organizations200_response.rb +2 -75
- data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +2 -75
- data/lib/tremendous/models/list_products_response.rb +2 -75
- data/lib/tremendous/models/list_products_response_products_inner.rb +4 -77
- data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +2 -75
- data/lib/tremendous/models/list_products_response_products_inner_documents.rb +2 -75
- data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +2 -75
- data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +61 -81
- data/lib/tremendous/models/list_rewards200_response.rb +2 -75
- data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +2 -75
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +2 -75
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +2 -75
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +2 -75
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +2 -75
- data/lib/tremendous/models/list_rewards401_response.rb +2 -75
- data/lib/tremendous/models/list_rewards401_response_errors.rb +2 -75
- data/lib/tremendous/models/list_roles200_response.rb +2 -75
- data/lib/tremendous/models/list_roles200_response_roles_inner.rb +2 -75
- data/lib/tremendous/models/list_topups200_response.rb +2 -75
- data/lib/tremendous/models/list_topups200_response_topups_inner.rb +3 -76
- data/lib/tremendous/models/list_webhook_events200_response.rb +2 -75
- data/lib/tremendous/models/list_webhooks200_response.rb +2 -75
- data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +2 -75
- data/lib/tremendous/models/member.rb +2 -75
- data/lib/tremendous/models/member_base.rb +2 -75
- data/lib/tremendous/models/member_with_events.rb +2 -75
- data/lib/tremendous/models/member_without_events.rb +2 -75
- data/lib/tremendous/models/{fraud_rule400_response.rb → member_without_events_response.rb} +20 -103
- data/lib/tremendous/models/member_without_events_response_member.rb +311 -0
- data/lib/tremendous/models/order.rb +4 -77
- data/lib/tremendous/models/order_base.rb +3 -76
- data/lib/tremendous/models/order_base_payment.rb +2 -75
- data/lib/tremendous/models/order_status.rb +1 -1
- data/lib/tremendous/models/order_with_link.rb +3 -76
- data/lib/tremendous/models/order_with_link_rewards_inner.rb +2 -75
- data/lib/tremendous/models/order_without_link.rb +4 -77
- data/lib/tremendous/models/organization.rb +2 -75
- data/lib/tremendous/models/organization_response.rb +147 -0
- data/lib/tremendous/models/organization_response_organization.rb +285 -0
- data/lib/tremendous/models/payment_details.rb +2 -75
- data/lib/tremendous/models/payment_details_refund.rb +2 -75
- data/lib/tremendous/models/payout.rb +2 -75
- data/lib/tremendous/models/product.rb +4 -77
- data/lib/tremendous/models/product_documents.rb +2 -75
- data/lib/tremendous/models/recipient.rb +2 -75
- data/lib/tremendous/models/refund_details.rb +2 -75
- data/lib/tremendous/models/report.rb +2 -75
- data/lib/tremendous/models/{delete_fraud_rule200_response.rb → report_response.rb} +25 -89
- data/lib/tremendous/models/resend_reward_request.rb +2 -75
- data/lib/tremendous/models/review_country.rb +2 -75
- data/lib/tremendous/models/review_country1.rb +2 -75
- data/lib/tremendous/models/review_email.rb +2 -75
- data/lib/tremendous/models/review_ip.rb +2 -75
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +2 -75
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +2 -75
- data/lib/tremendous/models/review_vpn.rb +2 -75
- data/lib/tremendous/models/reward.rb +2 -75
- data/lib/tremendous/models/reward_base.rb +2 -75
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +2 -75
- data/lib/tremendous/models/reward_for_order_create.rb +2 -75
- data/lib/tremendous/models/reward_link.rb +2 -75
- data/lib/tremendous/models/{inline_object1.rb → reward_link_response.rb} +5 -78
- data/lib/tremendous/models/reward_link_response_reward.rb +180 -0
- data/lib/tremendous/models/reward_response.rb +164 -0
- data/lib/tremendous/models/{order_without_link_rewards_inner.rb → reward_response_reward.rb} +4 -77
- data/lib/tremendous/models/reward_token.rb +2 -75
- data/lib/tremendous/models/reward_token_response.rb +164 -0
- data/lib/tremendous/models/{inline_object1_reward.rb → reward_token_response_reward.rb} +4 -77
- data/lib/tremendous/models/reward_value.rb +2 -75
- data/lib/tremendous/models/reward_with_link.rb +2 -75
- data/lib/tremendous/models/reward_with_link_delivery.rb +2 -75
- data/lib/tremendous/models/reward_without_link.rb +2 -75
- data/lib/tremendous/models/reward_without_link_delivery.rb +2 -75
- data/lib/tremendous/models/role.rb +2 -75
- data/lib/tremendous/models/simulate_webhook_request.rb +2 -75
- data/lib/tremendous/models/single_reward_order.rb +2 -75
- data/lib/tremendous/models/single_reward_order_payment.rb +3 -76
- data/lib/tremendous/models/single_reward_order_reward.rb +2 -75
- data/lib/tremendous/models/single_reward_order_reward_custom_fields_inner.rb +2 -75
- data/lib/tremendous/models/single_reward_order_reward_delivery.rb +2 -75
- data/lib/tremendous/models/single_reward_order_reward_delivery_meta.rb +2 -75
- data/lib/tremendous/models/single_reward_order_with_link.rb +2 -75
- data/lib/tremendous/models/single_reward_order_with_link_order.rb +3 -76
- data/lib/tremendous/models/single_reward_order_without_link.rb +2 -75
- data/lib/tremendous/models/single_reward_order_without_link_order.rb +4 -77
- data/lib/tremendous/models/topup.rb +3 -76
- data/lib/tremendous/models/topup_create_request.rb +2 -75
- data/lib/tremendous/models/topup_response.rb +147 -0
- data/lib/tremendous/models/update_campaign.rb +4 -77
- data/lib/tremendous/models/update_campaign_request.rb +4 -77
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +2 -75
- data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +7 -8
- data/lib/tremendous/models/update_member.rb +2 -75
- data/lib/tremendous/models/update_member_request.rb +2 -75
- data/lib/tremendous/models/webhook.rb +2 -75
- data/lib/tremendous/models/webhook_post.rb +2 -75
- data/lib/tremendous/models/webhook_response.rb +147 -0
- data/lib/tremendous/models/{update_fraud_rule_list200_response.rb → webhook_response_webhook.rb} +47 -94
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +28 -15
- metadata +28 -15
- data/lib/tremendous/models/allow_email1.rb +0 -250
- data/lib/tremendous/models/allow_ip1.rb +0 -250
- data/lib/tremendous/models/fraud_rule422_response.rb +0 -247
- data/lib/tremendous/models/list_rewards429_response.rb +0 -247
- data/lib/tremendous/models/resend_reward422_response.rb +0 -247
- data/lib/tremendous/models/review_email1.rb +0 -255
- data/lib/tremendous/models/review_ip1.rb +0 -250
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 2
|
|
7
7
|
Contact: developers@tremendous.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.25.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# Invoices are instruments to fund your Tremendous account's balance. Invoices can be created by your organization programatically. Once we receive your payment, the invoice is marked as `PAID` and we add the respective funds to your account's balance.
|
|
18
|
-
class Invoice
|
|
18
|
+
class Invoice < ApiModelBase
|
|
19
19
|
# The invoice number
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -227,9 +227,9 @@ module Tremendous
|
|
|
227
227
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
228
228
|
return false if @id.nil?
|
|
229
229
|
return false if @amount.nil?
|
|
230
|
-
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP"])
|
|
230
|
+
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP", "CAD"])
|
|
231
231
|
return false unless currency_code_validator.valid?(@currency_code)
|
|
232
|
-
currency_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP"])
|
|
232
|
+
currency_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP", "CAD"])
|
|
233
233
|
return false unless currency_validator.valid?(@currency)
|
|
234
234
|
return false if @status.nil?
|
|
235
235
|
status_validator = EnumAttributeValidator.new('String', ["DELETED", "PAID", "OPEN", "MARKED_AS_PAID"])
|
|
@@ -349,61 +349,6 @@ module Tremendous
|
|
|
349
349
|
new(transformed_hash)
|
|
350
350
|
end
|
|
351
351
|
|
|
352
|
-
# Deserializes the data based on type
|
|
353
|
-
# @param string type Data type
|
|
354
|
-
# @param string value Value to be deserialized
|
|
355
|
-
# @return [Object] Deserialized data
|
|
356
|
-
def self._deserialize(type, value)
|
|
357
|
-
case type.to_sym
|
|
358
|
-
when :Time
|
|
359
|
-
Time.parse(value)
|
|
360
|
-
when :Date
|
|
361
|
-
Date.parse(value)
|
|
362
|
-
when :String
|
|
363
|
-
value.to_s
|
|
364
|
-
when :Integer
|
|
365
|
-
value.to_i
|
|
366
|
-
when :Float
|
|
367
|
-
value.to_f
|
|
368
|
-
when :Boolean
|
|
369
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
370
|
-
true
|
|
371
|
-
else
|
|
372
|
-
false
|
|
373
|
-
end
|
|
374
|
-
when :Object
|
|
375
|
-
# generic object (usually a Hash), return directly
|
|
376
|
-
value
|
|
377
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
378
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
379
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
380
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
381
|
-
k_type = Regexp.last_match[:k_type]
|
|
382
|
-
v_type = Regexp.last_match[:v_type]
|
|
383
|
-
{}.tap do |hash|
|
|
384
|
-
value.each do |k, v|
|
|
385
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
386
|
-
end
|
|
387
|
-
end
|
|
388
|
-
else # model
|
|
389
|
-
# models (e.g. Pet) or oneOf
|
|
390
|
-
klass = Tremendous.const_get(type)
|
|
391
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
392
|
-
end
|
|
393
|
-
end
|
|
394
|
-
|
|
395
|
-
# Returns the string representation of the object
|
|
396
|
-
# @return [String] String presentation of the object
|
|
397
|
-
def to_s
|
|
398
|
-
to_hash.to_s
|
|
399
|
-
end
|
|
400
|
-
|
|
401
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
402
|
-
# @return [Hash] Returns the object in the form of hash
|
|
403
|
-
def to_body
|
|
404
|
-
to_hash
|
|
405
|
-
end
|
|
406
|
-
|
|
407
352
|
# Returns the object in the form of hash
|
|
408
353
|
# @return [Hash] Returns the object in the form of hash
|
|
409
354
|
def to_hash
|
|
@@ -420,24 +365,6 @@ module Tremendous
|
|
|
420
365
|
hash
|
|
421
366
|
end
|
|
422
367
|
|
|
423
|
-
# Outputs non-array value in the form of hash
|
|
424
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
425
|
-
# @param [Object] value Any valid value
|
|
426
|
-
# @return [Hash] Returns the value in the form of hash
|
|
427
|
-
def _to_hash(value)
|
|
428
|
-
if value.is_a?(Array)
|
|
429
|
-
value.compact.map { |v| _to_hash(v) }
|
|
430
|
-
elsif value.is_a?(Hash)
|
|
431
|
-
{}.tap do |hash|
|
|
432
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
433
|
-
end
|
|
434
|
-
elsif value.respond_to? :to_hash
|
|
435
|
-
value.to_hash
|
|
436
|
-
else
|
|
437
|
-
value
|
|
438
|
-
end
|
|
439
|
-
end
|
|
440
|
-
|
|
441
368
|
end
|
|
442
369
|
|
|
443
370
|
end
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
class InvoiceResponse < ApiModelBase
|
|
18
|
+
attr_accessor :invoice
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'invoice' => :'invoice'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'invoice' => :'InvoiceResponseInvoice'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::InvoiceResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::InvoiceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'invoice')
|
|
67
|
+
self.invoice = attributes[:'invoice']
|
|
68
|
+
else
|
|
69
|
+
self.invoice = nil
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @invoice.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "invoice", invoice cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
+
return false if @invoice.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] invoice Value to be assigned
|
|
95
|
+
def invoice=(invoice)
|
|
96
|
+
if invoice.nil?
|
|
97
|
+
fail ArgumentError, 'invoice cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@invoice = invoice
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
invoice == o.invoice
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see the `==` method
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def eql?(o)
|
|
114
|
+
self == o
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Calculates hash code according to all attributes.
|
|
118
|
+
# @return [Integer] Hash code
|
|
119
|
+
def hash
|
|
120
|
+
[invoice].hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def self.build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
transformed_hash = {}
|
|
130
|
+
openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = nil
|
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
134
|
+
# check to ensure the input is an array given that the attribute
|
|
135
|
+
# is documented as an array but the input is not
|
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
new(transformed_hash)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the object in the form of hash
|
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
|
148
|
+
def to_hash
|
|
149
|
+
hash = {}
|
|
150
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
151
|
+
value = self.send(attr)
|
|
152
|
+
if value.nil?
|
|
153
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
154
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
hash[param] = _to_hash(value)
|
|
158
|
+
end
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
# Invoices are instruments to fund your Tremendous account's balance. Invoices can be created by your organization programatically. Once we receive your payment, the invoice is marked as `PAID` and we add the respective funds to your account's balance.
|
|
18
|
+
class InvoiceResponseInvoice < ApiModelBase
|
|
19
|
+
# The invoice number
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Reference to the purchase order number within your organization
|
|
23
|
+
attr_accessor :po_number
|
|
24
|
+
|
|
25
|
+
# Amount of the invoice
|
|
26
|
+
attr_accessor :amount
|
|
27
|
+
|
|
28
|
+
# Currency of the invoice
|
|
29
|
+
attr_accessor :currency_code
|
|
30
|
+
|
|
31
|
+
# Deprecated: Use `currency_code` instead.
|
|
32
|
+
attr_accessor :currency
|
|
33
|
+
|
|
34
|
+
attr_accessor :international
|
|
35
|
+
|
|
36
|
+
# Status of this invoice <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>DELETED</code></td> <td>Invoice has been deleted by your organization</td> </tr> <tr> <td><code>PAID</code></td> <td>Invoice has been paid by your organization</td> </tr> <tr> <td><code>OPEN</code></td> <td>Invoice has been created by your organization but has not been paid, yet</td> </tr> </tbody> </table>
|
|
37
|
+
attr_accessor :status
|
|
38
|
+
|
|
39
|
+
# List of orders related to the invoice (it doesn't apply to prefunding)
|
|
40
|
+
attr_accessor :orders
|
|
41
|
+
|
|
42
|
+
# List of rewards related to the invoice (it doesn't apply to prefunding)
|
|
43
|
+
attr_accessor :rewards
|
|
44
|
+
|
|
45
|
+
# Timestamp of when the invoice has been created.
|
|
46
|
+
attr_accessor :created_at
|
|
47
|
+
|
|
48
|
+
# Timestamp of when the invoice has been paid.
|
|
49
|
+
attr_accessor :paid_at
|
|
50
|
+
|
|
51
|
+
class EnumAttributeValidator
|
|
52
|
+
attr_reader :datatype
|
|
53
|
+
attr_reader :allowable_values
|
|
54
|
+
|
|
55
|
+
def initialize(datatype, allowable_values)
|
|
56
|
+
@allowable_values = allowable_values.map do |value|
|
|
57
|
+
case datatype.to_s
|
|
58
|
+
when /Integer/i
|
|
59
|
+
value.to_i
|
|
60
|
+
when /Float/i
|
|
61
|
+
value.to_f
|
|
62
|
+
else
|
|
63
|
+
value
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def valid?(value)
|
|
69
|
+
!value || allowable_values.include?(value)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
74
|
+
def self.attribute_map
|
|
75
|
+
{
|
|
76
|
+
:'id' => :'id',
|
|
77
|
+
:'po_number' => :'po_number',
|
|
78
|
+
:'amount' => :'amount',
|
|
79
|
+
:'currency_code' => :'currency_code',
|
|
80
|
+
:'currency' => :'currency',
|
|
81
|
+
:'international' => :'international',
|
|
82
|
+
:'status' => :'status',
|
|
83
|
+
:'orders' => :'orders',
|
|
84
|
+
:'rewards' => :'rewards',
|
|
85
|
+
:'created_at' => :'created_at',
|
|
86
|
+
:'paid_at' => :'paid_at'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Returns attribute mapping this model knows about
|
|
91
|
+
def self.acceptable_attribute_map
|
|
92
|
+
attribute_map
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Returns all the JSON keys this model knows about
|
|
96
|
+
def self.acceptable_attributes
|
|
97
|
+
acceptable_attribute_map.values
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Attribute type mapping.
|
|
101
|
+
def self.openapi_types
|
|
102
|
+
{
|
|
103
|
+
:'id' => :'String',
|
|
104
|
+
:'po_number' => :'String',
|
|
105
|
+
:'amount' => :'Float',
|
|
106
|
+
:'currency_code' => :'String',
|
|
107
|
+
:'currency' => :'String',
|
|
108
|
+
:'international' => :'Boolean',
|
|
109
|
+
:'status' => :'String',
|
|
110
|
+
:'orders' => :'Array<String>',
|
|
111
|
+
:'rewards' => :'Array<String>',
|
|
112
|
+
:'created_at' => :'Time',
|
|
113
|
+
:'paid_at' => :'Time'
|
|
114
|
+
}
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# List of attributes with nullable: true
|
|
118
|
+
def self.openapi_nullable
|
|
119
|
+
Set.new([
|
|
120
|
+
:'po_number',
|
|
121
|
+
:'paid_at'
|
|
122
|
+
])
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Initializes the object
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
def initialize(attributes = {})
|
|
128
|
+
if (!attributes.is_a?(Hash))
|
|
129
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::InvoiceResponseInvoice` initialize method"
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
133
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
134
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
135
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
136
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::InvoiceResponseInvoice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
137
|
+
end
|
|
138
|
+
h[k.to_sym] = v
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'id')
|
|
142
|
+
self.id = attributes[:'id']
|
|
143
|
+
else
|
|
144
|
+
self.id = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'po_number')
|
|
148
|
+
self.po_number = attributes[:'po_number']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'amount')
|
|
152
|
+
self.amount = attributes[:'amount']
|
|
153
|
+
else
|
|
154
|
+
self.amount = nil
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'currency_code')
|
|
158
|
+
self.currency_code = attributes[:'currency_code']
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'currency')
|
|
162
|
+
self.currency = attributes[:'currency']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'international')
|
|
166
|
+
self.international = attributes[:'international']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'status')
|
|
170
|
+
self.status = attributes[:'status']
|
|
171
|
+
else
|
|
172
|
+
self.status = nil
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'orders')
|
|
176
|
+
if (value = attributes[:'orders']).is_a?(Array)
|
|
177
|
+
self.orders = value
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'rewards')
|
|
182
|
+
if (value = attributes[:'rewards']).is_a?(Array)
|
|
183
|
+
self.rewards = value
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'created_at')
|
|
188
|
+
self.created_at = attributes[:'created_at']
|
|
189
|
+
else
|
|
190
|
+
self.created_at = nil
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'paid_at')
|
|
194
|
+
self.paid_at = attributes[:'paid_at']
|
|
195
|
+
else
|
|
196
|
+
self.paid_at = nil
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
201
|
+
# @return Array for valid properties with the reasons
|
|
202
|
+
def list_invalid_properties
|
|
203
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
204
|
+
invalid_properties = Array.new
|
|
205
|
+
if @id.nil?
|
|
206
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if @amount.nil?
|
|
210
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if @status.nil?
|
|
214
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if @created_at.nil?
|
|
218
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
invalid_properties
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Check to see if the all the properties in the model are valid
|
|
225
|
+
# @return true if the model is valid
|
|
226
|
+
def valid?
|
|
227
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
228
|
+
return false if @id.nil?
|
|
229
|
+
return false if @amount.nil?
|
|
230
|
+
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP", "CAD"])
|
|
231
|
+
return false unless currency_code_validator.valid?(@currency_code)
|
|
232
|
+
currency_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP", "CAD"])
|
|
233
|
+
return false unless currency_validator.valid?(@currency)
|
|
234
|
+
return false if @status.nil?
|
|
235
|
+
status_validator = EnumAttributeValidator.new('String', ["DELETED", "PAID", "OPEN", "MARKED_AS_PAID"])
|
|
236
|
+
return false unless status_validator.valid?(@status)
|
|
237
|
+
return false if @created_at.nil?
|
|
238
|
+
true
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] id Value to be assigned
|
|
243
|
+
def id=(id)
|
|
244
|
+
if id.nil?
|
|
245
|
+
fail ArgumentError, 'id cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
@id = id
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] amount Value to be assigned
|
|
253
|
+
def amount=(amount)
|
|
254
|
+
if amount.nil?
|
|
255
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@amount = amount
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
262
|
+
# so that enum values added to the API don't break deserialization on
|
|
263
|
+
# older versions of this gem.
|
|
264
|
+
# @param [Object] currency_code Object to be assigned
|
|
265
|
+
def currency_code=(currency_code)
|
|
266
|
+
@currency_code = currency_code
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
270
|
+
# so that enum values added to the API don't break deserialization on
|
|
271
|
+
# older versions of this gem.
|
|
272
|
+
# @param [Object] currency Object to be assigned
|
|
273
|
+
def currency=(currency)
|
|
274
|
+
@currency = currency
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
278
|
+
# so that enum values added to the API don't break deserialization on
|
|
279
|
+
# older versions of this gem.
|
|
280
|
+
# @param [Object] status Object to be assigned
|
|
281
|
+
def status=(status)
|
|
282
|
+
if status.nil?
|
|
283
|
+
fail ArgumentError, 'status cannot be nil'
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
@status = status
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Custom attribute writer method with validation
|
|
290
|
+
# @param [Object] created_at Value to be assigned
|
|
291
|
+
def created_at=(created_at)
|
|
292
|
+
if created_at.nil?
|
|
293
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
@created_at = created_at
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Checks equality by comparing each attribute.
|
|
300
|
+
# @param [Object] Object to be compared
|
|
301
|
+
def ==(o)
|
|
302
|
+
return true if self.equal?(o)
|
|
303
|
+
self.class == o.class &&
|
|
304
|
+
id == o.id &&
|
|
305
|
+
po_number == o.po_number &&
|
|
306
|
+
amount == o.amount &&
|
|
307
|
+
currency_code == o.currency_code &&
|
|
308
|
+
currency == o.currency &&
|
|
309
|
+
international == o.international &&
|
|
310
|
+
status == o.status &&
|
|
311
|
+
orders == o.orders &&
|
|
312
|
+
rewards == o.rewards &&
|
|
313
|
+
created_at == o.created_at &&
|
|
314
|
+
paid_at == o.paid_at
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# @see the `==` method
|
|
318
|
+
# @param [Object] Object to be compared
|
|
319
|
+
def eql?(o)
|
|
320
|
+
self == o
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Calculates hash code according to all attributes.
|
|
324
|
+
# @return [Integer] Hash code
|
|
325
|
+
def hash
|
|
326
|
+
[id, po_number, amount, currency_code, currency, international, status, orders, rewards, created_at, paid_at].hash
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Builds the object from hash
|
|
330
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
331
|
+
# @return [Object] Returns the model itself
|
|
332
|
+
def self.build_from_hash(attributes)
|
|
333
|
+
return nil unless attributes.is_a?(Hash)
|
|
334
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
335
|
+
transformed_hash = {}
|
|
336
|
+
openapi_types.each_pair do |key, type|
|
|
337
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
338
|
+
transformed_hash["#{key}"] = nil
|
|
339
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
340
|
+
# check to ensure the input is an array given that the attribute
|
|
341
|
+
# is documented as an array but the input is not
|
|
342
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
343
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
344
|
+
end
|
|
345
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
346
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
new(transformed_hash)
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Returns the object in the form of hash
|
|
353
|
+
# @return [Hash] Returns the object in the form of hash
|
|
354
|
+
def to_hash
|
|
355
|
+
hash = {}
|
|
356
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
357
|
+
value = self.send(attr)
|
|
358
|
+
if value.nil?
|
|
359
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
360
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
hash[param] = _to_hash(value)
|
|
364
|
+
end
|
|
365
|
+
hash
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
end
|