talon_one 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -4
  3. data/docs/ApplicationSession.md +2 -1
  4. data/docs/Attribute.md +0 -2
  5. data/docs/ErrorSource.md +1 -0
  6. data/docs/Meta.md +1 -0
  7. data/docs/Notification.md +10 -0
  8. data/docs/Notifications.md +7 -0
  9. data/docs/ReferralRejectionReason.md +10 -0
  10. data/docs/UpdateUser.md +1 -0
  11. data/docs/User.md +1 -0
  12. data/docs/Webhook.md +0 -1
  13. data/lib/talon_one.rb +3 -0
  14. data/lib/talon_one/models/application_session.rb +12 -2
  15. data/lib/talon_one/models/attribute.rb +4 -38
  16. data/lib/talon_one/models/coupon_rejection_reason.rb +2 -2
  17. data/lib/talon_one/models/error_source.rb +14 -4
  18. data/lib/talon_one/models/meta.rb +10 -1
  19. data/lib/talon_one/models/notification.rb +219 -0
  20. data/lib/talon_one/models/notifications.rb +174 -0
  21. data/lib/talon_one/models/referral_rejection_reason.rb +251 -0
  22. data/lib/talon_one/models/update_user.rb +13 -4
  23. data/lib/talon_one/models/user.rb +13 -4
  24. data/lib/talon_one/models/webhook.rb +4 -21
  25. data/lib/talon_one/version.rb +1 -1
  26. data/spec/models/application_session_spec.rb +6 -0
  27. data/spec/models/attribute_spec.rb +0 -12
  28. data/spec/models/coupon_rejection_reason_spec.rb +1 -1
  29. data/spec/models/error_source_spec.rb +6 -0
  30. data/spec/models/meta_spec.rb +6 -0
  31. data/spec/models/notification_spec.rb +53 -0
  32. data/spec/models/notifications_spec.rb +35 -0
  33. data/spec/models/referral_rejection_reason_spec.rb +57 -0
  34. data/spec/models/update_user_spec.rb +6 -0
  35. data/spec/models/user_spec.rb +6 -0
  36. data/spec/models/webhook_spec.rb +0 -6
  37. data/talon_one-1.1.2.gem +0 -0
  38. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8dddff4255fff87364a365197e0d5689fb2d67e
4
- data.tar.gz: 7064f60371ade8c050b03ec07a91105831f5a4b3
3
+ metadata.gz: 3f39c6a8fc2964f76caaa933c5e03ab0e8f033cd
4
+ data.tar.gz: a37e870cf423a03aa685077b2334005028f8bfd8
5
5
  SHA512:
6
- metadata.gz: b290d2b10e5503255658fe788aa6cefc707c5ce3b1c70375ca898914ce3bf4c491d8b004955f30afa0ba674840157ec7ed6046989697b1bd7797d125fd7371c4
7
- data.tar.gz: af957c86655992704903cd89b6d98a812882f818ddab287c20f2296805e1eeaae44fe0d0ebac385d1fb481d02442cce966386d4ba55ef1dfa66ad8f0e606f88e
6
+ metadata.gz: 4d069d80d1cbe17ae87373a9d430f832c61b630dd33d7609a4fe0f8e990290d65c75cb1ecaf978a8caef4f293bc6f6c263f2ca7d0d460dcfecb0241d4017f39d
7
+ data.tar.gz: c78ba793510c2ad7b4d414077a74a1f950f5c7ebb1053d50dfc40c5935e878a5c5b5862d5fc6ec58ce042588baa0fae694c217225dbe0045723cea0a9d461aa0
data/README.md CHANGED
@@ -7,7 +7,7 @@ The Talon.One API is used to manage applications and campaigns, as well as to in
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 1.0.0
10
- - Package version: 1.1.2
10
+ - Package version: 1.2.0
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build talon_one.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./talon_one-1.1.2.gem
26
+ gem install ./talon_one-1.2.0.gem
27
27
  ```
28
- (for development, run `gem install --dev ./talon_one-1.1.2.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./talon_one-1.2.0.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'talon_one', '~> 1.1.2'
34
+ gem 'talon_one', '~> 1.2.0'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -362,7 +362,10 @@ Class | Method | HTTP request | Description
362
362
  - [TalonOne::NewTemplateDef](docs/NewTemplateDef.md)
363
363
  - [TalonOne::NewUser](docs/NewUser.md)
364
364
  - [TalonOne::NewWebhook](docs/NewWebhook.md)
365
+ - [TalonOne::Notification](docs/Notification.md)
366
+ - [TalonOne::Notifications](docs/Notifications.md)
365
367
  - [TalonOne::Referral](docs/Referral.md)
