seatschart 0.3.0 → 0.5.0

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +79 -11
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/auth_api.rb +85 -8
  5. data/lib/seatschart/api/billing_api.rb +93 -8
  6. data/lib/seatschart/api/charts_api.rb +63 -63
  7. data/lib/seatschart/api/events_api.rb +130 -124
  8. data/lib/seatschart/api/public_api.rb +6 -6
  9. data/lib/seatschart/api/seasons_api.rb +88 -88
  10. data/lib/seatschart/api/seats_api.rb +6 -6
  11. data/lib/seatschart/api/usage_api.rb +4 -4
  12. data/lib/seatschart/api/workspace_api.rb +1229 -51
  13. data/lib/seatschart/models/{api_error.rb → api_error_body.rb} +7 -7
  14. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +237 -0
  15. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_members_by_user_id200_response.rb +221 -0
  16. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +50 -4
  17. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response.rb +239 -0
  18. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response_invitations_inner.rb +286 -0
  19. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response.rb +239 -0
  20. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner.rb +321 -0
  21. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response.rb +239 -0
  22. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response_members_inner.rb +288 -0
  23. data/lib/seatschart/models/get_api_workspaces_overview200_response.rb +288 -0
  24. data/lib/seatschart/models/get_api_workspaces_overview200_response_account.rb +270 -0
  25. data/lib/seatschart/models/get_api_workspaces_overview200_response_account_charts.rb +233 -0
  26. data/lib/seatschart/models/get_api_workspaces_overview200_response_account_plan.rb +237 -0
  27. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner.rb +439 -0
  28. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_revenue.rb +234 -0
  29. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_usage.rb +271 -0
  30. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats.rb +431 -0
  31. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_overage.rb +233 -0
  32. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_projected.rb +237 -0
  33. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals.rb +318 -0
  34. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_revenue.rb +238 -0
  35. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_seats.rb +253 -0
  36. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +15 -15
  37. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +221 -0
  38. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request.rb +292 -0
  39. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_request.rb +288 -0
  40. data/lib/seatschart/models/post_api_auth_new_workspace_request.rb +294 -0
  41. data/lib/seatschart/models/post_api_billing_actions_change_plan_request.rb +256 -0
  42. data/lib/seatschart/models/post_api_events_by_event_id_actions_update_extra_data_request_objects_inner.rb +0 -2
  43. data/lib/seatschart/models/post_api_sandboxes201_response.rb +0 -4
  44. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +0 -2
  45. data/lib/seatschart/models/post_api_workspaces200_response.rb +464 -0
  46. data/lib/seatschart/models/post_api_workspaces200_response_api_key.rb +332 -0
  47. data/lib/seatschart/models/post_api_workspaces200_response_template.rb +260 -0
  48. data/lib/seatschart/models/post_api_workspaces200_response_template_webhooks_inner.rb +284 -0
  49. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response.rb +319 -0
  50. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request.rb +281 -0
  51. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response.rb +238 -0
  52. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response_invitation.rb +286 -0
  53. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations_request.rb +300 -0
  54. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response.rb +237 -0
  55. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key.rb +338 -0
  56. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys_request.rb +299 -0
  57. data/lib/seatschart/models/post_api_workspaces_request.rb +100 -4
  58. data/lib/seatschart/models/post_api_workspaces_request_issue_key.rb +294 -0
  59. data/lib/seatschart/version.rb +1 -1
  60. data/lib/seatschart/workspaces.rb +172 -0
  61. data/lib/seatschart.rb +41 -2
  62. metadata +43 -4
  63. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +0 -349
