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
|
# A list of the settings that you wish to copy over to the new organization.
|
|
18
|
-
class CreateOrganizationRequestCopySettings
|
|
18
|
+
class CreateOrganizationRequestCopySettings < ApiModelBase
|
|
19
19
|
# Copy over the campaigns from the current organization to the new organization. Defaults to `false`.
|
|
20
20
|
attr_accessor :campaigns
|
|
21
21
|
|
|
@@ -226,61 +226,6 @@ module Tremendous
|
|
|
226
226
|
new(transformed_hash)
|
|
227
227
|
end
|
|
228
228
|
|
|
229
|
-
# Deserializes the data based on type
|
|
230
|
-
# @param string type Data type
|
|
231
|
-
# @param string value Value to be deserialized
|
|
232
|
-
# @return [Object] Deserialized data
|
|
233
|
-
def self._deserialize(type, value)
|
|
234
|
-
case type.to_sym
|
|
235
|
-
when :Time
|
|
236
|
-
Time.parse(value)
|
|
237
|
-
when :Date
|
|
238
|
-
Date.parse(value)
|
|
239
|
-
when :String
|
|
240
|
-
value.to_s
|
|
241
|
-
when :Integer
|
|
242
|
-
value.to_i
|
|
243
|
-
when :Float
|
|
244
|
-
value.to_f
|
|
245
|
-
when :Boolean
|
|
246
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
247
|
-
true
|
|
248
|
-
else
|
|
249
|
-
false
|
|
250
|
-
end
|
|
251
|
-
when :Object
|
|
252
|
-
# generic object (usually a Hash), return directly
|
|
253
|
-
value
|
|
254
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
255
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
256
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
257
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
258
|
-
k_type = Regexp.last_match[:k_type]
|
|
259
|
-
v_type = Regexp.last_match[:v_type]
|
|
260
|
-
{}.tap do |hash|
|
|
261
|
-
value.each do |k, v|
|
|
262
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
else # model
|
|
266
|
-
# models (e.g. Pet) or oneOf
|
|
267
|
-
klass = Tremendous.const_get(type)
|
|
268
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
269
|
-
end
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# Returns the string representation of the object
|
|
273
|
-
# @return [String] String presentation of the object
|
|
274
|
-
def to_s
|
|
275
|
-
to_hash.to_s
|
|
276
|
-
end
|
|
277
|
-
|
|
278
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
279
|
-
# @return [Hash] Returns the object in the form of hash
|
|
280
|
-
def to_body
|
|
281
|
-
to_hash
|
|
282
|
-
end
|
|
283
|
-
|
|
284
229
|
# Returns the object in the form of hash
|
|
285
230
|
# @return [Hash] Returns the object in the form of hash
|
|
286
231
|
def to_hash
|
|
@@ -297,24 +242,6 @@ module Tremendous
|
|
|
297
242
|
hash
|
|
298
243
|
end
|
|
299
244
|
|
|
300
|
-
# Outputs non-array value in the form of hash
|
|
301
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
302
|
-
# @param [Object] value Any valid value
|
|
303
|
-
# @return [Hash] Returns the value in the form of hash
|
|
304
|
-
def _to_hash(value)
|
|
305
|
-
if value.is_a?(Array)
|
|
306
|
-
value.compact.map { |v| _to_hash(v) }
|
|
307
|
-
elsif value.is_a?(Hash)
|
|
308
|
-
{}.tap do |hash|
|
|
309
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
310
|
-
end
|
|
311
|
-
elsif value.respond_to? :to_hash
|
|
312
|
-
value.to_hash
|
|
313
|
-
else
|
|
314
|
-
value
|
|
315
|
-
end
|
|
316
|
-
end
|
|
317
|
-
|
|
318
245
|
end
|
|
319
246
|
|
|
320
247
|
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 CreateOrganizationResponse < 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' => :'CreateOrganizationResponseOrganization'
|
|
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::CreateOrganizationResponse` 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::CreateOrganizationResponse`. 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,282 @@
|
|
|
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 CreateOrganizationResponseOrganization < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# Name of the organization
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
# URL of the website of that organization
|
|
24
|
+
attr_accessor :website
|
|
25
|
+
|
|
26
|
+
# Default value is `false`. Set to true to also generate an API key associated to the new organization.
|
|
27
|
+
attr_accessor :with_api_key
|
|
28
|
+
|
|
29
|
+
attr_accessor :copy_settings
|
|
30
|
+
|
|
31
|
+
# Phone number of the organization. For non-US phone numbers, specify the country code (prefixed with +).
|
|
32
|
+
attr_accessor :phone
|
|
33
|
+
|
|
34
|
+
# Currency code for the new organization. Defaults to the current organization's currency if not provided.
|
|
35
|
+
attr_accessor :currency_code
|
|
36
|
+
|
|
37
|
+
# Timestamp of when the organization has been created.
|
|
38
|
+
attr_accessor :created_at
|
|
39
|
+
|
|
40
|
+
# The API key for the created organization. This property is only returned when `api_key` is set to `true`.
|
|
41
|
+
attr_accessor :api_key
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'id' => :'id',
|
|
47
|
+
:'name' => :'name',
|
|
48
|
+
:'website' => :'website',
|
|
49
|
+
:'with_api_key' => :'with_api_key',
|
|
50
|
+
:'copy_settings' => :'copy_settings',
|
|
51
|
+
:'phone' => :'phone',
|
|
52
|
+
:'currency_code' => :'currency_code',
|
|
53
|
+
:'created_at' => :'created_at',
|
|
54
|
+
:'api_key' => :'api_key'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'id' => :'String',
|
|
72
|
+
:'name' => :'String',
|
|
73
|
+
:'website' => :'String',
|
|
74
|
+
:'with_api_key' => :'Boolean',
|
|
75
|
+
:'copy_settings' => :'CreateOrganizationRequestCopySettings',
|
|
76
|
+
:'phone' => :'String',
|
|
77
|
+
:'currency_code' => :'String',
|
|
78
|
+
:'created_at' => :'Date',
|
|
79
|
+
:'api_key' => :'String'
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List of attributes with nullable: true
|
|
84
|
+
def self.openapi_nullable
|
|
85
|
+
Set.new([
|
|
86
|
+
:'phone',
|
|
87
|
+
])
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Initializes the object
|
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
92
|
+
def initialize(attributes = {})
|
|
93
|
+
if (!attributes.is_a?(Hash))
|
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateOrganizationResponseOrganization` initialize method"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
98
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
99
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
100
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
101
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateOrganizationResponseOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
102
|
+
end
|
|
103
|
+
h[k.to_sym] = v
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'id')
|
|
107
|
+
self.id = attributes[:'id']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'name')
|
|
111
|
+
self.name = attributes[:'name']
|
|
112
|
+
else
|
|
113
|
+
self.name = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'website')
|
|
117
|
+
self.website = attributes[:'website']
|
|
118
|
+
else
|
|
119
|
+
self.website = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'with_api_key')
|
|
123
|
+
self.with_api_key = attributes[:'with_api_key']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'copy_settings')
|
|
127
|
+
self.copy_settings = attributes[:'copy_settings']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'phone')
|
|
131
|
+
self.phone = attributes[:'phone']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'currency_code')
|
|
135
|
+
self.currency_code = attributes[:'currency_code']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'created_at')
|
|
139
|
+
self.created_at = attributes[:'created_at']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'api_key')
|
|
143
|
+
self.api_key = attributes[:'api_key']
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
148
|
+
# @return Array for valid properties with the reasons
|
|
149
|
+
def list_invalid_properties
|
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
151
|
+
invalid_properties = Array.new
|
|
152
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
153
|
+
if !@id.nil? && @id !~ pattern
|
|
154
|
+
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if @name.nil?
|
|
158
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if @website.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "website", website cannot be nil.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
invalid_properties
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Check to see if the all the properties in the model are valid
|
|
169
|
+
# @return true if the model is valid
|
|
170
|
+
def valid?
|
|
171
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
172
|
+
return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
173
|
+
return false if @name.nil?
|
|
174
|
+
return false if @website.nil?
|
|
175
|
+
true
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Custom attribute writer method with validation
|
|
179
|
+
# @param [Object] id Value to be assigned
|
|
180
|
+
def id=(id)
|
|
181
|
+
if id.nil?
|
|
182
|
+
fail ArgumentError, 'id cannot be nil'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
186
|
+
if id !~ pattern
|
|
187
|
+
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
@id = id
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Custom attribute writer method with validation
|
|
194
|
+
# @param [Object] name Value to be assigned
|
|
195
|
+
def name=(name)
|
|
196
|
+
if name.nil?
|
|
197
|
+
fail ArgumentError, 'name cannot be nil'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
@name = name
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Custom attribute writer method with validation
|
|
204
|
+
# @param [Object] website Value to be assigned
|
|
205
|
+
def website=(website)
|
|
206
|
+
if website.nil?
|
|
207
|
+
fail ArgumentError, 'website cannot be nil'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
@website = website
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Checks equality by comparing each attribute.
|
|
214
|
+
# @param [Object] Object to be compared
|
|
215
|
+
def ==(o)
|
|
216
|
+
return true if self.equal?(o)
|
|
217
|
+
self.class == o.class &&
|
|
218
|
+
id == o.id &&
|
|
219
|
+
name == o.name &&
|
|
220
|
+
website == o.website &&
|
|
221
|
+
with_api_key == o.with_api_key &&
|
|
222
|
+
copy_settings == o.copy_settings &&
|
|
223
|
+
phone == o.phone &&
|
|
224
|
+
currency_code == o.currency_code &&
|
|
225
|
+
created_at == o.created_at &&
|
|
226
|
+
api_key == o.api_key
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# @see the `==` method
|
|
230
|
+
# @param [Object] Object to be compared
|
|
231
|
+
def eql?(o)
|
|
232
|
+
self == o
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Calculates hash code according to all attributes.
|
|
236
|
+
# @return [Integer] Hash code
|
|
237
|
+
def hash
|
|
238
|
+
[id, name, website, with_api_key, copy_settings, phone, currency_code, created_at, api_key].hash
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Builds the object from hash
|
|
242
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
243
|
+
# @return [Object] Returns the model itself
|
|
244
|
+
def self.build_from_hash(attributes)
|
|
245
|
+
return nil unless attributes.is_a?(Hash)
|
|
246
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
247
|
+
transformed_hash = {}
|
|
248
|
+
openapi_types.each_pair do |key, type|
|
|
249
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
250
|
+
transformed_hash["#{key}"] = nil
|
|
251
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
252
|
+
# check to ensure the input is an array given that the attribute
|
|
253
|
+
# is documented as an array but the input is not
|
|
254
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
255
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
256
|
+
end
|
|
257
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
258
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
new(transformed_hash)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Returns the object in the form of hash
|
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
|
266
|
+
def to_hash
|
|
267
|
+
hash = {}
|
|
268
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
269
|
+
value = self.send(attr)
|
|
270
|
+
if value.nil?
|
|
271
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
272
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
hash[param] = _to_hash(value)
|
|
276
|
+
end
|
|
277
|
+
hash
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
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 CreateReport200Response
|
|
17
|
+
class CreateReport200Response < ApiModelBase
|
|
18
18
|
attr_accessor :report
|
|
19
19
|
|
|
20
20
|
# Report status message
|
|
@@ -153,61 +153,6 @@ module Tremendous
|
|
|
153
153
|
new(transformed_hash)
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
-
# Deserializes the data based on type
|
|
157
|
-
# @param string type Data type
|
|
158
|
-
# @param string value Value to be deserialized
|
|
159
|
-
# @return [Object] Deserialized data
|
|
160
|
-
def self._deserialize(type, value)
|
|
161
|
-
case type.to_sym
|
|
162
|
-
when :Time
|
|
163
|
-
Time.parse(value)
|
|
164
|
-
when :Date
|
|
165
|
-
Date.parse(value)
|
|
166
|
-
when :String
|
|
167
|
-
value.to_s
|
|
168
|
-
when :Integer
|
|
169
|
-
value.to_i
|
|
170
|
-
when :Float
|
|
171
|
-
value.to_f
|
|
172
|
-
when :Boolean
|
|
173
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
174
|
-
true
|
|
175
|
-
else
|
|
176
|
-
false
|
|
177
|
-
end
|
|
178
|
-
when :Object
|
|
179
|
-
# generic object (usually a Hash), return directly
|
|
180
|
-
value
|
|
181
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
182
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
183
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
184
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
185
|
-
k_type = Regexp.last_match[:k_type]
|
|
186
|
-
v_type = Regexp.last_match[:v_type]
|
|
187
|
-
{}.tap do |hash|
|
|
188
|
-
value.each do |k, v|
|
|
189
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
190
|
-
end
|
|
191
|
-
end
|
|
192
|
-
else # model
|
|
193
|
-
# models (e.g. Pet) or oneOf
|
|
194
|
-
klass = Tremendous.const_get(type)
|
|
195
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
196
|
-
end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
# Returns the string representation of the object
|
|
200
|
-
# @return [String] String presentation of the object
|
|
201
|
-
def to_s
|
|
202
|
-
to_hash.to_s
|
|
203
|
-
end
|
|
204
|
-
|
|
205
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
206
|
-
# @return [Hash] Returns the object in the form of hash
|
|
207
|
-
def to_body
|
|
208
|
-
to_hash
|
|
209
|
-
end
|
|
210
|
-
|
|
211
156
|
# Returns the object in the form of hash
|
|
212
157
|
# @return [Hash] Returns the object in the form of hash
|
|
213
158
|
def to_hash
|
|
@@ -224,24 +169,6 @@ module Tremendous
|
|
|
224
169
|
hash
|
|
225
170
|
end
|
|
226
171
|
|
|
227
|
-
# Outputs non-array value in the form of hash
|
|
228
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
229
|
-
# @param [Object] value Any valid value
|
|
230
|
-
# @return [Hash] Returns the value in the form of hash
|
|
231
|
-
def _to_hash(value)
|
|
232
|
-
if value.is_a?(Array)
|
|
233
|
-
value.compact.map { |v| _to_hash(v) }
|
|
234
|
-
elsif value.is_a?(Hash)
|
|
235
|
-
{}.tap do |hash|
|
|
236
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
237
|
-
end
|
|
238
|
-
elsif value.respond_to? :to_hash
|
|
239
|
-
value.to_hash
|
|
240
|
-
else
|
|
241
|
-
value
|
|
242
|
-
end
|
|
243
|
-
end
|
|
244
|
-
|
|
245
172
|
end
|
|
246
173
|
|
|
247
174
|
end
|