talon_one 5.0.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +77 -17
- data/docs/AchievementProgress.md +2 -0
- data/docs/AdditionalCampaignProperties.md +3 -1
- data/docs/AnalyticsDataPoint.md +19 -0
- data/docs/AnalyticsDataPointWithTrend.md +19 -0
- data/docs/AnalyticsDataPointWithTrendAndInfluencedRate.md +21 -0
- data/docs/AnalyticsDataPointWithTrendAndUplift.md +21 -0
- data/docs/Application.md +4 -0
- data/docs/ApplicationAnalyticsDataPoint.md +6 -6
- data/docs/ApplicationCIF.md +33 -0
- data/docs/ApplicationCIFExpression.md +27 -0
- data/docs/ApplicationCampaignAnalytics.md +13 -19
- data/docs/ApplicationCampaignStats.md +1 -3
- data/docs/AsyncCouponDeletionJobResponse.md +17 -0
- data/docs/BaseLoyaltyProgram.md +8 -4
- data/docs/BaseNotification.md +1 -1
- data/docs/BaseNotificationEntity.md +1 -1
- data/docs/Campaign.md +15 -1
- data/docs/CampaignCollectionEditedNotification.md +21 -0
- data/docs/CampaignNotificationPolicy.md +3 -1
- data/docs/CampaignStateChangedNotification.md +2 -2
- data/docs/CampaignStoreBudget.md +25 -0
- data/docs/CampaignVersions.md +27 -0
- data/docs/CardAddedDeductedPointsNotificationPolicy.md +19 -0
- data/docs/CartItem.md +1 -1
- data/docs/CodeGeneratorSettings.md +1 -1
- data/docs/Coupon.md +1 -1
- data/docs/CouponConstraints.md +1 -1
- data/docs/CouponCreationJob.md +1 -1
- data/docs/CouponDeletionFilters.md +43 -0
- data/docs/CouponDeletionJob.md +39 -0
- data/docs/CustomerSessionV2.md +2 -2
- data/docs/Effect.md +8 -0
- data/docs/EffectEntity.md +9 -1
- data/docs/Environment.md +3 -1
- data/docs/Event.md +1 -1
- data/docs/GenerateCampaignDescription.md +19 -0
- data/docs/GenerateCampaignTags.md +17 -0
- data/docs/GenerateItemFilterDescription.md +17 -0
- data/docs/GenerateLoyaltyCard.md +19 -0
- data/docs/GenerateRuleTitle.md +19 -0
- data/docs/GenerateRuleTitleRule.md +19 -0
- data/docs/IncreaseAchievementProgressEffectProps.md +1 -1
- data/docs/IntegrationApi.md +67 -6
- data/docs/IntegrationCoupon.md +1 -1
- data/docs/InventoryCoupon.md +1 -1
- data/docs/InventoryReferral.md +1 -1
- data/docs/LoyaltyBalanceWithTier.md +31 -0
- data/docs/LoyaltyBalancesWithTiers.md +19 -0
- data/docs/LoyaltyCard.md +6 -2
- data/docs/LoyaltyCardBatch.md +21 -0
- data/docs/LoyaltyCardBatchResponse.md +19 -0
- data/docs/LoyaltyProgram.md +14 -6
- data/docs/ManagementApi.md +1044 -69
- data/docs/MessageLogResponse.md +3 -3
- data/docs/NewAppWideCouponDeletionJob.md +19 -0
- data/docs/NewApplication.md +3 -1
- data/docs/NewApplicationCIF.md +27 -0
- data/docs/NewApplicationCIFExpression.md +21 -0
- data/docs/NewBaseNotification.md +1 -1
- data/docs/NewCouponCreationJob.md +1 -1
- data/docs/NewCouponDeletionJob.md +17 -0
- data/docs/NewCoupons.md +1 -1
- data/docs/NewCouponsForMultipleRecipients.md +1 -1
- data/docs/NewCustomerSessionV2.md +2 -2
- data/docs/NewLoyaltyProgram.md +8 -4
- data/docs/NewOutgoingIntegrationWebhook.md +2 -0
- data/docs/NewReferral.md +1 -1
- data/docs/NewReferralsForMultipleAdvocates.md +1 -1
- data/docs/NewRevisionVersion.md +37 -0
- data/docs/NewWebhook.md +2 -0
- data/docs/OktaEvent.md +19 -0
- data/docs/OktaEventPayload.md +17 -0
- data/docs/OktaEventPayloadData.md +17 -0
- data/docs/OktaEventTarget.md +21 -0
- data/docs/ProjectedTier.md +21 -0
- data/docs/Referral.md +1 -1
- data/docs/ReferralConstraints.md +1 -1
- data/docs/RejectCouponEffectProps.md +3 -1
- data/docs/RejectReferralEffectProps.md +3 -1
- data/docs/Revision.md +35 -0
- data/docs/RevisionActivation.md +17 -0
- data/docs/RevisionVersion.md +53 -0
- data/docs/RollbackIncreasedAchievementProgressEffectProps.md +27 -0
- data/docs/RuleFailureReason.md +5 -1
- data/docs/SSOConfig.md +3 -1
- data/docs/ScimBaseUser.md +23 -0
- data/docs/ScimBaseUserName.md +17 -0
- data/docs/ScimNewUser.md +23 -0
- data/docs/ScimPatchOperation.md +21 -0
- data/docs/ScimPatchRequest.md +19 -0
- data/docs/ScimResource.md +21 -0
- data/docs/ScimResourceTypesListResponse.md +17 -0
- data/docs/ScimSchemaResource.md +23 -0
- data/docs/ScimSchemasListResponse.md +21 -0
- data/docs/ScimServiceProviderConfigResponse.md +27 -0
- data/docs/ScimServiceProviderConfigResponseBulk.md +21 -0
- data/docs/ScimServiceProviderConfigResponseChangePassword.md +17 -0
- data/docs/ScimServiceProviderConfigResponseFilter.md +19 -0
- data/docs/ScimServiceProviderConfigResponsePatch.md +17 -0
- data/docs/ScimUser.md +25 -0
- data/docs/ScimUsersListResponse.md +21 -0
- data/docs/Tier.md +3 -1
- data/docs/TransferLoyaltyCard.md +3 -1
- data/docs/UpdateApplication.md +5 -1
- data/docs/UpdateApplicationCIF.md +23 -0
- data/docs/UpdateCampaign.md +1 -1
- data/docs/UpdateCoupon.md +1 -1
- data/docs/UpdateCouponBatch.md +1 -1
- data/docs/UpdateLoyaltyCard.md +4 -2
- data/docs/UpdateLoyaltyProgram.md +8 -4
- data/docs/UpdateReferral.md +1 -1
- data/docs/UpdateReferralBatch.md +1 -1
- data/docs/User.md +3 -1
- data/docs/Webhook.md +2 -0
- data/docs/WebhookWithOutgoingIntegrationDetails.md +2 -0
- data/lib/talon_one/api/integration_api.rb +83 -7
- data/lib/talon_one/api/management_api.rb +1127 -78
- data/lib/talon_one/models/achievement_progress.rb +16 -1
- data/lib/talon_one/models/additional_campaign_properties.rb +21 -6
- data/lib/talon_one/models/analytics_data_point.rb +225 -0
- data/lib/talon_one/models/analytics_data_point_with_trend.rb +225 -0
- data/lib/talon_one/models/analytics_data_point_with_trend_and_influenced_rate.rb +239 -0
- data/lib/talon_one/models/analytics_data_point_with_trend_and_uplift.rb +239 -0
- data/lib/talon_one/models/application.rb +21 -1
- data/lib/talon_one/models/application_analytics_data_point.rb +14 -4
- data/lib/talon_one/models/application_campaign_analytics.rb +39 -41
- data/lib/talon_one/models/application_campaign_stats.rb +1 -16
- data/lib/talon_one/models/application_cif.rb +308 -0
- data/lib/talon_one/models/application_cif_expression.rb +275 -0
- data/lib/talon_one/models/async_coupon_deletion_job_response.rb +213 -0
- data/lib/talon_one/models/attribute.rb +2 -2
- data/lib/talon_one/models/base_loyalty_program.rb +44 -25
- data/lib/talon_one/models/base_notification.rb +3 -2
- data/lib/talon_one/models/base_notification_entity.rb +1 -0
- data/lib/talon_one/models/campaign.rb +83 -6
- data/lib/talon_one/models/campaign_collection_edited_notification.rb +235 -0
- data/lib/talon_one/models/campaign_notification_policy.rb +16 -4
- data/lib/talon_one/models/campaign_state_changed_notification.rb +2 -2
- data/lib/talon_one/models/campaign_store_budget.rb +275 -0
- data/lib/talon_one/models/campaign_versions.rb +259 -0
- data/lib/talon_one/models/card_added_deducted_points_notification_policy.rb +269 -0
- data/lib/talon_one/models/cart_item.rb +1 -1
- data/lib/talon_one/models/code_generator_settings.rb +1 -1
- data/lib/talon_one/models/coupon.rb +1 -1
- data/lib/talon_one/models/coupon_constraints.rb +1 -1
- data/lib/talon_one/models/coupon_creation_job.rb +1 -1
- data/lib/talon_one/models/coupon_deletion_filters.rb +375 -0
- data/lib/talon_one/models/coupon_deletion_job.rb +370 -0
- data/lib/talon_one/models/customer_session_v2.rb +2 -2
- data/lib/talon_one/models/effect.rb +41 -1
- data/lib/talon_one/models/effect_entity.rb +44 -4
- data/lib/talon_one/models/environment.rb +16 -4
- data/lib/talon_one/models/event.rb +0 -5
- data/lib/talon_one/models/generate_campaign_description.rb +227 -0
- data/lib/talon_one/models/generate_campaign_tags.rb +212 -0
- data/lib/talon_one/models/generate_item_filter_description.rb +214 -0
- data/lib/talon_one/models/generate_loyalty_card.rb +256 -0
- data/lib/talon_one/models/generate_rule_title.rb +226 -0
- data/lib/talon_one/models/generate_rule_title_rule.rb +221 -0
- data/lib/talon_one/models/increase_achievement_progress_effect_props.rb +1 -1
- data/lib/talon_one/models/integration_coupon.rb +1 -1
- data/lib/talon_one/models/inventory_coupon.rb +1 -1
- data/lib/talon_one/models/inventory_referral.rb +1 -1
- data/lib/talon_one/models/loyalty_balance_with_tier.rb +276 -0
- data/lib/talon_one/models/loyalty_balances_with_tiers.rb +219 -0
- data/lib/talon_one/models/loyalty_card.rb +25 -5
- data/lib/talon_one/models/loyalty_card_batch.rb +304 -0
- data/lib/talon_one/models/loyalty_card_batch_response.rb +227 -0
- data/lib/talon_one/models/loyalty_program.rb +70 -29
- data/lib/talon_one/models/message_log_response.rb +3 -22
- data/lib/talon_one/models/new_app_wide_coupon_deletion_job.rb +227 -0
- data/lib/talon_one/models/new_application.rb +14 -4
- data/lib/talon_one/models/new_application_cif.rb +262 -0
- data/lib/talon_one/models/new_application_cif_expression.rb +229 -0
- data/lib/talon_one/models/new_attribute.rb +2 -2
- data/lib/talon_one/models/new_base_notification.rb +1 -0
- data/lib/talon_one/models/new_coupon_creation_job.rb +1 -1
- data/lib/talon_one/models/new_coupon_deletion_job.rb +211 -0
- data/lib/talon_one/models/new_coupons.rb +1 -1
- data/lib/talon_one/models/new_coupons_for_multiple_recipients.rb +1 -1
- data/lib/talon_one/models/new_customer_session_v2.rb +2 -2
- data/lib/talon_one/models/new_loyalty_program.rb +44 -25
- data/lib/talon_one/models/new_notification_test.rb +2 -2
- data/lib/talon_one/models/new_outgoing_integration_webhook.rb +11 -1
- data/lib/talon_one/models/new_referral.rb +1 -1
- data/lib/talon_one/models/new_referrals_for_multiple_advocates.rb +1 -1
- data/lib/talon_one/models/new_revision_version.rb +352 -0
- data/lib/talon_one/models/new_webhook.rb +11 -1
- data/lib/talon_one/models/okta_event.rb +229 -0
- data/lib/talon_one/models/okta_event_payload.rb +212 -0
- data/lib/talon_one/models/okta_event_payload_data.rb +214 -0
- data/lib/talon_one/models/okta_event_target.rb +243 -0
- data/lib/talon_one/models/projected_tier.rb +232 -0
- data/lib/talon_one/models/referral.rb +1 -1
- data/lib/talon_one/models/referral_constraints.rb +1 -1
- data/lib/talon_one/models/reject_coupon_effect_props.rb +14 -4
- data/lib/talon_one/models/reject_referral_effect_props.rb +14 -4
- data/lib/talon_one/models/revision.rb +319 -0
- data/lib/talon_one/models/revision_activation.rb +206 -0
- data/lib/talon_one/models/revision_version.rb +466 -0
- data/lib/talon_one/models/rollback_increased_achievement_progress_effect_props.rb +288 -0
- data/lib/talon_one/models/rule_failure_reason.rb +24 -4
- data/lib/talon_one/models/scim_base_user.rb +237 -0
- data/lib/talon_one/models/scim_base_user_name.rb +208 -0
- data/lib/talon_one/models/scim_new_user.rb +237 -0
- data/lib/talon_one/models/scim_patch_operation.rb +267 -0
- data/lib/talon_one/models/scim_patch_request.rb +226 -0
- data/lib/talon_one/models/scim_resource.rb +228 -0
- data/lib/talon_one/models/scim_resource_types_list_response.rb +214 -0
- data/lib/talon_one/models/scim_schema_resource.rb +239 -0
- data/lib/talon_one/models/scim_schemas_list_response.rb +236 -0
- data/lib/talon_one/models/scim_service_provider_config_response.rb +256 -0
- data/lib/talon_one/models/scim_service_provider_config_response_bulk.rb +228 -0
- data/lib/talon_one/models/scim_service_provider_config_response_change_password.rb +208 -0
- data/lib/talon_one/models/scim_service_provider_config_response_filter.rb +218 -0
- data/lib/talon_one/models/scim_service_provider_config_response_patch.rb +208 -0
- data/lib/talon_one/models/scim_user.rb +252 -0
- data/lib/talon_one/models/scim_users_list_response.rb +236 -0
- data/lib/talon_one/models/sso_config.rb +14 -4
- data/lib/talon_one/models/tier.rb +12 -2
- data/lib/talon_one/models/transfer_loyalty_card.rb +14 -4
- data/lib/talon_one/models/update_application.rb +24 -4
- data/lib/talon_one/models/update_application_cif.rb +237 -0
- data/lib/talon_one/models/update_campaign.rb +1 -1
- data/lib/talon_one/models/update_coupon.rb +1 -1
- data/lib/talon_one/models/update_coupon_batch.rb +1 -1
- data/lib/talon_one/models/update_loyalty_card.rb +15 -5
- data/lib/talon_one/models/update_loyalty_program.rb +44 -25
- data/lib/talon_one/models/update_referral.rb +1 -1
- data/lib/talon_one/models/update_referral_batch.rb +1 -1
- data/lib/talon_one/models/user.rb +14 -4
- data/lib/talon_one/models/webhook.rb +11 -1
- data/lib/talon_one/models/webhook_with_outgoing_integration_details.rb +11 -1
- data/lib/talon_one/version.rb +1 -1
- data/lib/talon_one.rb +54 -11
- data/spec/api/integration_api_spec.rb +18 -3
- data/spec/api/management_api_spec.rb +227 -23
- data/spec/models/achievement_progress_spec.rb +6 -0
- data/spec/models/additional_campaign_properties_spec.rb +7 -1
- data/spec/models/analytics_data_point_spec.rb +47 -0
- data/spec/models/analytics_data_point_with_trend_and_influenced_rate_spec.rb +53 -0
- data/spec/models/analytics_data_point_with_trend_and_uplift_spec.rb +53 -0
- data/spec/models/analytics_data_point_with_trend_spec.rb +47 -0
- data/spec/models/application_campaign_analytics_spec.rb +1 -19
- data/spec/models/application_campaign_stats_spec.rb +0 -6
- data/spec/models/application_cif_expression_spec.rb +71 -0
- data/spec/models/application_cif_spec.rb +89 -0
- data/spec/models/application_spec.rb +12 -0
- data/spec/models/async_coupon_deletion_job_response_spec.rb +41 -0
- data/spec/models/attribute_spec.rb +1 -1
- data/spec/models/base_loyalty_program_spec.rb +18 -6
- data/spec/models/base_notification_spec.rb +1 -1
- data/spec/models/campaign_collection_edited_notification_spec.rb +53 -0
- data/spec/models/campaign_notification_policy_spec.rb +6 -0
- data/spec/models/campaign_spec.rb +43 -1
- data/spec/models/campaign_store_budget_spec.rb +65 -0
- data/spec/models/campaign_versions_spec.rb +71 -0
- data/spec/models/card_added_deducted_points_notification_policy_spec.rb +51 -0
- data/spec/models/coupon_deletion_filters_spec.rb +123 -0
- data/spec/models/coupon_deletion_job_spec.rb +107 -0
- data/spec/models/effect_entity_spec.rb +24 -0
- data/spec/models/effect_spec.rb +24 -0
- data/spec/models/environment_spec.rb +6 -0
- data/spec/models/generate_campaign_description_spec.rb +47 -0
- data/spec/models/generate_campaign_tags_spec.rb +41 -0
- data/spec/models/generate_item_filter_description_spec.rb +41 -0
- data/spec/models/generate_loyalty_card_spec.rb +51 -0
- data/spec/models/generate_rule_title_rule_spec.rb +47 -0
- data/spec/models/generate_rule_title_spec.rb +47 -0
- data/spec/models/loyalty_balance_with_tier_spec.rb +83 -0
- data/spec/models/loyalty_balances_with_tiers_spec.rb +47 -0
- data/spec/models/loyalty_card_batch_response_spec.rb +47 -0
- data/spec/models/loyalty_card_batch_spec.rb +57 -0
- data/spec/models/loyalty_card_spec.rb +12 -0
- data/spec/models/loyalty_program_spec.rb +30 -6
- data/spec/models/new_app_wide_coupon_deletion_job_spec.rb +47 -0
- data/spec/models/new_application_cif_expression_spec.rb +53 -0
- data/spec/models/new_application_cif_spec.rb +71 -0
- data/spec/models/new_application_spec.rb +6 -0
- data/spec/models/new_attribute_spec.rb +1 -1
- data/spec/models/new_coupon_deletion_job_spec.rb +41 -0
- data/spec/models/new_loyalty_program_spec.rb +18 -6
- data/spec/models/new_notification_test_spec.rb +1 -1
- data/spec/models/new_outgoing_integration_webhook_spec.rb +6 -0
- data/spec/models/new_revision_version_spec.rb +105 -0
- data/spec/models/new_webhook_spec.rb +6 -0
- data/spec/models/okta_event_payload_data_spec.rb +41 -0
- data/spec/models/okta_event_payload_spec.rb +41 -0
- data/spec/models/okta_event_spec.rb +47 -0
- data/spec/models/okta_event_target_spec.rb +53 -0
- data/spec/models/projected_tier_spec.rb +53 -0
- data/spec/models/reject_coupon_effect_props_spec.rb +6 -0
- data/spec/models/reject_referral_effect_props_spec.rb +6 -0
- data/spec/models/revision_activation_spec.rb +41 -0
- data/spec/models/revision_spec.rb +95 -0
- data/spec/models/revision_version_spec.rb +153 -0
- data/spec/models/rollback_increased_achievement_progress_effect_props_spec.rb +71 -0
- data/spec/models/rule_failure_reason_spec.rb +12 -0
- data/spec/models/scim_base_user_name_spec.rb +41 -0
- data/spec/models/scim_base_user_spec.rb +59 -0
- data/spec/models/scim_new_user_spec.rb +59 -0
- data/spec/models/scim_patch_operation_spec.rb +57 -0
- data/spec/models/scim_patch_request_spec.rb +47 -0
- data/spec/models/scim_resource_spec.rb +53 -0
- data/spec/models/scim_resource_types_list_response_spec.rb +41 -0
- data/spec/models/scim_schema_resource_spec.rb +59 -0
- data/spec/models/scim_schemas_list_response_spec.rb +53 -0
- data/spec/models/scim_service_provider_config_response_bulk_spec.rb +53 -0
- data/spec/models/scim_service_provider_config_response_change_password_spec.rb +41 -0
- data/spec/models/scim_service_provider_config_response_filter_spec.rb +47 -0
- data/spec/models/scim_service_provider_config_response_patch_spec.rb +41 -0
- data/spec/models/scim_service_provider_config_response_spec.rb +71 -0
- data/spec/models/scim_user_spec.rb +65 -0
- data/spec/models/scim_users_list_response_spec.rb +53 -0
- data/spec/models/sso_config_spec.rb +6 -0
- data/spec/models/tier_spec.rb +6 -0
- data/spec/models/transfer_loyalty_card_spec.rb +6 -0
- data/spec/models/update_application_cif_spec.rb +59 -0
- data/spec/models/update_application_spec.rb +12 -0
- data/spec/models/update_loyalty_card_spec.rb +6 -0
- data/spec/models/update_loyalty_program_spec.rb +18 -6
- data/spec/models/user_spec.rb +6 -0
- data/spec/models/webhook_spec.rb +6 -0
- data/spec/models/webhook_with_outgoing_integration_details_spec.rb +6 -0
- metadata +219 -3
@@ -0,0 +1,352 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
|
5
|
+
|
6
|
+
The version of the OpenAPI document:
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
class NewRevisionVersion
|
17
|
+
# A user-facing name for this campaign.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# Timestamp when the campaign will become active.
|
21
|
+
attr_accessor :start_time
|
22
|
+
|
23
|
+
# Timestamp when the campaign will become inactive.
|
24
|
+
attr_accessor :end_time
|
25
|
+
|
26
|
+
# Arbitrary properties associated with this campaign.
|
27
|
+
attr_accessor :attributes
|
28
|
+
|
29
|
+
# A detailed description of the campaign.
|
30
|
+
attr_accessor :description
|
31
|
+
|
32
|
+
# The ID of the ruleset this campaign template will use.
|
33
|
+
attr_accessor :active_ruleset_id
|
34
|
+
|
35
|
+
# A list of tags for the campaign template.
|
36
|
+
attr_accessor :tags
|
37
|
+
|
38
|
+
attr_accessor :coupon_settings
|
39
|
+
|
40
|
+
attr_accessor :referral_settings
|
41
|
+
|
42
|
+
# The set of limits that will operate for this campaign version.
|
43
|
+
attr_accessor :limits
|
44
|
+
|
45
|
+
# A list of features for the campaign template.
|
46
|
+
attr_accessor :features
|
47
|
+
|
48
|
+
class EnumAttributeValidator
|
49
|
+
attr_reader :datatype
|
50
|
+
attr_reader :allowable_values
|
51
|
+
|
52
|
+
def initialize(datatype, allowable_values)
|
53
|
+
@allowable_values = allowable_values.map do |value|
|
54
|
+
case datatype.to_s
|
55
|
+
when /Integer/i
|
56
|
+
value.to_i
|
57
|
+
when /Float/i
|
58
|
+
value.to_f
|
59
|
+
else
|
60
|
+
value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def valid?(value)
|
66
|
+
!value || allowable_values.include?(value)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
71
|
+
def self.attribute_map
|
72
|
+
{
|
73
|
+
:'name' => :'name',
|
74
|
+
:'start_time' => :'startTime',
|
75
|
+
:'end_time' => :'endTime',
|
76
|
+
:'attributes' => :'attributes',
|
77
|
+
:'description' => :'description',
|
78
|
+
:'active_ruleset_id' => :'activeRulesetId',
|
79
|
+
:'tags' => :'tags',
|
80
|
+
:'coupon_settings' => :'couponSettings',
|
81
|
+
:'referral_settings' => :'referralSettings',
|
82
|
+
:'limits' => :'limits',
|
83
|
+
:'features' => :'features'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# Attribute type mapping.
|
88
|
+
def self.openapi_types
|
89
|
+
{
|
90
|
+
:'name' => :'String',
|
91
|
+
:'start_time' => :'DateTime',
|
92
|
+
:'end_time' => :'DateTime',
|
93
|
+
:'attributes' => :'Object',
|
94
|
+
:'description' => :'String',
|
95
|
+
:'active_ruleset_id' => :'Integer',
|
96
|
+
:'tags' => :'Array<String>',
|
97
|
+
:'coupon_settings' => :'CodeGeneratorSettings',
|
98
|
+
:'referral_settings' => :'CodeGeneratorSettings',
|
99
|
+
:'limits' => :'Array<LimitConfig>',
|
100
|
+
:'features' => :'Array<String>'
|
101
|
+
}
|
102
|
+
end
|
103
|
+
|
104
|
+
# List of attributes with nullable: true
|
105
|
+
def self.openapi_nullable
|
106
|
+
Set.new([
|
107
|
+
:'start_time',
|
108
|
+
:'end_time',
|
109
|
+
:'description',
|
110
|
+
:'active_ruleset_id',
|
111
|
+
])
|
112
|
+
end
|
113
|
+
|
114
|
+
# Initializes the object
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
def initialize(attributes = {})
|
117
|
+
if (!attributes.is_a?(Hash))
|
118
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::NewRevisionVersion` initialize method"
|
119
|
+
end
|
120
|
+
|
121
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
122
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
123
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
124
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::NewRevisionVersion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
125
|
+
end
|
126
|
+
h[k.to_sym] = v
|
127
|
+
}
|
128
|
+
|
129
|
+
if attributes.key?(:'name')
|
130
|
+
self.name = attributes[:'name']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'start_time')
|
134
|
+
self.start_time = attributes[:'start_time']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'end_time')
|
138
|
+
self.end_time = attributes[:'end_time']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'attributes')
|
142
|
+
self.attributes = attributes[:'attributes']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.key?(:'description')
|
146
|
+
self.description = attributes[:'description']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.key?(:'active_ruleset_id')
|
150
|
+
self.active_ruleset_id = attributes[:'active_ruleset_id']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:'tags')
|
154
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
155
|
+
self.tags = value
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'coupon_settings')
|
160
|
+
self.coupon_settings = attributes[:'coupon_settings']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'referral_settings')
|
164
|
+
self.referral_settings = attributes[:'referral_settings']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'limits')
|
168
|
+
if (value = attributes[:'limits']).is_a?(Array)
|
169
|
+
self.limits = value
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'features')
|
174
|
+
if (value = attributes[:'features']).is_a?(Array)
|
175
|
+
self.features = value
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
181
|
+
# @return Array for valid properties with the reasons
|
182
|
+
def list_invalid_properties
|
183
|
+
invalid_properties = Array.new
|
184
|
+
if !@name.nil? && @name.to_s.length < 1
|
185
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
186
|
+
end
|
187
|
+
|
188
|
+
invalid_properties
|
189
|
+
end
|
190
|
+
|
191
|
+
# Check to see if the all the properties in the model are valid
|
192
|
+
# @return true if the model is valid
|
193
|
+
def valid?
|
194
|
+
return false if !@name.nil? && @name.to_s.length < 1
|
195
|
+
true
|
196
|
+
end
|
197
|
+
|
198
|
+
# Custom attribute writer method with validation
|
199
|
+
# @param [Object] name Value to be assigned
|
200
|
+
def name=(name)
|
201
|
+
if !name.nil? && name.to_s.length < 1
|
202
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
203
|
+
end
|
204
|
+
|
205
|
+
@name = name
|
206
|
+
end
|
207
|
+
|
208
|
+
# Checks equality by comparing each attribute.
|
209
|
+
# @param [Object] Object to be compared
|
210
|
+
def ==(o)
|
211
|
+
return true if self.equal?(o)
|
212
|
+
self.class == o.class &&
|
213
|
+
name == o.name &&
|
214
|
+
start_time == o.start_time &&
|
215
|
+
end_time == o.end_time &&
|
216
|
+
attributes == o.attributes &&
|
217
|
+
description == o.description &&
|
218
|
+
active_ruleset_id == o.active_ruleset_id &&
|
219
|
+
tags == o.tags &&
|
220
|
+
coupon_settings == o.coupon_settings &&
|
221
|
+
referral_settings == o.referral_settings &&
|
222
|
+
limits == o.limits &&
|
223
|
+
features == o.features
|
224
|
+
end
|
225
|
+
|
226
|
+
# @see the `==` method
|
227
|
+
# @param [Object] Object to be compared
|
228
|
+
def eql?(o)
|
229
|
+
self == o
|
230
|
+
end
|
231
|
+
|
232
|
+
# Calculates hash code according to all attributes.
|
233
|
+
# @return [Integer] Hash code
|
234
|
+
def hash
|
235
|
+
[name, start_time, end_time, attributes, description, active_ruleset_id, tags, coupon_settings, referral_settings, limits, features].hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Builds the object from hash
|
239
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
240
|
+
# @return [Object] Returns the model itself
|
241
|
+
def self.build_from_hash(attributes)
|
242
|
+
new.build_from_hash(attributes)
|
243
|
+
end
|
244
|
+
|
245
|
+
# Builds the object from hash
|
246
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
247
|
+
# @return [Object] Returns the model itself
|
248
|
+
def build_from_hash(attributes)
|
249
|
+
return nil unless attributes.is_a?(Hash)
|
250
|
+
self.class.openapi_types.each_pair do |key, type|
|
251
|
+
if 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[self.class.attribute_map[key]].is_a?(Array)
|
255
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
256
|
+
end
|
257
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
258
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
259
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
260
|
+
end
|
261
|
+
|
262
|
+
self
|
263
|
+
end
|
264
|
+
|
265
|
+
# Deserializes the data based on type
|
266
|
+
# @param string type Data type
|
267
|
+
# @param string value Value to be deserialized
|
268
|
+
# @return [Object] Deserialized data
|
269
|
+
def _deserialize(type, value)
|
270
|
+
case type.to_sym
|
271
|
+
when :DateTime
|
272
|
+
DateTime.parse(value)
|
273
|
+
when :Date
|
274
|
+
Date.parse(value)
|
275
|
+
when :String
|
276
|
+
value.to_s
|
277
|
+
when :Integer
|
278
|
+
value.to_i
|
279
|
+
when :Float
|
280
|
+
value.to_f
|
281
|
+
when :Boolean
|
282
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
283
|
+
true
|
284
|
+
else
|
285
|
+
false
|
286
|
+
end
|
287
|
+
when :Object
|
288
|
+
# generic object (usually a Hash), return directly
|
289
|
+
value
|
290
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
291
|
+
inner_type = Regexp.last_match[:inner_type]
|
292
|
+
value.map { |v| _deserialize(inner_type, v) }
|
293
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
294
|
+
k_type = Regexp.last_match[:k_type]
|
295
|
+
v_type = Regexp.last_match[:v_type]
|
296
|
+
{}.tap do |hash|
|
297
|
+
value.each do |k, v|
|
298
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
299
|
+
end
|
300
|
+
end
|
301
|
+
else # model
|
302
|
+
TalonOne.const_get(type).build_from_hash(value)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
# Returns the string representation of the object
|
307
|
+
# @return [String] String presentation of the object
|
308
|
+
def to_s
|
309
|
+
to_hash.to_s
|
310
|
+
end
|
311
|
+
|
312
|
+
# to_body is an alias to to_hash (backward compatibility)
|
313
|
+
# @return [Hash] Returns the object in the form of hash
|
314
|
+
def to_body
|
315
|
+
to_hash
|
316
|
+
end
|
317
|
+
|
318
|
+
# Returns the object in the form of hash
|
319
|
+
# @return [Hash] Returns the object in the form of hash
|
320
|
+
def to_hash
|
321
|
+
hash = {}
|
322
|
+
self.class.attribute_map.each_pair do |attr, param|
|
323
|
+
value = self.send(attr)
|
324
|
+
if value.nil?
|
325
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
326
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
327
|
+
end
|
328
|
+
|
329
|
+
hash[param] = _to_hash(value)
|
330
|
+
end
|
331
|
+
hash
|
332
|
+
end
|
333
|
+
|
334
|
+
# Outputs non-array value in the form of hash
|
335
|
+
# For object, use to_hash. Otherwise, just return the value
|
336
|
+
# @param [Object] value Any valid value
|
337
|
+
# @return [Hash] Returns the value in the form of hash
|
338
|
+
def _to_hash(value)
|
339
|
+
if value.is_a?(Array)
|
340
|
+
value.compact.map { |v| _to_hash(v) }
|
341
|
+
elsif value.is_a?(Hash)
|
342
|
+
{}.tap do |hash|
|
343
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
344
|
+
end
|
345
|
+
elsif value.respond_to? :to_hash
|
346
|
+
value.to_hash
|
347
|
+
else
|
348
|
+
value
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
@@ -21,6 +21,9 @@ module TalonOne
|
|
21
21
|
# Name or title for this webhook.
|
22
22
|
attr_accessor :title
|
23
23
|
|
24
|
+
# A description of the webhook.
|
25
|
+
attr_accessor :description
|
26
|
+
|
24
27
|
# API method for this webhook.
|
25
28
|
attr_accessor :verb
|
26
29
|
|
@@ -66,6 +69,7 @@ module TalonOne
|
|
66
69
|
{
|
67
70
|
:'application_ids' => :'applicationIds',
|
68
71
|
:'title' => :'title',
|
72
|
+
:'description' => :'description',
|
69
73
|
:'verb' => :'verb',
|
70
74
|
:'url' => :'url',
|
71
75
|
:'headers' => :'headers',
|
@@ -80,6 +84,7 @@ module TalonOne
|
|
80
84
|
{
|
81
85
|
:'application_ids' => :'Array<Integer>',
|
82
86
|
:'title' => :'String',
|
87
|
+
:'description' => :'String',
|
83
88
|
:'verb' => :'String',
|
84
89
|
:'url' => :'String',
|
85
90
|
:'headers' => :'Array<String>',
|
@@ -120,6 +125,10 @@ module TalonOne
|
|
120
125
|
self.title = attributes[:'title']
|
121
126
|
end
|
122
127
|
|
128
|
+
if attributes.key?(:'description')
|
129
|
+
self.description = attributes[:'description']
|
130
|
+
end
|
131
|
+
|
123
132
|
if attributes.key?(:'verb')
|
124
133
|
self.verb = attributes[:'verb']
|
125
134
|
end
|
@@ -237,6 +246,7 @@ module TalonOne
|
|
237
246
|
self.class == o.class &&
|
238
247
|
application_ids == o.application_ids &&
|
239
248
|
title == o.title &&
|
249
|
+
description == o.description &&
|
240
250
|
verb == o.verb &&
|
241
251
|
url == o.url &&
|
242
252
|
headers == o.headers &&
|
@@ -254,7 +264,7 @@ module TalonOne
|
|
254
264
|
# Calculates hash code according to all attributes.
|
255
265
|
# @return [Integer] Hash code
|
256
266
|
def hash
|
257
|
-
[application_ids, title, verb, url, headers, payload, params, enabled].hash
|
267
|
+
[application_ids, title, description, verb, url, headers, payload, params, enabled].hash
|
258
268
|
end
|
259
269
|
|
260
270
|
# Builds the object from hash
|
@@ -0,0 +1,229 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
|
5
|
+
|
6
|
+
The version of the OpenAPI document:
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
# Single event definition in the event data emitted by Okta.
|
17
|
+
class OktaEvent
|
18
|
+
# Event type defining an action.
|
19
|
+
attr_accessor :event_type
|
20
|
+
|
21
|
+
attr_accessor :target
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'event_type' => :'eventType',
|
27
|
+
:'target' => :'target'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'event_type' => :'String',
|
35
|
+
:'target' => :'Array<OktaEventTarget>'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::OktaEvent` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::OktaEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'event_type')
|
61
|
+
self.event_type = attributes[:'event_type']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'target')
|
65
|
+
if (value = attributes[:'target']).is_a?(Array)
|
66
|
+
self.target = value
|
67
|
+
end
|
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
|
+
invalid_properties = Array.new
|
75
|
+
if @event_type.nil?
|
76
|
+
invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
|
77
|
+
end
|
78
|
+
|
79
|
+
if @target.nil?
|
80
|
+
invalid_properties.push('invalid value for "target", target cannot be nil.')
|
81
|
+
end
|
82
|
+
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
return false if @event_type.nil?
|
90
|
+
return false if @target.nil?
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Checks equality by comparing each attribute.
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def ==(o)
|
97
|
+
return true if self.equal?(o)
|
98
|
+
self.class == o.class &&
|
99
|
+
event_type == o.event_type &&
|
100
|
+
target == o.target
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Integer] Hash code
|
111
|
+
def hash
|
112
|
+
[event_type, target].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def self.build_from_hash(attributes)
|
119
|
+
new.build_from_hash(attributes)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def build_from_hash(attributes)
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
127
|
+
self.class.openapi_types.each_pair do |key, type|
|
128
|
+
if type =~ /\AArray<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
132
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
133
|
+
end
|
134
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
135
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
136
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
137
|
+
end
|
138
|
+
|
139
|
+
self
|
140
|
+
end
|
141
|
+
|
142
|
+
# Deserializes the data based on type
|
143
|
+
# @param string type Data type
|
144
|
+
# @param string value Value to be deserialized
|
145
|
+
# @return [Object] Deserialized data
|
146
|
+
def _deserialize(type, value)
|
147
|
+
case type.to_sym
|
148
|
+
when :DateTime
|
149
|
+
DateTime.parse(value)
|
150
|
+
when :Date
|
151
|
+
Date.parse(value)
|
152
|
+
when :String
|
153
|
+
value.to_s
|
154
|
+
when :Integer
|
155
|
+
value.to_i
|
156
|
+
when :Float
|
157
|
+
value.to_f
|
158
|
+
when :Boolean
|
159
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
160
|
+
true
|
161
|
+
else
|
162
|
+
false
|
163
|
+
end
|
164
|
+
when :Object
|
165
|
+
# generic object (usually a Hash), return directly
|
166
|
+
value
|
167
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
168
|
+
inner_type = Regexp.last_match[:inner_type]
|
169
|
+
value.map { |v| _deserialize(inner_type, v) }
|
170
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
171
|
+
k_type = Regexp.last_match[:k_type]
|
172
|
+
v_type = Regexp.last_match[:v_type]
|
173
|
+
{}.tap do |hash|
|
174
|
+
value.each do |k, v|
|
175
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
else # model
|
179
|
+
TalonOne.const_get(type).build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|