368
+ - [TalonOne::ReferralRejectionReason](docs/ReferralRejectionReason.md)
366
369
  - [TalonOne::Role](docs/Role.md)
367
370
  - [TalonOne::RoleAssign](docs/RoleAssign.md)
368
371
  - [TalonOne::RoleMembership](docs/RoleMembership.md)
@@ -9,10 +9,11 @@ Name | Type | Description | Notes
9
9
  **profile_id** | **Integer** | The globally unique Talon.One ID of the customer that created this entity. | [optional]
10
10
  **integration_id** | **String** | The ID used for this entity in the application system. |
11
11
  **coupon** | **String** | Any coupon code entered. |
12
- **referral** | **String** | Any referal code entered. |
12
+ **referral** | **String** | Any referral code entered. |
13
13
  **state** | **String** | Indicating if the customer session is in progress (\"open\"), \"closed\", or \"cancelled\". |
14
14
  **cart_items** | [**Array<CartItem>**](CartItem.md) | Serialized JSON representation. |
15
15
  **discounts** | **Hash<String, Float>** | A map of labelled discount values, in the same currency as the session. |
16
+ **total** | **Float** | The total sum of the session before any discounts applied. | [optional]
16
17
  **attributes** | **Object** | Arbitrary properties associated with this item | [optional]
17
18
 
18
19
 
@@ -14,7 +14,5 @@ Name | Type | Description | Notes
14
14
  **description** | **String** | A description of this attribute. |
15
15
  **suggestions** | **Array<String>** | A list of suggestions for the attribute. |
16
16
  **editable** | **BOOLEAN** | Whether or not this attribute can be edited. |
17
- **locked** | **BOOLEAN** | Indicates whether this attribute is in use. If in use only title can be changed and other operations are prohibited. | [default to false]
18
- **used_at** | **Array<String>** | array of rulesets where the attribute is used |
19
17
 
20
18
 
@@ -6,5 +6,6 @@ Name | Type | Description | Notes
6
6
  **pointer** | **String** | Pointer to the path in the payload that caused this error. | [optional]
7
7
  **parameter** | **String** | Query parameter that caused this error. | [optional]
8
8
  **line** | **String** | Line number in uploaded multipart file that caused this error. 'N/A' if unknown. | [optional]
9
+ **resource** | **String** | Pointer to the resource that caused this error | [optional]
9
10
 
10
11
 
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
6
6
  **campaigns** | **Object** | Maps each evaluated campaign ID to a key-value list of that campaigns attributes. Campaigns without attributes will be omitted. | [optional]
7
7
  **coupons** | **Object** | Maps the coupon value to a key-value list of that coupons attributes. | [optional]
8
8
  **coupon_rejection_reason** | [**CouponRejectionReason**](CouponRejectionReason.md) | | [optional]
9
+ **referral_rejection_reason** | [**ReferralRejectionReason**](ReferralRejectionReason.md) | | [optional]
9
10
  **warnings** | **Object** | | [optional]
10
11
 
11
12
 
@@ -0,0 +1,10 @@
1
+ # TalonOne::Notification
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | id of the notification |
7
+ **name** | **String** | name of the notification |
8
+ **description** | **String** | description of the notification |
9
+
10
+
@@ -0,0 +1,7 @@
1
+ # TalonOne::Notifications
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,10 @@
1
+ # TalonOne::ReferralRejectionReason
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **campaign_id** | **Integer** | |
7
+ **referral_id** | **Integer** | |
8
+ **reason** | **String** | |
9
+
10
+
@@ -12,5 +12,6 @@ Name | Type | Description | Notes
12
12
  **release_update** | **BOOLEAN** | Update the user via email | [optional]
13
13
  **latest_feature** | **String** | The latest feature you've been notified. | [optional]
14
14
  **roles** | **Array<Integer>** | Update | [optional]
15
+ **application_notification_subscriptions** | **Object** | | [optional]
15
16
 
16
17
 
@@ -15,5 +15,6 @@ Name | Type | Description | Notes
15
15
  **release_update** | **BOOLEAN** | Update the user via email |
16
16
  **latest_feature** | **String** | Latest feature the user has been notified. | [optional]
17
17
  **roles** | **Array<Integer>** | Contains a list of all roles a user is a memeber of | [optional]
18
+ **application_notification_subscriptions** | **Object** | | [optional]
18
19
 
19
20
 
@@ -14,6 +14,5 @@ Name | Type | Description | Notes
14
14
  **payload** | **String** | API payload (supports templating using parameters) for this webhook | [optional]
15
15
  **params** | [**Array<TemplateArgDef>**](TemplateArgDef.md) | Array of template argument definitions |
16
16
  **enabled** | **BOOLEAN** | Enables or disables webhook from showing in rule builder |
17
- **used_at** | **Array<String>** | array of rulesets where webhook is used |
18
17
 
19
18
 
@@ -152,7 +152,10 @@ require 'talon_one/models/new_ruleset'
152
152
  require 'talon_one/models/new_template_def'
153
153
  require 'talon_one/models/new_user'
154
154
  require 'talon_one/models/new_webhook'
155
+ require 'talon_one/models/notification'
156
+ require 'talon_one/models/notifications'
155
157
  require 'talon_one/models/referral'
158
+ require 'talon_one/models/referral_rejection_reason'
156
159
  require 'talon_one/models/role'
157
160
  require 'talon_one/models/role_assign'
158
161
  require 'talon_one/models/role_membership'
@@ -33,7 +33,7 @@ module TalonOne
33
33
  # Any coupon code entered.
34
34
  attr_accessor :coupon
35
35
 
36
- # Any referal code entered.
36
+ # Any referral code entered.
37
37
  attr_accessor :referral
38
38
 
39
39
  # Indicating if the customer session is in progress (\"open\"), \"closed\", or \"cancelled\".
@@ -45,6 +45,9 @@ module TalonOne
45
45
  # A map of labelled discount values, in the same currency as the session.
46
46
  attr_accessor :discounts
47
47
 
48
+ # The total sum of the session before any discounts applied.
49
+ attr_accessor :total
50
+
48
51
  # Arbitrary properties associated with this item
49
52
  attr_accessor :attributes
50
53
 
@@ -83,6 +86,7 @@ module TalonOne
83
86
  :'state' => :'state',
84
87
  :'cart_items' => :'cartItems',
85
88
  :'discounts' => :'discounts',
89
+ :'total' => :'total',
86
90
  :'attributes' => :'attributes'
87
91
  }
