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
@@ -0,0 +1,234 @@
|
|
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 IntegrationEvent
|
18
|
+
# 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.
|
19
|
+
attr_accessor :profile_id
|
20
|
+
|
21
|
+
# A string representing the event. Must not be a reserved event name.
|
22
|
+
attr_accessor :type
|
23
|
+
|
24
|
+
# Arbitrary additional JSON data associated with the event.
|
25
|
+
attr_accessor :attributes
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'profile_id' => :'profileId',
|
31
|
+
:'type' => :'type',
|
32
|
+
:'attributes' => :'attributes'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.swagger_types
|
38
|
+
{
|
39
|
+
:'profile_id' => :'String',
|
40
|
+
:'type' => :'String',
|
41
|
+
:'attributes' => :'Object'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
52
|
+
|
53
|
+
if attributes.has_key?(:'profileId')
|
54
|
+
self.profile_id = attributes[:'profileId']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'type')
|
58
|
+
self.type = attributes[:'type']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'attributes')
|
62
|
+
self.attributes = attributes[:'attributes']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
if @type.nil?
|
71
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
72
|
+
end
|
73
|
+
|
74
|
+
if @type.to_s.length < 1
|
75
|
+
invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.')
|
76
|
+
end
|
77
|
+
|
78
|
+
if @attributes.nil?
|
79
|
+
invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
|
80
|
+
end
|
81
|
+
|
82
|
+
invalid_properties
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check to see if the all the properties in the model are valid
|
86
|
+
# @return true if the model is valid
|
87
|
+
def valid?
|
88
|
+
return false if @type.nil?
|
89
|
+
return false if @type.to_s.length < 1
|
90
|
+
return false if @attributes.nil?
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Custom attribute writer method with validation
|
95
|
+
# @param [Object] type Value to be assigned
|
96
|
+
def type=(type)
|
97
|
+
if type.nil?
|
98
|
+
fail ArgumentError, 'type cannot be nil'
|
99
|
+
end
|
100
|
+
|
101
|
+
if type.to_s.length < 1
|
102
|
+
fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.'
|
103
|
+
end
|
104
|
+
|
105
|
+
@type = type
|
106
|
+
end
|
107
|
+
|
108
|
+
# Checks equality by comparing each attribute.
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def ==(o)
|
111
|
+
return true if self.equal?(o)
|
112
|
+
self.class == o.class &&
|
113
|
+
profile_id == o.profile_id &&
|
114
|
+
type == o.type &&
|
115
|
+
attributes == o.attributes
|
116
|
+
end
|
117
|
+
|
118
|
+
# @see the `==` method
|
119
|
+
# @param [Object] Object to be compared
|
120
|
+
def eql?(o)
|
121
|
+
self == o
|
122
|
+
end
|
123
|
+
|
124
|
+
# Calculates hash code according to all attributes.
|
125
|
+
# @return [Fixnum] Hash code
|
126
|
+
def hash
|
127
|
+
[profile_id, type, attributes].hash
|
128
|
+
end
|
129
|
+
|
130
|
+
# Builds the object from hash
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
+
# @return [Object] Returns the model itself
|
133
|
+
def build_from_hash(attributes)
|
134
|
+
return nil unless attributes.is_a?(Hash)
|
135
|
+
self.class.swagger_types.each_pair do |key, type|
|
136
|
+
if type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
141
|
+
end
|
142
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
143
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
144
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
145
|
+
end
|
146
|
+
|
147
|
+
self
|
148
|
+
end
|
149
|
+
|
150
|
+
# Deserializes the data based on type
|
151
|
+
# @param string type Data type
|
152
|
+
# @param string value Value to be deserialized
|
153
|
+
# @return [Object] Deserialized data
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :DateTime
|
157
|
+
DateTime.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :BOOLEAN
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
temp_model = TalonOne.const_get(type).new
|
188
|
+
temp_model.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
# @return [String] String presentation of the object
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_body
|
201
|
+
to_hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the object in the form of hash
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_hash
|
207
|
+
hash = {}
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
209
|
+
value = self.send(attr)
|
210
|
+
next if value.nil?
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
@@ -23,13 +23,16 @@ module TalonOne
|
|
23
23
|
|
24
24
|
attr_accessor :loyalty
|
25
25
|
|
26
|
+
attr_accessor :coupon
|
27
|
+
|
26
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
27
29
|
def self.attribute_map
|
28
30
|
{
|
29
31
|
:'session' => :'session',
|
30
32
|
:'profile' => :'profile',
|
31
33
|
:'event' => :'event',
|
32
|
-
:'loyalty' => :'loyalty'
|
34
|
+
:'loyalty' => :'loyalty',
|
35
|
+
:'coupon' => :'coupon'
|
33
36
|
}
|
34
37
|
end
|
35
38
|
|
@@ -39,7 +42,8 @@ module TalonOne
|
|
39
42
|
:'session' => :'CustomerSession',
|
40
43
|
:'profile' => :'CustomerProfile',
|
41
44
|
:'event' => :'Event',
|
42
|
-
:'loyalty' => :'Loyalty'
|
45
|
+
:'loyalty' => :'Loyalty',
|
46
|
+
:'coupon' => :'Coupon'
|
43
47
|
}
|
44
48
|
end
|
45
49
|
|
@@ -66,6 +70,10 @@ module TalonOne
|
|
66
70
|
if attributes.has_key?(:'loyalty')
|
67
71
|
self.loyalty = attributes[:'loyalty']
|
68
72
|
end
|
73
|
+
|
74
|
+
if attributes.has_key?(:'coupon')
|
75
|
+
self.coupon = attributes[:'coupon']
|
76
|
+
end
|
69
77
|
end
|
70
78
|
|
71
79
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -104,7 +112,8 @@ module TalonOne
|
|
104
112
|
session == o.session &&
|
105
113
|
profile == o.profile &&
|
106
114
|
event == o.event &&
|
107
|
-
loyalty == o.loyalty
|
115
|
+
loyalty == o.loyalty &&
|
116
|
+
coupon == o.coupon
|
108
117
|
end
|
109
118
|
|
110
119
|
# @see the `==` method
|
@@ -116,7 +125,7 @@ module TalonOne
|
|
116
125
|
# Calculates hash code according to all attributes.
|
117
126
|
# @return [Fixnum] Hash code
|
118
127
|
def hash
|
119
|
-
[session, profile, event, loyalty].hash
|
128
|
+
[session, profile, event, loyalty, coupon].hash
|
120
129
|
end
|
121
130
|
|
122
131
|
# Builds the object from hash
|
@@ -113,7 +113,7 @@ module TalonOne
|
|
113
113
|
# @return true if the model is valid
|
114
114
|
def valid?
|
115
115
|
return false if @action.nil?
|
116
|
-
action_validator = EnumAttributeValidator.new('String', ['redeemCoupon', 'redeemReferral', 'setDiscount', 'createCoupon'])
|
116
|
+
action_validator = EnumAttributeValidator.new('String', ['redeemCoupon', 'redeemReferral', 'setDiscount', 'createCoupon', 'setDiscountEffect'])
|
117
117
|
return false unless action_validator.valid?(@action)
|
118
118
|
return false if @limit.nil?
|
119
119
|
return false if @limit < 0
|
@@ -124,7 +124,7 @@ module TalonOne
|
|
124
124
|
# Custom attribute writer method checking allowed values (enum).
|
125
125
|
# @param [Object] action Object to be assigned
|
126
126
|
def action=(action)
|
127
|
-
validator = EnumAttributeValidator.new('String', ['redeemCoupon', 'redeemReferral', 'setDiscount', 'createCoupon'])
|
127
|
+
validator = EnumAttributeValidator.new('String', ['redeemCoupon', 'redeemReferral', 'setDiscount', 'createCoupon', 'setDiscountEffect'])
|
128
128
|
unless validator.valid?(action)
|
129
129
|
fail ArgumentError, 'invalid value for "action", must be one of #{validator.allowable_values}.'
|
130
130
|
end
|
@@ -22,6 +22,8 @@ module TalonOne
|
|
22
22
|
|
23
23
|
attr_accessor :coupon_rejection_reason
|
24
24
|
|
25
|
+
attr_accessor :referral_rejection_reason
|
26
|
+
|
25
27
|
attr_accessor :warnings
|
26
28
|
|
27
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -30,6 +32,7 @@ module TalonOne
|
|
30
32
|
:'campaigns' => :'campaigns',
|
31
33
|
:'coupons' => :'coupons',
|
32
34
|
:'coupon_rejection_reason' => :'couponRejectionReason',
|
35
|
+
:'referral_rejection_reason' => :'referralRejectionReason',
|
33
36
|
:'warnings' => :'warnings'
|
34
37
|
}
|
35
38
|
end
|
@@ -40,6 +43,7 @@ module TalonOne
|
|
40
43
|
:'campaigns' => :'Object',
|
41
44
|
:'coupons' => :'Object',
|
42
45
|
:'coupon_rejection_reason' => :'CouponRejectionReason',
|
46
|
+
:'referral_rejection_reason' => :'ReferralRejectionReason',
|
43
47
|
:'warnings' => :'Object'
|
44
48
|
}
|
45
49
|
end
|
@@ -64,6 +68,10 @@ module TalonOne
|
|
64
68
|
self.coupon_rejection_reason = attributes[:'couponRejectionReason']
|
65
69
|
end
|
66
70
|
|
71
|
+
if attributes.has_key?(:'referralRejectionReason')
|
72
|
+
self.referral_rejection_reason = attributes[:'referralRejectionReason']
|
73
|
+
end
|
74
|
+
|
67
75
|
if attributes.has_key?(:'warnings')
|
68
76
|
self.warnings = attributes[:'warnings']
|
69
77
|
end
|
@@ -90,6 +98,7 @@ module TalonOne
|
|
90
98
|
campaigns == o.campaigns &&
|
91
99
|
coupons == o.coupons &&
|
92
100
|
coupon_rejection_reason == o.coupon_rejection_reason &&
|
101
|
+
referral_rejection_reason == o.referral_rejection_reason &&
|
93
102
|
warnings == o.warnings
|
94
103
|
end
|
95
104
|
|
@@ -102,7 +111,7 @@ module TalonOne
|
|
102
111
|
# Calculates hash code according to all attributes.
|
103
112
|
# @return [Fixnum] Hash code
|
104
113
|
def hash
|
105
|
-
[campaigns, coupons, coupon_rejection_reason, warnings].hash
|
114
|
+
[campaigns, coupons, coupon_rejection_reason, referral_rejection_reason, warnings].hash
|
106
115
|
end
|
107
116
|
|
108
117
|
# Builds the object from hash
|
@@ -13,6 +13,7 @@ Swagger Codegen version: 2.4.7
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TalonOne
|
16
|
+
#
|
16
17
|
class NewApplication
|
17
18
|
# The name of this application.
|
18
19
|
attr_accessor :name
|
@@ -20,9 +21,6 @@ module TalonOne
|
|
20
21
|
# A longer description of the application.
|
21
22
|
attr_accessor :description
|
22
23
|
|
23
|
-
# Hex key for HMAC-signing API calls as coming from this application (16 hex digits)
|
24
|
-
attr_accessor :key
|
25
|
-
|
26
24
|
# A string containing an IANA timezone descriptor.
|
27
25
|
attr_accessor :timezone
|
28
26
|
|
@@ -38,6 +36,11 @@ module TalonOne
|
|
38
36
|
# Default limits for campaigns created in this application
|
39
37
|
attr_accessor :limits
|
40
38
|
|
39
|
+
attr_accessor :attributes_settings
|
40
|
+
|
41
|
+
# Hex key for HMAC-signing API calls as coming from this application (16 hex digits)
|
42
|
+
attr_accessor :key
|
43
|
+
|
41
44
|
class EnumAttributeValidator
|
42
45
|
attr_reader :datatype
|
43
46
|
attr_reader :allowable_values
|
@@ -65,12 +68,13 @@ module TalonOne
|
|
65
68
|
{
|
66
69
|
:'name' => :'name',
|
67
70
|
:'description' => :'description',
|
68
|
-
:'key' => :'key',
|
69
71
|
:'timezone' => :'timezone',
|
70
72
|
:'currency' => :'currency',
|
71
73
|
:'case_sensitivity' => :'caseSensitivity',
|
72
74
|
:'attributes' => :'attributes',
|
73
|
-
:'limits' => :'limits'
|
75
|
+
:'limits' => :'limits',
|
76
|
+
:'attributes_settings' => :'attributesSettings',
|
77
|
+
:'key' => :'key'
|
74
78
|
}
|
75
79
|
end
|
76
80
|
|
@@ -79,12 +83,13 @@ module TalonOne
|
|
79
83
|
{
|
80
84
|
:'name' => :'String',
|
81
85
|
:'description' => :'String',
|
82
|
-
:'key' => :'String',
|
83
86
|
:'timezone' => :'String',
|
84
87
|
:'currency' => :'String',
|
85
88
|
:'case_sensitivity' => :'String',
|
86
89
|
:'attributes' => :'Object',
|
87
|
-
:'limits' => :'Array<LimitConfig>'
|
90
|
+
:'limits' => :'Array<LimitConfig>',
|
91
|
+
:'attributes_settings' => :'AttributesSettings',
|
92
|
+
:'key' => :'String'
|
88
93
|
}
|
89
94
|
end
|
90
95
|
|
@@ -104,10 +109,6 @@ module TalonOne
|
|
104
109
|
self.description = attributes[:'description']
|
105
110
|
end
|
106
111
|
|
107
|
-
if attributes.has_key?(:'key')
|
108
|
-
self.key = attributes[:'key']
|
109
|
-
end
|
110
|
-
|
111
112
|
if attributes.has_key?(:'timezone')
|
112
113
|
self.timezone = attributes[:'timezone']
|
113
114
|
end
|
@@ -129,6 +130,14 @@ module TalonOne
|
|
129
130
|
self.limits = value
|
130
131
|
end
|
131
132
|
end
|
133
|
+
|
134
|
+
if attributes.has_key?(:'attributesSettings')
|
135
|
+
self.attributes_settings = attributes[:'attributesSettings']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.has_key?(:'key')
|
139
|
+
self.key = attributes[:'key']
|
140
|
+
end
|
132
141
|
end
|
133
142
|
|
134
143
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -143,22 +152,6 @@ module TalonOne
|
|
143
152
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
144
153
|
end
|
145
154
|
|
146
|
-
if @key.nil?
|
147
|
-
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
148
|
-
end
|
149
|
-
|
150
|
-
if @key.to_s.length > 16
|
151
|
-
invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 16.')
|
152
|
-
end
|
153
|
-
|
154
|
-
if @key.to_s.length < 16
|
155
|
-
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 16.')
|
156
|
-
end
|
157
|
-
|
158
|
-
if @key !~ Regexp.new(/^[a-fA-F0-9]{16}$/)
|
159
|
-
invalid_properties.push('invalid value for "key", must conform to the pattern /^[a-fA-F0-9]{16}$/.')
|
160
|
-
end
|
161
|
-
|
162
155
|
if @timezone.nil?
|
163
156
|
invalid_properties.push('invalid value for "timezone", timezone cannot be nil.')
|
164
157
|
end
|
@@ -175,6 +168,18 @@ module TalonOne
|
|
175
168
|
invalid_properties.push('invalid value for "currency", the character length must be great than or equal to 1.')
|
176
169
|
end
|
177
170
|
|
171
|
+
if !@key.nil? && @key.to_s.length > 16
|
172
|
+
invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 16.')
|
173
|
+
end
|
174
|
+
|
175
|
+
if !@key.nil? && @key.to_s.length < 16
|
176
|
+
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 16.')
|
177
|
+
end
|
178
|
+
|
179
|
+
if !@key.nil? && @key !~ Regexp.new(/^[a-fA-F0-9]{16}$/)
|
180
|
+
invalid_properties.push('invalid value for "key", must conform to the pattern /^[a-fA-F0-9]{16}$/.')
|
181
|
+
end
|
182
|
+
|
178
183
|
invalid_properties
|
179
184
|
end
|
180
185
|
|
@@ -183,16 +188,15 @@ module TalonOne
|
|
183
188
|
def valid?
|
184
189
|
return false if @name.nil?
|
185
190
|
return false if @name.to_s.length < 1
|
186
|
-
return false if @key.nil?
|
187
|
-
return false if @key.to_s.length > 16
|
188
|
-
return false if @key.to_s.length < 16
|
189
|
-
return false if @key !~ Regexp.new(/^[a-fA-F0-9]{16}$/)
|
190
191
|
return false if @timezone.nil?
|
191
192
|
return false if @timezone.to_s.length < 1
|
192
193
|
return false if @currency.nil?
|
193
194
|
return false if @currency.to_s.length < 1
|
194
195
|
case_sensitivity_validator = EnumAttributeValidator.new('String', ['sensitive', 'insensitive-uppercase', 'insensitive-lowercase'])
|
195
196
|
return false unless case_sensitivity_validator.valid?(@case_sensitivity)
|
197
|
+
return false if !@key.nil? && @key.to_s.length > 16
|
198
|
+
return false if !@key.nil? && @key.to_s.length < 16
|
199
|
+
return false if !@key.nil? && @key !~ Regexp.new(/^[a-fA-F0-9]{16}$/)
|
196
200
|
true
|
197
201
|
end
|
198
202
|
|
@@ -210,28 +214,6 @@ module TalonOne
|
|
210
214
|
@name = name
|
211
215
|
end
|
212
216
|
|
213
|
-
# Custom attribute writer method with validation
|
214
|
-
# @param [Object] key Value to be assigned
|
215
|
-
def key=(key)
|
216
|
-
if key.nil?
|
217
|
-
fail ArgumentError, 'key cannot be nil'
|
218
|
-
end
|
219
|
-
|
220
|
-
if key.to_s.length > 16
|
221
|
-
fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 16.'
|
222
|
-
end
|
223
|
-
|
224
|
-
if key.to_s.length < 16
|
225
|
-
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 16.'
|
226
|
-
end
|
227
|
-
|
228
|
-
if key !~ Regexp.new(/^[a-fA-F0-9]{16}$/)
|
229
|
-
fail ArgumentError, 'invalid value for "key", must conform to the pattern /^[a-fA-F0-9]{16}$/.'
|
230
|
-
end
|
231
|
-
|
232
|
-
@key = key
|
233
|
-
end
|
234
|
-
|
235
217
|
# Custom attribute writer method with validation
|
236
218
|
# @param [Object] timezone Value to be assigned
|
237
219
|
def timezone=(timezone)
|
@@ -270,6 +252,24 @@ module TalonOne
|
|
270
252
|
@case_sensitivity = case_sensitivity
|
271
253
|
end
|
272
254
|
|
255
|
+
# Custom attribute writer method with validation
|
256
|
+
# @param [Object] key Value to be assigned
|
257
|
+
def key=(key)
|
258
|
+
if !key.nil? && key.to_s.length > 16
|
259
|
+
fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 16.'
|
260
|
+
end
|
261
|
+
|
262
|
+
if !key.nil? && key.to_s.length < 16
|
263
|
+
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 16.'
|
264
|
+
end
|
265
|
+
|
266
|
+
if !key.nil? && key !~ Regexp.new(/^[a-fA-F0-9]{16}$/)
|
267
|
+
fail ArgumentError, 'invalid value for "key", must conform to the pattern /^[a-fA-F0-9]{16}$/.'
|
268
|
+
end
|
269
|
+
|
270
|
+
@key = key
|
271
|
+
end
|
272
|
+
|
273
273
|
# Checks equality by comparing each attribute.
|
274
274
|
# @param [Object] Object to be compared
|
275
275
|
def ==(o)
|
@@ -277,12 +277,13 @@ module TalonOne
|
|
277
277
|
self.class == o.class &&
|
278
278
|
name == o.name &&
|
279
279
|
description == o.description &&
|
280
|
-
key == o.key &&
|
281
280
|
timezone == o.timezone &&
|
282
281
|
currency == o.currency &&
|
283
282
|
case_sensitivity == o.case_sensitivity &&
|
284
283
|
attributes == o.attributes &&
|
285
|
-
limits == o.limits
|
284
|
+
limits == o.limits &&
|
285
|
+
attributes_settings == o.attributes_settings &&
|
286
|
+
key == o.key
|
286
287
|
end
|
287
288
|
|
288
289
|
# @see the `==` method
|
@@ -294,7 +295,7 @@ module TalonOne
|
|
294
295
|
# Calculates hash code according to all attributes.
|
295
296
|
# @return [Fixnum] Hash code
|
296
297
|
def hash
|
297
|
-
[name, description,
|
298
|
+
[name, description, timezone, currency, case_sensitivity, attributes, limits, attributes_settings, key].hash
|
298
299
|
end
|
299
300
|
|
300
301
|
# Builds the object from hash
|