talon_one 3.0.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +9 -6
  3. data/README.md +4 -6
  4. data/docs/AddLoyaltyPoints.md +2 -2
  5. data/docs/CustomEffect.md +1 -1
  6. data/docs/InlineResponse2001.md +1 -1
  7. data/docs/InlineResponse20010.md +3 -3
  8. data/docs/InlineResponse20011.md +3 -3
  9. data/docs/InlineResponse20012.md +1 -1
  10. data/docs/InlineResponse20013.md +2 -2
  11. data/docs/InlineResponse20014.md +3 -5
  12. data/docs/InlineResponse20015.md +4 -2
  13. data/docs/InlineResponse20016.md +2 -4
  14. data/docs/InlineResponse20017.md +4 -2
  15. data/docs/InlineResponse20018.md +2 -2
  16. data/docs/InlineResponse20019.md +1 -1
  17. data/docs/InlineResponse2002.md +3 -3
  18. data/docs/InlineResponse20020.md +2 -4
  19. data/docs/InlineResponse20021.md +3 -3
  20. data/docs/InlineResponse20022.md +1 -1
  21. data/docs/InlineResponse20023.md +3 -1
  22. data/docs/InlineResponse20024.md +1 -1
  23. data/docs/InlineResponse20025.md +2 -2
  24. data/docs/InlineResponse20026.md +2 -2
  25. data/docs/InlineResponse20027.md +3 -3
  26. data/docs/InlineResponse20028.md +3 -5
  27. data/docs/InlineResponse20029.md +1 -1
  28. data/docs/InlineResponse2003.md +1 -1
  29. data/docs/InlineResponse20030.md +5 -3
  30. data/docs/InlineResponse20031.md +1 -1
  31. data/docs/InlineResponse20032.md +1 -1
  32. data/docs/InlineResponse20033.md +1 -1
  33. data/docs/InlineResponse20034.md +1 -1
  34. data/docs/InlineResponse20035.md +1 -1
  35. data/docs/InlineResponse20036.md +1 -1
  36. data/docs/InlineResponse20037.md +2 -4
  37. data/docs/InlineResponse20038.md +4 -2
  38. data/docs/InlineResponse20039.md +1 -1
  39. data/docs/InlineResponse2004.md +1 -1
  40. data/docs/InlineResponse20040.md +19 -0
  41. data/docs/InlineResponse2005.md +1 -1
  42. data/docs/InlineResponse2006.md +1 -1
  43. data/docs/InlineResponse2007.md +2 -2
  44. data/docs/InlineResponse2008.md +1 -1
  45. data/docs/InlineResponse2009.md +1 -1
  46. data/docs/IntegrationApi.md +26 -26
  47. data/docs/ManagementApi.md +141 -141
  48. data/docs/MultiApplicationEntity.md +1 -1
  49. data/docs/NewCustomEffect.md +1 -1
  50. data/docs/NewOutgoingIntegrationWebhook.md +19 -0
  51. data/docs/NewWebhook.md +3 -3
  52. data/docs/OutgoingIntegrationConfiguration.md +3 -1
  53. data/docs/OutgoingIntegrationWebhookTemplate.md +3 -1
  54. data/docs/ReopenSessionResponse.md +17 -0
  55. data/docs/StrikethroughCustomEffectPerItemProps.md +21 -0
  56. data/docs/UpdateCustomEffect.md +1 -1
  57. data/docs/Webhook.md +3 -3
  58. data/lib/talon_one/api/integration_api.rb +48 -48
  59. data/lib/talon_one/api/management_api.rb +234 -234
  60. data/lib/talon_one/api_client.rb +2 -1
  61. data/lib/talon_one/api_error.rb +8 -1
  62. data/lib/talon_one/models/add_loyalty_points.rb +2 -2
  63. data/lib/talon_one/models/custom_effect.rb +1 -1
  64. data/lib/talon_one/models/inline_response2001.rb +1 -1
  65. data/lib/talon_one/models/inline_response20010.rb +11 -11
  66. data/lib/talon_one/models/inline_response20011.rb +11 -11
  67. data/lib/talon_one/models/inline_response20012.rb +1 -1
  68. data/lib/talon_one/models/inline_response20013.rb +1 -3
  69. data/lib/talon_one/models/inline_response20014.rb +9 -11
  70. data/lib/talon_one/models/inline_response20015.rb +11 -7
  71. data/lib/talon_one/models/inline_response20016.rb +7 -11
  72. data/lib/talon_one/models/inline_response20017.rb +11 -7
  73. data/lib/talon_one/models/inline_response20018.rb +10 -10
  74. data/lib/talon_one/models/inline_response20019.rb +1 -1
  75. data/lib/talon_one/models/inline_response2002.rb +11 -11
  76. data/lib/talon_one/models/inline_response20020.rb +7 -11
  77. data/lib/talon_one/models/inline_response20021.rb +10 -10
  78. data/lib/talon_one/models/inline_response20022.rb +1 -1
  79. data/lib/talon_one/models/inline_response20023.rb +10 -6
  80. data/lib/talon_one/models/inline_response20024.rb +1 -1
  81. data/lib/talon_one/models/inline_response20025.rb +6 -1
  82. data/lib/talon_one/models/inline_response20026.rb +1 -6
  83. data/lib/talon_one/models/inline_response20027.rb +11 -11
  84. data/lib/talon_one/models/inline_response20028.rb +7 -11
  85. data/lib/talon_one/models/inline_response20029.rb +1 -1
  86. data/lib/talon_one/models/inline_response2003.rb +1 -1
  87. data/lib/talon_one/models/inline_response20030.rb +11 -7
  88. data/lib/talon_one/models/inline_response20031.rb +1 -1
  89. data/lib/talon_one/models/inline_response20032.rb +1 -1
  90. data/lib/talon_one/models/inline_response20033.rb +1 -1
  91. data/lib/talon_one/models/inline_response20034.rb +1 -1
  92. data/lib/talon_one/models/inline_response20035.rb +1 -1
  93. data/lib/talon_one/models/inline_response20036.rb +1 -1
  94. data/lib/talon_one/models/inline_response20037.rb +7 -11
  95. data/lib/talon_one/models/inline_response20038.rb +11 -7
  96. data/lib/talon_one/models/inline_response20039.rb +1 -1
  97. data/lib/talon_one/models/inline_response2004.rb +1 -1
  98. data/lib/talon_one/models/inline_response20040.rb +227 -0
  99. data/lib/talon_one/models/inline_response2005.rb +1 -1
  100. data/lib/talon_one/models/inline_response2006.rb +1 -1
  101. data/lib/talon_one/models/inline_response2007.rb +10 -10
  102. data/lib/talon_one/models/inline_response2008.rb +1 -1
  103. data/lib/talon_one/models/inline_response2009.rb +1 -1
  104. data/lib/talon_one/models/multi_application_entity.rb +1 -1
  105. data/lib/talon_one/models/new_custom_effect.rb +1 -1
  106. data/lib/talon_one/models/new_outgoing_integration_webhook.rb +229 -0
  107. data/lib/talon_one/models/new_webhook.rb +3 -3
  108. data/lib/talon_one/models/outgoing_integration_configuration.rb +16 -1
  109. data/lib/talon_one/models/outgoing_integration_webhook_template.rb +53 -4
  110. data/lib/talon_one/models/reopen_session_response.rb +215 -0
  111. data/lib/talon_one/models/strikethrough_custom_effect_per_item_props.rb +243 -0
  112. data/lib/talon_one/models/update_custom_effect.rb +1 -1
  113. data/lib/talon_one/models/webhook.rb +3 -3
  114. data/lib/talon_one/version.rb +1 -1
  115. data/lib/talon_one.rb +4 -0
  116. data/spec/api/integration_api_spec.rb +9 -9
  117. data/spec/api/management_api_spec.rb +59 -59
  118. data/spec/models/inline_response20010_spec.rb +1 -1
  119. data/spec/models/inline_response20011_spec.rb +1 -1
  120. data/spec/models/inline_response20014_spec.rb +0 -6
  121. data/spec/models/inline_response20015_spec.rb +6 -0
  122. data/spec/models/inline_response20016_spec.rb +0 -6
  123. data/spec/models/inline_response20017_spec.rb +6 -0
  124. data/spec/models/inline_response20018_spec.rb +1 -1
  125. data/spec/models/inline_response20020_spec.rb +0 -6
  126. data/spec/models/inline_response20021_spec.rb +2 -2
  127. data/spec/models/inline_response20023_spec.rb +6 -0
  128. data/spec/models/inline_response20027_spec.rb +1 -1
  129. data/spec/models/inline_response20028_spec.rb +0 -6
  130. data/spec/models/inline_response2002_spec.rb +1 -1
  131. data/spec/models/inline_response20030_spec.rb +6 -0
  132. data/spec/models/inline_response20037_spec.rb +0 -6
  133. data/spec/models/inline_response20038_spec.rb +6 -0
  134. data/spec/models/inline_response20040_spec.rb +47 -0
  135. data/spec/models/inline_response2007_spec.rb +1 -1
  136. data/spec/models/new_outgoing_integration_webhook_spec.rb +47 -0
  137. data/spec/models/outgoing_integration_configuration_spec.rb +6 -0
  138. data/spec/models/outgoing_integration_webhook_template_spec.rb +10 -0
  139. data/spec/models/reopen_session_response_spec.rb +41 -0
  140. data/spec/models/strikethrough_custom_effect_per_item_props_spec.rb +53 -0
  141. data/talon_one.gemspec +1 -1
  142. metadata +18 -2