@@ -0,0 +1,464 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SeatsChart
17
+ class PostApiWorkspaces200Response
18
+ # Id of the new workspace (also its `workspaceId`).
19
+ attr_accessor :tenant_id
20
+
21
+ attr_accessor :display_name
22
+
23
+ # Public renderer key (`pub_…`): not a secret, not a credential.
24
+ attr_accessor :public_key
25
+
26
+ attr_accessor :role
27
+
28
+ attr_accessor :is_test
29
+
30
+ attr_accessor :kind
31
+
32
+ attr_accessor :parent_workspace_id
33
+
34
+ attr_accessor :copied_charts
35
+
36
+ attr_accessor :external_id
37
+
38
+ # Provisioned by a workspace admin key: billed to the platform account, no upgrade prompts for the organizer.
39
+ attr_accessor :created_by_api
40
+
41
+ attr_accessor :template_workspace_id
42
+
43
+ attr_accessor :template
44
+
45
+ attr_accessor :api_key
46
+
47
+ # True when this is the stored result of an earlier call with the same Idempotency-Key (secrets are null).
48
+ attr_accessor :idempotent_replay
49
+
50
+ attr_accessor :warning
51
+
52
+ class EnumAttributeValidator
53
+ attr_reader :datatype
54
+ attr_reader :allowable_values
55
+
56
+ def initialize(datatype, allowable_values)
57
+ @allowable_values = allowable_values.map do |value|
58
+ case datatype.to_s
59
+ when /Integer/i
60
+ value.to_i
61
+ when /Float/i
62
+ value.to_f
63
+ else
64
+ value
65
+ end
66
+ end
67
+ end
68
+
69
+ def valid?(value)
70
+ !value || allowable_values.include?(value)
71
+ end
72
+ end
73
+
74
+ # Attribute mapping from ruby-style variable name to JSON key.
75
+ def self.attribute_map
76
+ {
77
+ :'tenant_id' => :'tenantId',
78
+ :'display_name' => :'displayName',
79
+ :'public_key' => :'publicKey',
80
+ :'role' => :'role',
81
+ :'is_test' => :'isTest',
82
+ :'kind' => :'kind',
83
+ :'parent_workspace_id' => :'parentWorkspaceId',
84
+ :'copied_charts' => :'copiedCharts',
85
+ :'external_id' => :'externalId',
86
+ :'created_by_api' => :'createdByApi',
87
+ :'template_workspace_id' => :'templateWorkspaceId',
88
+ :'template' => :'template',
89
+ :'api_key' => :'apiKey',
90
+ :'idempotent_replay' => :'idempotentReplay',
91
+ :'warning' => :'warning'
92
+ }
93
+ end
94
+
95
+ # Returns all the JSON keys this model knows about
96
+ def self.acceptable_attributes
97
+ attribute_map.values
98
+ end
99
+
100
+ # Attribute type mapping.
101
+ def self.openapi_types
102
+ {
103
+ :'tenant_id' => :'String',
104
+ :'display_name' => :'String',
105
+ :'public_key' => :'String',
106
+ :'role' => :'String',
107
+ :'is_test' => :'Boolean',
108
+ :'kind' => :'String',
109
+ :'parent_workspace_id' => :'String',
110
+ :'copied_charts' => :'Integer',
111
+ :'external_id' => :'String',
112
+ :'created_by_api' => :'Boolean',
113
+ :'template_workspace_id' => :'String',
114
+ :'template' => :'PostApiWorkspaces200ResponseTemplate',
115
+ :'api_key' => :'PostApiWorkspaces200ResponseApiKey',
116
+ :'idempotent_replay' => :'Boolean',
117
+ :'warning' => :'String'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ :'parent_workspace_id',
125
+ :'external_id',
126
+ :'template_workspace_id',
127
+ :'template',
128
+ :'api_key',
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiWorkspaces200Response` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}) { |(k, v), h|
141
+ if (!self.class.attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiWorkspaces200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
+ end
144
+ h[k.to_sym] = v
145
+ }
146
+
147
+ if attributes.key?(:'tenant_id')
148
+ self.tenant_id = attributes[:'tenant_id']
149
+ else
150
+ self.tenant_id = nil
151
+ end
152
+
153
+ if attributes.key?(:'display_name')
154
+ self.display_name = attributes[:'display_name']
155
+ else
156
+ self.display_name = nil
157
+ end
158
+
159
+ if attributes.key?(:'public_key')
160
+ self.public_key = attributes[:'public_key']
161
+ else
162
+ self.public_key = nil
163
+ end
164
+
165
+ if attributes.key?(:'role')
166
+ self.role = attributes[:'role']
167
+ else
168
+ self.role = nil
169
+ end
170
+
171
+ if attributes.key?(:'is_test')
172
+ self.is_test = attributes[:'is_test']
173
+ else
174
+ self.is_test = nil
175
+ end
176
+
177
+ if attributes.key?(:'kind')
178
+ self.kind = attributes[:'kind']
179
+ else
180
+ self.kind = nil
181
+ end
182
+
183
+ if attributes.key?(:'parent_workspace_id')
184
+ self.parent_workspace_id = attributes[:'parent_workspace_id']
185
+ else
186
+ self.parent_workspace_id = nil
187
+ end
188
+
189
+ if attributes.key?(:'copied_charts')
190
+ self.copied_charts = attributes[:'copied_charts']
191
+ else
192
+ self.copied_charts = nil
193
+ end
194
+
195
+ if attributes.key?(:'external_id')
196
+ self.external_id = attributes[:'external_id']
197
+ else
198
+ self.external_id = nil
199
+ end
200
+
201
+ if attributes.key?(:'created_by_api')
202
+ self.created_by_api = attributes[:'created_by_api']
203
+ else
204
+ self.created_by_api = nil
205
+ end
206
+
207
+ if attributes.key?(:'template_workspace_id')
208
+ self.template_workspace_id = attributes[:'template_workspace_id']
209
+ else
210
+ self.template_workspace_id = nil
211
+ end
212
+
213
+ if attributes.key?(:'template')
214
+ self.template = attributes[:'template']
215
+ end
216
+
217
+ if attributes.key?(:'api_key')
218
+ self.api_key = attributes[:'api_key']
219
+ end
220
+
221
+ if attributes.key?(:'idempotent_replay')
222
+ self.idempotent_replay = attributes[:'idempotent_replay']
223
+ else
224
+ self.idempotent_replay = nil
225
+ end
226
+
227
+ if attributes.key?(:'warning')
228
+ self.warning = attributes[:'warning']
229
+ end
230
+ end
231
+
232
+ # Show invalid properties with the reasons. Usually used together with valid?
233
+ # @return Array for valid properties with the reasons
234
+ def list_invalid_properties
235
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
236
+ invalid_properties = Array.new
237
+ if @tenant_id.nil?
238
+ invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
239
+ end
240
+
241
+ if @display_name.nil?
242
+ invalid_properties.push('invalid value for "display_name", display_name cannot be nil.')
243
+ end
244
+
245
+ if @public_key.nil?
246
+ invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
247
+ end
248
+
249
+ if @role.nil?
250
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
251
+ end
252
+
253
+ if @is_test.nil?
254
+ invalid_properties.push('invalid value for "is_test", is_test cannot be nil.')
255
+ end
256
+
257
+ if @kind.nil?
258
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
259
+ end
260
+
261
+ if @copied_charts.nil?
262
+ invalid_properties.push('invalid value for "copied_charts", copied_charts cannot be nil.')
263
+ end
264
+
265
+ if @created_by_api.nil?
266
+ invalid_properties.push('invalid value for "created_by_api", created_by_api cannot be nil.')
267
+ end
268
+
269
+ if @idempotent_replay.nil?
270
+ invalid_properties.push('invalid value for "idempotent_replay", idempotent_replay cannot be nil.')
271
+ end
272
+
273
+ invalid_properties
274
+ end
275
+
276
+ # Check to see if the all the properties in the model are valid
277
+ # @return true if the model is valid
278
+ def valid?
279
+ warn '[DEPRECATED] the `valid?` method is obsolete'
280
+ return false if @tenant_id.nil?
281
+ return false if @display_name.nil?
282
+ return false if @public_key.nil?
283
+ return false if @role.nil?
284
+ role_validator = EnumAttributeValidator.new('String', ["admin"])
285
+ return false unless role_validator.valid?(@role)
286
+ return false if @is_test.nil?
287
+ return false if @kind.nil?
288
+ kind_validator = EnumAttributeValidator.new('String', ["production", "sandbox"])
289
+ return false unless kind_validator.valid?(@kind)
290
+ return false if @copied_charts.nil?
291
+ return false if @created_by_api.nil?
292
+ return false if @idempotent_replay.nil?
293
+ true
294
+ end
295
+
296
+ # Custom attribute writer method checking allowed values (enum).
297
+ # @param [Object] role Object to be assigned
298
+ def role=(role)
299
+ validator = EnumAttributeValidator.new('String', ["admin"])
300
+ unless validator.valid?(role)
301
+ fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
302
+ end
303
+ @role = role
304
+ end
305
+
306
+ # Custom attribute writer method checking allowed values (enum).
307
+ # @param [Object] kind Object to be assigned
308
+ def kind=(kind)
309
+ validator = EnumAttributeValidator.new('String', ["production", "sandbox"])
310
+ unless validator.valid?(kind)
311
+ fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
312
+ end
313
+ @kind = kind
314
+ end
315
+
316
+ # Checks equality by comparing each attribute.
317
+ # @param [Object] Object to be compared
318
+ def ==(o)
319
+ return true if self.equal?(o)
320
+ self.class == o.class &&
321
+ tenant_id == o.tenant_id &&
322
+ display_name == o.display_name &&
323
+ public_key == o.public_key &&
324
+ role == o.role &&
325
+ is_test == o.is_test &&
326
+ kind == o.kind &&
327
+ parent_workspace_id == o.parent_workspace_id &&
328
+ copied_charts == o.copied_charts &&
329
+ external_id == o.external_id &&
330
+ created_by_api == o.created_by_api &&
331
+ template_workspace_id == o.template_workspace_id &&
332
+ template == o.template &&
333
+ api_key == o.api_key &&
334
+ idempotent_replay == o.idempotent_replay &&
335
+ warning == o.warning
336
+ end
337
+
338
+ # @see the `==` method
339
+ # @param [Object] Object to be compared
340
+ def eql?(o)
341
+ self == o
342
+ end
343
+
344
+ # Calculates hash code according to all attributes.
345
+ # @return [Integer] Hash code
346
+ def hash
347
+ [tenant_id, display_name, public_key, role, is_test, kind, parent_workspace_id, copied_charts, external_id, created_by_api, template_workspace_id, template, api_key, idempotent_replay, warning].hash
348
+ end
349
+
350
+ # Builds the object from hash
351
+ # @param [Hash] attributes Model attributes in the form of hash
352
+ # @return [Object] Returns the model itself
353
+ def self.build_from_hash(attributes)
354
+ return nil unless attributes.is_a?(Hash)
355
+ attributes = attributes.transform_keys(&:to_sym)
356
+ transformed_hash = {}
357
+ openapi_types.each_pair do |key, type|
358
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
359
+ transformed_hash["#{key}"] = nil
360
+ elsif type =~ /\AArray<(.*)>/i
361
+ # check to ensure the input is an array given that the attribute
362
+ # is documented as an array but the input is not
363
+ if attributes[attribute_map[key]].is_a?(Array)
364
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
365
+ end
366
+ elsif !attributes[attribute_map[key]].nil?
367
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
368
+ end
369
+ end
370
+ new(transformed_hash)
371
+ end
372
+
373
+ # Deserializes the data based on type
374
+ # @param string type Data type
375
+ # @param string value Value to be deserialized
376
+ # @return [Object] Deserialized data
377
+ def self._deserialize(type, value)
378
+ case type.to_sym
379
+ when :Time
380
+ Time.parse(value)
381
+ when :Date
382
+ Date.parse(value)
383
+ when :String
384
+ value.to_s
385
+ when :Integer
386
+ value.to_i
387
+ when :Float
388
+ value.to_f
389
+ when :Boolean
390
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
391
+ true
392
+ else
393
+ false
394
+ end
395
+ when :Object
396
+ # generic object (usually a Hash), return directly
397
+ value
398
+ when /\AArray<(?<inner_type>.+)>\z/
399
+ inner_type = Regexp.last_match[:inner_type]
400
+ value.map { |v| _deserialize(inner_type, v) }
401
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
402
+ k_type = Regexp.last_match[:k_type]
403
+ v_type = Regexp.last_match[:v_type]
404
+ {}.tap do |hash|
405
+ value.each do |k, v|
406
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
407
+ end
408
+ end
409
+ else # model
410
+ # models (e.g. Pet) or oneOf
411
+ klass = SeatsChart.const_get(type)
412
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
413
+ end
414
+ end
415
+
416
+ # Returns the string representation of the object
417
+ # @return [String] String presentation of the object
418
+ def to_s
419
+ to_hash.to_s
420
+ end
421
+
422
+ # to_body is an alias to to_hash (backward compatibility)
423
+ # @return [Hash] Returns the object in the form of hash
424
+ def to_body
425
+ to_hash
426
+ end
427
+
428
+ # Returns the object in the form of hash
429
+ # @return [Hash] Returns the object in the form of hash
430
+ def to_hash
431
+ hash = {}
432
+ self.class.attribute_map.each_pair do |attr, param|
433
+ value = self.send(attr)
434
+ if value.nil?
435
+ is_nullable = self.class.openapi_nullable.include?(attr)
436
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
437
+ end
438
+
439
+ hash[param] = _to_hash(value)
440
+ end
441
+ hash
442
+ end
443
+
444
+ # Outputs non-array value in the form of hash
445
+ # For object, use to_hash. Otherwise, just return the value
446
+ # @param [Object] value Any valid value
447
+ # @return [Hash] Returns the value in the form of hash
448
+ def _to_hash(value)
449
+ if value.is_a?(Array)
450
+ value.compact.map { |v| _to_hash(v) }
451
+ elsif value.is_a?(Hash)
452
+ {}.tap do |hash|
453
+ value.each { |k, v| hash[k] = _to_hash(v) }
454
+ end
455
+ elsif value.respond_to? :to_hash
456
+ value.to_hash
457
+ else
458
+ value
459
+ end
460
+ end
461
+
462
+ end
463
+
464
+ end