talon_one 4.0.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -6
  3. data/docs/ActivateUserRequest.md +17 -0
  4. data/docs/Coupon.md +2 -2
  5. data/docs/CustomerInventory.md +1 -1
  6. data/docs/InlineResponse20044.md +1 -1
  7. data/docs/IntegrationApi.md +11 -11
  8. data/docs/IntegrationCoupon.md +2 -2
  9. data/docs/InventoryCoupon.md +2 -2
  10. data/docs/LoyaltyCardBalances.md +21 -0
  11. data/docs/LoyaltyCardProfileRegistration.md +1 -1
  12. data/docs/ManagementApi.md +187 -69
  13. data/docs/MessageLogEntry.md +1 -3
  14. data/docs/NewCoupons.md +1 -1
  15. data/docs/NewExternalInvitation.md +21 -0
  16. data/docs/UpdateCoupon.md +1 -1
  17. data/docs/UpdateUser.md +1 -1
  18. data/lib/talon_one/api/integration_api.rb +18 -18
  19. data/lib/talon_one/api/management_api.rb +200 -76
  20. data/lib/talon_one/models/activate_user_request.rb +213 -0
  21. data/lib/talon_one/models/additional_campaign_properties.rb +2 -2
  22. data/lib/talon_one/models/campaign.rb +2 -2
  23. data/lib/talon_one/models/coupon.rb +2 -2
  24. data/lib/talon_one/models/customer_inventory.rb +1 -1
  25. data/lib/talon_one/models/inline_response20044.rb +1 -1
  26. data/lib/talon_one/models/integration_coupon.rb +2 -2
  27. data/lib/talon_one/models/inventory_coupon.rb +2 -2
  28. data/lib/talon_one/models/loyalty_card_balances.rb +231 -0
  29. data/lib/talon_one/models/loyalty_card_profile_registration.rb +1 -1
  30. data/lib/talon_one/models/message_log_entry.rb +4 -14
  31. data/lib/talon_one/models/new_coupons.rb +1 -1
  32. data/lib/talon_one/models/new_external_invitation.rb +235 -0
  33. data/lib/talon_one/models/update_coupon.rb +1 -1
  34. data/lib/talon_one/models/update_user.rb +1 -1
  35. data/lib/talon_one/version.rb +1 -1
  36. data/lib/talon_one.rb +3 -0
  37. data/spec/api/integration_api_spec.rb +7 -7
  38. data/spec/api/management_api_spec.rb +43 -19
  39. data/spec/models/activate_user_request_spec.rb +41 -0
  40. data/spec/models/additional_campaign_properties_spec.rb +1 -1
  41. data/spec/models/campaign_spec.rb +1 -1
  42. data/spec/models/loyalty_card_balances_spec.rb +53 -0
  43. data/spec/models/message_log_entry_spec.rb +1 -7
  44. data/spec/models/new_external_invitation_spec.rb +53 -0
  45. metadata +30 -18
