fastcomments 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/client/README.md +27 -0
  3. data/client/docs/APIComment.md +1 -1
  4. data/client/docs/APICommentBase.md +1 -1
  5. data/client/docs/APICommentBaseMeta.md +20 -0
  6. data/client/docs/APITicket.md +34 -0
  7. data/client/docs/APITicketDetail.md +42 -0
  8. data/client/docs/APITicketFile.md +36 -0
  9. data/client/docs/APIUserSubscription.md +2 -0
  10. data/client/docs/ChangeTicketState200Response.md +34 -0
  11. data/client/docs/ChangeTicketStateBody.md +18 -0
  12. data/client/docs/ChangeTicketStateResponse.md +20 -0
  13. data/client/docs/CommentData.md +3 -1
  14. data/client/docs/CreateAPIUserSubscriptionData.md +2 -0
  15. data/client/docs/CreateCommentParams.md +2 -0
  16. data/client/docs/CreateTenantPackageBody.md +2 -0
  17. data/client/docs/CreateTicket200Response.md +34 -0
  18. data/client/docs/CreateTicketBody.md +18 -0
  19. data/client/docs/CreateTicketResponse.md +20 -0
  20. data/client/docs/CustomConfigParameters.md +21 -1
  21. data/client/docs/DefaultApi.md +384 -0
  22. data/client/docs/FComment.md +3 -1
  23. data/client/docs/FCommentMeta.md +2 -0
  24. data/client/docs/GetTicket200Response.md +36 -0
  25. data/client/docs/GetTicketResponse.md +22 -0
  26. data/client/docs/GetTickets200Response.md +34 -0
  27. data/client/docs/GetTicketsResponse.md +20 -0
  28. data/client/docs/HeaderAccountNotification.md +34 -0
  29. data/client/docs/HeaderState.md +3 -1
  30. data/client/docs/MentionAutoCompleteMode.md +15 -0
  31. data/client/docs/Moderator.md +3 -1
  32. data/client/docs/PublicApi.md +3 -1
  33. data/client/docs/ReplaceTenantPackageBody.md +2 -0
  34. data/client/docs/SearchUsers200Response.md +2 -0
  35. data/client/docs/SearchUsersSectionedResponse.md +20 -0
  36. data/client/docs/TOSConfig.md +22 -0
  37. data/client/docs/TenantPackage.md +4 -0
  38. data/client/docs/UpdatableCommentParams.md +1 -1
  39. data/client/docs/UpdateAPIUserSubscriptionData.md +18 -0
  40. data/client/docs/UpdateSubscriptionAPIResponse.md +24 -0
  41. data/client/docs/UpdateTenantPackageBody.md +2 -0
  42. data/client/docs/User.md +17 -1
  43. data/client/docs/UserBadge.md +3 -1
  44. data/client/docs/UserBadgeProgress.md +3 -1
  45. data/client/docs/UserSearchSection.md +15 -0
  46. data/client/docs/UserSearchSectionResult.md +20 -0
  47. data/client/docs/UserSessionInfo.md +2 -0
  48. data/client/lib/fastcomments-client/api/default_api.rb +383 -0
  49. data/client/lib/fastcomments-client/api/public_api.rb +7 -0
  50. data/client/lib/fastcomments-client/models/api_comment.rb +1 -1
  51. data/client/lib/fastcomments-client/models/api_comment_base.rb +1 -1
  52. data/client/lib/fastcomments-client/models/api_comment_base_meta.rb +156 -0
  53. data/client/lib/fastcomments-client/models/api_ticket.rb +374 -0
  54. data/client/lib/fastcomments-client/models/api_ticket_detail.rb +432 -0
  55. data/client/lib/fastcomments-client/models/api_ticket_file.rb +381 -0
  56. data/client/lib/fastcomments-client/models/api_user_subscription.rb +10 -1
  57. data/client/lib/fastcomments-client/models/change_ticket_state200_response.rb +103 -0
  58. data/client/lib/fastcomments-client/models/change_ticket_state_body.rb +164 -0
  59. data/client/lib/fastcomments-client/models/change_ticket_state_response.rb +212 -0
  60. data/client/lib/fastcomments-client/models/comment_data.rb +13 -4
  61. data/client/lib/fastcomments-client/models/create_api_user_subscription_data.rb +10 -1
  62. data/client/lib/fastcomments-client/models/create_comment_params.rb +10 -1
  63. data/client/lib/fastcomments-client/models/create_tenant_package_body.rb +10 -1
  64. data/client/lib/fastcomments-client/models/create_ticket200_response.rb +103 -0
  65. data/client/lib/fastcomments-client/models/create_ticket_body.rb +164 -0
  66. data/client/lib/fastcomments-client/models/create_ticket_response.rb +212 -0
  67. data/client/lib/fastcomments-client/models/custom_config_parameters.rb +97 -4
  68. data/client/lib/fastcomments-client/models/f_comment.rb +13 -4
  69. data/client/lib/fastcomments-client/models/f_comment_meta.rb +10 -1
  70. data/client/lib/fastcomments-client/models/get_ticket200_response.rb +103 -0
  71. data/client/lib/fastcomments-client/models/get_ticket_response.rb +240 -0
  72. data/client/lib/fastcomments-client/models/get_tickets200_response.rb +103 -0
  73. data/client/lib/fastcomments-client/models/get_tickets_response.rb +214 -0
  74. data/client/lib/fastcomments-client/models/header_account_notification.rb +322 -0
  75. data/client/lib/fastcomments-client/models/header_state.rb +32 -4
  76. data/client/lib/fastcomments-client/models/mention_auto_complete_mode.rb +41 -0
  77. data/client/lib/fastcomments-client/models/moderator.rb +14 -5
  78. data/client/lib/fastcomments-client/models/replace_tenant_package_body.rb +10 -1
  79. data/client/lib/fastcomments-client/models/search_users200_response.rb +2 -1
  80. data/client/lib/fastcomments-client/models/search_users_sectioned_response.rb +214 -0
  81. data/client/lib/fastcomments-client/models/tenant_package.rb +36 -1
  82. data/client/lib/fastcomments-client/models/tos_config.rb +168 -0
  83. data/client/lib/fastcomments-client/models/updatable_comment_params.rb +1 -1
  84. data/client/lib/fastcomments-client/models/update_api_user_subscription_data.rb +147 -0
  85. data/client/lib/fastcomments-client/models/update_subscription_api_response.rb +191 -0
  86. data/client/lib/fastcomments-client/models/update_tenant_package_body.rb +10 -1
  87. data/client/lib/fastcomments-client/models/user.rb +76 -4
  88. data/client/lib/fastcomments-client/models/user_badge.rb +14 -4
  89. data/client/lib/fastcomments-client/models/user_badge_progress.rb +13 -4
  90. data/client/lib/fastcomments-client/models/user_search_section.rb +41 -0
  91. data/client/lib/fastcomments-client/models/user_search_section_result.rb +214 -0
  92. data/client/lib/fastcomments-client/models/user_session_info.rb +10 -1
  93. data/client/lib/fastcomments-client.rb +22 -0
  94. data/client/spec/api/default_api_spec.rb +64 -0
  95. data/client/spec/api/public_api_spec.rb +1 -0
  96. data/client/spec/models/api_comment_base_meta_spec.rb +42 -0
  97. data/client/spec/models/api_ticket_detail_spec.rb +108 -0
  98. data/client/spec/models/api_ticket_file_spec.rb +90 -0
  99. data/client/spec/models/api_ticket_spec.rb +84 -0
  100. data/client/spec/models/api_user_subscription_spec.rb +6 -0
  101. data/client/spec/models/change_ticket_state200_response_spec.rb +21 -0
  102. data/client/spec/models/change_ticket_state_body_spec.rb +36 -0
  103. data/client/spec/models/change_ticket_state_response_spec.rb +42 -0
  104. data/client/spec/models/comment_data_spec.rb +6 -0
  105. data/client/spec/models/create_api_user_subscription_data_spec.rb +6 -0
  106. data/client/spec/models/create_comment_params_spec.rb +6 -0
  107. data/client/spec/models/create_tenant_package_body_spec.rb +6 -0
  108. data/client/spec/models/create_ticket200_response_spec.rb +21 -0
  109. data/client/spec/models/create_ticket_body_spec.rb +36 -0
  110. data/client/spec/models/create_ticket_response_spec.rb +42 -0
  111. data/client/spec/models/custom_config_parameters_spec.rb +60 -0
  112. data/client/spec/models/f_comment_meta_spec.rb +6 -0
  113. data/client/spec/models/f_comment_spec.rb +6 -0
  114. data/client/spec/models/get_ticket200_response_spec.rb +21 -0
  115. data/client/spec/models/get_ticket_response_spec.rb +48 -0
  116. data/client/spec/models/get_tickets200_response_spec.rb +21 -0
  117. data/client/spec/models/get_tickets_response_spec.rb +42 -0
  118. data/client/spec/models/header_account_notification_spec.rb +84 -0
  119. data/client/spec/models/header_state_spec.rb +6 -0
  120. data/client/spec/models/mention_auto_complete_mode_spec.rb +30 -0
  121. data/client/spec/models/moderator_spec.rb +6 -0
  122. data/client/spec/models/replace_tenant_package_body_spec.rb +6 -0
  123. data/client/spec/models/search_users_sectioned_response_spec.rb +42 -0
  124. data/client/spec/models/tenant_package_spec.rb +12 -0
  125. data/client/spec/models/tos_config_spec.rb +48 -0
  126. data/client/spec/models/update_api_user_subscription_data_spec.rb +36 -0
  127. data/client/spec/models/update_subscription_api_response_spec.rb +54 -0
  128. data/client/spec/models/update_tenant_package_body_spec.rb +6 -0
  129. data/client/spec/models/user_badge_progress_spec.rb +6 -0
  130. data/client/spec/models/user_badge_spec.rb +6 -0
  131. data/client/spec/models/user_search_section_result_spec.rb +42 -0
  132. data/client/spec/models/user_search_section_spec.rb +30 -0
  133. data/client/spec/models/user_session_info_spec.rb +6 -0
  134. data/client/spec/models/user_spec.rb +48 -0
  135. data/lib/fastcomments.rb +1 -1
  136. metadata +68 -2
