talon_one 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/docs/AddLoyaltyPoints.md +2 -2
- data/docs/CustomEffect.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse20010.md +3 -3
- data/docs/InlineResponse20011.md +3 -3
- data/docs/InlineResponse20012.md +1 -1
- data/docs/InlineResponse20013.md +2 -2
- data/docs/InlineResponse20014.md +3 -5
- data/docs/InlineResponse20015.md +4 -2
- data/docs/InlineResponse20016.md +2 -4
- data/docs/InlineResponse20017.md +4 -2
- data/docs/InlineResponse20018.md +2 -2
- data/docs/InlineResponse20019.md +1 -1
- data/docs/InlineResponse2002.md +3 -3
- data/docs/InlineResponse20020.md +2 -4
- data/docs/InlineResponse20021.md +3 -3
- data/docs/InlineResponse20022.md +1 -1
- data/docs/InlineResponse20023.md +3 -1
- data/docs/InlineResponse20024.md +1 -1
- data/docs/InlineResponse20025.md +2 -2
- data/docs/InlineResponse20026.md +2 -2
- data/docs/InlineResponse20027.md +3 -3
- data/docs/InlineResponse20028.md +3 -5
- data/docs/InlineResponse20029.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse20030.md +5 -3
- data/docs/InlineResponse20031.md +1 -1
- data/docs/InlineResponse20032.md +1 -1
- data/docs/InlineResponse20033.md +1 -1
- data/docs/InlineResponse20034.md +1 -1
- data/docs/InlineResponse20035.md +1 -1
- data/docs/InlineResponse20036.md +1 -1
- data/docs/InlineResponse20037.md +2 -4
- data/docs/InlineResponse20038.md +4 -2
- data/docs/InlineResponse20039.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse20040.md +19 -0
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +1 -1
- data/docs/InlineResponse2007.md +2 -2
- data/docs/InlineResponse2008.md +1 -1
- data/docs/InlineResponse2009.md +1 -1
- data/docs/IntegrationApi.md +26 -26
- data/docs/ManagementApi.md +141 -141
- data/docs/MultiApplicationEntity.md +1 -1
- data/docs/NewCustomEffect.md +1 -1
- data/docs/NewOutgoingIntegrationWebhook.md +19 -0
- data/docs/NewWebhook.md +3 -3
- data/docs/OutgoingIntegrationConfiguration.md +3 -1
- data/docs/OutgoingIntegrationWebhookTemplate.md +3 -1
- data/docs/ReopenSessionResponse.md +17 -0
- data/docs/StrikethroughCustomEffectPerItemProps.md +21 -0
- data/docs/UpdateCustomEffect.md +1 -1
- data/docs/Webhook.md +3 -3
- data/lib/talon_one/api/integration_api.rb +48 -48
- data/lib/talon_one/api/management_api.rb +234 -234
- data/lib/talon_one/models/add_loyalty_points.rb +2 -2
- data/lib/talon_one/models/custom_effect.rb +1 -1
- data/lib/talon_one/models/inline_response2001.rb +1 -1
- data/lib/talon_one/models/inline_response20010.rb +11 -11
- data/lib/talon_one/models/inline_response20011.rb +11 -11
- data/lib/talon_one/models/inline_response20012.rb +1 -1
- data/lib/talon_one/models/inline_response20013.rb +1 -3
- data/lib/talon_one/models/inline_response20014.rb +9 -11
- data/lib/talon_one/models/inline_response20015.rb +11 -7
- data/lib/talon_one/models/inline_response20016.rb +7 -11
- data/lib/talon_one/models/inline_response20017.rb +11 -7
- data/lib/talon_one/models/inline_response20018.rb +10 -10
- data/lib/talon_one/models/inline_response20019.rb +1 -1
- data/lib/talon_one/models/inline_response2002.rb +11 -11
- data/lib/talon_one/models/inline_response20020.rb +7 -11
- data/lib/talon_one/models/inline_response20021.rb +10 -10
- data/lib/talon_one/models/inline_response20022.rb +1 -1
- data/lib/talon_one/models/inline_response20023.rb +10 -6
- data/lib/talon_one/models/inline_response20024.rb +1 -1
- data/lib/talon_one/models/inline_response20025.rb +6 -1
- data/lib/talon_one/models/inline_response20026.rb +1 -6
- data/lib/talon_one/models/inline_response20027.rb +11 -11
- 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_response2003.rb +1 -1
- data/lib/talon_one/models/inline_response20030.rb +11 -7
- data/lib/talon_one/models/inline_response20031.rb +1 -1
- data/lib/talon_one/models/inline_response20032.rb +1 -1
- data/lib/talon_one/models/inline_response20033.rb +1 -1
- data/lib/talon_one/models/inline_response20034.rb +1 -1
- data/lib/talon_one/models/inline_response20035.rb +1 -1
- data/lib/talon_one/models/inline_response20036.rb +1 -1
- data/lib/talon_one/models/inline_response20037.rb +7 -11
- data/lib/talon_one/models/inline_response20038.rb +11 -7
- data/lib/talon_one/models/inline_response20039.rb +1 -1
- data/lib/talon_one/models/inline_response2004.rb +1 -1
- data/lib/talon_one/models/inline_response20040.rb +227 -0
- data/lib/talon_one/models/inline_response2005.rb +1 -1
- data/lib/talon_one/models/inline_response2006.rb +1 -1
- data/lib/talon_one/models/inline_response2007.rb +10 -10
- data/lib/talon_one/models/inline_response2008.rb +1 -1
- data/lib/talon_one/models/inline_response2009.rb +1 -1
- data/lib/talon_one/models/multi_application_entity.rb +1 -1
- data/lib/talon_one/models/new_custom_effect.rb +1 -1
- data/lib/talon_one/models/new_outgoing_integration_webhook.rb +229 -0
- data/lib/talon_one/models/new_webhook.rb +3 -3
- data/lib/talon_one/models/outgoing_integration_configuration.rb +16 -1
- data/lib/talon_one/models/outgoing_integration_webhook_template.rb +53 -4
- data/lib/talon_one/models/reopen_session_response.rb +215 -0
- data/lib/talon_one/models/strikethrough_custom_effect_per_item_props.rb +243 -0
- data/lib/talon_one/models/update_custom_effect.rb +1 -1
- data/lib/talon_one/models/webhook.rb +3 -3
- data/lib/talon_one/version.rb +1 -1
- data/lib/talon_one.rb +4 -0
- data/spec/api/integration_api_spec.rb +9 -9
- data/spec/api/management_api_spec.rb +59 -59
- data/spec/models/inline_response20010_spec.rb +1 -1
- data/spec/models/inline_response20011_spec.rb +1 -1
- data/spec/models/inline_response20014_spec.rb +0 -6
- data/spec/models/inline_response20015_spec.rb +6 -0
- data/spec/models/inline_response20016_spec.rb +0 -6
- data/spec/models/inline_response20017_spec.rb +6 -0
- data/spec/models/inline_response20018_spec.rb +1 -1
- data/spec/models/inline_response20020_spec.rb +0 -6
- data/spec/models/inline_response20021_spec.rb +2 -2
- data/spec/models/inline_response20023_spec.rb +6 -0
- data/spec/models/inline_response20027_spec.rb +1 -1
- data/spec/models/inline_response20028_spec.rb +0 -6
- data/spec/models/inline_response2002_spec.rb +1 -1
- data/spec/models/inline_response20030_spec.rb +6 -0
- data/spec/models/inline_response20037_spec.rb +0 -6
- data/spec/models/inline_response20038_spec.rb +6 -0
- data/spec/models/inline_response20040_spec.rb +47 -0
- data/spec/models/inline_response2007_spec.rb +1 -1
- data/spec/models/new_outgoing_integration_webhook_spec.rb +47 -0
- data/spec/models/outgoing_integration_configuration_spec.rb +6 -0
- data/spec/models/outgoing_integration_webhook_template_spec.rb +10 -0
- data/spec/models/reopen_session_response_spec.rb +41 -0
- data/spec/models/strikethrough_custom_effect_per_item_props_spec.rb +53 -0
- metadata +18 -2
@@ -15,7 +15,7 @@ require 'date'
|
|
15
15
|
module TalonOne
|
16
16
|
#
|
17
17
|
class NewWebhook
|
18
|
-
# The IDs of the
|
18
|
+
# The IDs of the Applications that are related to this entity.
|
19
19
|
attr_accessor :application_ids
|
20
20
|
|
21
21
|
# Name or title for this webhook.
|
@@ -24,7 +24,7 @@ module TalonOne
|
|
24
24
|
# API method for this webhook.
|
25
25
|
attr_accessor :verb
|
26
26
|
|
27
|
-
# API
|
27
|
+
# API URL (supports templating using parameters) for this webhook.
|
28
28
|
attr_accessor :url
|
29
29
|
|
30
30
|
# List of API HTTP headers for this webhook.
|
@@ -36,7 +36,7 @@ module TalonOne
|
|
36
36
|
# Array of template argument definitions.
|
37
37
|
attr_accessor :params
|
38
38
|
|
39
|
-
# Enables or disables webhook from showing in
|
39
|
+
# Enables or disables webhook from showing in the Rule Builder.
|
40
40
|
attr_accessor :enabled
|
41
41
|
|
42
42
|
class EnumAttributeValidator
|
@@ -14,6 +14,9 @@ require 'date'
|
|
14
14
|
|
15
15
|
module TalonOne
|
16
16
|
class OutgoingIntegrationConfiguration
|
17
|
+
# Unique ID for this entity.
|
18
|
+
attr_accessor :id
|
19
|
+
|
17
20
|
# The ID of the account to which this configuration belongs.
|
18
21
|
attr_accessor :account_id
|
19
22
|
|
@@ -25,6 +28,7 @@ module TalonOne
|
|
25
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
29
|
def self.attribute_map
|
27
30
|
{
|
31
|
+
:'id' => :'id',
|
28
32
|
:'account_id' => :'accountId',
|
29
33
|
:'type_id' => :'typeId',
|
30
34
|
:'policy' => :'policy'
|
@@ -34,6 +38,7 @@ module TalonOne
|
|
34
38
|
# Attribute type mapping.
|
35
39
|
def self.openapi_types
|
36
40
|
{
|
41
|
+
:'id' => :'Integer',
|
37
42
|
:'account_id' => :'Integer',
|
38
43
|
:'type_id' => :'Integer',
|
39
44
|
:'policy' => :'Object'
|
@@ -61,6 +66,10 @@ module TalonOne
|
|
61
66
|
h[k.to_sym] = v
|
62
67
|
}
|
63
68
|
|
69
|
+
if attributes.key?(:'id')
|
70
|
+
self.id = attributes[:'id']
|
71
|
+
end
|
72
|
+
|
64
73
|
if attributes.key?(:'account_id')
|
65
74
|
self.account_id = attributes[:'account_id']
|
66
75
|
end
|
@@ -78,6 +87,10 @@ module TalonOne
|
|
78
87
|
# @return Array for valid properties with the reasons
|
79
88
|
def list_invalid_properties
|
80
89
|
invalid_properties = Array.new
|
90
|
+
if @id.nil?
|
91
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
92
|
+
end
|
93
|
+
|
81
94
|
if @account_id.nil?
|
82
95
|
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
83
96
|
end
|
@@ -96,6 +109,7 @@ module TalonOne
|
|
96
109
|
# Check to see if the all the properties in the model are valid
|
97
110
|
# @return true if the model is valid
|
98
111
|
def valid?
|
112
|
+
return false if @id.nil?
|
99
113
|
return false if @account_id.nil?
|
100
114
|
return false if @type_id.nil?
|
101
115
|
return false if @policy.nil?
|
@@ -107,6 +121,7 @@ module TalonOne
|
|
107
121
|
def ==(o)
|
108
122
|
return true if self.equal?(o)
|
109
123
|
self.class == o.class &&
|
124
|
+
id == o.id &&
|
110
125
|
account_id == o.account_id &&
|
111
126
|
type_id == o.type_id &&
|
112
127
|
policy == o.policy
|
@@ -121,7 +136,7 @@ module TalonOne
|
|
121
136
|
# Calculates hash code according to all attributes.
|
122
137
|
# @return [Integer] Hash code
|
123
138
|
def hash
|
124
|
-
[account_id, type_id, policy].hash
|
139
|
+
[id, account_id, type_id, policy].hash
|
125
140
|
end
|
126
141
|
|
127
142
|
# Builds the object from hash
|
@@ -29,6 +29,31 @@ module TalonOne
|
|
29
29
|
# API payload (supports templating using parameters) for this webhook template.
|
30
30
|
attr_accessor :payload
|
31
31
|
|
32
|
+
# API method for this webhook.
|
33
|
+
attr_accessor :method
|
34
|
+
|
35
|
+
class EnumAttributeValidator
|
36
|
+
attr_reader :datatype
|
37
|
+
attr_reader :allowable_values
|
38
|
+
|
39
|
+
def initialize(datatype, allowable_values)
|
40
|
+
@allowable_values = allowable_values.map do |value|
|
41
|
+
case datatype.to_s
|
42
|
+
when /Integer/i
|
43
|
+
value.to_i
|
44
|
+
when /Float/i
|
45
|
+
value.to_f
|
46
|
+
else
|
47
|
+
value
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def valid?(value)
|
53
|
+
!value || allowable_values.include?(value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
32
57
|
# Attribute mapping from ruby-style variable name to JSON key.
|
33
58
|
def self.attribute_map
|
34
59
|
{
|
@@ -36,7 +61,8 @@ module TalonOne
|
|
36
61
|
:'integration_type' => :'integrationType',
|
37
62
|
:'title' => :'title',
|
38
63
|
:'description' => :'description',
|
39
|
-
:'payload' => :'payload'
|
64
|
+
:'payload' => :'payload',
|
65
|
+
:'method' => :'method'
|
40
66
|
}
|
41
67
|
end
|
42
68
|
|
@@ -47,7 +73,8 @@ module TalonOne
|
|
47
73
|
:'integration_type' => :'Integer',
|
48
74
|
:'title' => :'String',
|
49
75
|
:'description' => :'String',
|
50
|
-
:'payload' => :'String'
|
76
|
+
:'payload' => :'String',
|
77
|
+
:'method' => :'String'
|
51
78
|
}
|
52
79
|
end
|
53
80
|
|
@@ -91,6 +118,10 @@ module TalonOne
|
|
91
118
|
if attributes.key?(:'payload')
|
92
119
|
self.payload = attributes[:'payload']
|
93
120
|
end
|
121
|
+
|
122
|
+
if attributes.key?(:'method')
|
123
|
+
self.method = attributes[:'method']
|
124
|
+
end
|
94
125
|
end
|
95
126
|
|
96
127
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -133,6 +164,10 @@ module TalonOne
|
|
133
164
|
invalid_properties.push('invalid value for "payload", payload cannot be nil.')
|
134
165
|
end
|
135
166
|
|
167
|
+
if @method.nil?
|
168
|
+
invalid_properties.push('invalid value for "method", method cannot be nil.')
|
169
|
+
end
|
170
|
+
|
136
171
|
invalid_properties
|
137
172
|
end
|
138
173
|
|
@@ -148,6 +183,9 @@ module TalonOne
|
|
148
183
|
return false if @description.to_s.length > 1000
|
149
184
|
return false if @description.to_s.length < 1
|
150
185
|
return false if @payload.nil?
|
186
|
+
return false if @method.nil?
|
187
|
+
method_validator = EnumAttributeValidator.new('String', ["POST", "PUT", "GET", "DELETE", "PATCH"])
|
188
|
+
return false unless method_validator.valid?(@method)
|
151
189
|
true
|
152
190
|
end
|
153
191
|
|
@@ -187,6 +225,16 @@ module TalonOne
|
|
187
225
|
@description = description
|
188
226
|
end
|
189
227
|
|
228
|
+
# Custom attribute writer method checking allowed values (enum).
|
229
|
+
# @param [Object] method Object to be assigned
|
230
|
+
def method=(method)
|
231
|
+
validator = EnumAttributeValidator.new('String', ["POST", "PUT", "GET", "DELETE", "PATCH"])
|
232
|
+
unless validator.valid?(method)
|
233
|
+
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
234
|
+
end
|
235
|
+
@method = method
|
236
|
+
end
|
237
|
+
|
190
238
|
# Checks equality by comparing each attribute.
|
191
239
|
# @param [Object] Object to be compared
|
192
240
|
def ==(o)
|
@@ -196,7 +244,8 @@ module TalonOne
|
|
196
244
|
integration_type == o.integration_type &&
|
197
245
|
title == o.title &&
|
198
246
|
description == o.description &&
|
199
|
-
payload == o.payload
|
247
|
+
payload == o.payload &&
|
248
|
+
method == o.method
|
200
249
|
end
|
201
250
|
|
202
251
|
# @see the `==` method
|
@@ -208,7 +257,7 @@ module TalonOne
|
|
208
257
|
# Calculates hash code according to all attributes.
|
209
258
|
# @return [Integer] Hash code
|
210
259
|
def hash
|
211
|
-
[id, integration_type, title, description, payload].hash
|
260
|
+
[id, integration_type, title, description, payload, method].hash
|
212
261
|
end
|
213
262
|
|
214
263
|
# Builds the object from hash
|
@@ -0,0 +1,215 @@
|
|
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
|
+
# This is the response type returned by the Reopen customer sessions endpoint. It contains the rolled back effects.
|
17
|
+
class ReopenSessionResponse
|
18
|
+
# The effects generated by the rules in your running campaigns. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).
|
19
|
+
attr_accessor :effects
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'effects' => :'effects'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'effects' => :'Array<Effect>'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if (!attributes.is_a?(Hash))
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::ReopenSessionResponse` initialize method"
|
46
|
+
end
|
47
|
+
|
48
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
50
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::ReopenSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
52
|
+
end
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:'effects')
|
57
|
+
if (value = attributes[:'effects']).is_a?(Array)
|
58
|
+
self.effects = value
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
64
|
+
# @return Array for valid properties with the reasons
|
65
|
+
def list_invalid_properties
|
66
|
+
invalid_properties = Array.new
|
67
|
+
if @effects.nil?
|
68
|
+
invalid_properties.push('invalid value for "effects", effects cannot be nil.')
|
69
|
+
end
|
70
|
+
|
71
|
+
invalid_properties
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check to see if the all the properties in the model are valid
|
75
|
+
# @return true if the model is valid
|
76
|
+
def valid?
|
77
|
+
return false if @effects.nil?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
effects == o.effects
|
87
|
+
end
|
88
|
+
|
89
|
+
# @see the `==` method
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def eql?(o)
|
92
|
+
self == o
|
93
|
+
end
|
94
|
+
|
95
|
+
# Calculates hash code according to all attributes.
|
96
|
+
# @return [Integer] Hash code
|
97
|
+
def hash
|
98
|
+
[effects].hash
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def self.build_from_hash(attributes)
|
105
|
+
new.build_from_hash(attributes)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def build_from_hash(attributes)
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
113
|
+
self.class.openapi_types.each_pair do |key, type|
|
114
|
+
if type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
123
|
+
end
|
124
|
+
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
# Deserializes the data based on type
|
129
|
+
# @param string type Data type
|
130
|
+
# @param string value Value to be deserialized
|
131
|
+
# @return [Object] Deserialized data
|
132
|
+
def _deserialize(type, value)
|
133
|
+
case type.to_sym
|
134
|
+
when :DateTime
|
135
|
+
DateTime.parse(value)
|
136
|
+
when :Date
|
137
|
+
Date.parse(value)
|
138
|
+
when :String
|
139
|
+
value.to_s
|
140
|
+
when :Integer
|
141
|
+
value.to_i
|
142
|
+
when :Float
|
143
|
+
value.to_f
|
144
|
+
when :Boolean
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
|
+
true
|
147
|
+
else
|
148
|
+
false
|
149
|
+
end
|
150
|
+
when :Object
|
151
|
+
# generic object (usually a Hash), return directly
|
152
|
+
value
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
159
|
+
{}.tap do |hash|
|
160
|
+
value.each do |k, v|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
else # model
|
165
|
+
TalonOne.const_get(type).build_from_hash(value)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the string representation of the object
|
170
|
+
# @return [String] String presentation of the object
|
171
|
+
def to_s
|
172
|
+
to_hash.to_s
|
173
|
+
end
|
174
|
+
|
175
|
+
# to_body is an alias to to_hash (backward compatibility)
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
177
|
+
def to_body
|
178
|
+
to_hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the object in the form of hash
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_hash
|
184
|
+
hash = {}
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
186
|
+
value = self.send(attr)
|
187
|
+
if value.nil?
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
|
+
end
|
191
|
+
|
192
|
+
hash[param] = _to_hash(value)
|
193
|
+
end
|
194
|
+
hash
|
195
|
+
end
|
196
|
+
|
197
|
+
# Outputs non-array value in the form of hash
|
198
|
+
# For object, use to_hash. Otherwise, just return the value
|
199
|
+
# @param [Object] value Any valid value
|
200
|
+
# @return [Hash] Returns the value in the form of hash
|
201
|
+
def _to_hash(value)
|
202
|
+
if value.is_a?(Array)
|
203
|
+
value.compact.map { |v| _to_hash(v) }
|
204
|
+
elsif value.is_a?(Hash)
|
205
|
+
{}.tap do |hash|
|
206
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
207
|
+
end
|
208
|
+
elsif value.respond_to? :to_hash
|
209
|
+
value.to_hash
|
210
|
+
else
|
211
|
+
value
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
@@ -0,0 +1,243 @@
|
|
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
|
+
# customEffectPerItem effect in strikethrough pricing payload.
|
17
|
+
class StrikethroughCustomEffectPerItemProps
|
18
|
+
# ID of the effect.
|
19
|
+
attr_accessor :effect_id
|
20
|
+
|
21
|
+
# The type of the custom effect.
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# The JSON payload of the custom effect.
|
25
|
+
attr_accessor :payload
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'effect_id' => :'effectId',
|
31
|
+
:'name' => :'name',
|
32
|
+
:'payload' => :'payload'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'effect_id' => :'Integer',
|
40
|
+
:'name' => :'String',
|
41
|
+
:'payload' => :'Object'
|
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::StrikethroughCustomEffectPerItemProps` 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::StrikethroughCustomEffectPerItemProps`. 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?(:'effect_id')
|
67
|
+
self.effect_id = attributes[:'effect_id']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'name')
|
71
|
+
self.name = attributes[:'name']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'payload')
|
75
|
+
self.payload = attributes[:'payload']
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properties with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
if @effect_id.nil?
|
84
|
+
invalid_properties.push('invalid value for "effect_id", effect_id cannot be nil.')
|
85
|
+
end
|
86
|
+
|
87
|
+
if @name.nil?
|
88
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
89
|
+
end
|
90
|
+
|
91
|
+
if @payload.nil?
|
92
|
+
invalid_properties.push('invalid value for "payload", payload cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
return false if @effect_id.nil?
|
102
|
+
return false if @name.nil?
|
103
|
+
return false if @payload.nil?
|
104
|
+
true
|
105
|
+
end
|
106
|
+
|
107
|
+
# Checks equality by comparing each attribute.
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def ==(o)
|
110
|
+
return true if self.equal?(o)
|
111
|
+
self.class == o.class &&
|
112
|
+
effect_id == o.effect_id &&
|
113
|
+
name == o.name &&
|
114
|
+
payload == o.payload
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Integer] Hash code
|
125
|
+
def hash
|
126
|
+
[effect_id, name, payload].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def self.build_from_hash(attributes)
|
133
|
+
new.build_from_hash(attributes)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :Boolean
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
TalonOne.const_get(type).build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
@@ -15,7 +15,7 @@ require 'date'
|
|
15
15
|
module TalonOne
|
16
16
|
#
|
17
17
|
class UpdateCustomEffect
|
18
|
-
# The IDs of the
|
18
|
+
# The IDs of the Applications that are related to this entity.
|
19
19
|
attr_accessor :application_ids
|
20
20
|
|
21
21
|
# Indicates if this effect is per item or not.
|