@@ -0,0 +1,229 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
5
+
6
+ The version of the OpenAPI document:
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ class NewOutgoingIntegrationWebhook
17
+ # Webhook title.
18
+ attr_accessor :title
19
+
20
+ # IDs of the Applications to which a webhook must be linked.
21
+ attr_accessor :application_ids
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'title' => :'title',
27
+ :'application_ids' => :'applicationIds'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'title' => :'String',
35
+ :'application_ids' => :'Array<Integer>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::NewOutgoingIntegrationWebhook` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::NewOutgoingIntegrationWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'title')
61
+ self.title = attributes[:'title']
62
+ end
63
+
64
+ if attributes.key?(:'application_ids')
65
+ if (value = attributes[:'application_ids']).is_a?(Array)
66
+ self.application_ids = value
67
+ end
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ if @title.nil?
76
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
77
+ end
78
+
79
+ if @application_ids.nil?
80
+ invalid_properties.push('invalid value for "application_ids", application_ids cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @title.nil?
90
+ return false if @application_ids.nil?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ title == o.title &&
100
+ application_ids == o.application_ids
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [title, application_ids].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.openapi_types.each_pair do |key, type|
128
+ if type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ DateTime.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ TalonOne.const_get(type).build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+ end
229
+ end
@@ -15,7 +15,7 @@ require 'date'
15
15
  module TalonOne
16
16
  #
17
17
  class NewWebhook
18
- # The IDs of the applications that are related to this entity.
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 url (supports templating using parameters) for this webhook.
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 rule builder.
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