88
92
  end
@@ -100,6 +104,7 @@ module TalonOne
100
104
  :'state' => :'String',
101
105
  :'cart_items' => :'Array<CartItem>',
102
106
  :'discounts' => :'Hash<String, Float>',
107
+ :'total' => :'Float',
103
108
  :'attributes' => :'Object'
104
109
  }
105
110
  end
@@ -156,6 +161,10 @@ module TalonOne
156
161
  end
157
162
  end
158
163
 
164
+ if attributes.has_key?(:'total')
165
+ self.total = attributes[:'total']
166
+ end
167
+
159
168
  if attributes.has_key?(:'attributes')
160
169
  self.attributes = attributes[:'attributes']
161
170
  end
@@ -246,6 +255,7 @@ module TalonOne
246
255
  state == o.state &&
247
256
  cart_items == o.cart_items &&
248
257
  discounts == o.discounts &&
258
+ total == o.total &&
249
259
  attributes == o.attributes
250
260
  end
251
261
 
@@ -258,7 +268,7 @@ module TalonOne
258
268
  # Calculates hash code according to all attributes.
259
269
  # @return [Fixnum] Hash code
260
270
  def hash
261
- [id, created, application_id, profile_id, integration_id, coupon, referral, state, cart_items, discounts, attributes].hash
271
+ [id, created, application_id, profile_id, integration_id, coupon, referral, state, cart_items, discounts, total, attributes].hash
262
272
  end
263
273
 
264
274
  # Builds the object from hash
@@ -47,12 +47,6 @@ module TalonOne
47
47
  # Whether or not this attribute can be edited.
48
48
  attr_accessor :editable
49
49
 
50
- # Indicates whether this attribute is in use. If in use only title can be changed and other operations are prohibited.
51
- attr_accessor :locked
52
-
53
- # array of rulesets where the attribute is used
54
- attr_accessor :used_at
55
-
56
50
  class EnumAttributeValidator
57
51
  attr_reader :datatype
58
52
  attr_reader :allowable_values
@@ -88,9 +82,7 @@ module TalonOne
88
82
  :'type' => :'type',
89
83
  :'description' => :'description',
90
84
  :'suggestions' => :'suggestions',
91
- :'editable' => :'editable',
92
- :'locked' => :'locked',
93
- :'used_at' => :'usedAt'
85
+ :'editable' => :'editable'
94
86
  }
95
87
  end
96
88
 
@@ -107,9 +99,7 @@ module TalonOne
107
99
  :'type' => :'String',
108
100
  :'description' => :'String',
109
101
  :'suggestions' => :'Array<String>',
