tremendous_ruby 5.29.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 +48 -45
- 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 +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 +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 +2 -75
- 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
|
@@ -0,0 +1,310 @@
|
|
|
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 ConnectedOrganizationMemberSessionResponseConnectedOrganizationMemberSession < ApiModelBase
|
|
18
|
+
# Tremendous' identifier for the connected organization member.
|
|
19
|
+
attr_accessor :connected_organization_member_id
|
|
20
|
+
|
|
21
|
+
# The URL to start the \"Tremendous for Platforms\" flow.
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
# The URL used for links that redirect the user back to your site when they've completed their actions on Tremendous.
|
|
25
|
+
attr_accessor :return_url
|
|
26
|
+
|
|
27
|
+
# The opaque `state` value provided when the session was created, forwarded on the initial OAuth grant redirect. `null` when no value was set.
|
|
28
|
+
attr_accessor :state
|
|
29
|
+
|
|
30
|
+
# Timestamp of when the session will expire.
|
|
31
|
+
attr_accessor :expires_at
|
|
32
|
+
|
|
33
|
+
# Timestamp of when the session was created.
|
|
34
|
+
attr_accessor :created_at
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'connected_organization_member_id' => :'connected_organization_member_id',
|
|
40
|
+
:'url' => :'url',
|
|
41
|
+
:'return_url' => :'return_url',
|
|
42
|
+
:'state' => :'state',
|
|
43
|
+
:'expires_at' => :'expires_at',
|
|
44
|
+
:'created_at' => :'created_at'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns attribute mapping this model knows about
|
|
49
|
+
def self.acceptable_attribute_map
|
|
50
|
+
attribute_map
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns all the JSON keys this model knows about
|
|
54
|
+
def self.acceptable_attributes
|
|
55
|
+
acceptable_attribute_map.values
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute type mapping.
|
|
59
|
+
def self.openapi_types
|
|
60
|
+
{
|
|
61
|
+
:'connected_organization_member_id' => :'String',
|
|
62
|
+
:'url' => :'String',
|
|
63
|
+
:'return_url' => :'String',
|
|
64
|
+
:'state' => :'String',
|
|
65
|
+
:'expires_at' => :'Time',
|
|
66
|
+
:'created_at' => :'Time'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
:'state',
|
|
74
|
+
])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Initializes the object
|
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
79
|
+
def initialize(attributes = {})
|
|
80
|
+
if (!attributes.is_a?(Hash))
|
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ConnectedOrganizationMemberSessionResponseConnectedOrganizationMemberSession` initialize method"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
85
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ConnectedOrganizationMemberSessionResponseConnectedOrganizationMemberSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
|
+
end
|
|
90
|
+
h[k.to_sym] = v
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'connected_organization_member_id')
|
|
94
|
+
self.connected_organization_member_id = attributes[:'connected_organization_member_id']
|
|
95
|
+
else
|
|
96
|
+
self.connected_organization_member_id = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'url')
|
|
100
|
+
self.url = attributes[:'url']
|
|
101
|
+
else
|
|
102
|
+
self.url = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'return_url')
|
|
106
|
+
self.return_url = attributes[:'return_url']
|
|
107
|
+
else
|
|
108
|
+
self.return_url = nil
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'state')
|
|
112
|
+
self.state = attributes[:'state']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'expires_at')
|
|
116
|
+
self.expires_at = attributes[:'expires_at']
|
|
117
|
+
else
|
|
118
|
+
self.expires_at = nil
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'created_at')
|
|
122
|
+
self.created_at = attributes[:'created_at']
|
|
123
|
+
else
|
|
124
|
+
self.created_at = nil
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
129
|
+
# @return Array for valid properties with the reasons
|
|
130
|
+
def list_invalid_properties
|
|
131
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
132
|
+
invalid_properties = Array.new
|
|
133
|
+
if @connected_organization_member_id.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "connected_organization_member_id", connected_organization_member_id cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
138
|
+
if @connected_organization_member_id !~ pattern
|
|
139
|
+
invalid_properties.push("invalid value for \"connected_organization_member_id\", must conform to the pattern #{pattern}.")
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @url.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @return_url.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "return_url", return_url cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if !@state.nil? && @state.to_s.length > 1024
|
|
151
|
+
invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 1024.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if @expires_at.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if @created_at.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
invalid_properties
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Check to see if the all the properties in the model are valid
|
|
166
|
+
# @return true if the model is valid
|
|
167
|
+
def valid?
|
|
168
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
169
|
+
return false if @connected_organization_member_id.nil?
|
|
170
|
+
return false if @connected_organization_member_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
171
|
+
return false if @url.nil?
|
|
172
|
+
return false if @return_url.nil?
|
|
173
|
+
return false if !@state.nil? && @state.to_s.length > 1024
|
|
174
|
+
return false if @expires_at.nil?
|
|
175
|
+
return false if @created_at.nil?
|
|
176
|
+
true
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] connected_organization_member_id Value to be assigned
|
|
181
|
+
def connected_organization_member_id=(connected_organization_member_id)
|
|
182
|
+
if connected_organization_member_id.nil?
|
|
183
|
+
fail ArgumentError, 'connected_organization_member_id cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
187
|
+
if connected_organization_member_id !~ pattern
|
|
188
|
+
fail ArgumentError, "invalid value for \"connected_organization_member_id\", must conform to the pattern #{pattern}."
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
@connected_organization_member_id = connected_organization_member_id
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Custom attribute writer method with validation
|
|
195
|
+
# @param [Object] url Value to be assigned
|
|
196
|
+
def url=(url)
|
|
197
|
+
if url.nil?
|
|
198
|
+
fail ArgumentError, 'url cannot be nil'
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
@url = url
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method with validation
|
|
205
|
+
# @param [Object] return_url Value to be assigned
|
|
206
|
+
def return_url=(return_url)
|
|
207
|
+
if return_url.nil?
|
|
208
|
+
fail ArgumentError, 'return_url cannot be nil'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@return_url = return_url
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] state Value to be assigned
|
|
216
|
+
def state=(state)
|
|
217
|
+
if !state.nil? && state.to_s.length > 1024
|
|
218
|
+
fail ArgumentError, 'invalid value for "state", the character length must be smaller than or equal to 1024.'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@state = state
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Custom attribute writer method with validation
|
|
225
|
+
# @param [Object] expires_at Value to be assigned
|
|
226
|
+
def expires_at=(expires_at)
|
|
227
|
+
if expires_at.nil?
|
|
228
|
+
fail ArgumentError, 'expires_at cannot be nil'
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
@expires_at = expires_at
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Custom attribute writer method with validation
|
|
235
|
+
# @param [Object] created_at Value to be assigned
|
|
236
|
+
def created_at=(created_at)
|
|
237
|
+
if created_at.nil?
|
|
238
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
@created_at = created_at
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Checks equality by comparing each attribute.
|
|
245
|
+
# @param [Object] Object to be compared
|
|
246
|
+
def ==(o)
|
|
247
|
+
return true if self.equal?(o)
|
|
248
|
+
self.class == o.class &&
|
|
249
|
+
connected_organization_member_id == o.connected_organization_member_id &&
|
|
250
|
+
url == o.url &&
|
|
251
|
+
return_url == o.return_url &&
|
|
252
|
+
state == o.state &&
|
|
253
|
+
expires_at == o.expires_at &&
|
|
254
|
+
created_at == o.created_at
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# @see the `==` method
|
|
258
|
+
# @param [Object] Object to be compared
|
|
259
|
+
def eql?(o)
|
|
260
|
+
self == o
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Calculates hash code according to all attributes.
|
|
264
|
+
# @return [Integer] Hash code
|
|
265
|
+
def hash
|
|
266
|
+
[connected_organization_member_id, url, return_url, state, expires_at, created_at].hash
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Builds the object from hash
|
|
270
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
271
|
+
# @return [Object] Returns the model itself
|
|
272
|
+
def self.build_from_hash(attributes)
|
|
273
|
+
return nil unless attributes.is_a?(Hash)
|
|
274
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
275
|
+
transformed_hash = {}
|
|
276
|
+
openapi_types.each_pair do |key, type|
|
|
277
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
278
|
+
transformed_hash["#{key}"] = nil
|
|
279
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
280
|
+
# check to ensure the input is an array given that the attribute
|
|
281
|
+
# is documented as an array but the input is not
|
|
282
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
283
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
284
|
+
end
|
|
285
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
286
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
new(transformed_hash)
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Returns the object in the form of hash
|
|
293
|
+
# @return [Hash] Returns the object in the form of hash
|
|
294
|
+
def to_hash
|
|
295
|
+
hash = {}
|
|
296
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
297
|
+
value = self.send(attr)
|
|
298
|
+
if value.nil?
|
|
299
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
300
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
hash[param] = _to_hash(value)
|
|
304
|
+
end
|
|
305
|
+
hash
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
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
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# Associated `organization` resource. `null` until the registration flow for the connected organization has been completed.
|
|
18
|
-
class ConnectedOrganizationOrganization
|
|
18
|
+
class ConnectedOrganizationOrganization < 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
|
|
@@ -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,17 +14,13 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
attr_accessor :status
|
|
20
|
-
|
|
21
|
-
attr_accessor :errors
|
|
17
|
+
class ConnectedOrganizationResponse < ApiModelBase
|
|
18
|
+
attr_accessor :connected_organization
|
|
22
19
|
|
|
23
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
21
|
def self.attribute_map
|
|
25
22
|
{
|
|
26
|
-
:'
|
|
27
|
-
:'errors' => :'errors'
|
|
23
|
+
:'connected_organization' => :'connected_organization'
|
|
28
24
|
}
|
|
29
25
|
end
|
|
30
26
|
|
|
@@ -41,8 +37,7 @@ module Tremendous
|
|
|
41
37
|
# Attribute type mapping.
|
|
42
38
|
def self.openapi_types
|
|
43
39
|
{
|
|
44
|
-
:'
|
|
45
|
-
:'errors' => :'ListRewards401ResponseErrors'
|
|
40
|
+
:'connected_organization' => :'ConnectedOrganizationResponseConnectedOrganization'
|
|
46
41
|
}
|
|
47
42
|
end
|
|
48
43
|
|
|
@@ -56,26 +51,22 @@ module Tremendous
|
|
|
56
51
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
52
|
def initialize(attributes = {})
|
|
58
53
|
if (!attributes.is_a?(Hash))
|
|
59
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ConnectedOrganizationResponse` initialize method"
|
|
60
55
|
end
|
|
61
56
|
|
|
62
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
58
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
59
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
60
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ConnectedOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
62
|
end
|
|
68
63
|
h[k.to_sym] = v
|
|
69
64
|
}
|
|
70
65
|
|
|
71
|
-
if attributes.key?(:'
|
|
72
|
-
self.
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
if attributes.key?(:'errors')
|
|
76
|
-
self.errors = attributes[:'errors']
|
|
66
|
+
if attributes.key?(:'connected_organization')
|
|
67
|
+
self.connected_organization = attributes[:'connected_organization']
|
|
77
68
|
else
|
|
78
|
-
self.
|
|
69
|
+
self.connected_organization = nil
|
|
79
70
|
end
|
|
80
71
|
end
|
|
81
72
|
|
|
@@ -84,8 +75,8 @@ module Tremendous
|
|
|
84
75
|
def list_invalid_properties
|
|
85
76
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
86
77
|
invalid_properties = Array.new
|
|
87
|
-
if @
|
|
88
|
-
invalid_properties.push('invalid value for "
|
|
78
|
+
if @connected_organization.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "connected_organization", connected_organization cannot be nil.')
|
|
89
80
|
end
|
|
90
81
|
|
|
91
82
|
invalid_properties
|
|
@@ -95,18 +86,18 @@ module Tremendous
|
|
|
95
86
|
# @return true if the model is valid
|
|
96
87
|
def valid?
|
|
97
88
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
98
|
-
return false if @
|
|
89
|
+
return false if @connected_organization.nil?
|
|
99
90
|
true
|
|
100
91
|
end
|
|
101
92
|
|
|
102
93
|
# Custom attribute writer method with validation
|
|
103
|
-
# @param [Object]
|
|
104
|
-
def
|
|
105
|
-
if
|
|
106
|
-
fail ArgumentError, '
|
|
94
|
+
# @param [Object] connected_organization Value to be assigned
|
|
95
|
+
def connected_organization=(connected_organization)
|
|
96
|
+
if connected_organization.nil?
|
|
97
|
+
fail ArgumentError, 'connected_organization cannot be nil'
|
|
107
98
|
end
|
|
108
99
|
|
|
109
|
-
@
|
|
100
|
+
@connected_organization = connected_organization
|
|
110
101
|
end
|
|
111
102
|
|
|
112
103
|
# Checks equality by comparing each attribute.
|
|
@@ -114,8 +105,7 @@ module Tremendous
|
|
|
114
105
|
def ==(o)
|
|
115
106
|
return true if self.equal?(o)
|
|
116
107
|
self.class == o.class &&
|
|
117
|
-
|
|
118
|
-
errors == o.errors
|
|
108
|
+
connected_organization == o.connected_organization
|
|
119
109
|
end
|
|
120
110
|
|
|
121
111
|
# @see the `==` method
|
|
@@ -127,7 +117,7 @@ module Tremendous
|
|
|
127
117
|
# Calculates hash code according to all attributes.
|
|
128
118
|
# @return [Integer] Hash code
|
|
129
119
|
def hash
|
|
130
|
-
[
|
|
120
|
+
[connected_organization].hash
|
|
131
121
|
end
|
|
132
122
|
|
|
133
123
|
# Builds the object from hash
|
|
@@ -153,61 +143,6 @@ module Tremendous
|
|
|
153
143
|
new(transformed_hash)
|
|
154
144
|
end
|
|
155
145
|
|
|
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
146
|
# Returns the object in the form of hash
|
|
212
147
|
# @return [Hash] Returns the object in the form of hash
|
|
213
148
|
def to_hash
|
|
@@ -224,24 +159,6 @@ module Tremendous
|
|
|
224
159
|
hash
|
|
225
160
|
end
|
|
226
161
|
|
|
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
162
|
end
|
|
246
163
|
|
|
247
164
|
end
|