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.
Files changed (143) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +21 -12
  3. data/docs/AccountAnalytics.md +1 -0
  4. data/docs/AccountLimits.md +1 -0
  5. data/docs/Application.md +2 -1
  6. data/docs/ApplicationCustomer.md +1 -1
  7. data/docs/ApplicationSession.md +2 -1
  8. data/docs/Attribute.md +0 -2
  9. data/docs/AttributesMandatory.md +9 -0
  10. data/docs/AttributesSettings.md +8 -0
  11. data/docs/BaseSamlConnection.md +15 -0
  12. data/docs/Campaign.md +2 -0
  13. data/docs/CampaignAnalytics.md +9 -3
  14. data/docs/CampaignCopy.md +4 -0
  15. data/docs/Change.md +2 -2
  16. data/docs/CustomerInventory.md +9 -0
  17. data/docs/CustomerProfile.md +1 -1
  18. data/docs/ErrorSource.md +1 -0
  19. data/docs/Event.md +1 -1
  20. data/docs/InlineResponse20020.md +1 -1
  21. data/docs/InlineResponse20021.md +1 -1
  22. data/docs/InlineResponse20022.md +1 -1
  23. data/docs/InlineResponse20023.md +1 -1
  24. data/docs/InlineResponse20024.md +1 -1
  25. data/docs/InlineResponse20025.md +1 -1
  26. data/docs/InlineResponse20026.md +3 -2
  27. data/docs/InlineResponse20027.md +1 -1
  28. data/docs/InlineResponse20028.md +1 -1
  29. data/docs/InlineResponse20029.md +9 -0
  30. data/docs/IntegrationApi.md +66 -0
  31. data/docs/IntegrationEvent.md +10 -0
  32. data/docs/IntegrationState.md +1 -0
  33. data/docs/ManagementApi.md +175 -104
  34. data/docs/Meta.md +1 -0
  35. data/docs/NewApplication.md +2 -1
  36. data/docs/NewEvent.md +1 -1
  37. data/docs/NewSamlConnection.md +16 -0
  38. data/docs/Notification.md +10 -0
  39. data/docs/{ApplicationStorageData.md → Notifications.md} +1 -1
  40. data/docs/ReferralRejectionReason.md +10 -0
  41. data/docs/SamlConnection.md +18 -0
  42. data/docs/SamlConnectionMetadata.md +11 -0
  43. data/docs/UpdateApplication.md +15 -0
  44. data/docs/UpdateUser.md +1 -0
  45. data/docs/User.md +2 -0
  46. data/docs/Webhook.md +0 -1
  47. data/lib/talon_one.rb +13 -6
  48. data/lib/talon_one/api/integration_api.rb +60 -0
  49. data/lib/talon_one/api/management_api.rb +194 -121
  50. data/lib/talon_one/models/account_analytics.rb +19 -4
  51. data/lib/talon_one/models/account_limits.rb +11 -1
  52. data/lib/talon_one/models/application.rb +62 -53
  53. data/lib/talon_one/models/application_customer.rb +0 -5
  54. data/lib/talon_one/models/application_session.rb +12 -2
  55. data/lib/talon_one/models/attribute.rb +4 -38
  56. data/lib/talon_one/models/attributes_mandatory.rb +199 -0
  57. data/lib/talon_one/models/{new_application_storage_data.rb → attributes_settings.rb} +13 -4
  58. data/lib/talon_one/models/{application_storage.rb → base_saml_connection.rb} +122 -78
  59. data/lib/talon_one/models/campaign.rb +21 -1
  60. data/lib/talon_one/models/campaign_analytics.rb +94 -4
  61. data/lib/talon_one/models/campaign_copy.rb +46 -4
  62. data/lib/talon_one/models/change.rb +2 -2
  63. data/lib/talon_one/models/coupon_rejection_reason.rb +2 -2
  64. data/lib/talon_one/models/customer_inventory.rb +194 -0
  65. data/lib/talon_one/models/customer_profile.rb +0 -5
  66. data/lib/talon_one/models/error_source.rb +14 -4
  67. data/lib/talon_one/models/event.rb +11 -35
  68. data/lib/talon_one/models/inline_response_200_20.rb +1 -1
  69. data/lib/talon_one/models/inline_response_200_21.rb +1 -1
  70. data/lib/talon_one/models/inline_response_200_22.rb +1 -1
  71. data/lib/talon_one/models/inline_response_200_23.rb +1 -1
  72. data/lib/talon_one/models/inline_response_200_24.rb +1 -1
  73. data/lib/talon_one/models/inline_response_200_25.rb +1 -1
  74. data/lib/talon_one/models/inline_response_200_26.rb +11 -7
  75. data/lib/talon_one/models/inline_response_200_27.rb +1 -1
  76. data/lib/talon_one/models/inline_response_200_28.rb +1 -1
  77. data/lib/talon_one/models/{new_application_storage_tuple.rb → inline_response_200_29.rb} +22 -40
  78. data/lib/talon_one/models/integration_event.rb +234 -0
  79. data/lib/talon_one/models/integration_state.rb +13 -4
  80. data/lib/talon_one/models/limit_config.rb +2 -2
  81. data/lib/talon_one/models/meta.rb +10 -1
  82. data/lib/talon_one/models/new_application.rb +57 -56
  83. data/lib/talon_one/models/new_event.rb +38 -38
  84. data/lib/talon_one/models/new_saml_connection.rb +371 -0
  85. data/lib/talon_one/models/{new_application_storage.rb → notification.rb} +22 -17
  86. data/lib/talon_one/models/{application_storage_data.rb → notifications.rb} +1 -2
  87. data/lib/talon_one/models/referral_rejection_reason.rb +251 -0
  88. data/lib/talon_one/models/saml_connection.rb +387 -0
  89. data/lib/talon_one/models/{application_storage_tuple.rb → saml_connection_metadata.rb} +68 -80
  90. data/lib/talon_one/models/update_application.rb +361 -0
  91. data/lib/talon_one/models/update_user.rb +13 -4
  92. data/lib/talon_one/models/user.rb +23 -4
  93. data/lib/talon_one/models/webhook.rb +4 -21
  94. data/lib/talon_one/version.rb +1 -1
  95. data/spec/api/integration_api_spec.rb +14 -0
  96. data/spec/api/management_api_spec.rb +56 -37
  97. data/spec/models/account_analytics_spec.rb +6 -0
  98. data/spec/models/account_limits_spec.rb +6 -0
  99. data/spec/models/application_session_spec.rb +6 -0
  100. data/spec/models/application_spec.rb +12 -6
  101. data/spec/models/attribute_spec.rb +0 -12
  102. data/spec/models/{new_application_storage_tuple_spec.rb → attributes_mandatory_spec.rb} +8 -8
  103. data/spec/models/{new_application_storage_data_spec.rb → attributes_settings_spec.rb} +12 -6
  104. data/spec/models/{application_storage_spec.rb → base_saml_connection_spec.rb} +14 -14
  105. data/spec/models/campaign_analytics_spec.rb +36 -0
  106. data/spec/models/campaign_copy_spec.rb +24 -0
  107. data/spec/models/campaign_spec.rb +12 -0
  108. data/spec/models/coupon_rejection_reason_spec.rb +1 -1
  109. data/spec/models/customer_inventory_spec.rb +47 -0
  110. data/spec/models/error_source_spec.rb +6 -0
  111. data/spec/models/event_spec.rb +3 -3
  112. data/spec/models/inline_response_200_26_spec.rb +6 -0
  113. data/spec/models/inline_response_200_29_spec.rb +47 -0
  114. data/spec/models/integration_event_spec.rb +53 -0
  115. data/spec/models/integration_state_spec.rb +6 -0
  116. data/spec/models/limit_config_spec.rb +1 -1
  117. data/spec/models/meta_spec.rb +6 -0
  118. data/spec/models/new_application_spec.rb +12 -6
  119. data/spec/models/new_event_spec.rb +3 -3
  120. data/spec/models/new_saml_connection_spec.rb +89 -0
  121. data/spec/models/{new_application_storage_spec.rb → notification_spec.rb} +8 -8
  122. data/spec/models/{application_storage_data_spec.rb → notifications_spec.rb} +6 -6
  123. data/spec/models/referral_rejection_reason_spec.rb +57 -0
  124. data/spec/models/{application_storage_tuple_spec.rb → saml_connection_metadata_spec.rb} +10 -22
  125. data/spec/models/saml_connection_spec.rb +101 -0
  126. data/spec/models/update_application_spec.rb +87 -0
  127. data/spec/models/update_user_spec.rb +6 -0
  128. data/spec/models/user_spec.rb +12 -0
  129. data/spec/models/webhook_spec.rb +0 -6
  130. data/talon_one-1.0.0.gem +0 -0
  131. data/talon_one-1.1.0.gem +0 -0
  132. data/talon_one-1.1.1.gem +0 -0
  133. data/talon_one-1.1.2.gem +0 -0
  134. data/talon_one-1.2.0.gem +0 -0
  135. data/talon_one-1.3.0.gem +0 -0
  136. data/talon_one.gemspec +1 -1
  137. metadata +74 -42
  138. data/docs/ApplicationStorage.md +0 -15
  139. data/docs/ApplicationStorageTuple.md +0 -13
  140. data/docs/NewApplicationStorage.md +0 -10
  141. data/docs/NewApplicationStorageData.md +0 -7
  142. data/docs/NewApplicationStorageTuple.md +0 -9
  143. data/fck.rb +0 -64
