talon_one 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +21 -12
- data/docs/AccountAnalytics.md +1 -0
- data/docs/AccountLimits.md +1 -0
- data/docs/Application.md +2 -1
- data/docs/ApplicationCustomer.md +1 -1
- data/docs/ApplicationSession.md +2 -1
- data/docs/Attribute.md +0 -2
- data/docs/AttributesMandatory.md +9 -0
- data/docs/AttributesSettings.md +8 -0
- data/docs/BaseSamlConnection.md +15 -0
- data/docs/Campaign.md +2 -0
- data/docs/CampaignAnalytics.md +9 -3
- data/docs/CampaignCopy.md +4 -0
- data/docs/Change.md +2 -2
- data/docs/CustomerInventory.md +9 -0
- data/docs/CustomerProfile.md +1 -1
- data/docs/ErrorSource.md +1 -0
- data/docs/Event.md +1 -1
- data/docs/InlineResponse20020.md +1 -1
- data/docs/InlineResponse20021.md +1 -1
- data/docs/InlineResponse20022.md +1 -1
- data/docs/InlineResponse20023.md +1 -1
- data/docs/InlineResponse20024.md +1 -1
- data/docs/InlineResponse20025.md +1 -1
- data/docs/InlineResponse20026.md +3 -2
- data/docs/InlineResponse20027.md +1 -1
- data/docs/InlineResponse20028.md +1 -1
- data/docs/InlineResponse20029.md +9 -0
- data/docs/IntegrationApi.md +66 -0
- data/docs/IntegrationEvent.md +10 -0
- data/docs/IntegrationState.md +1 -0
- data/docs/ManagementApi.md +175 -104
- data/docs/Meta.md +1 -0
- data/docs/NewApplication.md +2 -1
- data/docs/NewEvent.md +1 -1
- data/docs/NewSamlConnection.md +16 -0
- data/docs/Notification.md +10 -0
- data/docs/{ApplicationStorageData.md → Notifications.md} +1 -1
- data/docs/ReferralRejectionReason.md +10 -0
- data/docs/SamlConnection.md +18 -0
- data/docs/SamlConnectionMetadata.md +11 -0
- data/docs/UpdateApplication.md +15 -0
- data/docs/UpdateUser.md +1 -0
- data/docs/User.md +2 -0
- data/docs/Webhook.md +0 -1
- data/lib/talon_one.rb +13 -6
- data/lib/talon_one/api/integration_api.rb +60 -0
- data/lib/talon_one/api/management_api.rb +194 -121
- data/lib/talon_one/models/account_analytics.rb +19 -4
- data/lib/talon_one/models/account_limits.rb +11 -1
- data/lib/talon_one/models/application.rb +62 -53
- data/lib/talon_one/models/application_customer.rb +0 -5
- data/lib/talon_one/models/application_session.rb +12 -2
- data/lib/talon_one/models/attribute.rb +4 -38
- data/lib/talon_one/models/attributes_mandatory.rb +199 -0
- data/lib/talon_one/models/{new_application_storage_data.rb → attributes_settings.rb} +13 -4
- data/lib/talon_one/models/{application_storage.rb → base_saml_connection.rb} +122 -78
- data/lib/talon_one/models/campaign.rb +21 -1
- data/lib/talon_one/models/campaign_analytics.rb +94 -4
- data/lib/talon_one/models/campaign_copy.rb +46 -4
- data/lib/talon_one/models/change.rb +2 -2
- data/lib/talon_one/models/coupon_rejection_reason.rb +2 -2
- data/lib/talon_one/models/customer_inventory.rb +194 -0
- data/lib/talon_one/models/customer_profile.rb +0 -5
- data/lib/talon_one/models/error_source.rb +14 -4
- data/lib/talon_one/models/event.rb +11 -35
- data/lib/talon_one/models/inline_response_200_20.rb +1 -1
- data/lib/talon_one/models/inline_response_200_21.rb +1 -1
- data/lib/talon_one/models/inline_response_200_22.rb +1 -1
- data/lib/talon_one/models/inline_response_200_23.rb +1 -1
- data/lib/talon_one/models/inline_response_200_24.rb +1 -1
- data/lib/talon_one/models/inline_response_200_25.rb +1 -1
- data/lib/talon_one/models/inline_response_200_26.rb +11 -7
- data/lib/talon_one/models/inline_response_200_27.rb +1 -1
- data/lib/talon_one/models/inline_response_200_28.rb +1 -1
- data/lib/talon_one/models/{new_application_storage_tuple.rb → inline_response_200_29.rb} +22 -40
- data/lib/talon_one/models/integration_event.rb +234 -0
- data/lib/talon_one/models/integration_state.rb +13 -4
- data/lib/talon_one/models/limit_config.rb +2 -2
- data/lib/talon_one/models/meta.rb +10 -1
- data/lib/talon_one/models/new_application.rb +57 -56
- data/lib/talon_one/models/new_event.rb +38 -38
- data/lib/talon_one/models/new_saml_connection.rb +371 -0
- data/lib/talon_one/models/{new_application_storage.rb → notification.rb} +22 -17
- data/lib/talon_one/models/{application_storage_data.rb → notifications.rb} +1 -2
- data/lib/talon_one/models/referral_rejection_reason.rb +251 -0
- data/lib/talon_one/models/saml_connection.rb +387 -0
- data/lib/talon_one/models/{application_storage_tuple.rb → saml_connection_metadata.rb} +68 -80
- data/lib/talon_one/models/update_application.rb +361 -0
- data/lib/talon_one/models/update_user.rb +13 -4
- data/lib/talon_one/models/user.rb +23 -4
- data/lib/talon_one/models/webhook.rb +4 -21
- data/lib/talon_one/version.rb +1 -1
- data/spec/api/integration_api_spec.rb +14 -0
- data/spec/api/management_api_spec.rb +56 -37
- data/spec/models/account_analytics_spec.rb +6 -0
- data/spec/models/account_limits_spec.rb +6 -0
- data/spec/models/application_session_spec.rb +6 -0
- data/spec/models/application_spec.rb +12 -6
- data/spec/models/attribute_spec.rb +0 -12
- data/spec/models/{new_application_storage_tuple_spec.rb → attributes_mandatory_spec.rb} +8 -8
- data/spec/models/{new_application_storage_data_spec.rb → attributes_settings_spec.rb} +12 -6
- data/spec/models/{application_storage_spec.rb → base_saml_connection_spec.rb} +14 -14
- data/spec/models/campaign_analytics_spec.rb +36 -0
- data/spec/models/campaign_copy_spec.rb +24 -0
- data/spec/models/campaign_spec.rb +12 -0
- data/spec/models/coupon_rejection_reason_spec.rb +1 -1
- data/spec/models/customer_inventory_spec.rb +47 -0
- data/spec/models/error_source_spec.rb +6 -0
- data/spec/models/event_spec.rb +3 -3
- data/spec/models/inline_response_200_26_spec.rb +6 -0
- data/spec/models/inline_response_200_29_spec.rb +47 -0
- data/spec/models/integration_event_spec.rb +53 -0
- data/spec/models/integration_state_spec.rb +6 -0
- data/spec/models/limit_config_spec.rb +1 -1
- data/spec/models/meta_spec.rb +6 -0
- data/spec/models/new_application_spec.rb +12 -6
- data/spec/models/new_event_spec.rb +3 -3
- data/spec/models/new_saml_connection_spec.rb +89 -0
- data/spec/models/{new_application_storage_spec.rb → notification_spec.rb} +8 -8
- data/spec/models/{application_storage_data_spec.rb → notifications_spec.rb} +6 -6
- data/spec/models/referral_rejection_reason_spec.rb +57 -0
- data/spec/models/{application_storage_tuple_spec.rb → saml_connection_metadata_spec.rb} +10 -22
- data/spec/models/saml_connection_spec.rb +101 -0
- data/spec/models/update_application_spec.rb +87 -0
- data/spec/models/update_user_spec.rb +6 -0
- data/spec/models/user_spec.rb +12 -0
- data/spec/models/webhook_spec.rb +0 -6
- data/talon_one-1.0.0.gem +0 -0
- data/talon_one-1.1.0.gem +0 -0
- data/talon_one-1.1.1.gem +0 -0
- data/talon_one-1.1.2.gem +0 -0
- data/talon_one-1.2.0.gem +0 -0
- data/talon_one-1.3.0.gem +0 -0
- data/talon_one.gemspec +1 -1
- metadata +74 -42
- data/docs/ApplicationStorage.md +0 -15
- data/docs/ApplicationStorageTuple.md +0 -13
- data/docs/NewApplicationStorage.md +0 -10
- data/docs/NewApplicationStorageData.md +0 -7
- data/docs/NewApplicationStorageTuple.md +0 -9
- data/fck.rb +0 -64
@@ -138,10 +138,6 @@ module TalonOne
|
|
138
138
|
invalid_properties.push('invalid value for "total_sales", total_sales cannot be nil.')
|
139
139
|
end
|
140
140
|
|
141
|
-
if @loyalty_memberships.nil?
|
142
|
-
invalid_properties.push('invalid value for "loyalty_memberships", loyalty_memberships cannot be nil.')
|
143
|
-
end
|
144
|
-
|
145
141
|
if @last_activity.nil?
|
146
142
|
invalid_properties.push('invalid value for "last_activity", last_activity cannot be nil.')
|
147
143
|
end
|
@@ -158,7 +154,6 @@ module TalonOne
|
|
158
154
|
return false if @account_id.nil?
|
159
155
|
return false if @closed_sessions.nil?
|
160
156
|
return false if @total_sales.nil?
|
161
|
-
return false if @loyalty_memberships.nil?
|
162
157
|
return false if @last_activity.nil?
|
163
158
|
true
|
164
159
|
end
|
@@ -24,12 +24,16 @@ module TalonOne
|
|
24
24
|
# Line number in uploaded multipart file that caused this error. 'N/A' if unknown.
|
25
25
|
attr_accessor :line
|
26
26
|
|
27
|
+
# Pointer to the resource that caused this error
|
28
|
+
attr_accessor :resource
|
29
|
+
|
27
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
28
31
|
def self.attribute_map
|
29
32
|
{
|
30
33
|
:'pointer' => :'pointer',
|
31
34
|
:'parameter' => :'parameter',
|
32
|
-
:'line' => :'line'
|
35
|
+
:'line' => :'line',
|
36
|
+
:'resource' => :'resource'
|
33
37
|
}
|
34
38
|
end
|
35
39
|
|
@@ -38,7 +42,8 @@ module TalonOne
|
|
38
42
|
{
|
39
43
|
:'pointer' => :'String',
|
40
44
|
:'parameter' => :'String',
|
41
|
-
:'line' => :'String'
|
45
|
+
:'line' => :'String',
|
46
|
+
:'resource' => :'String'
|
42
47
|
}
|
43
48
|
end
|
44
49
|
|
@@ -61,6 +66,10 @@ module TalonOne
|
|
61
66
|
if attributes.has_key?(:'line')
|
62
67
|
self.line = attributes[:'line']
|
63
68
|
end
|
69
|
+
|
70
|
+
if attributes.has_key?(:'resource')
|
71
|
+
self.resource = attributes[:'resource']
|
72
|
+
end
|
64
73
|
end
|
65
74
|
|
66
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -83,7 +92,8 @@ module TalonOne
|
|
83
92
|
self.class == o.class &&
|
84
93
|
pointer == o.pointer &&
|
85
94
|
parameter == o.parameter &&
|
86
|
-
line == o.line
|
95
|
+
line == o.line &&
|
96
|
+
resource == o.resource
|
87
97
|
end
|
88
98
|
|
89
99
|
# @see the `==` method
|
@@ -95,7 +105,7 @@ module TalonOne
|
|
95
105
|
# Calculates hash code according to all attributes.
|
96
106
|
# @return [Fixnum] Hash code
|
97
107
|
def hash
|
98
|
-
[pointer, parameter, line].hash
|
108
|
+
[pointer, parameter, line, resource].hash
|
99
109
|
end
|
100
110
|
|
101
111
|
# Builds the object from hash
|
@@ -27,15 +27,15 @@ module TalonOne
|
|
27
27
|
# ID of the customers profile as used within this Talon.One account. May be omitted or set to the empty string if the customer does not yet have a known profile ID.
|
28
28
|
attr_accessor :profile_id
|
29
29
|
|
30
|
-
# The ID of the session that this event occurred in.
|
31
|
-
attr_accessor :session_id
|
32
|
-
|
33
30
|
# A string representing the event. Must not be a reserved event name.
|
34
31
|
attr_accessor :type
|
35
32
|
|
36
33
|
# Arbitrary additional JSON data associated with the event.
|
37
34
|
attr_accessor :attributes
|
38
35
|
|
36
|
+
# The ID of the session that this event occurred in.
|
37
|
+
attr_accessor :session_id
|
38
|
+
|
39
39
|
# An array of \"effects\" that must be applied in response to this event. Example effects include `addItemToCart` or `setDiscount`.
|
40
40
|
attr_accessor :effects
|
41
41
|
|
@@ -51,9 +51,9 @@ module TalonOne
|
|
51
51
|
:'created' => :'created',
|
52
52
|
:'application_id' => :'applicationId',
|
53
53
|
:'profile_id' => :'profileId',
|
54
|
-
:'session_id' => :'sessionId',
|
55
54
|
:'type' => :'type',
|
56
55
|
:'attributes' => :'attributes',
|
56
|
+
:'session_id' => :'sessionId',
|
57
57
|
:'effects' => :'effects',
|
58
58
|
:'ledger_entries' => :'ledgerEntries',
|
59
59
|
:'meta' => :'meta'
|
@@ -67,9 +67,9 @@ module TalonOne
|
|
67
67
|
:'created' => :'DateTime',
|
68
68
|
:'application_id' => :'Integer',
|
69
69
|
:'profile_id' => :'String',
|
70
|
-
:'session_id' => :'String',
|
71
70
|
:'type' => :'String',
|
72
71
|
:'attributes' => :'Object',
|
72
|
+
:'session_id' => :'String',
|
73
73
|
:'effects' => :'Array<Object>',
|
74
74
|
:'ledger_entries' => :'Array<LedgerEntry>',
|
75
75
|
:'meta' => :'Meta'
|
@@ -100,10 +100,6 @@ module TalonOne
|
|
100
100
|
self.profile_id = attributes[:'profileId']
|
101
101
|
end
|
102
102
|
|
103
|
-
if attributes.has_key?(:'sessionId')
|
104
|
-
self.session_id = attributes[:'sessionId']
|
105
|
-
end
|
106
|
-
|
107
103
|
if attributes.has_key?(:'type')
|
108
104
|
self.type = attributes[:'type']
|
109
105
|
end
|
@@ -112,6 +108,10 @@ module TalonOne
|
|
112
108
|
self.attributes = attributes[:'attributes']
|
113
109
|
end
|
114
110
|
|
111
|
+
if attributes.has_key?(:'sessionId')
|
112
|
+
self.session_id = attributes[:'sessionId']
|
113
|
+
end
|
114
|
+
|
115
115
|
if attributes.has_key?(:'effects')
|
116
116
|
if (value = attributes[:'effects']).is_a?(Array)
|
117
117
|
self.effects = value
|
@@ -145,14 +145,6 @@ module TalonOne
|
|
145
145
|
invalid_properties.push('invalid value for "application_id", application_id cannot be nil.')
|
146
146
|
end
|
147
147
|
|
148
|
-
if @session_id.nil?
|
149
|
-
invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
|
150
|
-
end
|
151
|
-
|
152
|
-
if @session_id.to_s.length < 1
|
153
|
-
invalid_properties.push('invalid value for "session_id", the character length must be great than or equal to 1.')
|
154
|
-
end
|
155
|
-
|
156
148
|
if @type.nil?
|
157
149
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
158
150
|
end
|
@@ -182,8 +174,6 @@ module TalonOne
|
|
182
174
|
return false if @id.nil?
|
183
175
|
return false if @created.nil?
|
184
176
|
return false if @application_id.nil?
|
185
|
-
return false if @session_id.nil?
|
186
|
-
return false if @session_id.to_s.length < 1
|
187
177
|
return false if @type.nil?
|
188
178
|
return false if @type.to_s.length < 1
|
189
179
|
return false if @attributes.nil?
|
@@ -192,20 +182,6 @@ module TalonOne
|
|
192
182
|
true
|
193
183
|
end
|
194
184
|
|
195
|
-
# Custom attribute writer method with validation
|
196
|
-
# @param [Object] session_id Value to be assigned
|
197
|
-
def session_id=(session_id)
|
198
|
-
if session_id.nil?
|
199
|
-
fail ArgumentError, 'session_id cannot be nil'
|
200
|
-
end
|
201
|
-
|
202
|
-
if session_id.to_s.length < 1
|
203
|
-
fail ArgumentError, 'invalid value for "session_id", the character length must be great than or equal to 1.'
|
204
|
-
end
|
205
|
-
|
206
|
-
@session_id = session_id
|
207
|
-
end
|
208
|
-
|
209
185
|
# Custom attribute writer method with validation
|
210
186
|
# @param [Object] type Value to be assigned
|
211
187
|
def type=(type)
|
@@ -229,9 +205,9 @@ module TalonOne
|
|
229
205
|
created == o.created &&
|
230
206
|
application_id == o.application_id &&
|
231
207
|
profile_id == o.profile_id &&
|
232
|
-
session_id == o.session_id &&
|
233
208
|
type == o.type &&
|
234
209
|
attributes == o.attributes &&
|
210
|
+
session_id == o.session_id &&
|
235
211
|
effects == o.effects &&
|
236
212
|
ledger_entries == o.ledger_entries &&
|
237
213
|
meta == o.meta
|
@@ -246,7 +222,7 @@ module TalonOne
|
|
246
222
|
# Calculates hash code according to all attributes.
|
247
223
|
# @return [Fixnum] Hash code
|
248
224
|
def hash
|
249
|
-
[id, created, application_id, profile_id,
|
225
|
+
[id, created, application_id, profile_id, type, attributes, session_id, effects, ledger_entries, meta].hash
|
250
226
|
end
|
251
227
|
|
252
228
|
# Builds the object from hash
|
@@ -16,12 +16,15 @@ module TalonOne
|
|
16
16
|
class InlineResponse20026
|
17
17
|
attr_accessor :total_result_size
|
18
18
|
|
19
|
+
attr_accessor :has_more
|
20
|
+
|
19
21
|
attr_accessor :data
|
20
22
|
|
21
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
24
|
def self.attribute_map
|
23
25
|
{
|
24
26
|
:'total_result_size' => :'totalResultSize',
|
27
|
+
:'has_more' => :'hasMore',
|
25
28
|
:'data' => :'data'
|
26
29
|
}
|
27
30
|
end
|
@@ -30,7 +33,8 @@ module TalonOne
|
|
30
33
|
def self.swagger_types
|
31
34
|
{
|
32
35
|
:'total_result_size' => :'Integer',
|
33
|
-
:'
|
36
|
+
:'has_more' => :'BOOLEAN',
|
37
|
+
:'data' => :'Array<Change>'
|
34
38
|
}
|
35
39
|
end
|
36
40
|
|
@@ -46,6 +50,10 @@ module TalonOne
|
|
46
50
|
self.total_result_size = attributes[:'totalResultSize']
|
47
51
|
end
|
48
52
|
|
53
|
+
if attributes.has_key?(:'hasMore')
|
54
|
+
self.has_more = attributes[:'hasMore']
|
55
|
+
end
|
56
|
+
|
49
57
|
if attributes.has_key?(:'data')
|
50
58
|
if (value = attributes[:'data']).is_a?(Array)
|
51
59
|
self.data = value
|
@@ -57,10 +65,6 @@ module TalonOne
|
|
57
65
|
# @return Array for valid properties with the reasons
|
58
66
|
def list_invalid_properties
|
59
67
|
invalid_properties = Array.new
|
60
|
-
if @total_result_size.nil?
|
61
|
-
invalid_properties.push('invalid value for "total_result_size", total_result_size cannot be nil.')
|
62
|
-
end
|
63
|
-
|
64
68
|
if @data.nil?
|
65
69
|
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
66
70
|
end
|
@@ -71,7 +75,6 @@ module TalonOne
|
|
71
75
|
# Check to see if the all the properties in the model are valid
|
72
76
|
# @return true if the model is valid
|
73
77
|
def valid?
|
74
|
-
return false if @total_result_size.nil?
|
75
78
|
return false if @data.nil?
|
76
79
|
true
|
77
80
|
end
|
@@ -82,6 +85,7 @@ module TalonOne
|
|
82
85
|
return true if self.equal?(o)
|
83
86
|
self.class == o.class &&
|
84
87
|
total_result_size == o.total_result_size &&
|
88
|
+
has_more == o.has_more &&
|
85
89
|
data == o.data
|
86
90
|
end
|
87
91
|
|
@@ -94,7 +98,7 @@ module TalonOne
|
|
94
98
|
# Calculates hash code according to all attributes.
|
95
99
|
# @return [Fixnum] Hash code
|
96
100
|
def hash
|
97
|
-
[total_result_size, data].hash
|
101
|
+
[total_result_size, has_more, data].hash
|
98
102
|
end
|
99
103
|
|
100
104
|
# Builds the object from hash
|
@@ -13,25 +13,24 @@ Swagger Codegen version: 2.4.7
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TalonOne
|
16
|
-
class
|
17
|
-
|
18
|
-
attr_accessor :key
|
16
|
+
class InlineResponse20029
|
17
|
+
attr_accessor :total_result_size
|
19
18
|
|
20
|
-
attr_accessor :
|
19
|
+
attr_accessor :data
|
21
20
|
|
22
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
23
22
|
def self.attribute_map
|
24
23
|
{
|
25
|
-
:'
|
26
|
-
:'
|
24
|
+
:'total_result_size' => :'totalResultSize',
|
25
|
+
:'data' => :'data'
|
27
26
|
}
|
28
27
|
end
|
29
28
|
|
30
29
|
# Attribute type mapping.
|
31
30
|
def self.swagger_types
|
32
31
|
{
|
33
|
-
:'
|
34
|
-
:'
|
32
|
+
:'total_result_size' => :'Integer',
|
33
|
+
:'data' => :'Array<Role>'
|
35
34
|
}
|
36
35
|
end
|
37
36
|
|
@@ -43,12 +42,14 @@ module TalonOne
|
|
43
42
|
# convert string to symbol for hash key
|
44
43
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
45
44
|
|
46
|
-
if attributes.has_key?(:'
|
47
|
-
self.
|
45
|
+
if attributes.has_key?(:'totalResultSize')
|
46
|
+
self.total_result_size = attributes[:'totalResultSize']
|
48
47
|
end
|
49
48
|
|
50
|
-
if attributes.has_key?(:'
|
51
|
-
|
49
|
+
if attributes.has_key?(:'data')
|
50
|
+
if (value = attributes[:'data']).is_a?(Array)
|
51
|
+
self.data = value
|
52
|
+
end
|
52
53
|
end
|
53
54
|
end
|
54
55
|
|
@@ -56,16 +57,12 @@ module TalonOne
|
|
56
57
|
# @return Array for valid properties with the reasons
|
57
58
|
def list_invalid_properties
|
58
59
|
invalid_properties = Array.new
|
59
|
-
if @
|
60
|
-
invalid_properties.push('invalid value for "
|
61
|
-
end
|
62
|
-
|
63
|
-
if @key.to_s.length < 1
|
64
|
-
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
60
|
+
if @total_result_size.nil?
|
61
|
+
invalid_properties.push('invalid value for "total_result_size", total_result_size cannot be nil.')
|
65
62
|
end
|
66
63
|
|
67
|
-
if @
|
68
|
-
invalid_properties.push('invalid value for "
|
64
|
+
if @data.nil?
|
65
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
69
66
|
end
|
70
67
|
|
71
68
|
invalid_properties
|
@@ -74,33 +71,18 @@ module TalonOne
|
|
74
71
|
# Check to see if the all the properties in the model are valid
|
75
72
|
# @return true if the model is valid
|
76
73
|
def valid?
|
77
|
-
return false if @
|
78
|
-
return false if @
|
79
|
-
return false if @value.nil?
|
74
|
+
return false if @total_result_size.nil?
|
75
|
+
return false if @data.nil?
|
80
76
|
true
|
81
77
|
end
|
82
78
|
|
83
|
-
# Custom attribute writer method with validation
|
84
|
-
# @param [Object] key Value to be assigned
|
85
|
-
def key=(key)
|
86
|
-
if key.nil?
|
87
|
-
fail ArgumentError, 'key cannot be nil'
|
88
|
-
end
|
89
|
-
|
90
|
-
if key.to_s.length < 1
|
91
|
-
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
92
|
-
end
|
93
|
-
|
94
|
-
@key = key
|
95
|
-
end
|
96
|
-
|
97
79
|
# Checks equality by comparing each attribute.
|
98
80
|
# @param [Object] Object to be compared
|
99
81
|
def ==(o)
|
100
82
|
return true if self.equal?(o)
|
101
83
|
self.class == o.class &&
|
102
|
-
|
103
|
-
|
84
|
+
total_result_size == o.total_result_size &&
|
85
|
+
data == o.data
|
104
86
|
end
|
105
87
|
|
106
88
|
# @see the `==` method
|
@@ -112,7 +94,7 @@ module TalonOne
|
|
112
94
|
# Calculates hash code according to all attributes.
|
113
95
|
# @return [Fixnum] Hash code
|
114
96
|
def hash
|
115
|
-
[
|
97
|
+
[total_result_size, data].hash
|
116
98
|
end
|
117
99
|
|
118
100
|
# Builds the object from hash
|