talon_one 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +39 -3
- data/docs/Account.md +1 -1
- data/docs/AccountAdditionalCost.md +1 -1
- data/docs/Achievement.md +2 -2
- data/docs/AchievementBase.md +1 -1
- data/docs/AchievementProgressWithDefinition.md +1 -1
- data/docs/AchievementStatusEntry.md +2 -2
- data/docs/AddPriceAdjustmentCatalogAction.md +19 -0
- data/docs/AddedDeductedPointsBalancesNotificationPolicy.md +19 -0
- data/docs/Application.md +1 -1
- data/docs/ApplicationCIF.md +1 -1
- data/docs/ApplicationCIFExpression.md +1 -1
- data/docs/ApplicationCustomer.md +2 -2
- data/docs/ApplicationEvent.md +1 -1
- data/docs/ApplicationSession.md +1 -1
- data/docs/Attribute.md +1 -1
- data/docs/Audience.md +1 -1
- data/docs/AudienceCustomer.md +2 -2
- data/docs/BaseNotificationWebhook.md +1 -1
- data/docs/Binding.md +9 -1
- data/docs/CampaignCollection.md +1 -1
- data/docs/CampaignCollectionWithoutPayload.md +1 -1
- data/docs/CampaignDeactivationRequest.md +17 -0
- data/docs/CampaignGroup.md +1 -1
- data/docs/CampaignSet.md +1 -1
- data/docs/CampaignStoreBudget.md +1 -1
- data/docs/CampaignTemplate.md +1 -1
- data/docs/CardAddedDeductedPointsBalancesNotificationPolicy.md +19 -0
- data/docs/CartItem.md +12 -2
- data/docs/Catalog.md +1 -1
- data/docs/CatalogItem.md +1 -1
- data/docs/Change.md +1 -1
- data/docs/Collection.md +1 -1
- data/docs/CollectionWithoutPayload.md +1 -1
- data/docs/Coupon.md +2 -2
- data/docs/CouponCreationJob.md +1 -1
- data/docs/CouponDeletionJob.md +1 -1
- data/docs/CouponEntity.md +19 -0
- data/docs/CreateAchievement.md +1 -1
- data/docs/CustomEffect.md +1 -1
- data/docs/CustomerProfile.md +2 -2
- data/docs/CustomerProfileEntity.md +19 -0
- data/docs/CustomerSessionV2.md +1 -1
- data/docs/Effect.md +6 -0
- data/docs/EffectEntity.md +7 -1
- data/docs/Entity.md +1 -1
- data/docs/Environment.md +4 -2
- data/docs/Event.md +1 -1
- data/docs/EventType.md +1 -1
- data/docs/Export.md +1 -1
- data/docs/ExtendLoyaltyPointsExpiryDateEffectProps.md +25 -0
- data/docs/Giveaway.md +1 -1
- data/docs/GiveawaysPool.md +1 -1
- data/docs/Import.md +1 -1
- data/docs/InlineResponse20048.md +2 -4
- data/docs/InlineResponse20049.md +2 -4
- data/docs/InlineResponse20050.md +19 -0
- data/docs/InlineResponse20051.md +19 -0
- data/docs/IntegrationApi.md +3 -3
- data/docs/IntegrationCoupon.md +2 -2
- data/docs/IntegrationCustomerProfileAudienceRequest.md +17 -0
- data/docs/IntegrationCustomerProfileAudienceRequestItem.md +21 -0
- data/docs/IntegrationEventV2Request.md +2 -0
- data/docs/InventoryCoupon.md +2 -2
- data/docs/InventoryReferral.md +1 -1
- data/docs/LedgerEntry.md +1 -1
- data/docs/LedgerInfo.md +2 -2
- data/docs/LoyaltyCard.md +1 -1
- data/docs/LoyaltyProgramBalance.md +2 -2
- data/docs/LoyaltyTier.md +1 -1
- data/docs/ManagementApi.md +792 -29
- data/docs/ModelReturn.md +1 -1
- data/docs/MultipleAudiencesItem.md +1 -1
- data/docs/NewPriceAdjustment.md +27 -0
- data/docs/NewPriceType.md +23 -0
- data/docs/NewWebhook.md +2 -0
- data/docs/Picklist.md +1 -1
- data/docs/PriceDetail.md +23 -0
- data/docs/PriceType.md +33 -0
- data/docs/Referral.md +1 -1
- data/docs/RevisionActivationRequest.md +19 -0
- data/docs/Role.md +1 -1
- data/docs/RoleV2.md +1 -1
- data/docs/Ruleset.md +1 -1
- data/docs/SamlConnection.md +1 -1
- data/docs/ScimBaseGroup.md +19 -0
- data/docs/ScimGroup.md +21 -0
- data/docs/ScimGroupMember.md +19 -0
- data/docs/ScimGroupsListResponse.md +21 -0
- data/docs/Store.md +1 -1
- data/docs/TemplateDef.md +1 -1
- data/docs/UpdateAchievement.md +1 -1
- data/docs/User.md +1 -1
- data/docs/Webhook.md +3 -1
- data/docs/WebhookAuthentication.md +33 -0
- data/docs/WebhookAuthenticationBase.md +21 -0
- data/docs/WebhookAuthenticationDataBasic.md +19 -0
- data/docs/WebhookAuthenticationDataCustom.md +17 -0
- data/docs/WebhookAuthenticationWebhookRef.md +21 -0
- data/docs/WebhookWithOutgoingIntegrationDetails.md +3 -1
- data/lib/talon_one/api/integration_api.rb +6 -6
- data/lib/talon_one/api/management_api.rb +879 -11
- data/lib/talon_one/models/account.rb +1 -1
- data/lib/talon_one/models/account_additional_cost.rb +1 -1
- data/lib/talon_one/models/achievement.rb +4 -4
- data/lib/talon_one/models/achievement_base.rb +3 -3
- data/lib/talon_one/models/achievement_progress_with_definition.rb +3 -3
- data/lib/talon_one/models/achievement_status_entry.rb +4 -4
- data/lib/talon_one/models/add_price_adjustment_catalog_action.rb +230 -0
- data/lib/talon_one/models/added_deducted_points_balances_notification_policy.rb +269 -0
- data/lib/talon_one/models/application.rb +1 -1
- data/lib/talon_one/models/application_cif.rb +1 -1
- data/lib/talon_one/models/application_cif_expression.rb +1 -1
- data/lib/talon_one/models/application_customer.rb +2 -2
- data/lib/talon_one/models/application_event.rb +1 -1
- data/lib/talon_one/models/application_session.rb +1 -1
- data/lib/talon_one/models/attribute.rb +1 -1
- data/lib/talon_one/models/audience.rb +1 -1
- data/lib/talon_one/models/audience_customer.rb +2 -2
- data/lib/talon_one/models/base_notification.rb +2 -2
- data/lib/talon_one/models/base_notification_webhook.rb +1 -1
- data/lib/talon_one/models/binding.rb +44 -4
- data/lib/talon_one/models/campaign_collection.rb +1 -1
- data/lib/talon_one/models/campaign_collection_without_payload.rb +1 -1
- data/lib/talon_one/models/campaign_deactivation_request.rb +214 -0
- data/lib/talon_one/models/campaign_group.rb +1 -1
- data/lib/talon_one/models/campaign_set.rb +1 -1
- data/lib/talon_one/models/campaign_store_budget.rb +1 -1
- data/lib/talon_one/models/campaign_template.rb +1 -1
- data/lib/talon_one/models/card_added_deducted_points_balances_notification_policy.rb +269 -0
- data/lib/talon_one/models/cart_item.rb +57 -5
- data/lib/talon_one/models/catalog.rb +1 -1
- data/lib/talon_one/models/catalog_action.rb +2 -2
- data/lib/talon_one/models/catalog_item.rb +1 -1
- data/lib/talon_one/models/change.rb +1 -1
- data/lib/talon_one/models/collection.rb +1 -1
- data/lib/talon_one/models/collection_without_payload.rb +1 -1
- data/lib/talon_one/models/coupon.rb +7 -7
- data/lib/talon_one/models/coupon_constraints.rb +5 -5
- data/lib/talon_one/models/coupon_creation_job.rb +6 -6
- data/lib/talon_one/models/coupon_deletion_job.rb +1 -1
- data/lib/talon_one/models/coupon_entity.rb +227 -0
- data/lib/talon_one/models/create_achievement.rb +3 -3
- data/lib/talon_one/models/custom_effect.rb +1 -1
- data/lib/talon_one/models/customer_profile.rb +2 -2
- data/lib/talon_one/models/customer_profile_entity.rb +227 -0
- data/lib/talon_one/models/customer_session_v2.rb +1 -1
- data/lib/talon_one/models/effect.rb +31 -1
- data/lib/talon_one/models/effect_entity.rb +34 -4
- data/lib/talon_one/models/entity.rb +1 -1
- data/lib/talon_one/models/environment.rb +17 -5
- data/lib/talon_one/models/event.rb +1 -1
- data/lib/talon_one/models/event_type.rb +1 -1
- data/lib/talon_one/models/export.rb +1 -1
- data/lib/talon_one/models/extend_loyalty_points_expiry_date_effect_props.rb +270 -0
- data/lib/talon_one/models/giveaway.rb +1 -1
- data/lib/talon_one/models/giveaways_pool.rb +1 -1
- data/lib/talon_one/models/import.rb +1 -1
- data/lib/talon_one/models/inline_response20048.rb +2 -16
- data/lib/talon_one/models/inline_response20049.rb +2 -21
- data/lib/talon_one/models/inline_response20050.rb +222 -0
- data/lib/talon_one/models/inline_response20051.rb +227 -0
- data/lib/talon_one/models/integration_coupon.rb +7 -7
- data/lib/talon_one/models/integration_customer_profile_audience_request.rb +208 -0
- data/lib/talon_one/models/integration_customer_profile_audience_request_item.rb +295 -0
- data/lib/talon_one/models/integration_event_v2_request.rb +13 -1
- data/lib/talon_one/models/inventory_coupon.rb +7 -7
- data/lib/talon_one/models/inventory_referral.rb +1 -1
- data/lib/talon_one/models/ledger_entry.rb +1 -1
- data/lib/talon_one/models/ledger_info.rb +0 -10
- data/lib/talon_one/models/loyalty_card.rb +1 -1
- data/lib/talon_one/models/loyalty_program_balance.rb +0 -10
- data/lib/talon_one/models/loyalty_tier.rb +1 -1
- data/lib/talon_one/models/model_return.rb +1 -1
- data/lib/talon_one/models/multiple_audiences_item.rb +1 -1
- data/lib/talon_one/models/new_coupon_creation_job.rb +5 -5
- data/lib/talon_one/models/new_coupons.rb +5 -5
- data/lib/talon_one/models/new_coupons_for_multiple_recipients.rb +5 -5
- data/lib/talon_one/models/new_message_test.rb +2 -2
- data/lib/talon_one/models/new_price_adjustment.rb +268 -0
- data/lib/talon_one/models/new_price_type.rb +270 -0
- data/lib/talon_one/models/new_webhook.rb +16 -1
- data/lib/talon_one/models/picklist.rb +1 -1
- data/lib/talon_one/models/price_detail.rb +237 -0
- data/lib/talon_one/models/price_type.rb +347 -0
- data/lib/talon_one/models/referral.rb +1 -1
- data/lib/talon_one/models/revision_activation_request.rb +224 -0
- data/lib/talon_one/models/role.rb +1 -1
- data/lib/talon_one/models/role_v2.rb +1 -1
- data/lib/talon_one/models/ruleset.rb +1 -1
- data/lib/talon_one/models/saml_connection.rb +1 -1
- data/lib/talon_one/models/scim_base_group.rb +220 -0
- data/lib/talon_one/models/scim_group.rb +235 -0
- data/lib/talon_one/models/scim_group_member.rb +218 -0
- data/lib/talon_one/models/scim_groups_list_response.rb +236 -0
- data/lib/talon_one/models/store.rb +1 -1
- data/lib/talon_one/models/template_def.rb +1 -1
- data/lib/talon_one/models/update_achievement.rb +3 -3
- data/lib/talon_one/models/update_coupon.rb +5 -5
- data/lib/talon_one/models/update_coupon_batch.rb +5 -5
- data/lib/talon_one/models/user.rb +1 -1
- data/lib/talon_one/models/webhook.rb +17 -2
- data/lib/talon_one/models/webhook_authentication.rb +365 -0
- data/lib/talon_one/models/webhook_authentication_base.rb +274 -0
- data/lib/talon_one/models/webhook_authentication_data_basic.rb +227 -0
- data/lib/talon_one/models/webhook_authentication_data_custom.rb +213 -0
- data/lib/talon_one/models/webhook_authentication_webhook_ref.rb +258 -0
- data/lib/talon_one/models/webhook_with_outgoing_integration_details.rb +17 -2
- data/lib/talon_one/version.rb +1 -1
- data/lib/talon_one.rb +24 -0
- data/spec/api/integration_api_spec.rb +3 -3
- data/spec/api/management_api_spec.rb +167 -3
- data/spec/models/achievement_base_spec.rb +1 -1
- data/spec/models/achievement_progress_with_definition_spec.rb +1 -1
- data/spec/models/achievement_spec.rb +1 -1
- data/spec/models/achievement_status_entry_spec.rb +1 -1
- data/spec/models/add_price_adjustment_catalog_action_spec.rb +47 -0
- data/spec/models/added_deducted_points_balances_notification_policy_spec.rb +51 -0
- data/spec/models/base_notification_spec.rb +1 -1
- data/spec/models/binding_spec.rb +24 -0
- data/spec/models/campaign_deactivation_request_spec.rb +41 -0
- data/spec/models/card_added_deducted_points_balances_notification_policy_spec.rb +51 -0
- data/spec/models/cart_item_spec.rb +30 -0
- data/spec/models/catalog_action_spec.rb +1 -1
- data/spec/models/coupon_entity_spec.rb +47 -0
- data/spec/models/create_achievement_spec.rb +1 -1
- data/spec/models/customer_profile_entity_spec.rb +47 -0
- data/spec/models/effect_entity_spec.rb +18 -0
- data/spec/models/effect_spec.rb +18 -0
- data/spec/models/environment_spec.rb +6 -0
- data/spec/models/extend_loyalty_points_expiry_date_effect_props_spec.rb +65 -0
- data/spec/models/inline_response20048_spec.rb +0 -6
- data/spec/models/inline_response20049_spec.rb +0 -6
- data/spec/models/inline_response20050_spec.rb +47 -0
- data/spec/models/inline_response20051_spec.rb +47 -0
- data/spec/models/integration_customer_profile_audience_request_item_spec.rb +57 -0
- data/spec/models/integration_customer_profile_audience_request_spec.rb +41 -0
- data/spec/models/integration_event_v2_request_spec.rb +6 -0
- data/spec/models/new_message_test_spec.rb +1 -1
- data/spec/models/new_price_adjustment_spec.rb +71 -0
- data/spec/models/new_price_type_spec.rb +59 -0
- data/spec/models/new_webhook_spec.rb +6 -0
- data/spec/models/price_detail_spec.rb +59 -0
- data/spec/models/price_type_spec.rb +89 -0
- data/spec/models/scim_base_group_spec.rb +47 -0
- data/spec/models/scim_group_member_spec.rb +47 -0
- data/spec/models/scim_group_spec.rb +53 -0
- data/spec/models/scim_groups_list_response_spec.rb +53 -0
- data/spec/models/update_achievement_spec.rb +1 -1
- data/spec/models/webhook_authentication_base_spec.rb +57 -0
- data/spec/models/webhook_authentication_data_basic_spec.rb +47 -0
- data/spec/models/webhook_authentication_data_custom_spec.rb +41 -0
- data/spec/models/webhook_authentication_spec.rb +93 -0
- data/spec/models/webhook_authentication_webhook_ref_spec.rb +53 -0
- data/spec/models/webhook_spec.rb +6 -0
- data/spec/models/webhook_with_outgoing_integration_details_spec.rb +6 -0
- metadata +100 -2
@@ -0,0 +1,269 @@
|
|
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 CardAddedDeductedPointsBalancesNotificationPolicy
|
17
|
+
# Notification name.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
attr_accessor :scopes
|
21
|
+
|
22
|
+
class EnumAttributeValidator
|
23
|
+
attr_reader :datatype
|
24
|
+
attr_reader :allowable_values
|
25
|
+
|
26
|
+
def initialize(datatype, allowable_values)
|
27
|
+
@allowable_values = allowable_values.map do |value|
|
28
|
+
case datatype.to_s
|
29
|
+
when /Integer/i
|
30
|
+
value.to_i
|
31
|
+
when /Float/i
|
32
|
+
value.to_f
|
33
|
+
else
|
34
|
+
value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def valid?(value)
|
40
|
+
!value || allowable_values.include?(value)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'name' => :'name',
|
48
|
+
:'scopes' => :'scopes'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.openapi_types
|
54
|
+
{
|
55
|
+
:'name' => :'String',
|
56
|
+
:'scopes' => :'Array<String>'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# List of attributes with nullable: true
|
61
|
+
def self.openapi_nullable
|
62
|
+
Set.new([
|
63
|
+
])
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
68
|
+
def initialize(attributes = {})
|
69
|
+
if (!attributes.is_a?(Hash))
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::CardAddedDeductedPointsBalancesNotificationPolicy` initialize method"
|
71
|
+
end
|
72
|
+
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::CardAddedDeductedPointsBalancesNotificationPolicy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
77
|
+
end
|
78
|
+
h[k.to_sym] = v
|
79
|
+
}
|
80
|
+
|
81
|
+
if attributes.key?(:'name')
|
82
|
+
self.name = attributes[:'name']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'scopes')
|
86
|
+
if (value = attributes[:'scopes']).is_a?(Array)
|
87
|
+
self.scopes = value
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
93
|
+
# @return Array for valid properties with the reasons
|
94
|
+
def list_invalid_properties
|
95
|
+
invalid_properties = Array.new
|
96
|
+
if @name.nil?
|
97
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
98
|
+
end
|
99
|
+
|
100
|
+
if @name.to_s.length < 1
|
101
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if @scopes.nil?
|
105
|
+
invalid_properties.push('invalid value for "scopes", scopes cannot be nil.')
|
106
|
+
end
|
107
|
+
|
108
|
+
invalid_properties
|
109
|
+
end
|
110
|
+
|
111
|
+
# Check to see if the all the properties in the model are valid
|
112
|
+
# @return true if the model is valid
|
113
|
+
def valid?
|
114
|
+
return false if @name.nil?
|
115
|
+
return false if @name.to_s.length < 1
|
116
|
+
return false if @scopes.nil?
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
120
|
+
# Custom attribute writer method with validation
|
121
|
+
# @param [Object] name Value to be assigned
|
122
|
+
def name=(name)
|
123
|
+
if name.nil?
|
124
|
+
fail ArgumentError, 'name cannot be nil'
|
125
|
+
end
|
126
|
+
|
127
|
+
if name.to_s.length < 1
|
128
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
129
|
+
end
|
130
|
+
|
131
|
+
@name = name
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
name == o.name &&
|
140
|
+
scopes == o.scopes
|
141
|
+
end
|
142
|
+
|
143
|
+
# @see the `==` method
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def eql?(o)
|
146
|
+
self == o
|
147
|
+
end
|
148
|
+
|
149
|
+
# Calculates hash code according to all attributes.
|
150
|
+
# @return [Integer] Hash code
|
151
|
+
def hash
|
152
|
+
[name, scopes].hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Builds the object from hash
|
156
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
157
|
+
# @return [Object] Returns the model itself
|
158
|
+
def self.build_from_hash(attributes)
|
159
|
+
new.build_from_hash(attributes)
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def build_from_hash(attributes)
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
167
|
+
self.class.openapi_types.each_pair do |key, type|
|
168
|
+
if type =~ /\AArray<(.*)>/i
|
169
|
+
# check to ensure the input is an array given that the attribute
|
170
|
+
# is documented as an array but the input is not
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
172
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
173
|
+
end
|
174
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
175
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
176
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
177
|
+
end
|
178
|
+
|
179
|
+
self
|
180
|
+
end
|
181
|
+
|
182
|
+
# Deserializes the data based on type
|
183
|
+
# @param string type Data type
|
184
|
+
# @param string value Value to be deserialized
|
185
|
+
# @return [Object] Deserialized data
|
186
|
+
def _deserialize(type, value)
|
187
|
+
case type.to_sym
|
188
|
+
when :DateTime
|
189
|
+
DateTime.parse(value)
|
190
|
+
when :Date
|
191
|
+
Date.parse(value)
|
192
|
+
when :String
|
193
|
+
value.to_s
|
194
|
+
when :Integer
|
195
|
+
value.to_i
|
196
|
+
when :Float
|
197
|
+
value.to_f
|
198
|
+
when :Boolean
|
199
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
200
|
+
true
|
201
|
+
else
|
202
|
+
false
|
203
|
+
end
|
204
|
+
when :Object
|
205
|
+
# generic object (usually a Hash), return directly
|
206
|
+
value
|
207
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
208
|
+
inner_type = Regexp.last_match[:inner_type]
|
209
|
+
value.map { |v| _deserialize(inner_type, v) }
|
210
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
211
|
+
k_type = Regexp.last_match[:k_type]
|
212
|
+
v_type = Regexp.last_match[:v_type]
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each do |k, v|
|
215
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
else # model
|
219
|
+
TalonOne.const_get(type).build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
@@ -58,9 +58,24 @@ module TalonOne
|
|
58
58
|
# Use this property to set a value for the additional costs of this item, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs).
|
59
59
|
attr_accessor :additional_costs
|
60
60
|
|
61
|
-
# The
|
61
|
+
# The catalog item ID.
|
62
62
|
attr_accessor :catalog_item_id
|
63
63
|
|
64
|
+
# The selected price type for this cart item (e.g. the price for members only).
|
65
|
+
attr_accessor :selected_price_type
|
66
|
+
|
67
|
+
# The reference ID of the selected price adjustment for this cart item. Only returned if the selected price resulted from a price adjustment.
|
68
|
+
attr_accessor :adjustment_reference_id
|
69
|
+
|
70
|
+
# The date and time from which the price adjustment is effective. Only returned if the selected price resulted from a price adjustment that contains this field.
|
71
|
+
attr_accessor :adjustment_effective_from
|
72
|
+
|
73
|
+
# The date and time until which the price adjustment is effective. Only returned if the selected price resulted from a price adjustment that contains this field.
|
74
|
+
attr_accessor :adjustment_effective_until
|
75
|
+
|
76
|
+
# A map of keys and values representing the price types and related price adjustment details for this cart item. The keys correspond to the `priceType` names.
|
77
|
+
attr_accessor :prices
|
78
|
+
|
64
79
|
# Attribute mapping from ruby-style variable name to JSON key.
|
65
80
|
def self.attribute_map
|
66
81
|
{
|
@@ -79,7 +94,12 @@ module TalonOne
|
|
79
94
|
:'position' => :'position',
|
80
95
|
:'attributes' => :'attributes',
|
81
96
|
:'additional_costs' => :'additionalCosts',
|
82
|
-
:'catalog_item_id' => :'catalogItemID'
|
97
|
+
:'catalog_item_id' => :'catalogItemID',
|
98
|
+
:'selected_price_type' => :'selectedPriceType',
|
99
|
+
:'adjustment_reference_id' => :'adjustmentReferenceId',
|
100
|
+
:'adjustment_effective_from' => :'adjustmentEffectiveFrom',
|
101
|
+
:'adjustment_effective_until' => :'adjustmentEffectiveUntil',
|
102
|
+
:'prices' => :'prices'
|
83
103
|
}
|
84
104
|
end
|
85
105
|
|
@@ -101,7 +121,12 @@ module TalonOne
|
|
101
121
|
:'position' => :'Float',
|
102
122
|
:'attributes' => :'Object',
|
103
123
|
:'additional_costs' => :'Hash<String, AdditionalCost>',
|
104
|
-
:'catalog_item_id' => :'Integer'
|
124
|
+
:'catalog_item_id' => :'Integer',
|
125
|
+
:'selected_price_type' => :'String',
|
126
|
+
:'adjustment_reference_id' => :'String',
|
127
|
+
:'adjustment_effective_from' => :'DateTime',
|
128
|
+
:'adjustment_effective_until' => :'DateTime',
|
129
|
+
:'prices' => :'Hash<String, PriceDetail>'
|
105
130
|
}
|
106
131
|
end
|
107
132
|
|
@@ -191,6 +216,28 @@ module TalonOne
|
|
191
216
|
if attributes.key?(:'catalog_item_id')
|
192
217
|
self.catalog_item_id = attributes[:'catalog_item_id']
|
193
218
|
end
|
219
|
+
|
220
|
+
if attributes.key?(:'selected_price_type')
|
221
|
+
self.selected_price_type = attributes[:'selected_price_type']
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'adjustment_reference_id')
|
225
|
+
self.adjustment_reference_id = attributes[:'adjustment_reference_id']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'adjustment_effective_from')
|
229
|
+
self.adjustment_effective_from = attributes[:'adjustment_effective_from']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'adjustment_effective_until')
|
233
|
+
self.adjustment_effective_until = attributes[:'adjustment_effective_until']
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'prices')
|
237
|
+
if (value = attributes[:'prices']).is_a?(Hash)
|
238
|
+
self.prices = value
|
239
|
+
end
|
240
|
+
end
|
194
241
|
end
|
195
242
|
|
196
243
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -274,7 +321,12 @@ module TalonOne
|
|
274
321
|
position == o.position &&
|
275
322
|
attributes == o.attributes &&
|
276
323
|
additional_costs == o.additional_costs &&
|
277
|
-
catalog_item_id == o.catalog_item_id
|
324
|
+
catalog_item_id == o.catalog_item_id &&
|
325
|
+
selected_price_type == o.selected_price_type &&
|
326
|
+
adjustment_reference_id == o.adjustment_reference_id &&
|
327
|
+
adjustment_effective_from == o.adjustment_effective_from &&
|
328
|
+
adjustment_effective_until == o.adjustment_effective_until &&
|
329
|
+
prices == o.prices
|
278
330
|
end
|
279
331
|
|
280
332
|
# @see the `==` method
|
@@ -286,7 +338,7 @@ module TalonOne
|
|
286
338
|
# Calculates hash code according to all attributes.
|
287
339
|
# @return [Integer] Hash code
|
288
340
|
def hash
|
289
|
-
[name, sku, quantity, returned_quantity, remaining_quantity, price, category, product, weight, height, width, length, position, attributes, additional_costs, catalog_item_id].hash
|
341
|
+
[name, sku, quantity, returned_quantity, remaining_quantity, price, category, product, weight, height, width, length, position, attributes, additional_costs, catalog_item_id, selected_price_type, adjustment_reference_id, adjustment_effective_from, adjustment_effective_until, prices].hash
|
290
342
|
end
|
291
343
|
|
292
344
|
# Builds the object from hash
|
@@ -107,7 +107,7 @@ module TalonOne
|
|
107
107
|
# @return true if the model is valid
|
108
108
|
def valid?
|
109
109
|
return false if @type.nil?
|
110
|
-
type_validator = EnumAttributeValidator.new('String', ["ADD", "PATCH", "PATCH_MANY", "REMOVE", "REMOVE_MANY"])
|
110
|
+
type_validator = EnumAttributeValidator.new('String', ["ADD", "PATCH", "PATCH_MANY", "REMOVE", "REMOVE_MANY", "ADD_PRICE_ADJUSTMENT"])
|
111
111
|
return false unless type_validator.valid?(@type)
|
112
112
|
return false if @payload.nil?
|
113
113
|
true
|
@@ -116,7 +116,7 @@ module TalonOne
|
|
116
116
|
# Custom attribute writer method checking allowed values (enum).
|
117
117
|
# @param [Object] type Object to be assigned
|
118
118
|
def type=(type)
|
119
|
-
validator = EnumAttributeValidator.new('String', ["ADD", "PATCH", "PATCH_MANY", "REMOVE", "REMOVE_MANY"])
|
119
|
+
validator = EnumAttributeValidator.new('String', ["ADD", "PATCH", "PATCH_MANY", "REMOVE", "REMOVE_MANY", "ADD_PRICE_ADJUSTMENT"])
|
120
120
|
unless validator.valid?(type)
|
121
121
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
122
122
|
end
|
@@ -14,10 +14,10 @@ require 'date'
|
|
14
14
|
|
15
15
|
module TalonOne
|
16
16
|
class Coupon
|
17
|
-
#
|
17
|
+
# The internal ID of the coupon.
|
18
18
|
attr_accessor :id
|
19
19
|
|
20
|
-
# The time
|
20
|
+
# The time the coupon was created.
|
21
21
|
attr_accessor :created
|
22
22
|
|
23
23
|
# The ID of the campaign that owns this entity.
|
@@ -288,8 +288,8 @@ module TalonOne
|
|
288
288
|
invalid_properties.push('invalid value for "usage_limit", must be greater than or equal to 0.')
|
289
289
|
end
|
290
290
|
|
291
|
-
if !@discount_limit.nil? && @discount_limit >
|
292
|
-
invalid_properties.push('invalid value for "discount_limit", must be smaller than or equal to
|
291
|
+
if !@discount_limit.nil? && @discount_limit > 1E+15
|
292
|
+
invalid_properties.push('invalid value for "discount_limit", must be smaller than or equal to 1E+15.')
|
293
293
|
end
|
294
294
|
|
295
295
|
if !@discount_limit.nil? && @discount_limit < 0
|
@@ -326,7 +326,7 @@ module TalonOne
|
|
326
326
|
return false if @usage_limit.nil?
|
327
327
|
return false if @usage_limit > 999999
|
328
328
|
return false if @usage_limit < 0
|
329
|
-
return false if !@discount_limit.nil? && @discount_limit >
|
329
|
+
return false if !@discount_limit.nil? && @discount_limit > 1E+15
|
330
330
|
return false if !@discount_limit.nil? && @discount_limit < 0
|
331
331
|
return false if !@reservation_limit.nil? && @reservation_limit > 999999
|
332
332
|
return false if !@reservation_limit.nil? && @reservation_limit < 0
|
@@ -370,8 +370,8 @@ module TalonOne
|
|
370
370
|
# Custom attribute writer method with validation
|
371
371
|
# @param [Object] discount_limit Value to be assigned
|
372
372
|
def discount_limit=(discount_limit)
|
373
|
-
if !discount_limit.nil? && discount_limit >
|
374
|
-
fail ArgumentError, 'invalid value for "discount_limit", must be smaller than or equal to
|
373
|
+
if !discount_limit.nil? && discount_limit > 1E+15
|
374
|
+
fail ArgumentError, 'invalid value for "discount_limit", must be smaller than or equal to 1E+15.'
|
375
375
|
end
|
376
376
|
|
377
377
|
if !discount_limit.nil? && discount_limit < 0
|
@@ -105,8 +105,8 @@ module TalonOne
|
|
105
105
|
invalid_properties.push('invalid value for "usage_limit", must be greater than or equal to 0.')
|
106
106
|
end
|
107
107
|
|
108
|
-
if !@discount_limit.nil? && @discount_limit >
|
109
|
-
invalid_properties.push('invalid value for "discount_limit", must be smaller than or equal to
|
108
|
+
if !@discount_limit.nil? && @discount_limit > 1E+15
|
109
|
+
invalid_properties.push('invalid value for "discount_limit", must be smaller than or equal to 1E+15.')
|
110
110
|
end
|
111
111
|
|
112
112
|
if !@discount_limit.nil? && @discount_limit < 0
|
@@ -129,7 +129,7 @@ module TalonOne
|
|
129
129
|
def valid?
|
130
130
|
return false if !@usage_limit.nil? && @usage_limit > 999999
|
131
131
|
return false if !@usage_limit.nil? && @usage_limit < 0
|
132
|
-
return false if !@discount_limit.nil? && @discount_limit >
|
132
|
+
return false if !@discount_limit.nil? && @discount_limit > 1E+15
|
133
133
|
return false if !@discount_limit.nil? && @discount_limit < 0
|
134
134
|
return false if !@reservation_limit.nil? && @reservation_limit > 999999
|
135
135
|
return false if !@reservation_limit.nil? && @reservation_limit < 0
|
@@ -153,8 +153,8 @@ module TalonOne
|
|
153
153
|
# Custom attribute writer method with validation
|
154
154
|
# @param [Object] discount_limit Value to be assigned
|
155
155
|
def discount_limit=(discount_limit)
|
156
|
-
if !discount_limit.nil? && discount_limit >
|
157
|
-
fail ArgumentError, 'invalid value for "discount_limit", must be smaller than or equal to
|
156
|
+
if !discount_limit.nil? && discount_limit > 1E+15
|
157
|
+
fail ArgumentError, 'invalid value for "discount_limit", must be smaller than or equal to 1E+15.'
|
158
158
|
end
|
159
159
|
|
160
160
|
if !discount_limit.nil? && discount_limit < 0
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
|
15
15
|
module TalonOne
|
16
16
|
class CouponCreationJob
|
17
|
-
#
|
17
|
+
# The internal ID of this entity.
|
18
18
|
attr_accessor :id
|
19
19
|
|
20
20
|
# The time this entity was created.
|
@@ -283,8 +283,8 @@ module TalonOne
|
|
283
283
|
invalid_properties.push('invalid value for "usage_limit", must be greater than or equal to 0.')
|
284
284
|
end
|
285
285
|
|
286
|
-
if !@discount_limit.nil? && @discount_limit >
|
287
|
-
invalid_properties.push('invalid value for "discount_limit", must be smaller than or equal to
|
286
|
+
if !@discount_limit.nil? && @discount_limit > 1E+15
|
287
|
+
invalid_properties.push('invalid value for "discount_limit", must be smaller than or equal to 1E+15.')
|
288
288
|
end
|
289
289
|
|
290
290
|
if !@discount_limit.nil? && @discount_limit < 0
|
@@ -361,7 +361,7 @@ module TalonOne
|
|
361
361
|
return false if @usage_limit.nil?
|
362
362
|
return false if @usage_limit > 999999
|
363
363
|
return false if @usage_limit < 0
|
364
|
-
return false if !@discount_limit.nil? && @discount_limit >
|
364
|
+
return false if !@discount_limit.nil? && @discount_limit > 1E+15
|
365
365
|
return false if !@discount_limit.nil? && @discount_limit < 0
|
366
366
|
return false if !@reservation_limit.nil? && @reservation_limit > 999999
|
367
367
|
return false if !@reservation_limit.nil? && @reservation_limit < 0
|
@@ -401,8 +401,8 @@ module TalonOne
|
|
401
401
|
# Custom attribute writer method with validation
|
402
402
|
# @param [Object] discount_limit Value to be assigned
|
403
403
|
def discount_limit=(discount_limit)
|
404
|
-
if !discount_limit.nil? && discount_limit >
|
405
|
-
fail ArgumentError, 'invalid value for "discount_limit", must be smaller than or equal to
|
404
|
+
if !discount_limit.nil? && discount_limit > 1E+15
|
405
|
+
fail ArgumentError, 'invalid value for "discount_limit", must be smaller than or equal to 1E+15.'
|
406
406
|
end
|
407
407
|
|
408
408
|
if !discount_limit.nil? && discount_limit < 0
|