@@ -0,0 +1,235 @@
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
+ # Parameters for inviting a new user from an external identity provider.
17
+ class NewExternalInvitation
18
+ # Name of the user.
19
+ attr_accessor :name
20
+
21
+ # List of user groups in the external identity provider. If there are roles in Talon.One whose names match these user groups, those roles will be automatically assigned to the user upon invitation.
22
+ attr_accessor :user_groups
23
+
24
+ # Email address of the user.
25
+ attr_accessor :email
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'name' => :'name',
31
+ :'user_groups' => :'userGroups',
32
+ :'email' => :'email'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'name' => :'String',
40
+ :'user_groups' => :'Array<String>',
41
+ :'email' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::NewExternalInvitation` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::NewExternalInvitation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'name')
67
+ self.name = attributes[:'name']
68
+ end
69
+
70
+ if attributes.key?(:'user_groups')
71
+ if (value = attributes[:'user_groups']).is_a?(Array)
72
+ self.user_groups = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'email')
77
+ self.email = attributes[:'email']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @email.nil?
86
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
87
+ end
88
+
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @email.nil?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ name == o.name &&
105
+ user_groups == o.user_groups &&
106
+ email == o.email
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [name, user_groups, email].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ new.build_from_hash(attributes)
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.openapi_types.each_pair do |key, type|
134
+ if type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :DateTime
155
+ DateTime.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ TalonOne.const_get(type).build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+ end
235
+ end
@@ -39,7 +39,7 @@ module TalonOne
39
39
  # Arbitrary properties associated with this item.
40
40
  attr_accessor :attributes
41
41
 
42
- # Whether the reservation effect actually created a new reservation.
42
+ # An indication of whether the code can be redeemed only if it has been reserved first.
43
43
  attr_accessor :is_reservation_mandatory
44
44
 
45
45
  # An indication of whether the coupon is implicitly reserved for all customers.
@@ -26,7 +26,7 @@ module TalonOne
26
26
  # Indicates the access level of the user.
27
27
  attr_accessor :policy
28
28
 
29
- # A list of the IDs of the roles assigned to the user. **Note**: Use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint to find the ID of a role.
29
+ # A list of the IDs of the roles assigned to the user. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint.
30
30
  attr_accessor :roles
31
31
 
32
32
  # Application notifications that the user is subscribed to.
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module TalonOne
14
- VERSION = '4.0.0'
14
+ VERSION = '5.0.0'
15
15
  end
data/lib/talon_one.rb CHANGED
@@ -35,6 +35,7 @@ require 'talon_one/models/account_limits'
35
35
  require 'talon_one/models/achievement'
36
36
  require 'talon_one/models/achievement_additional_properties'
37
37
  require 'talon_one/models/achievement_progress'
38
+ require 'talon_one/models/activate_user_request'
38
39
  require 'talon_one/models/add_free_item_effect_props'
39
40
  require 'talon_one/models/add_item_catalog_action'
40
41
  require 'talon_one/models/add_loyalty_points'
@@ -274,6 +275,7 @@ require 'talon_one/models/loyalty'
274
275
  require 'talon_one/models/loyalty_balance'
275
276
  require 'talon_one/models/loyalty_balances'
276
277
  require 'talon_one/models/loyalty_card'
278
+ require 'talon_one/models/loyalty_card_balances'
277
279
  require 'talon_one/models/loyalty_card_profile_registration'
278
280
  require 'talon_one/models/loyalty_card_registration'
279
281
  require 'talon_one/models/loyalty_dashboard_data'
@@ -333,6 +335,7 @@ require 'talon_one/models/new_customer_session'
333
335
  require 'talon_one/models/new_customer_session_v2'
334
336
  require 'talon_one/models/new_event'
335
337
  require 'talon_one/models/new_event_type'
338
+ require 'talon_one/models/new_external_invitation'
336
339
  require 'talon_one/models/new_giveaways_pool'
337
340
  require 'talon_one/models/new_internal_audience'
338
341
  require 'talon_one/models/new_invitation'
@@ -46,7 +46,7 @@ describe 'IntegrationApi' do
46
46
 
47
47
  # unit tests for create_coupon_reservation
48
48
  # Create coupon reservation
49
- # Create a coupon reservation for specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). Reserving a coupon allows you to associate a coupon code to a given customer(s). You can then list the reserved coupons of a given customer with the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. If a coupon gets created for a specific user, it will automatically appear in their coupons. When a user redeems a coupon, a reservation is automatically created after the redemption and the used coupon will be returned in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. For example, you can use this endpoint and &#x60;List customer data&#x60; to create a _coupon wallet_ by reserving coupon codes for a customer, and then displaying their coupon wallet when they visit your store. If the **Coupon visibility** checkbox was selected when [creating a universal code](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons#generating-a-universal-code), the coupon code is implicitly reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. &lt;div class&#x3D;\&quot;redoc-section\&quot;&gt; &lt;p class&#x3D;\&quot;title\&quot;&gt;Important&lt;/p&gt; This endpoint creates a **soft** reservation. _Any_ customer can use a reserved coupon code and proceed to checkout. To create a hard reservation, you can: - use the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) endpoint or, - use the [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoint setting the &#x60;recipientsIntegrationId&#x60; property or, - create a coupon code with the **Reservation mandatory** option then use the [Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). This endpoint overrides the reservation limit set for the coupon code during coupon creation. &lt;/div&gt; To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint.
49
+ # Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation effect](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon will be associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint.
50
50
  # @param coupon_value The code of the coupon.
51
51
  # @param body body
52
52
  # @param [Hash] opts the optional parameters
@@ -163,12 +163,12 @@ describe 'IntegrationApi' do
163
163
 
164
164
  # unit tests for get_loyalty_balances
165
165
  # Get customer&#39;s loyalty points
166
- # Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data)
166
+ # Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data)
167
167
  # @param loyalty_program_id Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
168
168
  # @param integration_id The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.
169
169
  # @param [Hash] opts the optional parameters
170
170
  # @option opts [DateTime] :end_date Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.
171
- # @option opts [Array<String>] :subledger_id Filter results by one or more subledger IDs. Must be exact match.
171
+ # @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
172
172
  # @return [LoyaltyBalances]
173
173
  describe 'get_loyalty_balances test' do
174
174
  it 'should work' do
@@ -184,7 +184,7 @@ describe 'IntegrationApi' do
184
184
  # @param [Hash] opts the optional parameters
185
185
  # @option opts [DateTime] :end_date Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.
186
186
  # @option opts [Array<String>] :subledger_id Filter results by one or more subledger IDs. Must be exact match.
187
- # @return [LoyaltyBalances]
187
+ # @return [LoyaltyCardBalances]
188
188
  describe 'get_loyalty_card_balances test' do
189
189
  it 'should work' do
190
190
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -198,7 +198,7 @@ describe 'IntegrationApi' do
198
198
  # @param loyalty_card_id Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
199
199
  # @param [Hash] opts the optional parameters
200
200
  # @option opts [String] :status Filter points based on their status.
201
- # @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
201
+ # @option opts [Array<String>] :subledger_id Filter results by one or more subledger IDs. Must be exact match.
202
202
  # @option opts [Integer] :page_size The number of items in the response.
203
203
  # @option opts [Integer] :skip The number of items to skip when paging through large result sets.
204
204
  # @return [InlineResponse2003]
@@ -214,7 +214,7 @@ describe 'IntegrationApi' do
214
214
  # @param loyalty_program_id Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
215
215
  # @param loyalty_card_id Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
216
216
  # @param [Hash] opts the optional parameters
217
- # @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
217
+ # @option opts [Array<String>] :subledger_id Filter results by one or more subledger IDs. Must be exact match.
218
218
  # @option opts [String] :loyalty_transaction_type Filter results by loyalty transaction type: - &#x60;manual&#x60;: Loyalty transaction that was done manually. - &#x60;session&#x60;: Loyalty transaction that resulted from a customer session. - &#x60;import&#x60;: Loyalty transaction that was imported from a CSV file.
219
219
  # @option opts [DateTime] :start_date Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.
220
220
  # @option opts [DateTime] :end_date Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.
@@ -265,7 +265,7 @@ describe 'IntegrationApi' do
265
265
 
266
266
  # unit tests for get_reserved_customers
267
267
  # List customers that have this coupon reserved
268
- # Return all customers that have this coupon marked as reserved. Coupons are reserved in the following ways: - To create a soft reservation (any customer can use the coupon), use the [Create coupon reservation](#operation/createCouponReservation) endpoint. - To create a hard reservation (only the given customer can use the coupon), create a coupon in the Campaign Manager for a given &#x60;recipientIntegrationId&#x60; or use the [Create coupons](https://docs.talon.one/management-api#operation/createCoupons) or [Create coupons for multiple recipients](https://docs.talon.one/management-api#operation/createCouponsForMultipleRecipients) endpoints.
268
+ # Return all customers that have this coupon marked as reserved. This includes hard and soft reservations.
269
269
  # @param coupon_value The code of the coupon.
270
270
  # @param [Hash] opts the optional parameters
271
271
  # @return [InlineResponse200]
@@ -32,6 +32,18 @@ describe 'ManagementApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for activate_user_by_email
36
+ # Activate user by email address
37
+ # Activate a deactivated user by their email address.
38
+ # @param body body
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [nil]
41
+ describe 'activate_user_by_email test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
35
47
  # unit tests for add_loyalty_card_points
36
48
  # Add points to card
37
49
  # Add points to the given loyalty card in the specified card-based loyalty program.
@@ -504,7 +516,7 @@ describe 'ManagementApi' do
504
516
 
505
517
  # unit tests for export_coupons
506
518
  # Export coupons
507
- # Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file can contain the following columns: - &#x60;accountid&#x60;: The ID of your deployment. - &#x60;applicationid&#x60;: The ID of the Application this coupon is related to. - &#x60;attributes&#x60;: A json object describing _custom_ referral attribute names and their values. - &#x60;batchid&#x60;: The ID of the batch this coupon is part of. - &#x60;campaignid&#x60;: The ID of the campaign this coupon is related to. - &#x60;counter&#x60;: The number of times this coupon has been redeemed. - &#x60;created&#x60;: The creation date of the coupon code. - &#x60;deleted&#x60;: Whether the coupon code is deleted. - &#x60;deleted_changelogid&#x60;: The ID of the delete event in the logs. - &#x60;discount_counter&#x60;: The amount of discount given by this coupon. - &#x60;discount_limitval&#x60;: The maximum discount amount that can be given be this coupon. - &#x60;expirydate&#x60;: The end date in RFC3339 of the code redemption period. - &#x60;id&#x60;: The internal ID of the coupon code. - &#x60;importid&#x60;: The ID of the import job that created this coupon. - &#x60;is_reservation_mandatory&#x60;: Whether this coupon requires a reservation to be redeemed. - &#x60;limits&#x60;: The limits set on this coupon. - &#x60;limitval&#x60;: The maximum number of redemptions of this code. - &#x60;recipientintegrationid&#x60;: The integration ID of the customer considered as recipient of the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - &#x60;referralid&#x60;: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - &#x60;reservation&#x60;: Whether the coupon is reserved. - &#x60;reservation_counter&#x60;: How many times this coupon has been reserved. - &#x60;reservation_limitval&#x60;: The maximum of number of reservations this coupon can have. - &#x60;startdate&#x60;: The start date in RFC3339 of the code redemption period. - &#x60;value&#x60;: The coupon code.
519
+ # Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file can contain the following columns: - &#x60;accountid&#x60;: The ID of your deployment. - &#x60;applicationid&#x60;: The ID of the Application this coupon is related to. - &#x60;attributes&#x60;: A json object describing _custom_ referral attribute names and their values. - &#x60;batchid&#x60;: The ID of the batch this coupon is part of. - &#x60;campaignid&#x60;: The ID of the campaign this coupon is related to. - &#x60;counter&#x60;: The number of times this coupon has been redeemed. - &#x60;created&#x60;: The creation date of the coupon code. - &#x60;deleted&#x60;: Whether the coupon code is deleted. - &#x60;deleted_changelogid&#x60;: The ID of the delete event in the logs. - &#x60;discount_counter&#x60;: The amount of discount given by this coupon. - &#x60;discount_limitval&#x60;: The maximum discount amount that can be given be this coupon. - &#x60;expirydate&#x60;: The end date in RFC3339 of the code redemption period. - &#x60;id&#x60;: The internal ID of the coupon code. - &#x60;importid&#x60;: The ID of the import job that created this coupon. - &#x60;is_reservation_mandatory&#x60;: Whether this coupon requires a reservation to be redeemed. - &#x60;limits&#x60;: The limits set on this coupon. - &#x60;limitval&#x60;: The maximum number of redemptions of this code. - &#x60;recipientintegrationid&#x60;: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - &#x60;referralid&#x60;: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - &#x60;reservation&#x60;: Whether the coupon can be reserved for multiple customers. - &#x60;reservation_counter&#x60;: How many times this coupon has been reserved. - &#x60;reservation_limitval&#x60;: The maximum of number of reservations this coupon can have. - &#x60;startdate&#x60;: The start date in RFC3339 of the code redemption period. - &#x60;value&#x60;: The coupon code.
508
520
  # @param application_id The ID of the Application. It is displayed in your Talon.One deployment URL.
509
521
  # @param [Hash] opts the optional parameters
510
522
  # @option opts [Float] :campaign_id Filter results by campaign.
@@ -794,17 +806,6 @@ describe 'ManagementApi' do
794
806
  end
795
807
  end
796
808
 
797
- # unit tests for get_all_roles
798
- # List roles
799
- # List all roles.
800
- # @param [Hash] opts the optional parameters
801
- # @return [InlineResponse20044]
802
- describe 'get_all_roles test' do
803
- it 'should work' do
804
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
805
- end
806
- end
807
-
808
809
  # unit tests for get_application
809
810
  # Get Application
810
811
  # Get the application specified by the ID.
@@ -1521,13 +1522,13 @@ describe 'ManagementApi' do
1521
1522
  end
1522
1523
  end
1523
1524
 
1524
- # unit tests for get_role
1525
+ # unit tests for get_role_v2
1525
1526
  # Get role
1526
- # Get the details of a specific role. To see all the roles, use [List roles](#operation/getAllRoles).
1527
- # @param role_id ID of role. **Note**: To find the ID of a role, use the [List roles](https://docs.talon.one/management-api#tag/Roles/operation/getAllRoles) endpoint.
1527
+ # Get the details of a specific role. To see all the roles, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint.
1528
+ # @param role_id The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint.
1528
1529
  # @param [Hash] opts the optional parameters
1529
- # @return [Role]
1530
- describe 'get_role test' do
1530
+ # @return [RoleV2]
1531
+ describe 'get_role_v2 test' do
1531
1532
  it 'should work' do
1532
1533
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
1533
1534
  end
@@ -1730,7 +1731,7 @@ describe 'ManagementApi' do
1730
1731
 
1731
1732
  # unit tests for import_coupons
1732
1733
  # Import coupons
1733
- # Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - &#x60;value&#x60; (required): The coupon code. - &#x60;expirydate&#x60;: The end date in RFC3339 of the code redemption period. - &#x60;startdate&#x60;: The start date in RFC3339 of the code redemption period. - &#x60;recipientintegrationid&#x60;: The integration ID of the customer who receives the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - &#x60;limitval&#x60;: The maximum number of redemptions of this code. For unlimited redemptions, use &#x60;0&#x60;. Defaults to &#x60;1&#x60; when not provided. - &#x60;discountlimit&#x60;: The total discount value that the code can give. This is typically used to represent a gift card value. - &#x60;attributes&#x60;: A JSON object describing _custom_ coupon attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called &#x60;category&#x60; associated with the coupon entity, the object in the CSV file, when opened in a text editor, must be: &#x60;\&quot;{\&quot;category\&quot;: \&quot;10_off\&quot;}\&quot;&#x60;. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** &#x60;&#x60;&#x60;text \&quot;value\&quot;,\&quot;expirydate\&quot;,\&quot;startdate\&quot;,\&quot;recipientintegrationid\&quot;,\&quot;limitval\&quot;,\&quot;attributes\&quot;,\&quot;discountlimit\&quot; COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\&quot;{\&quot;\&quot;Category\&quot;\&quot;: \&quot;\&quot;10_off\&quot;\&quot;}\&quot;,2.4 &#x60;&#x60;&#x60; Once imported, you can find the &#x60;batchId&#x60; in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount).
1734
+ # Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - &#x60;value&#x60; (required): The coupon code. - &#x60;expirydate&#x60;: The end date in RFC3339 of the code redemption period. - &#x60;startdate&#x60;: The start date in RFC3339 of the code redemption period. - &#x60;recipientintegrationid&#x60;: The integration ID of the recipient of the coupon. Only the customer with this integration ID can redeem this code. Available only for personal codes. - &#x60;limitval&#x60;: The maximum number of redemptions of this code. For unlimited redemptions, use &#x60;0&#x60;. Defaults to &#x60;1&#x60; when not provided. - &#x60;discountlimit&#x60;: The total discount value that the code can give. This is typically used to represent a gift card value. - &#x60;attributes&#x60;: A JSON object describing _custom_ coupon attribute names and their values, enclosed with double quotation marks. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called &#x60;category&#x60; associated with the coupon entity, the object in the CSV file, when opened in a text editor, must be: &#x60;\&quot;{\&quot;category\&quot;: \&quot;10_off\&quot;}\&quot;&#x60;. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** &#x60;&#x60;&#x60;text \&quot;value\&quot;,\&quot;expirydate\&quot;,\&quot;startdate\&quot;,\&quot;recipientintegrationid\&quot;,\&quot;limitval\&quot;,\&quot;attributes\&quot;,\&quot;discountlimit\&quot; COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\&quot;{\&quot;\&quot;Category\&quot;\&quot;: \&quot;\&quot;10_off\&quot;\&quot;}\&quot;,2.4 &#x60;&#x60;&#x60; Once imported, you can find the &#x60;batchId&#x60; in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount).
1734
1735
  # @param application_id The ID of the Application. It is displayed in your Talon.One deployment URL.
1735
1736
  # @param campaign_id The ID of the campaign. It is displayed in your Talon.One deployment URL.
1736
1737
  # @param [Hash] opts the optional parameters
@@ -1809,6 +1810,18 @@ describe 'ManagementApi' do
1809
1810
  end
1810
1811
  end
1811
1812
 
1813
+ # unit tests for invite_user_external
1814
+ # Invite user from identity provider
1815
+ # Invite a user from an external identity provider to Talon.One by sending an invitation to their email address.
1816
+ # @param body body
1817
+ # @param [Hash] opts the optional parameters
1818
+ # @return [nil]
1819
+ describe 'invite_user_external test' do
1820
+ it 'should work' do
1821
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
1822
+ end
1823
+ end
1824
+
1812
1825
  # unit tests for list_account_collections
1813
1826
  # List collections in account
1814
1827
  # List account-level collections in the account.
@@ -1841,6 +1854,17 @@ describe 'ManagementApi' do
1841
1854
  end
1842
1855
  end
1843
1856
 
1857
+ # unit tests for list_all_roles_v2
1858
+ # List roles
1859
+ # List all roles.
1860
+ # @param [Hash] opts the optional parameters
1861
+ # @return [InlineResponse20044]
1862
+ describe 'list_all_roles_v2 test' do
1863
+ it 'should work' do
1864
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
1865
+ end
1866
+ end
1867
+
1844
1868
  # unit tests for list_catalog_items
1845
1869
  # List items in a catalog
1846
1870
  # Return a paginated list of cart items in the given catalog.
@@ -2201,7 +2225,7 @@ describe 'ManagementApi' do
2201
2225
  # unit tests for update_role_v2
2202
2226
  # Update role
2203
2227
  # Update a specific role.
2204
- # @param role_id The ID of role.
2228
+ # @param role_id The ID of role. **Note**: To find the ID of a role, use the [List roles](/management-api#tag/Roles/operation/listAllRolesV2) endpoint.
2205
2229
  # @param body body
2206
2230
  # @param [Hash] opts the optional parameters
2207
2231
  # @return [RoleV2]
@@ -0,0 +1,41 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for TalonOne::ActivateUserRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'ActivateUserRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = TalonOne::ActivateUserRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of ActivateUserRequest' do
31
+ it 'should create an instance of ActivateUserRequest' do
32
+ expect(@instance).to be_instance_of(TalonOne::ActivateUserRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "email"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
@@ -161,7 +161,7 @@ describe 'AdditionalCampaignProperties' do
161
161
  describe 'test attribute "frontend_state"' do
162
162
  it 'should work' do
163
163
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
164
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["expired", "scheduled", "running", "draft"])
164
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["expired", "scheduled", "running", "draft", "disabled", "archived"])
165
165
  # validator.allowable_values.each do |value|
166
166
  # expect { @instance.frontend_state = value }.not_to raise_error
167
167
  # end
@@ -287,7 +287,7 @@ describe 'Campaign' do
287
287
  describe 'test attribute "frontend_state"' do
288
288
  it 'should work' do
289
289
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
290
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["expired", "scheduled", "running", "draft"])
290
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["expired", "scheduled", "running", "draft", "disabled", "archived"])
291
291
  # validator.allowable_values.each do |value|
292
292
  # expect { @instance.frontend_state = value }.not_to raise_error
293
293
  # end
@@ -0,0 +1,53 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for TalonOne::LoyaltyCardBalances
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'LoyaltyCardBalances' do
21
+ before do
22
+ # run before each test
23
+ @instance = TalonOne::LoyaltyCardBalances.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of LoyaltyCardBalances' do
31
+ it 'should create an instance of LoyaltyCardBalances' do
32
+ expect(@instance).to be_instance_of(TalonOne::LoyaltyCardBalances)
33
+ end
34
+ end
35
+ describe 'test attribute "balance"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "subledger_balances"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "profiles"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end
@@ -83,19 +83,13 @@ describe 'MessageLogEntry' do
83
83
  describe 'test attribute "entity_type"' do
84
84
  it 'should work' do
85
85
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["application", "loyalty_program", "webhook"])
86
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["application", "loyalty_program"])
87
87
  # validator.allowable_values.each do |value|
88
88
  # expect { @instance.entity_type = value }.not_to raise_error
89
89
  # end
90
90
  end
91
91
  end
92
92
 
93
- describe 'test attribute "url"' do
94
- it 'should work' do
95
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
96
- end
97
- end
98
-
99
93
  describe 'test attribute "application_id"' do
100
94
  it 'should work' do
101
95
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers