talon_one 2.3.0 → 2.4.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 +31 -5
- data/docs/ApplicationCampaignStats.md +27 -0
- data/docs/ApplicationReferee.md +27 -0
- data/docs/AwardGiveawayEffectProps.md +25 -0
- data/docs/Campaign.md +2 -0
- data/docs/Coupon.md +1 -1
- data/docs/CustomEffect.md +41 -0
- data/docs/CustomEffectProps.md +19 -0
- data/docs/CustomerInventory.md +4 -2
- data/docs/CustomerProfileIntegrationRequestV2.md +1 -1
- data/docs/Environment.md +10 -0
- data/docs/Giveaway.md +33 -0
- data/docs/GiveawaysPool.md +33 -0
- data/docs/ImportEntity.md +17 -0
- data/docs/InlineResponse20010.md +3 -3
- data/docs/InlineResponse20011.md +4 -2
- data/docs/InlineResponse20012.md +2 -4
- data/docs/InlineResponse20013.md +3 -3
- data/docs/InlineResponse20014.md +2 -2
- data/docs/InlineResponse20015.md +2 -2
- data/docs/InlineResponse20016.md +3 -3
- data/docs/InlineResponse20017.md +2 -2
- data/docs/InlineResponse20018.md +3 -3
- data/docs/InlineResponse20019.md +5 -3
- data/docs/InlineResponse20020.md +2 -2
- data/docs/InlineResponse20021.md +1 -1
- data/docs/InlineResponse20022.md +1 -1
- data/docs/InlineResponse20023.md +1 -1
- data/docs/InlineResponse20024.md +1 -1
- data/docs/InlineResponse20025.md +1 -1
- data/docs/InlineResponse20026.md +1 -1
- data/docs/InlineResponse20027.md +4 -2
- data/docs/InlineResponse20028.md +2 -4
- data/docs/InlineResponse20029.md +1 -1
- data/docs/InlineResponse2006.md +2 -2
- data/docs/InlineResponse2007.md +3 -3
- data/docs/InlineResponse2008.md +1 -1
- data/docs/InlineResponse2009.md +2 -2
- data/docs/{InlineResponse20030.md → InlineResponse201.md} +3 -3
- data/docs/IntegrationApi.md +77 -11
- data/docs/IntegrationRequest.md +1 -1
- data/docs/IntegrationStateV2.md +3 -1
- data/docs/InventoryCoupon.md +53 -0
- data/docs/LoyaltyProgram.md +3 -1
- data/docs/LoyaltyProgramEntity.md +17 -0
- data/docs/LoyaltyTier.md +25 -0
- data/docs/ManagementApi.md +370 -69
- data/docs/NewCustomEffect.md +29 -0
- data/docs/NewGiveawaysPool.md +21 -0
- data/docs/NewLoyaltyTier.md +19 -0
- data/docs/NewReferral.md +10 -6
- data/docs/NewReferralsForMultipleAdvocates.md +31 -0
- data/docs/NewRole.md +1 -1
- data/docs/Referral.md +13 -7
- data/docs/ReferralConstraints.md +21 -0
- data/docs/Role.md +8 -4
- data/docs/UpdateCustomEffect.md +29 -0
- data/docs/UpdateLoyaltyTier.md +19 -0
- data/docs/UpdateReferral.md +25 -0
- data/docs/UpdateRole.md +1 -1
- data/docs/WillAwardGiveawayEffectProps.md +21 -0
- data/lib/talon_one.rb +21 -1
- data/lib/talon_one/api/integration_api.rb +80 -10
- data/lib/talon_one/api/management_api.rb +460 -97
- data/lib/talon_one/models/application_campaign_stats.rb +288 -0
- data/lib/talon_one/models/application_referee.rb +288 -0
- data/lib/talon_one/models/attribute.rb +2 -2
- data/lib/talon_one/models/award_giveaway_effect_props.rb +273 -0
- data/lib/talon_one/models/campaign.rb +11 -1
- data/lib/talon_one/models/coupon.rb +1 -1
- data/lib/talon_one/models/custom_effect.rb +377 -0
- data/lib/talon_one/models/custom_effect_props.rb +228 -0
- data/lib/talon_one/models/customer_inventory.rb +15 -4
- data/lib/talon_one/models/customer_profile_integration_request_v2.rb +1 -1
- data/lib/talon_one/models/environment.rb +61 -1
- data/lib/talon_one/models/export.rb +2 -2
- data/lib/talon_one/models/giveaway.rb +308 -0
- data/lib/talon_one/models/giveaways_pool.rb +315 -0
- data/lib/talon_one/models/import_entity.rb +207 -0
- data/lib/talon_one/models/inline_response20010.rb +11 -11
- data/lib/talon_one/models/inline_response20011.rb +11 -7
- data/lib/talon_one/models/inline_response20012.rb +6 -10
- data/lib/talon_one/models/inline_response20013.rb +11 -11
- data/lib/talon_one/models/inline_response20014.rb +10 -10
- data/lib/talon_one/models/inline_response20015.rb +1 -6
- data/lib/talon_one/models/inline_response20016.rb +13 -8
- data/lib/talon_one/models/inline_response20017.rb +10 -10
- data/lib/talon_one/models/inline_response20018.rb +11 -11
- data/lib/talon_one/models/inline_response20019.rb +11 -7
- data/lib/talon_one/models/inline_response20020.rb +6 -1
- data/lib/talon_one/models/inline_response20021.rb +1 -1
- data/lib/talon_one/models/inline_response20022.rb +1 -1
- data/lib/talon_one/models/inline_response20023.rb +1 -1
- data/lib/talon_one/models/inline_response20024.rb +1 -1
- data/lib/talon_one/models/inline_response20025.rb +1 -1
- data/lib/talon_one/models/inline_response20026.rb +1 -1
- data/lib/talon_one/models/inline_response20027.rb +11 -7
- data/lib/talon_one/models/inline_response20028.rb +7 -11
- data/lib/talon_one/models/inline_response20029.rb +1 -1
- data/lib/talon_one/models/inline_response2006.rb +10 -10
- data/lib/talon_one/models/inline_response2007.rb +11 -11
- data/lib/talon_one/models/inline_response2008.rb +1 -1
- data/lib/talon_one/models/inline_response2009.rb +10 -10
- data/lib/talon_one/models/{inline_response20030.rb → inline_response201.rb} +4 -4
- data/lib/talon_one/models/integration_request.rb +1 -1
- data/lib/talon_one/models/integration_state_v2.rb +15 -4
- data/lib/talon_one/models/inventory_coupon.rb +499 -0
- data/lib/talon_one/models/loyalty_program.rb +16 -4
- data/lib/talon_one/models/loyalty_program_entity.rb +212 -0
- data/lib/talon_one/models/loyalty_tier.rb +301 -0
- data/lib/talon_one/models/new_attribute.rb +2 -2
- data/lib/talon_one/models/new_custom_effect.rb +291 -0
- data/lib/talon_one/models/new_giveaways_pool.rb +234 -0
- data/lib/talon_one/models/new_loyalty_tier.rb +256 -0
- data/lib/talon_one/models/new_referral.rb +64 -19
- data/lib/talon_one/models/new_referrals_for_multiple_advocates.rb +349 -0
- data/lib/talon_one/models/new_role.rb +1 -1
- data/lib/talon_one/models/referral.rb +86 -47
- data/lib/talon_one/models/referral_constraints.rb +251 -0
- data/lib/talon_one/models/role.rb +44 -4
- data/lib/talon_one/models/update_custom_effect.rb +292 -0
- data/lib/talon_one/models/update_loyalty_tier.rb +256 -0
- data/lib/talon_one/models/update_referral.rb +271 -0
- data/lib/talon_one/models/update_role.rb +1 -1
- data/lib/talon_one/models/will_award_giveaway_effect_props.rb +243 -0
- data/lib/talon_one/version.rb +1 -1
- data/spec/api/integration_api_spec.rb +19 -5
- data/spec/api/management_api_spec.rb +102 -33
- data/spec/models/application_campaign_stats_spec.rb +71 -0
- data/spec/models/application_referee_spec.rb +71 -0
- data/spec/models/attribute_spec.rb +1 -1
- data/spec/models/award_giveaway_effect_props_spec.rb +65 -0
- data/spec/models/campaign_spec.rb +7 -1
- data/spec/models/custom_effect_props_spec.rb +47 -0
- data/spec/models/custom_effect_spec.rb +113 -0
- data/spec/models/customer_inventory_spec.rb +6 -0
- data/spec/models/customer_profile_integration_request_v2_spec.rb +1 -1
- data/spec/models/environment_spec.rb +30 -0
- data/spec/models/export_spec.rb +1 -1
- data/spec/models/giveaway_spec.rb +89 -0
- data/spec/models/giveaways_pool_spec.rb +89 -0
- data/spec/models/import_entity_spec.rb +41 -0
- data/spec/models/inline_response20010_spec.rb +1 -1
- data/spec/models/inline_response20011_spec.rb +6 -0
- data/spec/models/inline_response20012_spec.rb +0 -6
- data/spec/models/inline_response20013_spec.rb +1 -1
- data/spec/models/inline_response20014_spec.rb +1 -1
- data/spec/models/inline_response20016_spec.rb +1 -1
- data/spec/models/inline_response20017_spec.rb +1 -1
- data/spec/models/inline_response20018_spec.rb +1 -1
- data/spec/models/inline_response20019_spec.rb +6 -0
- data/spec/models/inline_response20027_spec.rb +6 -0
- data/spec/models/inline_response20028_spec.rb +0 -6
- data/spec/models/inline_response2006_spec.rb +1 -1
- data/spec/models/inline_response2007_spec.rb +1 -1
- data/spec/models/inline_response2009_spec.rb +1 -1
- data/spec/models/{inline_response20030_spec.rb → inline_response201_spec.rb} +6 -6
- data/spec/models/integration_request_spec.rb +1 -1
- data/spec/models/integration_state_v2_spec.rb +6 -0
- data/spec/models/inventory_coupon_spec.rb +149 -0
- data/spec/models/loyalty_program_entity_spec.rb +41 -0
- data/spec/models/loyalty_program_spec.rb +6 -0
- data/spec/models/loyalty_tier_spec.rb +65 -0
- data/spec/models/new_attribute_spec.rb +1 -1
- data/spec/models/new_campaign_spec.rb +1 -1
- data/spec/models/new_custom_effect_spec.rb +77 -0
- data/spec/models/new_giveaways_pool_spec.rb +53 -0
- data/spec/models/new_loyalty_tier_spec.rb +47 -0
- data/spec/models/new_referral_spec.rb +17 -5
- data/spec/models/new_referrals_for_multiple_advocates_spec.rb +83 -0
- data/spec/models/referral_constraints_spec.rb +53 -0
- data/spec/models/referral_spec.rb +21 -3
- data/spec/models/role_spec.rb +12 -0
- data/spec/models/update_campaign_spec.rb +1 -1
- data/spec/models/update_custom_effect_spec.rb +77 -0
- data/spec/models/update_loyalty_tier_spec.rb +47 -0
- data/spec/models/update_referral_spec.rb +65 -0
- data/spec/models/will_award_giveaway_effect_props_spec.rb +53 -0
- metadata +86 -6
@@ -236,7 +236,7 @@ module TalonOne
|
|
236
236
|
return false if @created.nil?
|
237
237
|
return false if @account_id.nil?
|
238
238
|
return false if @entity.nil?
|
239
|
-
entity_validator = EnumAttributeValidator.new('String', ["Account", "Application", "Campaign", "CustomerProfile", "CustomerSession", "CartItem", "Coupon", "Event"])
|
239
|
+
entity_validator = EnumAttributeValidator.new('String', ["Account", "Application", "Campaign", "CustomerProfile", "CustomerSession", "CartItem", "Coupon", "Event", "Giveaway", "Referral"])
|
240
240
|
return false unless entity_validator.valid?(@entity)
|
241
241
|
return false if @name.nil?
|
242
242
|
return false if @title.nil?
|
@@ -252,7 +252,7 @@ module TalonOne
|
|
252
252
|
# Custom attribute writer method checking allowed values (enum).
|
253
253
|
# @param [Object] entity Object to be assigned
|
254
254
|
def entity=(entity)
|
255
|
-
validator = EnumAttributeValidator.new('String', ["Account", "Application", "Campaign", "CustomerProfile", "CustomerSession", "CartItem", "Coupon", "Event"])
|
255
|
+
validator = EnumAttributeValidator.new('String', ["Account", "Application", "Campaign", "CustomerProfile", "CustomerSession", "CartItem", "Coupon", "Event", "Giveaway", "Referral"])
|
256
256
|
unless validator.valid?(entity)
|
257
257
|
fail ArgumentError, "invalid value for \"entity\", must be one of #{validator.allowable_values}."
|
258
258
|
end
|
@@ -0,0 +1,273 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
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
|
+
# The properties specific to the \"awardGiveaway\" effect. This effect contains information on the giveaway item, and which profile it was awarded to.
|
17
|
+
class AwardGiveawayEffectProps
|
18
|
+
# The ID of the giveaways pool the code was taken from.
|
19
|
+
attr_accessor :pool_id
|
20
|
+
|
21
|
+
# The name of the giveaways pool the code was taken from.
|
22
|
+
attr_accessor :pool_name
|
23
|
+
|
24
|
+
# The integration ID of the profile that was awarded the giveaway.
|
25
|
+
attr_accessor :recipient_integration_id
|
26
|
+
|
27
|
+
# The internal ID for the giveaway that was awarded.
|
28
|
+
attr_accessor :giveaway_id
|
29
|
+
|
30
|
+
# The giveaway code that was awarded.
|
31
|
+
attr_accessor :code
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'pool_id' => :'poolId',
|
37
|
+
:'pool_name' => :'poolName',
|
38
|
+
:'recipient_integration_id' => :'recipientIntegrationId',
|
39
|
+
:'giveaway_id' => :'giveawayId',
|
40
|
+
:'code' => :'code'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'pool_id' => :'Integer',
|
48
|
+
:'pool_name' => :'String',
|
49
|
+
:'recipient_integration_id' => :'String',
|
50
|
+
:'giveaway_id' => :'Integer',
|
51
|
+
:'code' => :'String'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of attributes with nullable: true
|
56
|
+
def self.openapi_nullable
|
57
|
+
Set.new([
|
58
|
+
])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
if (!attributes.is_a?(Hash))
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::AwardGiveawayEffectProps` initialize method"
|
66
|
+
end
|
67
|
+
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::AwardGiveawayEffectProps`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
|
+
end
|
73
|
+
h[k.to_sym] = v
|
74
|
+
}
|
75
|
+
|
76
|
+
if attributes.key?(:'pool_id')
|
77
|
+
self.pool_id = attributes[:'pool_id']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'pool_name')
|
81
|
+
self.pool_name = attributes[:'pool_name']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'recipient_integration_id')
|
85
|
+
self.recipient_integration_id = attributes[:'recipient_integration_id']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'giveaway_id')
|
89
|
+
self.giveaway_id = attributes[:'giveaway_id']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'code')
|
93
|
+
self.code = attributes[:'code']
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
98
|
+
# @return Array for valid properties with the reasons
|
99
|
+
def list_invalid_properties
|
100
|
+
invalid_properties = Array.new
|
101
|
+
if @pool_id.nil?
|
102
|
+
invalid_properties.push('invalid value for "pool_id", pool_id cannot be nil.')
|
103
|
+
end
|
104
|
+
|
105
|
+
if @pool_name.nil?
|
106
|
+
invalid_properties.push('invalid value for "pool_name", pool_name cannot be nil.')
|
107
|
+
end
|
108
|
+
|
109
|
+
if @recipient_integration_id.nil?
|
110
|
+
invalid_properties.push('invalid value for "recipient_integration_id", recipient_integration_id cannot be nil.')
|
111
|
+
end
|
112
|
+
|
113
|
+
if @giveaway_id.nil?
|
114
|
+
invalid_properties.push('invalid value for "giveaway_id", giveaway_id cannot be nil.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if @code.nil?
|
118
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @pool_id.nil?
|
128
|
+
return false if @pool_name.nil?
|
129
|
+
return false if @recipient_integration_id.nil?
|
130
|
+
return false if @giveaway_id.nil?
|
131
|
+
return false if @code.nil?
|
132
|
+
true
|
133
|
+
end
|
134
|
+
|
135
|
+
# Checks equality by comparing each attribute.
|
136
|
+
# @param [Object] Object to be compared
|
137
|
+
def ==(o)
|
138
|
+
return true if self.equal?(o)
|
139
|
+
self.class == o.class &&
|
140
|
+
pool_id == o.pool_id &&
|
141
|
+
pool_name == o.pool_name &&
|
142
|
+
recipient_integration_id == o.recipient_integration_id &&
|
143
|
+
giveaway_id == o.giveaway_id &&
|
144
|
+
code == o.code
|
145
|
+
end
|
146
|
+
|
147
|
+
# @see the `==` method
|
148
|
+
# @param [Object] Object to be compared
|
149
|
+
def eql?(o)
|
150
|
+
self == o
|
151
|
+
end
|
152
|
+
|
153
|
+
# Calculates hash code according to all attributes.
|
154
|
+
# @return [Integer] Hash code
|
155
|
+
def hash
|
156
|
+
[pool_id, pool_name, recipient_integration_id, giveaway_id, code].hash
|
157
|
+
end
|
158
|
+
|
159
|
+
# Builds the object from hash
|
160
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
161
|
+
# @return [Object] Returns the model itself
|
162
|
+
def self.build_from_hash(attributes)
|
163
|
+
new.build_from_hash(attributes)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Builds the object from hash
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
+
# @return [Object] Returns the model itself
|
169
|
+
def build_from_hash(attributes)
|
170
|
+
return nil unless attributes.is_a?(Hash)
|
171
|
+
self.class.openapi_types.each_pair do |key, type|
|
172
|
+
if type =~ /\AArray<(.*)>/i
|
173
|
+
# check to ensure the input is an array given that the attribute
|
174
|
+
# is documented as an array but the input is not
|
175
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
176
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
177
|
+
end
|
178
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
179
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
180
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
181
|
+
end
|
182
|
+
|
183
|
+
self
|
184
|
+
end
|
185
|
+
|
186
|
+
# Deserializes the data based on type
|
187
|
+
# @param string type Data type
|
188
|
+
# @param string value Value to be deserialized
|
189
|
+
# @return [Object] Deserialized data
|
190
|
+
def _deserialize(type, value)
|
191
|
+
case type.to_sym
|
192
|
+
when :DateTime
|
193
|
+
DateTime.parse(value)
|
194
|
+
when :Date
|
195
|
+
Date.parse(value)
|
196
|
+
when :String
|
197
|
+
value.to_s
|
198
|
+
when :Integer
|
199
|
+
value.to_i
|
200
|
+
when :Float
|
201
|
+
value.to_f
|
202
|
+
when :Boolean
|
203
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
204
|
+
true
|
205
|
+
else
|
206
|
+
false
|
207
|
+
end
|
208
|
+
when :Object
|
209
|
+
# generic object (usually a Hash), return directly
|
210
|
+
value
|
211
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
212
|
+
inner_type = Regexp.last_match[:inner_type]
|
213
|
+
value.map { |v| _deserialize(inner_type, v) }
|
214
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
215
|
+
k_type = Regexp.last_match[:k_type]
|
216
|
+
v_type = Regexp.last_match[:v_type]
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each do |k, v|
|
219
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
else # model
|
223
|
+
TalonOne.const_get(type).build_from_hash(value)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns the string representation of the object
|
228
|
+
# @return [String] String presentation of the object
|
229
|
+
def to_s
|
230
|
+
to_hash.to_s
|
231
|
+
end
|
232
|
+
|
233
|
+
# to_body is an alias to to_hash (backward compatibility)
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
235
|
+
def to_body
|
236
|
+
to_hash
|
237
|
+
end
|
238
|
+
|
239
|
+
# Returns the object in the form of hash
|
240
|
+
# @return [Hash] Returns the object in the form of hash
|
241
|
+
def to_hash
|
242
|
+
hash = {}
|
243
|
+
self.class.attribute_map.each_pair do |attr, param|
|
244
|
+
value = self.send(attr)
|
245
|
+
if value.nil?
|
246
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
247
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
248
|
+
end
|
249
|
+
|
250
|
+
hash[param] = _to_hash(value)
|
251
|
+
end
|
252
|
+
hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Outputs non-array value in the form of hash
|
256
|
+
# For object, use to_hash. Otherwise, just return the value
|
257
|
+
# @param [Object] value Any valid value
|
258
|
+
# @return [Hash] Returns the value in the form of hash
|
259
|
+
def _to_hash(value)
|
260
|
+
if value.is_a?(Array)
|
261
|
+
value.compact.map { |v| _to_hash(v) }
|
262
|
+
elsif value.is_a?(Hash)
|
263
|
+
{}.tap do |hash|
|
264
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
265
|
+
end
|
266
|
+
elsif value.respond_to? :to_hash
|
267
|
+
value.to_hash
|
268
|
+
else
|
269
|
+
value
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
@@ -82,6 +82,9 @@ module TalonOne
|
|
82
82
|
# Total number of referrals created by rules in this campaign.
|
83
83
|
attr_accessor :referral_creation_count
|
84
84
|
|
85
|
+
# Total number of giveaways awarded by rules in this campaign.
|
86
|
+
attr_accessor :awarded_giveaways_count
|
87
|
+
|
85
88
|
# Total number of loyalty points created by rules in this campaign.
|
86
89
|
attr_accessor :created_loyalty_points_count
|
87
90
|
|
@@ -154,6 +157,7 @@ module TalonOne
|
|
154
157
|
:'discount_effect_count' => :'discountEffectCount',
|
155
158
|
:'coupon_creation_count' => :'couponCreationCount',
|
156
159
|
:'referral_creation_count' => :'referralCreationCount',
|
160
|
+
:'awarded_giveaways_count' => :'awardedGiveawaysCount',
|
157
161
|
:'created_loyalty_points_count' => :'createdLoyaltyPointsCount',
|
158
162
|
:'created_loyalty_points_effect_count' => :'createdLoyaltyPointsEffectCount',
|
159
163
|
:'redeemed_loyalty_points_count' => :'redeemedLoyaltyPointsCount',
|
@@ -191,6 +195,7 @@ module TalonOne
|
|
191
195
|
:'discount_effect_count' => :'Integer',
|
192
196
|
:'coupon_creation_count' => :'Integer',
|
193
197
|
:'referral_creation_count' => :'Integer',
|
198
|
+
:'awarded_giveaways_count' => :'Integer',
|
194
199
|
:'created_loyalty_points_count' => :'Float',
|
195
200
|
:'created_loyalty_points_effect_count' => :'Integer',
|
196
201
|
:'redeemed_loyalty_points_count' => :'Float',
|
@@ -325,6 +330,10 @@ module TalonOne
|
|
325
330
|
self.referral_creation_count = attributes[:'referral_creation_count']
|
326
331
|
end
|
327
332
|
|
333
|
+
if attributes.key?(:'awarded_giveaways_count')
|
334
|
+
self.awarded_giveaways_count = attributes[:'awarded_giveaways_count']
|
335
|
+
end
|
336
|
+
|
328
337
|
if attributes.key?(:'created_loyalty_points_count')
|
329
338
|
self.created_loyalty_points_count = attributes[:'created_loyalty_points_count']
|
330
339
|
end
|
@@ -480,6 +489,7 @@ module TalonOne
|
|
480
489
|
discount_effect_count == o.discount_effect_count &&
|
481
490
|
coupon_creation_count == o.coupon_creation_count &&
|
482
491
|
referral_creation_count == o.referral_creation_count &&
|
492
|
+
awarded_giveaways_count == o.awarded_giveaways_count &&
|
483
493
|
created_loyalty_points_count == o.created_loyalty_points_count &&
|
484
494
|
created_loyalty_points_effect_count == o.created_loyalty_points_effect_count &&
|
485
495
|
redeemed_loyalty_points_count == o.redeemed_loyalty_points_count &&
|
@@ -499,7 +509,7 @@ module TalonOne
|
|
499
509
|
# Calculates hash code according to all attributes.
|
500
510
|
# @return [Integer] Hash code
|
501
511
|
def hash
|
502
|
-
[id, created, application_id, user_id, name, description, start_time, end_time, attributes, state, active_ruleset_id, tags, features, coupon_settings, referral_settings, limits, campaign_groups, coupon_redemption_count, referral_redemption_count, discount_count, discount_effect_count, coupon_creation_count, referral_creation_count, created_loyalty_points_count, created_loyalty_points_effect_count, redeemed_loyalty_points_count, redeemed_loyalty_points_effect_count, last_activity, updated, created_by, updated_by].hash
|
512
|
+
[id, created, application_id, user_id, name, description, start_time, end_time, attributes, state, active_ruleset_id, tags, features, coupon_settings, referral_settings, limits, campaign_groups, coupon_redemption_count, referral_redemption_count, discount_count, discount_effect_count, coupon_creation_count, referral_creation_count, awarded_giveaways_count, created_loyalty_points_count, created_loyalty_points_effect_count, redeemed_loyalty_points_count, redeemed_loyalty_points_effect_count, last_activity, updated, created_by, updated_by].hash
|
503
513
|
end
|
504
514
|
|
505
515
|
# Builds the object from hash
|
@@ -60,7 +60,7 @@ module TalonOne
|
|
60
60
|
# The ID of the Import which created this coupon.
|
61
61
|
attr_accessor :import_id
|
62
62
|
|
63
|
-
# This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a
|
63
|
+
# This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favorite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified.
|
64
64
|
attr_accessor :reservation
|
65
65
|
|
66
66
|
# The id of the batch the coupon belongs to.
|
@@ -0,0 +1,377 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
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
|
+
#
|
17
|
+
class CustomEffect
|
18
|
+
# Unique ID for this entity.
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The exact moment this entity was created.
|
22
|
+
attr_accessor :created
|
23
|
+
|
24
|
+
# The ID of the account that owns this entity.
|
25
|
+
attr_accessor :account_id
|
26
|
+
|
27
|
+
# The exact moment this entity was last modified.
|
28
|
+
attr_accessor :modified
|
29
|
+
|
30
|
+
# The name of this effect.
|
31
|
+
attr_accessor :name
|
32
|
+
|
33
|
+
# The title of this effect.
|
34
|
+
attr_accessor :title
|
35
|
+
|
36
|
+
# The JSON payload of this effect.
|
37
|
+
attr_accessor :payload
|
38
|
+
|
39
|
+
# The description of this effect.
|
40
|
+
attr_accessor :description
|
41
|
+
|
42
|
+
# Determines if this effect is active.
|
43
|
+
attr_accessor :enabled
|
44
|
+
|
45
|
+
# A list of the IDs of the applications that this effect is enabled for
|
46
|
+
attr_accessor :subscribed_applications_ids
|
47
|
+
|
48
|
+
# Array of template argument definitions
|
49
|
+
attr_accessor :params
|
50
|
+
|
51
|
+
# ID of the user who last updated this effect if available.
|
52
|
+
attr_accessor :modified_by
|
53
|
+
|
54
|
+
# ID of the user who created this effect.
|
55
|
+
attr_accessor :created_by
|
56
|
+
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
58
|
+
def self.attribute_map
|
59
|
+
{
|
60
|
+
:'id' => :'id',
|
61
|
+
:'created' => :'created',
|
62
|
+
:'account_id' => :'accountId',
|
63
|
+
:'modified' => :'modified',
|
64
|
+
:'name' => :'name',
|
65
|
+
:'title' => :'title',
|
66
|
+
:'payload' => :'payload',
|
67
|
+
:'description' => :'description',
|
68
|
+
:'enabled' => :'enabled',
|
69
|
+
:'subscribed_applications_ids' => :'subscribedApplicationsIds',
|
70
|
+
:'params' => :'params',
|
71
|
+
:'modified_by' => :'modifiedBy',
|
72
|
+
:'created_by' => :'createdBy'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.openapi_types
|
78
|
+
{
|
79
|
+
:'id' => :'Integer',
|
80
|
+
:'created' => :'DateTime',
|
81
|
+
:'account_id' => :'Integer',
|
82
|
+
:'modified' => :'DateTime',
|
83
|
+
:'name' => :'String',
|
84
|
+
:'title' => :'String',
|
85
|
+
:'payload' => :'String',
|
86
|
+
:'description' => :'String',
|
87
|
+
:'enabled' => :'Boolean',
|
88
|
+
:'subscribed_applications_ids' => :'Array<Integer>',
|
89
|
+
:'params' => :'Array<TemplateArgDef>',
|
90
|
+
:'modified_by' => :'Integer',
|
91
|
+
:'created_by' => :'Integer'
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
# List of attributes with nullable: true
|
96
|
+
def self.openapi_nullable
|
97
|
+
Set.new([
|
98
|
+
])
|
99
|
+
end
|
100
|
+
|
101
|
+
# Initializes the object
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
def initialize(attributes = {})
|
104
|
+
if (!attributes.is_a?(Hash))
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::CustomEffect` initialize method"
|
106
|
+
end
|
107
|
+
|
108
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
109
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
110
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::CustomEffect`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
112
|
+
end
|
113
|
+
h[k.to_sym] = v
|
114
|
+
}
|
115
|
+
|
116
|
+
if attributes.key?(:'id')
|
117
|
+
self.id = attributes[:'id']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'created')
|
121
|
+
self.created = attributes[:'created']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'account_id')
|
125
|
+
self.account_id = attributes[:'account_id']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'modified')
|
129
|
+
self.modified = attributes[:'modified']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'name')
|
133
|
+
self.name = attributes[:'name']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'title')
|
137
|
+
self.title = attributes[:'title']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'payload')
|
141
|
+
self.payload = attributes[:'payload']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'description')
|
145
|
+
self.description = attributes[:'description']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'enabled')
|
149
|
+
self.enabled = attributes[:'enabled']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'subscribed_applications_ids')
|
153
|
+
if (value = attributes[:'subscribed_applications_ids']).is_a?(Array)
|
154
|
+
self.subscribed_applications_ids = value
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'params')
|
159
|
+
if (value = attributes[:'params']).is_a?(Array)
|
160
|
+
self.params = value
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'modified_by')
|
165
|
+
self.modified_by = attributes[:'modified_by']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'created_by')
|
169
|
+
self.created_by = attributes[:'created_by']
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
174
|
+
# @return Array for valid properties with the reasons
|
175
|
+
def list_invalid_properties
|
176
|
+
invalid_properties = Array.new
|
177
|
+
if @id.nil?
|
178
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
179
|
+
end
|
180
|
+
|
181
|
+
if @created.nil?
|
182
|
+
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
183
|
+
end
|
184
|
+
|
185
|
+
if @account_id.nil?
|
186
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if @modified.nil?
|
190
|
+
invalid_properties.push('invalid value for "modified", modified cannot be nil.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @name.nil?
|
194
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @title.nil?
|
198
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
if @payload.nil?
|
202
|
+
invalid_properties.push('invalid value for "payload", payload cannot be nil.')
|
203
|
+
end
|
204
|
+
|
205
|
+
if @enabled.nil?
|
206
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
207
|
+
end
|
208
|
+
|
209
|
+
if @created_by.nil?
|
210
|
+
invalid_properties.push('invalid value for "created_by", created_by cannot be nil.')
|
211
|
+
end
|
212
|
+
|
213
|
+
invalid_properties
|
214
|
+
end
|
215
|
+
|
216
|
+
# Check to see if the all the properties in the model are valid
|
217
|
+
# @return true if the model is valid
|
218
|
+
def valid?
|
219
|
+
return false if @id.nil?
|
220
|
+
return false if @created.nil?
|
221
|
+
return false if @account_id.nil?
|
222
|
+
return false if @modified.nil?
|
223
|
+
return false if @name.nil?
|
224
|
+
return false if @title.nil?
|
225
|
+
return false if @payload.nil?
|
226
|
+
return false if @enabled.nil?
|
227
|
+
return false if @created_by.nil?
|
228
|
+
true
|
229
|
+
end
|
230
|
+
|
231
|
+
# Checks equality by comparing each attribute.
|
232
|
+
# @param [Object] Object to be compared
|
233
|
+
def ==(o)
|
234
|
+
return true if self.equal?(o)
|
235
|
+
self.class == o.class &&
|
236
|
+
id == o.id &&
|
237
|
+
created == o.created &&
|
238
|
+
account_id == o.account_id &&
|
239
|
+
modified == o.modified &&
|
240
|
+
name == o.name &&
|
241
|
+
title == o.title &&
|
242
|
+
payload == o.payload &&
|
243
|
+
description == o.description &&
|
244
|
+
enabled == o.enabled &&
|
245
|
+
subscribed_applications_ids == o.subscribed_applications_ids &&
|
246
|
+
params == o.params &&
|
247
|
+
modified_by == o.modified_by &&
|
248
|
+
created_by == o.created_by
|
249
|
+
end
|
250
|
+
|
251
|
+
# @see the `==` method
|
252
|
+
# @param [Object] Object to be compared
|
253
|
+
def eql?(o)
|
254
|
+
self == o
|
255
|
+
end
|
256
|
+
|
257
|
+
# Calculates hash code according to all attributes.
|
258
|
+
# @return [Integer] Hash code
|
259
|
+
def hash
|
260
|
+
[id, created, account_id, modified, name, title, payload, description, enabled, subscribed_applications_ids, params, modified_by, created_by].hash
|
261
|
+
end
|
262
|
+
|
263
|
+
# Builds the object from hash
|
264
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
265
|
+
# @return [Object] Returns the model itself
|
266
|
+
def self.build_from_hash(attributes)
|
267
|
+
new.build_from_hash(attributes)
|
268
|
+
end
|
269
|
+
|
270
|
+
# Builds the object from hash
|
271
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
272
|
+
# @return [Object] Returns the model itself
|
273
|
+
def build_from_hash(attributes)
|
274
|
+
return nil unless attributes.is_a?(Hash)
|
275
|
+
self.class.openapi_types.each_pair do |key, type|
|
276
|
+
if type =~ /\AArray<(.*)>/i
|
277
|
+
# check to ensure the input is an array given that the attribute
|
278
|
+
# is documented as an array but the input is not
|
279
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
280
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
281
|
+
end
|
282
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
283
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
284
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
285
|
+
end
|
286
|
+
|
287
|
+
self
|
288
|
+
end
|
289
|
+
|
290
|
+
# Deserializes the data based on type
|
291
|
+
# @param string type Data type
|
292
|
+
# @param string value Value to be deserialized
|
293
|
+
# @return [Object] Deserialized data
|
294
|
+
def _deserialize(type, value)
|
295
|
+
case type.to_sym
|
296
|
+
when :DateTime
|
297
|
+
DateTime.parse(value)
|
298
|
+
when :Date
|
299
|
+
Date.parse(value)
|
300
|
+
when :String
|
301
|
+
value.to_s
|
302
|
+
when :Integer
|
303
|
+
value.to_i
|
304
|
+
when :Float
|
305
|
+
value.to_f
|
306
|
+
when :Boolean
|
307
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
308
|
+
true
|
309
|
+
else
|
310
|
+
false
|
311
|
+
end
|
312
|
+
when :Object
|
313
|
+
# generic object (usually a Hash), return directly
|
314
|
+
value
|
315
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
316
|
+
inner_type = Regexp.last_match[:inner_type]
|
317
|
+
value.map { |v| _deserialize(inner_type, v) }
|
318
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
319
|
+
k_type = Regexp.last_match[:k_type]
|
320
|
+
v_type = Regexp.last_match[:v_type]
|
321
|
+
{}.tap do |hash|
|
322
|
+
value.each do |k, v|
|
323
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
324
|
+
end
|
325
|
+
end
|
326
|
+
else # model
|
327
|
+
TalonOne.const_get(type).build_from_hash(value)
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
# Returns the string representation of the object
|
332
|
+
# @return [String] String presentation of the object
|
333
|
+
def to_s
|
334
|
+
to_hash.to_s
|
335
|
+
end
|
336
|
+
|
337
|
+
# to_body is an alias to to_hash (backward compatibility)
|
338
|
+
# @return [Hash] Returns the object in the form of hash
|
339
|
+
def to_body
|
340
|
+
to_hash
|
341
|
+
end
|
342
|
+
|
343
|
+
# Returns the object in the form of hash
|
344
|
+
# @return [Hash] Returns the object in the form of hash
|
345
|
+
def to_hash
|
346
|
+
hash = {}
|
347
|
+
self.class.attribute_map.each_pair do |attr, param|
|
348
|
+
value = self.send(attr)
|
349
|
+
if value.nil?
|
350
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
351
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
352
|
+
end
|
353
|
+
|
354
|
+
hash[param] = _to_hash(value)
|
355
|
+
end
|
356
|
+
hash
|
357
|
+
end
|
358
|
+
|
359
|
+
# Outputs non-array value in the form of hash
|
360
|
+
# For object, use to_hash. Otherwise, just return the value
|
361
|
+
# @param [Object] value Any valid value
|
362
|
+
# @return [Hash] Returns the value in the form of hash
|
363
|
+
def _to_hash(value)
|
364
|
+
if value.is_a?(Array)
|
365
|
+
value.compact.map { |v| _to_hash(v) }
|
366
|
+
elsif value.is_a?(Hash)
|
367
|
+
{}.tap do |hash|
|
368
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
369
|
+
end
|
370
|
+
elsif value.respond_to? :to_hash
|
371
|
+
value.to_hash
|
372
|
+
else
|
373
|
+
value
|
374
|
+
end
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|