110
- :'editable' => :'BOOLEAN',
111
- :'locked' => :'BOOLEAN',
112
- :'used_at' => :'Array<String>'
102
+ :'editable' => :'BOOLEAN'
113
103
  }
114
104
  end
115
105
 
@@ -166,18 +156,6 @@ module TalonOne
166
156
  if attributes.has_key?(:'editable')
167
157
  self.editable = attributes[:'editable']
168
158
  end
169
-
170
- if attributes.has_key?(:'locked')
171
- self.locked = attributes[:'locked']
172
- else
173
- self.locked = false
174
- end
175
-
176
- if attributes.has_key?(:'usedAt')
177
- if (value = attributes[:'usedAt']).is_a?(Array)
178
- self.used_at = value
179
- end
180
- end
181
159
  end
182
160
 
183
161
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -224,14 +202,6 @@ module TalonOne
224
202
  invalid_properties.push('invalid value for "editable", editable cannot be nil.')
225
203
  end
226
204
 
227
- if @locked.nil?
228
- invalid_properties.push('invalid value for "locked", locked cannot be nil.')
229
- end
230
-
231
- if @used_at.nil?
232
- invalid_properties.push('invalid value for "used_at", used_at cannot be nil.')
233
- end
234
-
235
205
  invalid_properties
236
206
  end
237
207
 
@@ -252,8 +222,6 @@ module TalonOne
252
222
  return false if @description.nil?
253
223
  return false if @suggestions.nil?
254
224
  return false if @editable.nil?
255
- return false if @locked.nil?
256
- return false if @used_at.nil?
257
225
  true
258
226
  end
259
227
 
@@ -292,9 +260,7 @@ module TalonOne
292
260
  type == o.type &&
293
261
  description == o.description &&
294
262
  suggestions == o.suggestions &&
295
- editable == o.editable &&
296
- locked == o.locked &&
297
- used_at == o.used_at
263
+ editable == o.editable
298
264
  end
299
265
 
300
266
  # @see the `==` method
@@ -306,7 +272,7 @@ module TalonOne
306
272
  # Calculates hash code according to all attributes.
307
273
  # @return [Fixnum] Hash code
308
274
  def hash
309
- [id, created, account_id, entity, event_type, name, title, type, description, suggestions, editable, locked, used_at].hash
275
+ [id, created, account_id, entity, event_type, name, title, type, description, suggestions, editable].hash
310
276
  end
311
277
 
312
278
  # Builds the object from hash
@@ -107,7 +107,7 @@ module TalonOne
107
107
  return false if @campaign_id.nil?
108
108
  return false if @coupon_id.nil?
109
109
  return false if @reason.nil?
110
- reason_validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition'])
110
+ reason_validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponValidConditionMissing', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition', 'EffectCouldNotBeApplied'])
111
111
  return false unless reason_validator.valid?(@reason)
112
112
  true
113
113
  end
@@ -115,7 +115,7 @@ module TalonOne
115
115
  # Custom attribute writer method checking allowed values (enum).
116
116
  # @param [Object] reason Object to be assigned
117
117
  def reason=(reason)
118
- validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition'])
118
+ validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponValidConditionMissing', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition', 'EffectCouldNotBeApplied'])
119
119
  unless validator.valid?(reason)
120
120
  fail ArgumentError, 'invalid value for "reason", must be one of #{validator.allowable_values}.'
121
121
  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
@@ -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
@@ -0,0 +1,219 @@
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 Notification
17
+ # id of the notification
18
+ attr_accessor :id
19
+
20
+ # name of the notification
21
+ attr_accessor :name
22
+
23
+ # description of the notification
24
+ attr_accessor :description
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'name' => :'name',
31
+ :'description' => :'description'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'id' => :'Integer',
39
+ :'name' => :'String',
40
+ :'description' => :'String'
41
+ }
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ return unless attributes.is_a?(Hash)
48
+
49
+ # convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
51
+
52
+ if attributes.has_key?(:'id')
53
+ self.id = attributes[:'id']
54
+ end
55
+
56
+ if attributes.has_key?(:'name')
57
+ self.name = attributes[:'name']
58
+ end
59
+
60
+ if attributes.has_key?(:'description')
61
+ self.description = attributes[:'description']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @id.nil?
70
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
71
+ end
72
+
73
+ if @name.nil?
74
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
75
+ end
76
+
77
+ if @description.nil?
78
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @id.nil?
88
+ return false if @name.nil?
89
+ return false if @description.nil?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ id == o.id &&
99
+ name == o.name &&
100
+ description == o.description
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [id, name, description].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :BOOLEAN
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ temp_model = TalonOne.const_get(type).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+ end
219
+ end