talon_one 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,175 +0,0 @@
1
- =begin
2
- #Talon.One API
3
-
4
- #The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
5
-
6
- OpenAPI spec version: 1.0.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.7
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module TalonOne
16
- # Array of ApplicationStorageData.
17
- class ApplicationStorageData
18
- # Attribute mapping from ruby-style variable name to JSON key.
19
- def self.attribute_map
20
- {
21
- }
22
- end
23
-
24
- # Attribute type mapping.
25
- def self.swagger_types
26
- {
27
- }
28
- end
29
-
30
- # Initializes the object
31
- # @param [Hash] attributes Model attributes in the form of hash
32
- def initialize(attributes = {})
33
- return unless attributes.is_a?(Hash)
34
-
35
- # convert string to symbol for hash key
36
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
37
- end
38
-
39
- # Show invalid properties with the reasons. Usually used together with valid?
40
- # @return Array for valid properties with the reasons
41
- def list_invalid_properties
42
- invalid_properties = Array.new
43
- invalid_properties
44
- end
45
-
46
- # Check to see if the all the properties in the model are valid
47
- # @return true if the model is valid
48
- def valid?
49
- true
50
- end
51
-
52
- # Checks equality by comparing each attribute.
53
- # @param [Object] Object to be compared
54
- def ==(o)
55
- return true if self.equal?(o)
56
- self.class == o.class
57
- end
58
-
59
- # @see the `==` method
60
- # @param [Object] Object to be compared
61
- def eql?(o)
62
- self == o
63
- end
64
-
65
- # Calculates hash code according to all attributes.
66
- # @return [Fixnum] Hash code
67
- def hash
68
- [].hash
69
- end
70
-
71
- # Builds the object from hash
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- # @return [Object] Returns the model itself
74
- def build_from_hash(attributes)
75
- return nil unless attributes.is_a?(Hash)
76
- self.class.swagger_types.each_pair do |key, type|
77
- if type =~ /\AArray<(.*)>/i
78
- # check to ensure the input is an array given that the the attribute
79
- # is documented as an array but the input is not
80
- if attributes[self.class.attribute_map[key]].is_a?(Array)
81
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
82
- end
83
- elsif !attributes[self.class.attribute_map[key]].nil?
84
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
85
- end # or else data not found in attributes(hash), not an issue as the data can be optional
86
- end
87
-
88
- self
89
- end
90
-
91
- # Deserializes the data based on type
92
- # @param string type Data type
93
- # @param string value Value to be deserialized
94
- # @return [Object] Deserialized data
95
- def _deserialize(type, value)
96
- case type.to_sym
97
- when :DateTime
98
- DateTime.parse(value)
99
- when :Date
100
- Date.parse(value)
101
- when :String
102
- value.to_s
103
- when :Integer
104
- value.to_i
105
- when :Float
106
- value.to_f
107
- when :BOOLEAN
108
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
109
- true
110
- else
111
- false
112
- end
113
- when :Object
114
- # generic object (usually a Hash), return directly
115
- value
116
- when /\AArray<(?<inner_type>.+)>\z/
117
- inner_type = Regexp.last_match[:inner_type]
118
- value.map { |v| _deserialize(inner_type, v) }
119
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
120
- k_type = Regexp.last_match[:k_type]
121
- v_type = Regexp.last_match[:v_type]
122
- {}.tap do |hash|
123
- value.each do |k, v|
124
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
125
- end
126
- end
127
- else # model
128
- temp_model = TalonOne.const_get(type).new
129
- temp_model.build_from_hash(value)
130
- end
131
- end
132
-
133
- # Returns the string representation of the object
134
- # @return [String] String presentation of the object
135
- def to_s
136
- to_hash.to_s
137
- end
138
-
139
- # to_body is an alias to to_hash (backward compatibility)
140
- # @return [Hash] Returns the object in the form of hash
141
- def to_body
142
- to_hash
143
- end
144
-
145
- # Returns the object in the form of hash
146
- # @return [Hash] Returns the object in the form of hash
147
- def to_hash
148
- hash = {}
149
- self.class.attribute_map.each_pair do |attr, param|
150
- value = self.send(attr)
151
- next if value.nil?
152
- hash[param] = _to_hash(value)
153
- end
154
- hash
155
- end
156
-
157
- # Outputs non-array value in the form of hash
158
- # For object, use to_hash. Otherwise, just return the value
159
- # @param [Object] value Any valid value
160
- # @return [Hash] Returns the value in the form of hash
161
- def _to_hash(value)
162
- if value.is_a?(Array)
163
- value.compact.map { |v| _to_hash(v) }
164
- elsif value.is_a?(Hash)
165
- {}.tap do |hash|
166
- value.each { |k, v| hash[k] = _to_hash(v) }
167
- end
168
- elsif value.respond_to? :to_hash
169
- value.to_hash
170
- else
171
- value
172
- end
173
- end
174
- end
175
- end
@@ -1,283 +0,0 @@
1
- =begin
2
- #Talon.One API
3
-
4
- #The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
5
-
6
- OpenAPI spec version: 1.0.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.7
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module TalonOne
16
- #
17
- class ApplicationStorageTuple
18
- # Unique ID for this entity.
19
- attr_accessor :id
20
-
21
- # The exact moment this entity was created.
22
- attr_accessor :created
23
-
24
- # The exact moment this entity was last modified.
25
- attr_accessor :modified
26
-
27
- # Key information that will map to a value, e.g. SKU number \"LEV-JN-SL-36-GN\".
28
- attr_accessor :key
29
-
30
- attr_accessor :value
31
-
32
- # ID of the storage in which the data resides
33
- attr_accessor :storage_id
34
-
35
- # Attribute mapping from ruby-style variable name to JSON key.
36
- def self.attribute_map
37
- {
38
- :'id' => :'id',
39
- :'created' => :'created',
40
- :'modified' => :'modified',
41
- :'key' => :'key',
42
- :'value' => :'value',
43
- :'storage_id' => :'storageId'
44
- }
45
- end
46
-
47
- # Attribute type mapping.
48
- def self.swagger_types
49
- {
50
- :'id' => :'Integer',
51
- :'created' => :'DateTime',
52
- :'modified' => :'DateTime',
53
- :'key' => :'String',
54
- :'value' => :'Object',
55
- :'storage_id' => :'Integer'
56
- }
57
- end
58
-
59
- # Initializes the object
60
- # @param [Hash] attributes Model attributes in the form of hash
61
- def initialize(attributes = {})
62
- return unless attributes.is_a?(Hash)
63
-
64
- # convert string to symbol for hash key
65
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
-
67
- if attributes.has_key?(:'id')
68
- self.id = attributes[:'id']
69
- end
70
-
71
- if attributes.has_key?(:'created')
72
- self.created = attributes[:'created']
73
- end
74
-
75
- if attributes.has_key?(:'modified')
76
- self.modified = attributes[:'modified']
77
- end
78
-
79
- if attributes.has_key?(:'key')
80
- self.key = attributes[:'key']
81
- end
82
-
83
- if attributes.has_key?(:'value')
84
- self.value = attributes[:'value']
85
- end
86
-
87
- if attributes.has_key?(:'storageId')
88
- self.storage_id = attributes[:'storageId']
89
- end
90
- end
91
-
92
- # Show invalid properties with the reasons. Usually used together with valid?
93
- # @return Array for valid properties with the reasons
94
- def list_invalid_properties
95
- invalid_properties = Array.new
96
- if @id.nil?
97
- invalid_properties.push('invalid value for "id", id cannot be nil.')
98
- end
99
-
100
- if @created.nil?
101
- invalid_properties.push('invalid value for "created", created cannot be nil.')
102
- end
103
-
104
- if @modified.nil?
105
- invalid_properties.push('invalid value for "modified", modified cannot be nil.')
106
- end
107
-
108
- if @key.nil?
109
- invalid_properties.push('invalid value for "key", key cannot be nil.')
110
- end
111
-
112
- if @key.to_s.length < 1
113
- invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
114
- end
115
-
116
- if @value.nil?
117
- invalid_properties.push('invalid value for "value", value cannot be nil.')
118
- end
119
-
120
- if @storage_id.nil?
121
- invalid_properties.push('invalid value for "storage_id", storage_id cannot be nil.')
122
- end
123
-
124
- invalid_properties
125
- end
126
-
127
- # Check to see if the all the properties in the model are valid
128
- # @return true if the model is valid
129
- def valid?
130
- return false if @id.nil?
131
- return false if @created.nil?
132
- return false if @modified.nil?
133
- return false if @key.nil?
134
- return false if @key.to_s.length < 1
135
- return false if @value.nil?
136
- return false if @storage_id.nil?
137
- true
138
- end
139
-
140
- # Custom attribute writer method with validation
141
- # @param [Object] key Value to be assigned
142
- def key=(key)
143
- if key.nil?
144
- fail ArgumentError, 'key cannot be nil'
145
- end
146
-
147
- if key.to_s.length < 1
148
- fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
149
- end
150
-
151
- @key = key
152
- end
153
-
154
- # Checks equality by comparing each attribute.
155
- # @param [Object] Object to be compared
156
- def ==(o)
157
- return true if self.equal?(o)
158
- self.class == o.class &&
159
- id == o.id &&
160
- created == o.created &&
161
- modified == o.modified &&
162
- key == o.key &&
163
- value == o.value &&
164
- storage_id == o.storage_id
165
- end
166
-
167
- # @see the `==` method
168
- # @param [Object] Object to be compared
169
- def eql?(o)
170
- self == o
171
- end
172
-
173
- # Calculates hash code according to all attributes.
174
- # @return [Fixnum] Hash code
175
- def hash
176
- [id, created, modified, key, value, storage_id].hash
177
- end
178
-
179
- # Builds the object from hash
180
- # @param [Hash] attributes Model attributes in the form of hash
181
- # @return [Object] Returns the model itself
182
- def build_from_hash(attributes)
183
- return nil unless attributes.is_a?(Hash)
184
- self.class.swagger_types.each_pair do |key, type|
185
- if type =~ /\AArray<(.*)>/i
186
- # check to ensure the input is an array given that the the attribute
187
- # is documented as an array but the input is not
188
- if attributes[self.class.attribute_map[key]].is_a?(Array)
189
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
190
- end
191
- elsif !attributes[self.class.attribute_map[key]].nil?
192
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
193
- end # or else data not found in attributes(hash), not an issue as the data can be optional
194
- end
195
-
196
- self
197
- end
198
-
199
- # Deserializes the data based on type
200
- # @param string type Data type
201
- # @param string value Value to be deserialized
202
- # @return [Object] Deserialized data
203
- def _deserialize(type, value)
204
- case type.to_sym
205
- when :DateTime
206
- DateTime.parse(value)
207
- when :Date
208
- Date.parse(value)
209
- when :String
210
- value.to_s
211
- when :Integer
212
- value.to_i
213
- when :Float
214
- value.to_f
215
- when :BOOLEAN
216
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
- true
218
- else
219
- false
220
- end
221
- when :Object
222
- # generic object (usually a Hash), return directly
223
- value
224
- when /\AArray<(?<inner_type>.+)>\z/
225
- inner_type = Regexp.last_match[:inner_type]
226
- value.map { |v| _deserialize(inner_type, v) }
227
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
- k_type = Regexp.last_match[:k_type]
229
- v_type = Regexp.last_match[:v_type]
230
- {}.tap do |hash|
231
- value.each do |k, v|
232
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
- end
234
- end
235
- else # model
236
- temp_model = TalonOne.const_get(type).new
237
- temp_model.build_from_hash(value)
238
- end
239
- end
240
-
241
- # Returns the string representation of the object
242
- # @return [String] String presentation of the object
243
- def to_s
244
- to_hash.to_s
245
- end
246
-
247
- # to_body is an alias to to_hash (backward compatibility)
248
- # @return [Hash] Returns the object in the form of hash
249
- def to_body
250
- to_hash
251
- end
252
-
253
- # Returns the object in the form of hash
254
- # @return [Hash] Returns the object in the form of hash
255
- def to_hash
256
- hash = {}
257
- self.class.attribute_map.each_pair do |attr, param|
258
- value = self.send(attr)
259
- next if value.nil?
260
- hash[param] = _to_hash(value)
261
- end
262
- hash
263
- end
264
-
265
- # Outputs non-array value in the form of hash
266
- # For object, use to_hash. Otherwise, just return the value
267
- # @param [Object] value Any valid value
268
- # @return [Hash] Returns the value in the form of hash
269
- def _to_hash(value)
270
- if value.is_a?(Array)
271
- value.compact.map { |v| _to_hash(v) }
272
- elsif value.is_a?(Hash)
273
- {}.tap do |hash|
274
- value.each { |k, v| hash[k] = _to_hash(v) }
275
- end
276
- elsif value.respond_to? :to_hash
277
- value.to_hash
278
- else
279
- value
280
- end
281
- end
282
- end
283
- end