@@ -18,22 +18,22 @@ module TalonOne
18
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
19
  attr_accessor :profile_id
20
20
 
21
- # The ID of the session that this event occurred in.
22
- attr_accessor :session_id
23
-
24
21
  # A string representing the event. Must not be a reserved event name.
25
22
  attr_accessor :type
26
23
 
27
24
  # Arbitrary additional JSON data associated with the event.
28
25
  attr_accessor :attributes
29
26
 
27
+ # The ID of the session that this event occurred in.
28
+ attr_accessor :session_id
29
+
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
31
31
  def self.attribute_map
32
32
  {
33
33
  :'profile_id' => :'profileId',
34
- :'session_id' => :'sessionId',
35
34
  :'type' => :'type',
36
- :'attributes' => :'attributes'
35
+ :'attributes' => :'attributes',
36
+ :'session_id' => :'sessionId'
37
37
  }
38
38
  end
39
39
 
@@ -41,9 +41,9 @@ module TalonOne
41
41
  def self.swagger_types
42
42
  {
43
43
  :'profile_id' => :'String',
44
- :'session_id' => :'String',
45
44
  :'type' => :'String',
46
- :'attributes' => :'Object'
45
+ :'attributes' => :'Object',
46
+ :'session_id' => :'String'
47
47
  }
