tremendous_ruby 5.29.0 → 6.0.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 +52 -49
- 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 +13 -76
- 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 +3 -76
- data/lib/tremendous/models/create_connected_organization_request_kyb_prefill.rb +13 -76
- 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 +3 -76
- 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 +2 -3
- 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 +5 -78
- data/lib/tremendous/models/fraud_review_base.rb +5 -78
- data/lib/tremendous/models/fraud_review_geo.rb +2 -75
- data/lib/tremendous/models/fraud_review_list_item.rb +5 -78
- data/lib/tremendous/models/fraud_review_reason.rb +7 -2
- data/lib/tremendous/models/fraud_review_redemption_method.rb +6 -2
- 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 +4 -77
- 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 +13 -76
- 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 +4 -77
- 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 +4 -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 +5 -78
- 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 +3 -76
- 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 +3 -76
- 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 +3 -76
- 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 +5 -78
- 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 +3 -76
- data/lib/tremendous/models/reward_base.rb +3 -76
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +2 -75
- data/lib/tremendous/models/reward_for_order_create.rb +3 -76
- 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} +5 -78
- 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 +3 -76
- data/lib/tremendous/models/reward_with_link.rb +3 -76
- data/lib/tremendous/models/reward_with_link_delivery.rb +2 -75
- data/lib/tremendous/models/reward_without_link.rb +3 -76
- 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 +2 -75
- data/lib/tremendous/models/single_reward_order_reward.rb +3 -76
- 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 +29 -16
- 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
|
# Organizations are a way to separate different parts of your business within the same Tremendous account. Your root Tremendous account is an organization itself and can have multiple sub-organizations. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. Each organizations can have it's own API key.
|
|
18
|
-
class Organization
|
|
18
|
+
class Organization < ApiModelBase
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
21
|
# Name of the organization
|
|
@@ -264,61 +264,6 @@ module Tremendous
|
|
|
264
264
|
new(transformed_hash)
|
|
265
265
|
end
|
|
266
266
|
|
|
267
|
-
# Deserializes the data based on type
|
|
268
|
-
# @param string type Data type
|
|
269
|
-
# @param string value Value to be deserialized
|
|
270
|
-
# @return [Object] Deserialized data
|
|
271
|
-
def self._deserialize(type, value)
|
|
272
|
-
case type.to_sym
|
|
273
|
-
when :Time
|
|
274
|
-
Time.parse(value)
|
|
275
|
-
when :Date
|
|
276
|
-
Date.parse(value)
|
|
277
|
-
when :String
|
|
278
|
-
value.to_s
|
|
279
|
-
when :Integer
|
|
280
|
-
value.to_i
|
|
281
|
-
when :Float
|
|
282
|
-
value.to_f
|
|
283
|
-
when :Boolean
|
|
284
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
285
|
-
true
|
|
286
|
-
else
|
|
287
|
-
false
|
|
288
|
-
end
|
|
289
|
-
when :Object
|
|
290
|
-
# generic object (usually a Hash), return directly
|
|
291
|
-
value
|
|
292
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
293
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
294
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
295
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
296
|
-
k_type = Regexp.last_match[:k_type]
|
|
297
|
-
v_type = Regexp.last_match[:v_type]
|
|
298
|
-
{}.tap do |hash|
|
|
299
|
-
value.each do |k, v|
|
|
300
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
301
|
-
end
|
|
302
|
-
end
|
|
303
|
-
else # model
|
|
304
|
-
# models (e.g. Pet) or oneOf
|
|
305
|
-
klass = Tremendous.const_get(type)
|
|
306
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
307
|
-
end
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
# Returns the string representation of the object
|
|
311
|
-
# @return [String] String presentation of the object
|
|
312
|
-
def to_s
|
|
313
|
-
to_hash.to_s
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
317
|
-
# @return [Hash] Returns the object in the form of hash
|
|
318
|
-
def to_body
|
|
319
|
-
to_hash
|
|
320
|
-
end
|
|
321
|
-
|
|
322
267
|
# Returns the object in the form of hash
|
|
323
268
|
# @return [Hash] Returns the object in the form of hash
|
|
324
269
|
def to_hash
|
|
@@ -335,24 +280,6 @@ module Tremendous
|
|
|
335
280
|
hash
|
|
336
281
|
end
|
|
337
282
|
|
|
338
|
-
# Outputs non-array value in the form of hash
|
|
339
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
340
|
-
# @param [Object] value Any valid value
|
|
341
|
-
# @return [Hash] Returns the value in the form of hash
|
|
342
|
-
def _to_hash(value)
|
|
343
|
-
if value.is_a?(Array)
|
|
344
|
-
value.compact.map { |v| _to_hash(v) }
|
|
345
|
-
elsif value.is_a?(Hash)
|
|
346
|
-
{}.tap do |hash|
|
|
347
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
348
|
-
end
|
|
349
|
-
elsif value.respond_to? :to_hash
|
|
350
|
-
value.to_hash
|
|
351
|
-
else
|
|
352
|
-
value
|
|
353
|
-
end
|
|
354
|
-
end
|
|
355
|
-
|
|
356
283
|
end
|
|
357
284
|
|
|
358
285
|
end
|
|
@@ -0,0 +1,147 @@
|
|
|
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 OrganizationResponse < ApiModelBase
|
|
18
|
+
attr_accessor :organization
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'organization' => :'organization'
|
|
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
|
+
:'organization' => :'OrganizationResponseOrganization'
|
|
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::OrganizationResponse` 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::OrganizationResponse`. 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?(:'organization')
|
|
67
|
+
self.organization = attributes[:'organization']
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
72
|
+
# @return Array for valid properties with the reasons
|
|
73
|
+
def list_invalid_properties
|
|
74
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
75
|
+
invalid_properties = Array.new
|
|
76
|
+
invalid_properties
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Check to see if the all the properties in the model are valid
|
|
80
|
+
# @return true if the model is valid
|
|
81
|
+
def valid?
|
|
82
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
83
|
+
true
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Checks equality by comparing each attribute.
|
|
87
|
+
# @param [Object] Object to be compared
|
|
88
|
+
def ==(o)
|
|
89
|
+
return true if self.equal?(o)
|
|
90
|
+
self.class == o.class &&
|
|
91
|
+
organization == o.organization
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# @see the `==` method
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def eql?(o)
|
|
97
|
+
self == o
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Calculates hash code according to all attributes.
|
|
101
|
+
# @return [Integer] Hash code
|
|
102
|
+
def hash
|
|
103
|
+
[organization].hash
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Builds the object from hash
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
# @return [Object] Returns the model itself
|
|
109
|
+
def self.build_from_hash(attributes)
|
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
|
111
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
112
|
+
transformed_hash = {}
|
|
113
|
+
openapi_types.each_pair do |key, type|
|
|
114
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
115
|
+
transformed_hash["#{key}"] = nil
|
|
116
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
117
|
+
# check to ensure the input is an array given that the attribute
|
|
118
|
+
# is documented as an array but the input is not
|
|
119
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
120
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
121
|
+
end
|
|
122
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
123
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
new(transformed_hash)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Returns the object in the form of hash
|
|
130
|
+
# @return [Hash] Returns the object in the form of hash
|
|
131
|
+
def to_hash
|
|
132
|
+
hash = {}
|
|
133
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
134
|
+
value = self.send(attr)
|
|
135
|
+
if value.nil?
|
|
136
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
137
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
hash[param] = _to_hash(value)
|
|
141
|
+
end
|
|
142
|
+
hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
end
|
|
@@ -0,0 +1,285 @@
|
|
|
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
|
+
# Organizations are a way to separate different parts of your business within the same Tremendous account. Your root Tremendous account is an organization itself and can have multiple sub-organizations. You can assign users in your Tremendous team as members to any organization. Users can be members of multiple organizations at once. Each organizations can have it's own API key.
|
|
18
|
+
class OrganizationResponseOrganization < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Name of the organization
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# URL of the website of that organization
|
|
25
|
+
attr_accessor :website
|
|
26
|
+
|
|
27
|
+
# Currency used for this organization's balances, orders, and transactions.
|
|
28
|
+
attr_accessor :currency_code
|
|
29
|
+
|
|
30
|
+
# Status of the organization. Organizations need to be approved to be able to use them to send out rewards.
|
|
31
|
+
attr_accessor :status
|
|
32
|
+
|
|
33
|
+
# Timestamp of when the organization has been created. *This field is only returned when creating an organization.* It is not returned anymore when retrieving or listing organizations.
|
|
34
|
+
attr_accessor :created_at
|
|
35
|
+
|
|
36
|
+
class EnumAttributeValidator
|
|
37
|
+
attr_reader :datatype
|
|
38
|
+
attr_reader :allowable_values
|
|
39
|
+
|
|
40
|
+
def initialize(datatype, allowable_values)
|
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
|
42
|
+
case datatype.to_s
|
|
43
|
+
when /Integer/i
|
|
44
|
+
value.to_i
|
|
45
|
+
when /Float/i
|
|
46
|
+
value.to_f
|
|
47
|
+
else
|
|
48
|
+
value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def valid?(value)
|
|
54
|
+
!value || allowable_values.include?(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'id' => :'id',
|
|
62
|
+
:'name' => :'name',
|
|
63
|
+
:'website' => :'website',
|
|
64
|
+
:'currency_code' => :'currency_code',
|
|
65
|
+
:'status' => :'status',
|
|
66
|
+
:'created_at' => :'created_at'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns attribute mapping this model knows about
|
|
71
|
+
def self.acceptable_attribute_map
|
|
72
|
+
attribute_map
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
|
76
|
+
def self.acceptable_attributes
|
|
77
|
+
acceptable_attribute_map.values
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Attribute type mapping.
|
|
81
|
+
def self.openapi_types
|
|
82
|
+
{
|
|
83
|
+
:'id' => :'String',
|
|
84
|
+
:'name' => :'String',
|
|
85
|
+
:'website' => :'String',
|
|
86
|
+
:'currency_code' => :'String',
|
|
87
|
+
:'status' => :'String',
|
|
88
|
+
:'created_at' => :'Date'
|
|
89
|
+
}
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# List of attributes with nullable: true
|
|
93
|
+
def self.openapi_nullable
|
|
94
|
+
Set.new([
|
|
95
|
+
])
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
if (!attributes.is_a?(Hash))
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::OrganizationResponseOrganization` initialize method"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::OrganizationResponseOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'id')
|
|
115
|
+
self.id = attributes[:'id']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'name')
|
|
119
|
+
self.name = attributes[:'name']
|
|
120
|
+
else
|
|
121
|
+
self.name = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'website')
|
|
125
|
+
self.website = attributes[:'website']
|
|
126
|
+
else
|
|
127
|
+
self.website = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'currency_code')
|
|
131
|
+
self.currency_code = attributes[:'currency_code']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'status')
|
|
135
|
+
self.status = attributes[:'status']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'created_at')
|
|
139
|
+
self.created_at = attributes[:'created_at']
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
144
|
+
# @return Array for valid properties with the reasons
|
|
145
|
+
def list_invalid_properties
|
|
146
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
147
|
+
invalid_properties = Array.new
|
|
148
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
149
|
+
if !@id.nil? && @id !~ pattern
|
|
150
|
+
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @name.nil?
|
|
154
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if @website.nil?
|
|
158
|
+
invalid_properties.push('invalid value for "website", website cannot be nil.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
invalid_properties
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Check to see if the all the properties in the model are valid
|
|
165
|
+
# @return true if the model is valid
|
|
166
|
+
def valid?
|
|
167
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
168
|
+
return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
169
|
+
return false if @name.nil?
|
|
170
|
+
return false if @website.nil?
|
|
171
|
+
status_validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "REJECTED"])
|
|
172
|
+
return false unless status_validator.valid?(@status)
|
|
173
|
+
true
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Custom attribute writer method with validation
|
|
177
|
+
# @param [Object] id Value to be assigned
|
|
178
|
+
def id=(id)
|
|
179
|
+
if id.nil?
|
|
180
|
+
fail ArgumentError, 'id cannot be nil'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
184
|
+
if id !~ pattern
|
|
185
|
+
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
@id = id
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] name Value to be assigned
|
|
193
|
+
def name=(name)
|
|
194
|
+
if name.nil?
|
|
195
|
+
fail ArgumentError, 'name cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@name = name
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] website Value to be assigned
|
|
203
|
+
def website=(website)
|
|
204
|
+
if website.nil?
|
|
205
|
+
fail ArgumentError, 'website cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@website = website
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
212
|
+
# so that enum values added to the API don't break deserialization on
|
|
213
|
+
# older versions of this gem.
|
|
214
|
+
# @param [Object] status Object to be assigned
|
|
215
|
+
def status=(status)
|
|
216
|
+
@status = status
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Checks equality by comparing each attribute.
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def ==(o)
|
|
222
|
+
return true if self.equal?(o)
|
|
223
|
+
self.class == o.class &&
|
|
224
|
+
id == o.id &&
|
|
225
|
+
name == o.name &&
|
|
226
|
+
website == o.website &&
|
|
227
|
+
currency_code == o.currency_code &&
|
|
228
|
+
status == o.status &&
|
|
229
|
+
created_at == o.created_at
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# @see the `==` method
|
|
233
|
+
# @param [Object] Object to be compared
|
|
234
|
+
def eql?(o)
|
|
235
|
+
self == o
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Calculates hash code according to all attributes.
|
|
239
|
+
# @return [Integer] Hash code
|
|
240
|
+
def hash
|
|
241
|
+
[id, name, website, currency_code, status, created_at].hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Builds the object from hash
|
|
245
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
246
|
+
# @return [Object] Returns the model itself
|
|
247
|
+
def self.build_from_hash(attributes)
|
|
248
|
+
return nil unless attributes.is_a?(Hash)
|
|
249
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
250
|
+
transformed_hash = {}
|
|
251
|
+
openapi_types.each_pair do |key, type|
|
|
252
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
253
|
+
transformed_hash["#{key}"] = nil
|
|
254
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
255
|
+
# check to ensure the input is an array given that the attribute
|
|
256
|
+
# is documented as an array but the input is not
|
|
257
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
258
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
259
|
+
end
|
|
260
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
261
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
new(transformed_hash)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the object in the form of hash
|
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
|
269
|
+
def to_hash
|
|
270
|
+
hash = {}
|
|
271
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
272
|
+
value = self.send(attr)
|
|
273
|
+
if value.nil?
|
|
274
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
275
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
hash[param] = _to_hash(value)
|
|
279
|
+
end
|
|
280
|
+
hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|
|
@@ -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
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
|
-
class PaymentDetails
|
|
17
|
+
class PaymentDetails < ApiModelBase
|
|
18
18
|
# Total price of the order before fees, denominated in `currency_code`.
|
|
19
19
|
attr_accessor :subtotal
|
|
20
20
|
|
|
@@ -297,61 +297,6 @@ module Tremendous
|
|
|
297
297
|
new(transformed_hash)
|
|
298
298
|
end
|
|
299
299
|
|
|
300
|
-
# Deserializes the data based on type
|
|
301
|
-
# @param string type Data type
|
|
302
|
-
# @param string value Value to be deserialized
|
|
303
|
-
# @return [Object] Deserialized data
|
|
304
|
-
def self._deserialize(type, value)
|
|
305
|
-
case type.to_sym
|
|
306
|
-
when :Time
|
|
307
|
-
Time.parse(value)
|
|
308
|
-
when :Date
|
|
309
|
-
Date.parse(value)
|
|
310
|
-
when :String
|
|
311
|
-
value.to_s
|
|
312
|
-
when :Integer
|
|
313
|
-
value.to_i
|
|
314
|
-
when :Float
|
|
315
|
-
value.to_f
|
|
316
|
-
when :Boolean
|
|
317
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
318
|
-
true
|
|
319
|
-
else
|
|
320
|
-
false
|
|
321
|
-
end
|
|
322
|
-
when :Object
|
|
323
|
-
# generic object (usually a Hash), return directly
|
|
324
|
-
value
|
|
325
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
326
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
327
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
328
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
329
|
-
k_type = Regexp.last_match[:k_type]
|
|
330
|
-
v_type = Regexp.last_match[:v_type]
|
|
331
|
-
{}.tap do |hash|
|
|
332
|
-
value.each do |k, v|
|
|
333
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
334
|
-
end
|
|
335
|
-
end
|
|
336
|
-
else # model
|
|
337
|
-
# models (e.g. Pet) or oneOf
|
|
338
|
-
klass = Tremendous.const_get(type)
|
|
339
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
340
|
-
end
|
|
341
|
-
end
|
|
342
|
-
|
|
343
|
-
# Returns the string representation of the object
|
|
344
|
-
# @return [String] String presentation of the object
|
|
345
|
-
def to_s
|
|
346
|
-
to_hash.to_s
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
350
|
-
# @return [Hash] Returns the object in the form of hash
|
|
351
|
-
def to_body
|
|
352
|
-
to_hash
|
|
353
|
-
end
|
|
354
|
-
|
|
355
300
|
# Returns the object in the form of hash
|
|
356
301
|
# @return [Hash] Returns the object in the form of hash
|
|
357
302
|
def to_hash
|
|
@@ -368,24 +313,6 @@ module Tremendous
|
|
|
368
313
|
hash
|
|
369
314
|
end
|
|
370
315
|
|
|
371
|
-
# Outputs non-array value in the form of hash
|
|
372
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
373
|
-
# @param [Object] value Any valid value
|
|
374
|
-
# @return [Hash] Returns the value in the form of hash
|
|
375
|
-
def _to_hash(value)
|
|
376
|
-
if value.is_a?(Array)
|
|
377
|
-
value.compact.map { |v| _to_hash(v) }
|
|
378
|
-
elsif value.is_a?(Hash)
|
|
379
|
-
{}.tap do |hash|
|
|
380
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
381
|
-
end
|
|
382
|
-
elsif value.respond_to? :to_hash
|
|
383
|
-
value.to_hash
|
|
384
|
-
else
|
|
385
|
-
value
|
|
386
|
-
end
|
|
387
|
-
end
|
|
388
|
-
|
|
389
316
|
end
|
|
390
317
|
|
|
391
318
|
end
|