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
@@ -13,46 +13,35 @@ Swagger Codegen version: 2.4.7
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TalonOne
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
attr_accessor :id
|
16
|
+
class SamlConnectionMetadata
|
17
|
+
# ID of the SAML service.
|
18
|
+
attr_accessor :name
|
20
19
|
|
21
|
-
#
|
22
|
-
attr_accessor :
|
20
|
+
# Determines if this SAML connection active.
|
21
|
+
attr_accessor :enabled
|
23
22
|
|
24
|
-
|
25
|
-
attr_accessor :modified
|
23
|
+
attr_accessor :account_id
|
26
24
|
|
27
|
-
#
|
28
|
-
attr_accessor :
|
29
|
-
|
30
|
-
attr_accessor :value
|
31
|
-
|
32
|
-
# ID of the storage in which the data resides
|
33
|
-
attr_accessor :storage_id
|
25
|
+
# Identity Provider metadata XML document.
|
26
|
+
attr_accessor :metadata_document
|
34
27
|
|
35
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
29
|
def self.attribute_map
|
37
30
|
{
|
38
|
-
:'
|
39
|
-
:'
|
40
|
-
:'
|
41
|
-
:'
|
42
|
-
:'value' => :'value',
|
43
|
-
:'storage_id' => :'storageId'
|
31
|
+
:'name' => :'name',
|
32
|
+
:'enabled' => :'enabled',
|
33
|
+
:'account_id' => :'accountId',
|
34
|
+
:'metadata_document' => :'metadataDocument'
|
44
35
|
}
|
45
36
|
end
|
46
37
|
|
47
38
|
# Attribute type mapping.
|
48
39
|
def self.swagger_types
|
49
40
|
{
|
50
|
-
:'
|
51
|
-
:'
|
52
|
-
:'
|
53
|
-
:'
|
54
|
-
:'value' => :'Object',
|
55
|
-
:'storage_id' => :'Integer'
|
41
|
+
:'name' => :'String',
|
42
|
+
:'enabled' => :'BOOLEAN',
|
43
|
+
:'account_id' => :'Float',
|
44
|
+
:'metadata_document' => :'String'
|
56
45
|
}
|
57
46
|
end
|
58
47
|
|
@@ -64,28 +53,20 @@ module TalonOne
|
|
64
53
|
# convert string to symbol for hash key
|
65
54
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
66
55
|
|
67
|
-
if attributes.has_key?(:'
|
68
|
-
self.
|
69
|
-
end
|
70
|
-
|
71
|
-
if attributes.has_key?(:'created')
|
72
|
-
self.created = attributes[:'created']
|
56
|
+
if attributes.has_key?(:'name')
|
57
|
+
self.name = attributes[:'name']
|
73
58
|
end
|
74
59
|
|
75
|
-
if attributes.has_key?(:'
|
76
|
-
self.
|
60
|
+
if attributes.has_key?(:'enabled')
|
61
|
+
self.enabled = attributes[:'enabled']
|
77
62
|
end
|
78
63
|
|
79
|
-
if attributes.has_key?(:'
|
80
|
-
self.
|
64
|
+
if attributes.has_key?(:'accountId')
|
65
|
+
self.account_id = attributes[:'accountId']
|
81
66
|
end
|
82
67
|
|
83
|
-
if attributes.has_key?(:'
|
84
|
-
self.
|
85
|
-
end
|
86
|
-
|
87
|
-
if attributes.has_key?(:'storageId')
|
88
|
-
self.storage_id = attributes[:'storageId']
|
68
|
+
if attributes.has_key?(:'metadataDocument')
|
69
|
+
self.metadata_document = attributes[:'metadataDocument']
|
89
70
|
end
|
90
71
|
end
|
91
72
|
|
@@ -93,32 +74,28 @@ module TalonOne
|
|
93
74
|
# @return Array for valid properties with the reasons
|
94
75
|
def list_invalid_properties
|
95
76
|
invalid_properties = Array.new
|
96
|
-
if @
|
97
|
-
invalid_properties.push('invalid value for "
|
98
|
-
end
|
99
|
-
|
100
|
-
if @created.nil?
|
101
|
-
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
77
|
+
if @name.nil?
|
78
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
102
79
|
end
|
103
80
|
|
104
|
-
if @
|
105
|
-
invalid_properties.push('invalid value for "
|
81
|
+
if @name.to_s.length < 1
|
82
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
106
83
|
end
|
107
84
|
|
108
|
-
if @
|
109
|
-
invalid_properties.push('invalid value for "
|
85
|
+
if @enabled.nil?
|
86
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
110
87
|
end
|
111
88
|
|
112
|
-
if @
|
113
|
-
invalid_properties.push('invalid value for "
|
89
|
+
if @account_id.nil?
|
90
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
114
91
|
end
|
115
92
|
|
116
|
-
if @
|
117
|
-
invalid_properties.push('invalid value for "
|
93
|
+
if @metadata_document.nil?
|
94
|
+
invalid_properties.push('invalid value for "metadata_document", metadata_document cannot be nil.')
|
118
95
|
end
|
119
96
|
|
120
|
-
if @
|
121
|
-
invalid_properties.push('invalid value for "
|
97
|
+
if @metadata_document.to_s.length < 1
|
98
|
+
invalid_properties.push('invalid value for "metadata_document", the character length must be great than or equal to 1.')
|
122
99
|
end
|
123
100
|
|
124
101
|
invalid_properties
|
@@ -127,28 +104,41 @@ module TalonOne
|
|
127
104
|
# Check to see if the all the properties in the model are valid
|
128
105
|
# @return true if the model is valid
|
129
106
|
def valid?
|
130
|
-
return false if @
|
131
|
-
return false if @
|
132
|
-
return false if @
|
133
|
-
return false if @
|
134
|
-
return false if @
|
135
|
-
return false if @
|
136
|
-
return false if @storage_id.nil?
|
107
|
+
return false if @name.nil?
|
108
|
+
return false if @name.to_s.length < 1
|
109
|
+
return false if @enabled.nil?
|
110
|
+
return false if @account_id.nil?
|
111
|
+
return false if @metadata_document.nil?
|
112
|
+
return false if @metadata_document.to_s.length < 1
|
137
113
|
true
|
138
114
|
end
|
139
115
|
|
140
116
|
# Custom attribute writer method with validation
|
141
|
-
# @param [Object]
|
142
|
-
def
|
143
|
-
if
|
144
|
-
fail ArgumentError, '
|
117
|
+
# @param [Object] name Value to be assigned
|
118
|
+
def name=(name)
|
119
|
+
if name.nil?
|
120
|
+
fail ArgumentError, 'name cannot be nil'
|
121
|
+
end
|
122
|
+
|
123
|
+
if name.to_s.length < 1
|
124
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
125
|
+
end
|
126
|
+
|
127
|
+
@name = name
|
128
|
+
end
|
129
|
+
|
130
|
+
# Custom attribute writer method with validation
|
131
|
+
# @param [Object] metadata_document Value to be assigned
|
132
|
+
def metadata_document=(metadata_document)
|
133
|
+
if metadata_document.nil?
|
134
|
+
fail ArgumentError, 'metadata_document cannot be nil'
|
145
135
|
end
|
146
136
|
|
147
|
-
if
|
148
|
-
fail ArgumentError, 'invalid value for "
|
137
|
+
if metadata_document.to_s.length < 1
|
138
|
+
fail ArgumentError, 'invalid value for "metadata_document", the character length must be great than or equal to 1.'
|
149
139
|
end
|
150
140
|
|
151
|
-
@
|
141
|
+
@metadata_document = metadata_document
|
152
142
|
end
|
153
143
|
|
154
144
|
# Checks equality by comparing each attribute.
|
@@ -156,12 +146,10 @@ module TalonOne
|
|
156
146
|
def ==(o)
|
157
147
|
return true if self.equal?(o)
|
158
148
|
self.class == o.class &&
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
value == o.value &&
|
164
|
-
storage_id == o.storage_id
|
149
|
+
name == o.name &&
|
150
|
+
enabled == o.enabled &&
|
151
|
+
account_id == o.account_id &&
|
152
|
+
metadata_document == o.metadata_document
|
165
153
|
end
|
166
154
|
|
167
155
|
# @see the `==` method
|
@@ -173,7 +161,7 @@ module TalonOne
|
|
173
161
|
# Calculates hash code according to all attributes.
|
174
162
|
# @return [Fixnum] Hash code
|
175
163
|
def hash
|
176
|
-
[
|
164
|
+
[name, enabled, account_id, metadata_document].hash
|
177
165
|
end
|
178
166
|
|
179
167
|
# Builds the object from hash
|
@@ -0,0 +1,361 @@
|
|
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
|
+
class UpdateApplication
|
17
|
+
# The name of this application.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# A longer description of the application.
|
21
|
+
attr_accessor :description
|
22
|
+
|
23
|
+
# A string containing an IANA timezone descriptor.
|
24
|
+
attr_accessor :timezone
|
25
|
+
|
26
|
+
# A string describing a default currency for new customer sessions.
|
27
|
+
attr_accessor :currency
|
28
|
+
|
29
|
+
# A string indicating how should campaigns in this application deal with case sensitivity on coupon codes.
|
30
|
+
attr_accessor :case_sensitivity
|
31
|
+
|
32
|
+
# Arbitrary properties associated with this campaign
|
33
|
+
attr_accessor :attributes
|
34
|
+
|
35
|
+
# Default limits for campaigns created in this application
|
36
|
+
attr_accessor :limits
|
37
|
+
|
38
|
+
attr_accessor :attributes_settings
|
39
|
+
|
40
|
+
class EnumAttributeValidator
|
41
|
+
attr_reader :datatype
|
42
|
+
attr_reader :allowable_values
|
43
|
+
|
44
|
+
def initialize(datatype, allowable_values)
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
46
|
+
case datatype.to_s
|
47
|
+
when /Integer/i
|
48
|
+
value.to_i
|
49
|
+
when /Float/i
|
50
|
+
value.to_f
|
51
|
+
else
|
52
|
+
value
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def valid?(value)
|
58
|
+
!value || allowable_values.include?(value)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
63
|
+
def self.attribute_map
|
64
|
+
{
|
65
|
+
:'name' => :'name',
|
66
|
+
:'description' => :'description',
|
67
|
+
:'timezone' => :'timezone',
|
68
|
+
:'currency' => :'currency',
|
69
|
+
:'case_sensitivity' => :'caseSensitivity',
|
70
|
+
:'attributes' => :'attributes',
|
71
|
+
:'limits' => :'limits',
|
72
|
+
:'attributes_settings' => :'attributesSettings'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.swagger_types
|
78
|
+
{
|
79
|
+
:'name' => :'String',
|
80
|
+
:'description' => :'String',
|
81
|
+
:'timezone' => :'String',
|
82
|
+
:'currency' => :'String',
|
83
|
+
:'case_sensitivity' => :'String',
|
84
|
+
:'attributes' => :'Object',
|
85
|
+
:'limits' => :'Array<LimitConfig>',
|
86
|
+
:'attributes_settings' => :'AttributesSettings'
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initializes the object
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
def initialize(attributes = {})
|
93
|
+
return unless attributes.is_a?(Hash)
|
94
|
+
|
95
|
+
# convert string to symbol for hash key
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
97
|
+
|
98
|
+
if attributes.has_key?(:'name')
|
99
|
+
self.name = attributes[:'name']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'description')
|
103
|
+
self.description = attributes[:'description']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'timezone')
|
107
|
+
self.timezone = attributes[:'timezone']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'currency')
|
111
|
+
self.currency = attributes[:'currency']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'caseSensitivity')
|
115
|
+
self.case_sensitivity = attributes[:'caseSensitivity']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'attributes')
|
119
|
+
self.attributes = attributes[:'attributes']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'limits')
|
123
|
+
if (value = attributes[:'limits']).is_a?(Array)
|
124
|
+
self.limits = value
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.has_key?(:'attributesSettings')
|
129
|
+
self.attributes_settings = attributes[:'attributesSettings']
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
134
|
+
# @return Array for valid properties with the reasons
|
135
|
+
def list_invalid_properties
|
136
|
+
invalid_properties = Array.new
|
137
|
+
if @name.nil?
|
138
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
139
|
+
end
|
140
|
+
|
141
|
+
if @name.to_s.length < 1
|
142
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
143
|
+
end
|
144
|
+
|
145
|
+
if @timezone.nil?
|
146
|
+
invalid_properties.push('invalid value for "timezone", timezone cannot be nil.')
|
147
|
+
end
|
148
|
+
|
149
|
+
if @timezone.to_s.length < 1
|
150
|
+
invalid_properties.push('invalid value for "timezone", the character length must be great than or equal to 1.')
|
151
|
+
end
|
152
|
+
|
153
|
+
if @currency.nil?
|
154
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
155
|
+
end
|
156
|
+
|
157
|
+
if @currency.to_s.length < 1
|
158
|
+
invalid_properties.push('invalid value for "currency", the character length must be great than or equal to 1.')
|
159
|
+
end
|
160
|
+
|
161
|
+
invalid_properties
|
162
|
+
end
|
163
|
+
|
164
|
+
# Check to see if the all the properties in the model are valid
|
165
|
+
# @return true if the model is valid
|
166
|
+
def valid?
|
167
|
+
return false if @name.nil?
|
168
|
+
return false if @name.to_s.length < 1
|
169
|
+
return false if @timezone.nil?
|
170
|
+
return false if @timezone.to_s.length < 1
|
171
|
+
return false if @currency.nil?
|
172
|
+
return false if @currency.to_s.length < 1
|
173
|
+
case_sensitivity_validator = EnumAttributeValidator.new('String', ['sensitive', 'insensitive-uppercase', 'insensitive-lowercase'])
|
174
|
+
return false unless case_sensitivity_validator.valid?(@case_sensitivity)
|
175
|
+
true
|
176
|
+
end
|
177
|
+
|
178
|
+
# Custom attribute writer method with validation
|
179
|
+
# @param [Object] name Value to be assigned
|
180
|
+
def name=(name)
|
181
|
+
if name.nil?
|
182
|
+
fail ArgumentError, 'name cannot be nil'
|
183
|
+
end
|
184
|
+
|
185
|
+
if name.to_s.length < 1
|
186
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
187
|
+
end
|
188
|
+
|
189
|
+
@name = name
|
190
|
+
end
|
191
|
+
|
192
|
+
# Custom attribute writer method with validation
|
193
|
+
# @param [Object] timezone Value to be assigned
|
194
|
+
def timezone=(timezone)
|
195
|
+
if timezone.nil?
|
196
|
+
fail ArgumentError, 'timezone cannot be nil'
|
197
|
+
end
|
198
|
+
|
199
|
+
if timezone.to_s.length < 1
|
200
|
+
fail ArgumentError, 'invalid value for "timezone", the character length must be great than or equal to 1.'
|
201
|
+
end
|
202
|
+
|
203
|
+
@timezone = timezone
|
204
|
+
end
|
205
|
+
|
206
|
+
# Custom attribute writer method with validation
|
207
|
+
# @param [Object] currency Value to be assigned
|
208
|
+
def currency=(currency)
|
209
|
+
if currency.nil?
|
210
|
+
fail ArgumentError, 'currency cannot be nil'
|
211
|
+
end
|
212
|
+
|
213
|
+
if currency.to_s.length < 1
|
214
|
+
fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 1.'
|
215
|
+
end
|
216
|
+
|
217
|
+
@currency = currency
|
218
|
+
end
|
219
|
+
|
220
|
+
# Custom attribute writer method checking allowed values (enum).
|
221
|
+
# @param [Object] case_sensitivity Object to be assigned
|
222
|
+
def case_sensitivity=(case_sensitivity)
|
223
|
+
validator = EnumAttributeValidator.new('String', ['sensitive', 'insensitive-uppercase', 'insensitive-lowercase'])
|
224
|
+
unless validator.valid?(case_sensitivity)
|
225
|
+
fail ArgumentError, 'invalid value for "case_sensitivity", must be one of #{validator.allowable_values}.'
|
226
|
+
end
|
227
|
+
@case_sensitivity = case_sensitivity
|
228
|
+
end
|
229
|
+
|
230
|
+
# Checks equality by comparing each attribute.
|
231
|
+
# @param [Object] Object to be compared
|
232
|
+
def ==(o)
|
233
|
+
return true if self.equal?(o)
|
234
|
+
self.class == o.class &&
|
235
|
+
name == o.name &&
|
236
|
+
description == o.description &&
|
237
|
+
timezone == o.timezone &&
|
238
|
+
currency == o.currency &&
|
239
|
+
case_sensitivity == o.case_sensitivity &&
|
240
|
+
attributes == o.attributes &&
|
241
|
+
limits == o.limits &&
|
242
|
+
attributes_settings == o.attributes_settings
|
243
|
+
end
|
244
|
+
|
245
|
+
# @see the `==` method
|
246
|
+
# @param [Object] Object to be compared
|
247
|
+
def eql?(o)
|
248
|
+
self == o
|
249
|
+
end
|
250
|
+
|
251
|
+
# Calculates hash code according to all attributes.
|
252
|
+
# @return [Fixnum] Hash code
|
253
|
+
def hash
|
254
|
+
[name, description, timezone, currency, case_sensitivity, attributes, limits, attributes_settings].hash
|
255
|
+
end
|
256
|
+
|
257
|
+
# Builds the object from hash
|
258
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
259
|
+
# @return [Object] Returns the model itself
|
260
|
+
def build_from_hash(attributes)
|
261
|
+
return nil unless attributes.is_a?(Hash)
|
262
|
+
self.class.swagger_types.each_pair do |key, type|
|
263
|
+
if type =~ /\AArray<(.*)>/i
|
264
|
+
# check to ensure the input is an array given that the the attribute
|
265
|
+
# is documented as an array but the input is not
|
266
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
267
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
268
|
+
end
|
269
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
270
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
271
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
272
|
+
end
|
273
|
+
|
274
|
+
self
|
275
|
+
end
|
276
|
+
|
277
|
+
# Deserializes the data based on type
|
278
|
+
# @param string type Data type
|
279
|
+
# @param string value Value to be deserialized
|
280
|
+
# @return [Object] Deserialized data
|
281
|
+
def _deserialize(type, value)
|
282
|
+
case type.to_sym
|
283
|
+
when :DateTime
|
284
|
+
DateTime.parse(value)
|
285
|
+
when :Date
|
286
|
+
Date.parse(value)
|
287
|
+
when :String
|
288
|
+
value.to_s
|
289
|
+
when :Integer
|
290
|
+
value.to_i
|
291
|
+
when :Float
|
292
|
+
value.to_f
|
293
|
+
when :BOOLEAN
|
294
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
295
|
+
true
|
296
|
+
else
|
297
|
+
false
|
298
|
+
end
|
299
|
+
when :Object
|
300
|
+
# generic object (usually a Hash), return directly
|
301
|
+
value
|
302
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
303
|
+
inner_type = Regexp.last_match[:inner_type]
|
304
|
+
value.map { |v| _deserialize(inner_type, v) }
|
305
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
306
|
+
k_type = Regexp.last_match[:k_type]
|
307
|
+
v_type = Regexp.last_match[:v_type]
|
308
|
+
{}.tap do |hash|
|
309
|
+
value.each do |k, v|
|
310
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
311
|
+
end
|
312
|
+
end
|
313
|
+
else # model
|
314
|
+
temp_model = TalonOne.const_get(type).new
|
315
|
+
temp_model.build_from_hash(value)
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
# Returns the string representation of the object
|
320
|
+
# @return [String] String presentation of the object
|
321
|
+
def to_s
|
322
|
+
to_hash.to_s
|
323
|
+
end
|
324
|
+
|
325
|
+
# to_body is an alias to to_hash (backward compatibility)
|
326
|
+
# @return [Hash] Returns the object in the form of hash
|
327
|
+
def to_body
|
328
|
+
to_hash
|
329
|
+
end
|
330
|
+
|
331
|
+
# Returns the object in the form of hash
|
332
|
+
# @return [Hash] Returns the object in the form of hash
|
333
|
+
def to_hash
|
334
|
+
hash = {}
|
335
|
+
self.class.attribute_map.each_pair do |attr, param|
|
336
|
+
value = self.send(attr)
|
337
|
+
next if value.nil?
|
338
|
+
hash[param] = _to_hash(value)
|
339
|
+
end
|
340
|
+
hash
|
341
|
+
end
|
342
|
+
|
343
|
+
# Outputs non-array value in the form of hash
|
344
|
+
# For object, use to_hash. Otherwise, just return the value
|
345
|
+
# @param [Object] value Any valid value
|
346
|
+
# @return [Hash] Returns the value in the form of hash
|
347
|
+
def _to_hash(value)
|
348
|
+
if value.is_a?(Array)
|
349
|
+
value.compact.map { |v| _to_hash(v) }
|
350
|
+
elsif value.is_a?(Hash)
|
351
|
+
{}.tap do |hash|
|
352
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
353
|
+
end
|
354
|
+
elsif value.respond_to? :to_hash
|
355
|
+
value.to_hash
|
356
|
+
else
|
357
|
+
value
|
358
|
+
end
|
359
|
+
end
|
360
|
+
end
|
361
|
+
end
|