48
48
  end
49
49
 
@@ -59,10 +59,6 @@ module TalonOne
59
59
  self.profile_id = attributes[:'profileId']
60
60
  end
61
61
 
62
- if attributes.has_key?(:'sessionId')
63
- self.session_id = attributes[:'sessionId']
64
- end
65
-
66
62
  if attributes.has_key?(:'type')
67
63
  self.type = attributes[:'type']
68
64
  end
@@ -70,20 +66,16 @@ module TalonOne
70
66
  if attributes.has_key?(:'attributes')
71
67
  self.attributes = attributes[:'attributes']
72
68
  end
69
+
70
+ if attributes.has_key?(:'sessionId')
71
+ self.session_id = attributes[:'sessionId']
72
+ end
73
73
  end
74
74
 
75
75
  # Show invalid properties with the reasons. Usually used together with valid?
76
76
  # @return Array for valid properties with the reasons
77
77
  def list_invalid_properties
78
78
  invalid_properties = Array.new
79
- if @session_id.nil?
80
- invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
81
- end
82
-
83
- if @session_id.to_s.length < 1
84
- invalid_properties.push('invalid value for "session_id", the character length must be great than or equal to 1.')
85
- end
86
-
87
79
  if @type.nil?
88
80
  invalid_properties.push('invalid value for "type", type cannot be nil.')
89
81
  end
@@ -96,34 +88,28 @@ module TalonOne
96
88
  invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
97
89
  end
98
90
 
91
+ if @session_id.nil?
92
+ invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
93
+ end
94
+
95
+ if @session_id.to_s.length < 1
96
+ invalid_properties.push('invalid value for "session_id", the character length must be great than or equal to 1.')
97
+ end
98
+
99
99
  invalid_properties
100
100
  end
101
101
 
102
102
  # Check to see if the all the properties in the model are valid
103
103
  # @return true if the model is valid
104
104
  def valid?
105
- return false if @session_id.nil?
106
- return false if @session_id.to_s.length < 1
107
105
  return false if @type.nil?
108
106
  return false if @type.to_s.length < 1
109
107
  return false if @attributes.nil?
108
+ return false if @session_id.nil?
109
+ return false if @session_id.to_s.length < 1
110
110
  true
111
111
  end
112
112
 