@@ -0,0 +1,381 @@
1
+ =begin
2
+ #fastcomments
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FastCommentsClient
17
+ class APITicketFile < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :s3_key
21
+
22
+ attr_accessor :original_file_name
23
+
24
+ attr_accessor :size_bytes
25
+
26
+ attr_accessor :content_type
27
+
28
+ attr_accessor :uploaded_by_user_id
29
+
30
+ attr_accessor :uploaded_at
31
+
32
+ attr_accessor :url
33
+
34
+ attr_accessor :expires_at
35
+
36
+ attr_accessor :expired
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'s3_key' => :'s3Key',
43
+ :'original_file_name' => :'originalFileName',
44
+ :'size_bytes' => :'sizeBytes',
45
+ :'content_type' => :'contentType',
46
+ :'uploaded_by_user_id' => :'uploadedByUserId',
47
+ :'uploaded_at' => :'uploadedAt',
48
+ :'url' => :'url',
49
+ :'expires_at' => :'expiresAt',
50
+ :'expired' => :'expired'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'id' => :'String',
68
+ :'s3_key' => :'String',
69
+ :'original_file_name' => :'String',
70
+ :'size_bytes' => :'Integer',
71
+ :'content_type' => :'String',
72
+ :'uploaded_by_user_id' => :'String',
73
+ :'uploaded_at' => :'String',
74
+ :'url' => :'String',
75
+ :'expires_at' => :'String',
76
+ :'expired' => :'Boolean'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FastCommentsClient::APITicketFile` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FastCommentsClient::APITicketFile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ else
105
+ self.id = nil
106
+ end
107
+
108
+ if attributes.key?(:'s3_key')
109
+ self.s3_key = attributes[:'s3_key']
110
+ else
111
+ self.s3_key = nil
112
+ end
113
+
114
+ if attributes.key?(:'original_file_name')
115
+ self.original_file_name = attributes[:'original_file_name']
116
+ else
117
+ self.original_file_name = nil
118
+ end
119
+
120
+ if attributes.key?(:'size_bytes')
121
+ self.size_bytes = attributes[:'size_bytes']
122
+ else
123
+ self.size_bytes = nil
124
+ end
125
+
126
+ if attributes.key?(:'content_type')
127
+ self.content_type = attributes[:'content_type']
128
+ else
129
+ self.content_type = nil
130
+ end
131
+
132
+ if attributes.key?(:'uploaded_by_user_id')
133
+ self.uploaded_by_user_id = attributes[:'uploaded_by_user_id']
134
+ else
135
+ self.uploaded_by_user_id = nil
136
+ end
137
+
138
+ if attributes.key?(:'uploaded_at')
139
+ self.uploaded_at = attributes[:'uploaded_at']
140
+ else
141
+ self.uploaded_at = nil
142
+ end
143
+
144
+ if attributes.key?(:'url')
145
+ self.url = attributes[:'url']
146
+ else
147
+ self.url = nil
148
+ end
149
+
150
+ if attributes.key?(:'expires_at')
151
+ self.expires_at = attributes[:'expires_at']
152
+ else
153
+ self.expires_at = nil
154
+ end
155
+
156
+ if attributes.key?(:'expired')
157
+ self.expired = attributes[:'expired']
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
165
+ invalid_properties = Array.new
166
+ if @id.nil?
167
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
168
+ end
169
+
170
+ if @s3_key.nil?
171
+ invalid_properties.push('invalid value for "s3_key", s3_key cannot be nil.')
172
+ end
173
+
174
+ if @original_file_name.nil?
175
+ invalid_properties.push('invalid value for "original_file_name", original_file_name cannot be nil.')
176
+ end
177
+
178
+ if @size_bytes.nil?
179
+ invalid_properties.push('invalid value for "size_bytes", size_bytes cannot be nil.')
180
+ end
181
+
182
+ if @content_type.nil?
183
+ invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
184
+ end
185
+
186
+ if @uploaded_by_user_id.nil?
187
+ invalid_properties.push('invalid value for "uploaded_by_user_id", uploaded_by_user_id cannot be nil.')
188
+ end
189
+
190
+ if @uploaded_at.nil?
191
+ invalid_properties.push('invalid value for "uploaded_at", uploaded_at cannot be nil.')
192
+ end
193
+
194
+ if @url.nil?
195
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
196
+ end
197
+
198
+ if @expires_at.nil?
199
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
200
+ end
201
+
202
+ invalid_properties
203
+ end
204
+
205
+ # Check to see if the all the properties in the model are valid
206
+ # @return true if the model is valid
207
+ def valid?
208
+ warn '[DEPRECATED] the `valid?` method is obsolete'
209
+ return false if @id.nil?
210
+ return false if @s3_key.nil?
211
+ return false if @original_file_name.nil?
212
+ return false if @size_bytes.nil?
213
+ return false if @content_type.nil?
214
+ return false if @uploaded_by_user_id.nil?
215
+ return false if @uploaded_at.nil?
216
+ return false if @url.nil?
217
+ return false if @expires_at.nil?
218
+ true
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] id Value to be assigned
223
+ def id=(id)
224
+ if id.nil?
225
+ fail ArgumentError, 'id cannot be nil'
226
+ end
227
+
228
+ @id = id
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] s3_key Value to be assigned
233
+ def s3_key=(s3_key)
234
+ if s3_key.nil?
235
+ fail ArgumentError, 's3_key cannot be nil'
236
+ end
237
+
238
+ @s3_key = s3_key
239
+ end
240
+
241
+ # Custom attribute writer method with validation
242
+ # @param [Object] original_file_name Value to be assigned
243
+ def original_file_name=(original_file_name)
244
+ if original_file_name.nil?
245
+ fail ArgumentError, 'original_file_name cannot be nil'
246
+ end
247
+
248
+ @original_file_name = original_file_name
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] size_bytes Value to be assigned
253
+ def size_bytes=(size_bytes)
254
+ if size_bytes.nil?
255
+ fail ArgumentError, 'size_bytes cannot be nil'
256
+ end
257
+
258
+ @size_bytes = size_bytes
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] content_type Value to be assigned
263
+ def content_type=(content_type)
264
+ if content_type.nil?
265
+ fail ArgumentError, 'content_type cannot be nil'
266
+ end
267
+
268
+ @content_type = content_type
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] uploaded_by_user_id Value to be assigned
273
+ def uploaded_by_user_id=(uploaded_by_user_id)
274
+ if uploaded_by_user_id.nil?
275
+ fail ArgumentError, 'uploaded_by_user_id cannot be nil'
276
+ end
277
+
278
+ @uploaded_by_user_id = uploaded_by_user_id
279
+ end
280
+
281
+ # Custom attribute writer method with validation
282
+ # @param [Object] uploaded_at Value to be assigned
283
+ def uploaded_at=(uploaded_at)
284
+ if uploaded_at.nil?
285
+ fail ArgumentError, 'uploaded_at cannot be nil'
286
+ end
287
+
288
+ @uploaded_at = uploaded_at
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] url Value to be assigned
293
+ def url=(url)
294
+ if url.nil?
295
+ fail ArgumentError, 'url cannot be nil'
296
+ end
297
+
298
+ @url = url
299
+ end
300
+
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] expires_at Value to be assigned
303
+ def expires_at=(expires_at)
304
+ if expires_at.nil?
305
+ fail ArgumentError, 'expires_at cannot be nil'
306
+ end
307
+
308
+ @expires_at = expires_at
309
+ end
310
+
311
+ # Checks equality by comparing each attribute.
312
+ # @param [Object] Object to be compared
313
+ def ==(o)
314
+ return true if self.equal?(o)
315
+ self.class == o.class &&
316
+ id == o.id &&
317
+ s3_key == o.s3_key &&
318
+ original_file_name == o.original_file_name &&
319
+ size_bytes == o.size_bytes &&
320
+ content_type == o.content_type &&
321
+ uploaded_by_user_id == o.uploaded_by_user_id &&
322
+ uploaded_at == o.uploaded_at &&
323
+ url == o.url &&
324
+ expires_at == o.expires_at &&
325
+ expired == o.expired
326
+ end
327
+
328
+ # @see the `==` method
329
+ # @param [Object] Object to be compared
330
+ def eql?(o)
331
+ self == o
332
+ end
333
+
334
+ # Calculates hash code according to all attributes.
335
+ # @return [Integer] Hash code
336
+ def hash
337
+ [id, s3_key, original_file_name, size_bytes, content_type, uploaded_by_user_id, uploaded_at, url, expires_at, expired].hash
338
+ end
339
+
340
+ # Builds the object from hash
341
+ # @param [Hash] attributes Model attributes in the form of hash
342
+ # @return [Object] Returns the model itself
343
+ def self.build_from_hash(attributes)
344
+ return nil unless attributes.is_a?(Hash)
345
+ attributes = attributes.transform_keys(&:to_sym)
346
+ transformed_hash = {}
347
+ openapi_types.each_pair do |key, type|
348
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
349
+ transformed_hash["#{key}"] = nil
350
+ elsif type =~ /\AArray<(.*)>/i
351
+ # check to ensure the input is an array given that the attribute
352
+ # is documented as an array but the input is not
353
+ if attributes[attribute_map[key]].is_a?(Array)
354
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
355
+ end
356
+ elsif !attributes[attribute_map[key]].nil?
357
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
358
+ end
359
+ end
360
+ new(transformed_hash)
361
+ end
362
+
363
+ # Returns the object in the form of hash
364
+ # @return [Hash] Returns the object in the form of hash
365
+ def to_hash
366
+ hash = {}
367
+ self.class.attribute_map.each_pair do |attr, param|
368
+ value = self.send(attr)
369
+ if value.nil?
370
+ is_nullable = self.class.openapi_nullable.include?(attr)
371
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
372
+ end
373
+
374
+ hash[param] = _to_hash(value)
375
+ end
376
+ hash
377
+ end
378
+
379
+ end
380
+
381
+ end
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module FastCommentsClient
17
17
  class APIUserSubscription < ApiModelBase
18
+ attr_accessor :notification_frequency
19
+
18
20
  attr_accessor :created_at
19
21
 
20
22
  attr_accessor :page_title
@@ -32,6 +34,7 @@ module FastCommentsClient
32
34
  # Attribute mapping from ruby-style variable name to JSON key.
33
35
  def self.attribute_map
34
36
  {
37
+ :'notification_frequency' => :'notificationFrequency',
35
38
  :'created_at' => :'createdAt',
36
39
  :'page_title' => :'pageTitle',
37
40
  :'url' => :'url',
@@ -55,6 +58,7 @@ module FastCommentsClient
55
58
  # Attribute type mapping.
56
59
  def self.openapi_types
57
60
  {
61
+ :'notification_frequency' => :'Float',
58
62
  :'created_at' => :'Time',
59
63
  :'page_title' => :'String',
60
64
  :'url' => :'String',
@@ -87,6 +91,10 @@ module FastCommentsClient
87
91
  h[k.to_sym] = v
88
92
  }
89
93
 
94
+ if attributes.key?(:'notification_frequency')
95
+ self.notification_frequency = attributes[:'notification_frequency']
96
+ end
97
+
90
98
  if attributes.key?(:'created_at')
91
99
  self.created_at = attributes[:'created_at']
92
100
  else
@@ -187,6 +195,7 @@ module FastCommentsClient
187
195
  def ==(o)
188
196
  return true if self.equal?(o)
189
197
  self.class == o.class &&
198
+ notification_frequency == o.notification_frequency &&
190
199
  created_at == o.created_at &&
191
200
  page_title == o.page_title &&
192
201
  url == o.url &&
@@ -205,7 +214,7 @@ module FastCommentsClient
205
214
  # Calculates hash code according to all attributes.
206
215
  # @return [Integer] Hash code
207
216
  def hash
208
- [created_at, page_title, url, url_id, anon_user_id, user_id, id].hash
217
+ [notification_frequency, created_at, page_title, url, url_id, anon_user_id, user_id, id].hash
209
218
  end
210
219
 
211
220
  # Builds the object from hash
@@ -0,0 +1,103 @@
1
+ =begin
2
+ #fastcomments
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FastCommentsClient
17
+ module ChangeTicketState200Response
18
+ class << self
19
+ # List of class defined in anyOf (OpenAPI v3)
20
+ def openapi_any_of
21
+ [
22
+ :'APIError',
23
+ :'ChangeTicketStateResponse'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of anyOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
34
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
35
+ # - TODO: scalar values are de facto behaving as if they were nullable.
36
+ # - TODO: logging when debugging is set.
37
+ openapi_any_of.each do |klass|
38
+ begin
39
+ next if klass == :AnyType # "nullable: true"
40
+ return find_and_cast_into_type(klass, data)
41
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
42
+ end
43
+ end
44
+
45
+ openapi_any_of.include?(:AnyType) ? data : nil
46
+ end
47
+
48
+ private
49
+
50
+ SchemaMismatchError = Class.new(StandardError)
51
+
52
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
53
+ def find_and_cast_into_type(klass, data)
54
+ return if data.nil?
55
+
56
+ case klass.to_s
57
+ when 'Boolean'
58
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
59
+ when 'Float'
60
+ return data if data.instance_of?(Float)
61
+ when 'Integer'
62
+ return data if data.instance_of?(Integer)
63
+ when 'Time'
64
+ return Time.parse(data)
65
+ when 'Date'
66
+ return Date.iso8601(data)
67
+ when 'String'
68
+ return data if data.instance_of?(String)
69
+ when 'Object' # "type: object"
70
+ return data if data.instance_of?(Hash)
71
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
72
+ if data.instance_of?(Array)
73
+ sub_type = Regexp.last_match[:sub_type]
74
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
75
+ end
76
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
77
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
78
+ sub_type = Regexp.last_match[:sub_type]
79
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
80
+ end
81
+ else # model
82
+ const = FastCommentsClient.const_get(klass)
83
+ if const
84
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
85
+ model = const.build(data)
86
+ return model if model
87
+ else
88
+ # raise if data contains keys that are not known to the model
89
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
+ model = const.build_from_hash(data)
91
+ return model if model
92
+ end
93
+ end
94
+ end
95
+
96
+ raise # if no match by now, raise
97
+ rescue
98
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
99
+ end
100
+ end
101
+ end
102
+
103
+ end
@@ -0,0 +1,164 @@
1
+ =begin
2
+ #fastcomments
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 0.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FastCommentsClient
17
+ class ChangeTicketStateBody < ApiModelBase
18
+ attr_accessor :state
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'state' => :'state'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'state' => :'Integer'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FastCommentsClient::ChangeTicketStateBody` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FastCommentsClient::ChangeTicketStateBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'state')
67
+ self.state = attributes[:'state']
68
+ else
69
+ self.state = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @state.nil?
79
+ invalid_properties.push('invalid value for "state", state 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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @state.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] state Value to be assigned
95
+ def state=(state)
96
+ if state.nil?
97
+ fail ArgumentError, 'state cannot be nil'
98
+ end
99
+
100
+ @state = state
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ state == o.state
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [state].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end