113
- # Custom attribute writer method with validation
114
- # @param [Object] session_id Value to be assigned
115
- def session_id=(session_id)
116
- if session_id.nil?
117
- fail ArgumentError, 'session_id cannot be nil'
118
- end
119
-
120
- if session_id.to_s.length < 1
121
- fail ArgumentError, 'invalid value for "session_id", the character length must be great than or equal to 1.'
122
- end
123
-
124
- @session_id = session_id
125
- end
126
-
127
113
  # Custom attribute writer method with validation
128
114
  # @param [Object] type Value to be assigned
129
115
  def type=(type)
@@ -138,15 +124,29 @@ module TalonOne
138
124
  @type = type
139
125
  end
140
126
 
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] session_id Value to be assigned
129
+ def session_id=(session_id)
130
+ if session_id.nil?
131
+ fail ArgumentError, 'session_id cannot be nil'
132
+ end
133
+
134
+ if session_id.to_s.length < 1
135
+ fail ArgumentError, 'invalid value for "session_id", the character length must be great than or equal to 1.'
136
+ end
137
+
138
+ @session_id = session_id
139
+ end
140
+
141
141
  # Checks equality by comparing each attribute.
142
142
  # @param [Object] Object to be compared
143
143
  def ==(o)
144
144
  return true if self.equal?(o)
145
145
  self.class == o.class &&
146
146
  profile_id == o.profile_id &&
147
- session_id == o.session_id &&
148
147
  type == o.type &&
149
- attributes == o.attributes
148
+ attributes == o.attributes &&
149
+ session_id == o.session_id
150
150
  end
151
151
 
152
152
  # @see the `==` method
@@ -158,7 +158,7 @@ module TalonOne
158
158
  # Calculates hash code according to all attributes.
159
159
  # @return [Fixnum] Hash code
160
160
  def hash
161
- [profile_id, session_id, type, attributes].hash
161
+ [profile_id, type, attributes, session_id].hash
162
162
  end
163
163
 
164
164
  # Builds the object from hash
@@ -0,0 +1,371 @@
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 NewSamlConnection
18
+ # X.509 Certificate.
19
+ attr_accessor :x509certificate
20
+
21
+ # The ID of the account that owns this entity.
22
+ attr_accessor :account_id
23
+
24
+ # ID of the SAML service.
25
+ attr_accessor :name
26
+
27
+ # Determines if this SAML connection active.
28
+ attr_accessor :enabled
29
+
30
+ # Identity Provider Entity ID.
31
+ attr_accessor :issuer
32
+
33
+ # Single Sign-On URL.
34
+ attr_accessor :sign_on_url
35
+
36
+ # Single Sign-Out URL.
37
+ attr_accessor :sign_out_url
38
+
39
+ # Metadata URL.
40
+ attr_accessor :metadata_url
41
+
42
+ # The application-defined unique identifier that is the intended audience of the SAML assertion. This is most often the SP Entity ID of your application. When not specified, the ACS URL will be used.
43
+ attr_accessor :audience_uri
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'x509certificate' => :'x509certificate',
49
+ :'account_id' => :'accountId',
50
+ :'name' => :'name',
51
+ :'enabled' => :'enabled',
52
+ :'issuer' => :'issuer',
53
+ :'sign_on_url' => :'signOnURL',
54
+ :'sign_out_url' => :'signOutURL',
55
+ :'metadata_url' => :'metadataURL',
56
+ :'audience_uri' => :'audienceURI'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'x509certificate' => :'String',
64
+ :'account_id' => :'Integer',
65
+ :'name' => :'String',
66
+ :'enabled' => :'BOOLEAN',
67
+ :'issuer' => :'String',
68
+ :'sign_on_url' => :'String',
69
+ :'sign_out_url' => :'String',
70
+ :'metadata_url' => :'String',
71
+ :'audience_uri' => :'String'
72
+ }
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ return unless attributes.is_a?(Hash)
79
+
80
+ # convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
82
+
83
+ if attributes.has_key?(:'x509certificate')
84
+ self.x509certificate = attributes[:'x509certificate']
85
+ end
86
+
87
+ if attributes.has_key?(:'accountId')
88
+ self.account_id = attributes[:'accountId']
89
+ end
90
+
91
+ if attributes.has_key?(:'name')
92
+ self.name = attributes[:'name']
93
+ end
94
+
95
+ if attributes.has_key?(:'enabled')
96
+ self.enabled = attributes[:'enabled']
97
+ end
98
+
99
+ if attributes.has_key?(:'issuer')
100
+ self.issuer = attributes[:'issuer']
101
+ end
102
+
103
+ if attributes.has_key?(:'signOnURL')
104
+ self.sign_on_url = attributes[:'signOnURL']
105
+ end
106
+
107
+ if attributes.has_key?(:'signOutURL')
108
+ self.sign_out_url = attributes[:'signOutURL']
109
+ end
110
+
111
+ if attributes.has_key?(:'metadataURL')
112
+ self.metadata_url = attributes[:'metadataURL']
113
+ end
114
+
115
+ if attributes.has_key?(:'audienceURI')
116
+ self.audience_uri = attributes[:'audienceURI']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ if @x509certificate.nil?
125
+ invalid_properties.push('invalid value for "x509certificate", x509certificate cannot be nil.')
126
+ end
127
+
128
+ if @x509certificate.to_s.length < 1
129
+ invalid_properties.push('invalid value for "x509certificate", the character length must be great than or equal to 1.')
130
+ end
131
+
132
+ if @account_id.nil?
133
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
134
+ end
135
+
136
+ if @name.nil?
137
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
138
+ end
139
+
140
+ if @name.to_s.length < 1
141
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
142
+ end
143
+
144
+ if @enabled.nil?
145
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
146
+ end
147
+
148
+ if @issuer.nil?
149
+ invalid_properties.push('invalid value for "issuer", issuer cannot be nil.')
150
+ end
151
+
152
+ if @issuer.to_s.length < 1
153
+ invalid_properties.push('invalid value for "issuer", the character length must be great than or equal to 1.')
154
+ end
155
+
156
+ if @sign_on_url.nil?
157
+ invalid_properties.push('invalid value for "sign_on_url", sign_on_url cannot be nil.')
158
+ end
159
+
160
+ if @sign_on_url.to_s.length < 1
161
+ invalid_properties.push('invalid value for "sign_on_url", the character length must be great than or equal to 1.')
162
+ end
163
+
164
+ invalid_properties
165
+ end
166
+
167
+ # Check to see if the all the properties in the model are valid
168
+ # @return true if the model is valid
169
+ def valid?
170
+ return false if @x509certificate.nil?
171
+ return false if @x509certificate.to_s.length < 1
172
+ return false if @account_id.nil?
173
+ return false if @name.nil?
174
+ return false if @name.to_s.length < 1
175
+ return false if @enabled.nil?
176
+ return false if @issuer.nil?
177
+ return false if @issuer.to_s.length < 1
178
+ return false if @sign_on_url.nil?
179
+ return false if @sign_on_url.to_s.length < 1
180
+ true
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] x509certificate Value to be assigned
185
+ def x509certificate=(x509certificate)
186
+ if x509certificate.nil?
187
+ fail ArgumentError, 'x509certificate cannot be nil'
188
+ end
189
+
190
+ if x509certificate.to_s.length < 1
191
+ fail ArgumentError, 'invalid value for "x509certificate", the character length must be great than or equal to 1.'
192
+ end
193
+
194
+ @x509certificate = x509certificate
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] name Value to be assigned
199
+ def name=(name)
200
+ if name.nil?
201
+ fail ArgumentError, 'name cannot be nil'
202
+ end
203
+
204
+ if name.to_s.length < 1
205
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
206
+ end
207
+
208
+ @name = name
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] issuer Value to be assigned
213
+ def issuer=(issuer)
214
+ if issuer.nil?
215
+ fail ArgumentError, 'issuer cannot be nil'
216
+ end
217
+
218
+ if issuer.to_s.length < 1
219
+ fail ArgumentError, 'invalid value for "issuer", the character length must be great than or equal to 1.'
220
+ end
221
+
222
+ @issuer = issuer
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] sign_on_url Value to be assigned
227
+ def sign_on_url=(sign_on_url)
228
+ if sign_on_url.nil?
229
+ fail ArgumentError, 'sign_on_url cannot be nil'
230
+ end
231
+
232
+ if sign_on_url.to_s.length < 1
233
+ fail ArgumentError, 'invalid value for "sign_on_url", the character length must be great than or equal to 1.'
234
+ end
235
+
236
+ @sign_on_url = sign_on_url
237
+ end
238
+
239
+ # Checks equality by comparing each attribute.
240
+ # @param [Object] Object to be compared
241
+ def ==(o)
242
+ return true if self.equal?(o)
243
+ self.class == o.class &&
244
+ x509certificate == o.x509certificate &&
245
+ account_id == o.account_id &&
246
+ name == o.name &&
247
+ enabled == o.enabled &&
248
+ issuer == o.issuer &&
249
+ sign_on_url == o.sign_on_url &&
250
+ sign_out_url == o.sign_out_url &&
251
+ metadata_url == o.metadata_url &&
252
+ audience_uri == o.audience_uri
253
+ end
254
+
255
+ # @see the `==` method
256
+ # @param [Object] Object to be compared
257
+ def eql?(o)
258
+ self == o
259
+ end
260
+
261
+ # Calculates hash code according to all attributes.
262
+ # @return [Fixnum] Hash code
263
+ def hash
264
+ [x509certificate, account_id, name, enabled, issuer, sign_on_url, sign_out_url, metadata_url, audience_uri].hash
265
+ end
266
+
267
+ # Builds the object from hash
268
+ # @param [Hash] attributes Model attributes in the form of hash
269
+ # @return [Object] Returns the model itself
270
+ def build_from_hash(attributes)
271
+ return nil unless attributes.is_a?(Hash)
272
+ self.class.swagger_types.each_pair do |key, type|
273
+ if type =~ /\AArray<(.*)>/i
274
+ # check to ensure the input is an array given that the the attribute
275
+ # is documented as an array but the input is not
276
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
277
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
278
+ end
279
+ elsif !attributes[self.class.attribute_map[key]].nil?
280
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
281
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
282
+ end
283
+
284
+ self
285
+ end
286
+
287
+ # Deserializes the data based on type
288
+ # @param string type Data type
289
+ # @param string value Value to be deserialized
290
+ # @return [Object] Deserialized data
291
+ def _deserialize(type, value)
292
+ case type.to_sym
293
+ when :DateTime
294
+ DateTime.parse(value)
295
+ when :Date
296
+ Date.parse(value)
297
+ when :String
298
+ value.to_s
299
+ when :Integer
300
+ value.to_i
301
+ when :Float
302
+ value.to_f
303
+ when :BOOLEAN
304
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
305
+ true
306
+ else
307
+ false
308
+ end
309
+ when :Object
310
+ # generic object (usually a Hash), return directly
311
+ value
312
+ when /\AArray<(?<inner_type>.+)>\z/
313
+ inner_type = Regexp.last_match[:inner_type]
314
+ value.map { |v| _deserialize(inner_type, v) }
315
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
316
+ k_type = Regexp.last_match[:k_type]
317
+ v_type = Regexp.last_match[:v_type]
318
+ {}.tap do |hash|
319
+ value.each do |k, v|
320
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
321
+ end
322
+ end
323
+ else # model
324
+ temp_model = TalonOne.const_get(type).new
325
+ temp_model.build_from_hash(value)
326
+ end
327
+ end
328
+
329
+ # Returns the string representation of the object
330
+ # @return [String] String presentation of the object
331
+ def to_s
332
+ to_hash.to_s
333
+ end
334
+
335
+ # to_body is an alias to to_hash (backward compatibility)
336
+ # @return [Hash] Returns the object in the form of hash
337
+ def to_body
338
+ to_hash
339
+ end
340
+
341
+ # Returns the object in the form of hash
342
+ # @return [Hash] Returns the object in the form of hash
343
+ def to_hash
344
+ hash = {}
345
+ self.class.attribute_map.each_pair do |attr, param|
346
+ value = self.send(attr)
347
+ next if value.nil?
348
+ hash[param] = _to_hash(value)
349
+ end
350
+ hash
351
+ end
352
+
353
+ # Outputs non-array value in the form of hash
354
+ # For object, use to_hash. Otherwise, just return the value
355
+ # @param [Object] value Any valid value
356
+ # @return [Hash] Returns the value in the form of hash
357
+ def _to_hash(value)
358
+ if value.is_a?(Array)
359
+ value.compact.map { |v| _to_hash(v) }
360
+ elsif value.is_a?(Hash)
361
+ {}.tap do |hash|
362
+ value.each { |k, v| hash[k] = _to_hash(v) }
363
+ end
364
+ elsif value.respond_to? :to_hash
365
+ value.to_hash
366
+ else
367
+ value
368
+ end
369
+ end
370
+ end
371
+ end