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,294 @@
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
+ # Mint an ordinary API key of the new workspace; its `secret` is returned once in `apiKey`.
18
+ class PostApiWorkspacesRequestIssueKey
19
+ # Key name (default \"Organizer key\").
20
+ attr_accessor :name
21
+
22
+ # Every scope (default when `scopes` is absent). Never a workspace admin key.
23
+ attr_accessor :full_access
24
+
25
+ # Granted scopes when not full access: `read`, `holds`, `bookings`, `inventory_admin`, `charts_write`, `events_write`, `reports`, `webhooks`.
26
+ attr_accessor :scopes
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'name' => :'name',
32
+ :'full_access' => :'fullAccess',
33
+ :'scopes' => :'scopes'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'name' => :'String',
46
+ :'full_access' => :'Boolean',
47
+ :'scopes' => :'Array<String>'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiWorkspacesRequestIssueKey` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiWorkspacesRequestIssueKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'full_access')
77
+ self.full_access = attributes[:'full_access']
78
+ end
79
+
80
+ if attributes.key?(:'scopes')
81
+ if (value = attributes[:'scopes']).is_a?(Array)
82
+ self.scopes = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ if !@name.nil? && @name.to_s.length > 256
93
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 256.')
94
+ end
95
+
96
+ if !@name.nil? && @name.to_s.length < 1
97
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
98
+ end
99
+
100
+ if !@scopes.nil? && @scopes.length > 16
101
+ invalid_properties.push('invalid value for "scopes", number of items must be less than or equal to 16.')
102
+ end
103
+
104
+ if !@scopes.nil? && @scopes.length < 1
105
+ invalid_properties.push('invalid value for "scopes", number of items must be greater than or equal to 1.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if !@name.nil? && @name.to_s.length > 256
116
+ return false if !@name.nil? && @name.to_s.length < 1
117
+ return false if !@scopes.nil? && @scopes.length > 16
118
+ return false if !@scopes.nil? && @scopes.length < 1
119
+ true
120
+ end
121
+
122
+ # Custom attribute writer method with validation
123
+ # @param [Object] name Value to be assigned
124
+ def name=(name)
125
+ if name.nil?
126
+ fail ArgumentError, 'name cannot be nil'
127
+ end
128
+
129
+ if name.to_s.length > 256
130
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
131
+ end
132
+
133
+ if name.to_s.length < 1
134
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
135
+ end
136
+
137
+ @name = name
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] scopes Value to be assigned
142
+ def scopes=(scopes)
143
+ if scopes.nil?
144
+ fail ArgumentError, 'scopes cannot be nil'
145
+ end
146
+
147
+ if scopes.length > 16
148
+ fail ArgumentError, 'invalid value for "scopes", number of items must be less than or equal to 16.'
149
+ end
150
+
151
+ if scopes.length < 1
152
+ fail ArgumentError, 'invalid value for "scopes", number of items must be greater than or equal to 1.'
153
+ end
154
+
155
+ @scopes = scopes
156
+ end
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param [Object] Object to be compared
160
+ def ==(o)
161
+ return true if self.equal?(o)
162
+ self.class == o.class &&
163
+ name == o.name &&
164
+ full_access == o.full_access &&
165
+ scopes == o.scopes
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [name, full_access, scopes].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def self._deserialize(type, value)
208
+ case type.to_sym
209
+ when :Time
210
+ Time.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :Boolean
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ # models (e.g. Pet) or oneOf
241
+ klass = SeatsChart.const_get(type)
242
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+
294
+ end
@@ -11,5 +11,5 @@ Generator version: 7.11.0
11
11
  =end
12
12
 
13
13
  module SeatsChart
14
- VERSION = '0.3.0'
14
+ VERSION = '0.5.0'
15
15
  end
@@ -0,0 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ # One workspace per organizer (ticketing platforms) for the SeatsChart Ruby client.
4
+ # Copied into the generated gem (lib/seatschart/workspaces.rb) and required from lib/seatschart.rb by
5
+ # scripts/generate-server-sdks.sh.
6
+ #
7
+ # A platform operates every organizer workspace it administers with one workspace admin key:
8
+ #
9
+ # org = SeatsChart.for_workspace('org-1042') # every call sends X-Workspace-Key: org-1042
10
+ # SeatsChart::EmbedApi.new(org).post_api_embed_tokens(...)
11
+ # workspaces = SeatsChart::Workspaces.new
12
+ # created = workspaces.create({ displayName: 'Teatro Aurora', externalId: 'org-1042',
13
+ # templateWorkspaceId: 'org-template', issueKey: { name: 'Server key' } },
14
+ # idempotency_key: 'provision-org-1042')
15
+ # workspaces.list_all_overview(created_by_api: true).each { |row| puts row.external_id }
16
+ #
17
+ # Bodies are the generated request models or hashes with the API's JSON field names. Every workspace_id argument also
18
+ # takes the external id you gave the workspace.
19
+ require 'securerandom'
20
+
21
+ module SeatsChart
22
+ WORKSPACE_KEY_HEADER = 'X-Workspace-Key'
23
+
24
+ # A copy of api_client (default: ApiClient.default) whose every call carries X-Workspace-Key and acts exactly as that
25
+ # workspace's own full-access key would (its rate limits, usage and audit trail). The original is unchanged; both
26
+ # share the configuration and the retry policy. Ordinary keys get 403 ERR_WORKSPACE_HEADER_NOT_ALLOWED; a workspace of
27
+ # another account answers 404.
28
+ def self.for_workspace(id_or_external_id, api_client = nil)
29
+ workspace = id_or_external_id.to_s.strip
30
+ raise ArgumentError, 'for_workspace needs a workspace id or external id' if workspace.empty?
31
+
32
+ client = api_client || ApiClient.default
33
+ scoped = client.dup
34
+ scoped.default_headers = client.default_headers.merge(WORKSPACE_KEY_HEADER => workspace)
35
+ scoped
36
+ end
37
+
38
+ # The organizer workspace calls named like the TypeScript SDK (workspaces.create, getByExternalId, keys, members,
39
+ # invitations, overview). The generated WorkspaceApi stays available for every other workspace route.
40
+ class Workspaces
41
+ attr_reader :keys, :members, :invitations
42
+
43
+ def initialize(api_client = nil, api: nil)
44
+ @api = api || WorkspaceApi.new(api_client || ApiClient.default)
45
+ @keys = Keys.new(@api)
46
+ @members = Members.new(@api)
47
+ @invitations = Invitations.new(@api)
48
+ end
49
+
50
+ # POST /api/workspaces: displayName and, for an organizer, externalId, templateWorkspaceId and issueKey. Always
51
+ # sent with an Idempotency-Key (yours, or a fresh one the retries reuse): a replay returns the same workspace with
52
+ # idempotent_replay true and every secret nil.
53
+ def create(body, idempotency_key: nil)
54
+ key = idempotency_key.to_s.strip.empty? ? SecureRandom.uuid : idempotency_key
55
+ @api.post_api_workspaces(Workspaces.model(:PostApiWorkspacesRequest, body), idempotency_key: key)
56
+ end
57
+
58
+ def get(workspace_id)
59
+ @api.get_api_workspaces_by_workspace_id(workspace_id)
60
+ end
61
+
62
+ # The workspace with this external id among the workspaces you belong to (404 otherwise).
63
+ def get_by_external_id(external_id)
64
+ @api.get_api_workspaces_by_external_id_by_external_id(external_id)
65
+ end
66
+
67
+ # Consolidated overview per workspace and in total. Filters: external_id, status, created_by_api, created_from,
68
+ # created_to, month, limit, cursor.
69
+ def overview(**query)
70
+ @api.get_api_workspaces_overview(query)
71
+ end
72
+
73
+ # Every overview item matching the filters, page after page (walks next_cursor). Without a block: an Enumerator.
74
+ def list_all_overview(**query, &block)
75
+ return enum_for(:list_all_overview, **query) unless block
76
+
77
+ query.delete(:cursor)
78
+ cursor = nil
79
+ loop do
80
+ page = overview(**query, **(cursor ? { cursor: cursor } : {}))
81
+ Array(Workspaces.field(page, :items)).each(&block)
82
+ cursor = Workspaces.field(page, :next_cursor)
83
+ break if cursor.nil? || cursor.to_s.empty?
84
+ end
85
+ end
86
+
87
+ # A hash body (JSON field names) becomes the generated model `name`; a model passes through.
88
+ def self.model(name, body)
89
+ return body unless body.is_a?(Hash)
90
+
91
+ SeatsChart.const_get(name).build_from_hash(body)
92
+ end
93
+
94
+ # Reads a field of a generated model (snake_case reader) or a hash (camelCase JSON name or symbol).
95
+ def self.field(value, name)
96
+ return value.public_send(name) if value.respond_to?(name)
97
+ return nil unless value.is_a?(Hash)
98
+
99
+ camel = name.to_s.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
100
+ [name, name.to_s, camel, camel.to_sym].each { |k| return value[k] if value.key?(k) }
101
+ nil
102
+ end
103
+
104
+ # API keys of a workspace you administer (workspace admin keys are read only here).
105
+ class Keys
106
+ def initialize(api)
107
+ @api = api
108
+ end
109
+
110
+ def list(workspace_id)
111
+ @api.get_api_workspaces_by_workspace_id_keys(workspace_id)
112
+ end
113
+
114
+ # New ordinary key (full access by default, or scopes); its secret is returned once.
115
+ def create(workspace_id, body)
116
+ @api.post_api_workspaces_by_workspace_id_keys(workspace_id, Workspaces.model(:PostApiWorkspacesByWorkspaceIdKeysRequest, body))
117
+ end
118
+
119
+ # Renames or rescopes a key (next request).
120
+ def update(workspace_id, key_id, body)
121
+ @api.patch_api_workspaces_by_workspace_id_keys_by_key_id(workspace_id, key_id,
122
+ Workspaces.model(:PatchApiWorkspacesByWorkspaceIdKeysByKeyIdRequest, body))
123
+ end
124
+
125
+ # New secret for the same key (returned once); the old one stops at once.
126
+ def rotate(workspace_id, key_id)
127
+ @api.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate(workspace_id, key_id)
128
+ end
129
+
130
+ def revoke(workspace_id, key_id)
131
+ @api.delete_api_workspaces_by_workspace_id_keys_by_key_id(workspace_id, key_id)
132
+ end
133
+ end
134
+
135
+ # Dashboard members of a workspace you administer.
136
+ class Members
137
+ def initialize(api)
138
+ @api = api
139
+ end
140
+
141
+ def list(workspace_id)
142
+ @api.get_api_workspaces_by_workspace_id_members(workspace_id)
143
+ end
144
+
145
+ # Removes a member (not the last admin, not yourself).
146
+ def remove(workspace_id, user_id)
147
+ @api.delete_api_workspaces_by_workspace_id_members_by_user_id(workspace_id, user_id)
148
+ end
149
+ end
150
+
151
+ # Invitations of an organizer's team to the dashboard of its workspace.
152
+ class Invitations
153
+ def initialize(api)
154
+ @api = api
155
+ end
156
+
157
+ def list(workspace_id)
158
+ @api.get_api_workspaces_by_workspace_id_invitations(workspace_id)
159
+ end
160
+
161
+ # Invites { email:, role: } (admin, map_editor or viewer); invite_token is returned once.
162
+ def create(workspace_id, body)
163
+ @api.post_api_workspaces_by_workspace_id_invitations(workspace_id,
164
+ Workspaces.model(:PostApiWorkspacesByWorkspaceIdInvitationsRequest, body))
165
+ end
166
+
167
+ def revoke(workspace_id, invitation_id)
168
+ @api.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id(workspace_id, invitation_id)
169
+ end
170
+ end
171
+ end
172
+ end
data/lib/seatschart.rb CHANGED
@@ -17,10 +17,12 @@ require 'seatschart/version'
17
17
  require 'seatschart/configuration'
18
18
 
19
19
  # Models
20
- require 'seatschart/models/api_error'
20
+ require 'seatschart/models/api_error_body'
21
21
  require 'seatschart/models/api_error_params_value'
22
22
  require 'seatschart/models/delete_api_sandboxes_by_sandbox_id200_response'
23
23
  require 'seatschart/models/delete_api_workspaces_by_workspace_id200_response'
24
+ require 'seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response'
25
+ require 'seatschart/models/delete_api_workspaces_by_workspace_id_members_by_user_id200_response'
24
26
  require 'seatschart/models/get_api_charts_by_chart_id_versions200_response'
25
27
  require 'seatschart/models/get_api_charts_by_chart_id_versions200_response_items_inner'
26
28
  require 'seatschart/models/get_api_charts_by_chart_id_versions200_response_items_inner_published_by'
@@ -58,6 +60,25 @@ require 'seatschart/models/get_api_workspace_settings200_response_overrides'
58
60
  require 'seatschart/models/get_api_workspace_settings200_response_sources'
59
61
  require 'seatschart/models/get_api_workspaces200_response'
60
62
  require 'seatschart/models/get_api_workspaces200_response_items_inner'
63
+ require 'seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response'
64
+ require 'seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response_invitations_inner'
65
+ require 'seatschart/models/get_api_workspaces_by_workspace_id_keys200_response'
66
+ require 'seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner'
67
+ require 'seatschart/models/get_api_workspaces_by_workspace_id_members200_response'
68
+ require 'seatschart/models/get_api_workspaces_by_workspace_id_members200_response_members_inner'
69
+ require 'seatschart/models/get_api_workspaces_overview200_response'
70
+ require 'seatschart/models/get_api_workspaces_overview200_response_account'
71
+ require 'seatschart/models/get_api_workspaces_overview200_response_account_charts'
72
+ require 'seatschart/models/get_api_workspaces_overview200_response_account_plan'
73
+ require 'seatschart/models/get_api_workspaces_overview200_response_items_inner'
74
+ require 'seatschart/models/get_api_workspaces_overview200_response_items_inner_revenue'
75
+ require 'seatschart/models/get_api_workspaces_overview200_response_items_inner_usage'
76
+ require 'seatschart/models/get_api_workspaces_overview200_response_seats'
77
+ require 'seatschart/models/get_api_workspaces_overview200_response_seats_overage'
78
+ require 'seatschart/models/get_api_workspaces_overview200_response_seats_projected'
79
+ require 'seatschart/models/get_api_workspaces_overview200_response_totals'
80
+ require 'seatschart/models/get_api_workspaces_overview200_response_totals_revenue'
81
+ require 'seatschart/models/get_api_workspaces_overview200_response_totals_seats'
61
82
  require 'seatschart/models/patch_api_charts_by_chart_id_categories_by_category_id_request'
62
83
  require 'seatschart/models/patch_api_charts_by_chart_id_request'
63
84
  require 'seatschart/models/patch_api_events_by_event_id_inventory_channels_by_channel_key_id_request'
@@ -78,6 +99,9 @@ require 'seatschart/models/patch_api_workspace_defaults_request_renderer'
78
99
  require 'seatschart/models/patch_api_workspace_integration_request'
79
100
  require 'seatschart/models/patch_api_workspace_request'
80
101
  require 'seatschart/models/patch_api_workspace_settings_request'
102
+ require 'seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response'
103
+ require 'seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request'
104
+ require 'seatschart/models/patch_api_workspaces_by_workspace_id_request'
81
105
  require 'seatschart/models/post_api_auth2fa_disable_request'
82
106
  require 'seatschart/models/post_api_auth2fa_enable_request'
83
107
  require 'seatschart/models/post_api_auth2fa_enroll_confirm_request'
@@ -86,9 +110,11 @@ require 'seatschart/models/post_api_auth2fa_verify_request'
86
110
  require 'seatschart/models/post_api_auth_accept_invite_request'
87
111
  require 'seatschart/models/post_api_auth_login_request'
88
112
  require 'seatschart/models/post_api_auth_logout_request'
113
+ require 'seatschart/models/post_api_auth_new_workspace_request'
89
114
  require 'seatschart/models/post_api_auth_refresh_request'
90
115
  require 'seatschart/models/post_api_auth_signup_request'
91
116
  require 'seatschart/models/post_api_auth_switch_workspace_request'
117
+ require 'seatschart/models/post_api_billing_actions_change_plan_request'
92
118
  require 'seatschart/models/post_api_billing_checkout_session_request'
93
119
  require 'seatschart/models/post_api_billing_confirm_checkout_request'
94
120
  require 'seatschart/models/post_api_charts_by_chart_id_actions_archive200_response'
@@ -197,8 +223,20 @@ require 'seatschart/models/post_api_team_invitations_request'
197
223
  require 'seatschart/models/post_api_ticket_buyers_request'
198
224
  require 'seatschart/models/post_api_viewer_tokens_request'
199
225
  require 'seatschart/models/post_api_webhooks_request'
226
+ require 'seatschart/models/post_api_workspaces200_response'
227
+ require 'seatschart/models/post_api_workspaces200_response_api_key'
228
+ require 'seatschart/models/post_api_workspaces200_response_template'
229
+ require 'seatschart/models/post_api_workspaces200_response_template_webhooks_inner'
230
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response'
231
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request'
232
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response'
233
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response_invitation'
234
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_invitations_request'
235
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_keys201_response'
236
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key'
237
+ require 'seatschart/models/post_api_workspaces_by_workspace_id_keys_request'
200
238
  require 'seatschart/models/post_api_workspaces_request'
201
- require 'seatschart/models/put_api_charts_by_chart_id_map_draft_request'
239
+ require 'seatschart/models/post_api_workspaces_request_issue_key'
202
240
  require 'seatschart/models/put_api_charts_by_chart_id_tags_request'
203
241
  require 'seatschart/models/put_api_charts_by_chart_id_versions_by_version_thumbnail_request'
204
242
  require 'seatschart/models/put_api_events_by_event_id_inventory_channels_definitions_request'
@@ -263,3 +301,4 @@ module SeatsChart
263
301
  end
264
302
  end
265
303
  require 'seatschart/retry'
304
+ require 'seatschart/workspaces'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seatschart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SeatsChart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-10 00:00:00.000000000 Z
11
+ date: 2026-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -90,10 +90,12 @@ files:
90
90
  - lib/seatschart/api_client.rb
91
91
  - lib/seatschart/api_error.rb
92
92
  - lib/seatschart/configuration.rb
93
- - lib/seatschart/models/api_error.rb
93
+ - lib/seatschart/models/api_error_body.rb
94
94
  - lib/seatschart/models/api_error_params_value.rb
95
95
  - lib/seatschart/models/delete_api_sandboxes_by_sandbox_id200_response.rb
96
96
  - lib/seatschart/models/delete_api_workspaces_by_workspace_id200_response.rb
97
+ - lib/seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb
98
+ - lib/seatschart/models/delete_api_workspaces_by_workspace_id_members_by_user_id200_response.rb
97
99
  - lib/seatschart/models/get_api_charts_by_chart_id_versions200_response.rb
98
100
  - lib/seatschart/models/get_api_charts_by_chart_id_versions200_response_items_inner.rb
99
101
  - lib/seatschart/models/get_api_charts_by_chart_id_versions200_response_items_inner_published_by.rb
@@ -131,6 +133,25 @@ files:
131
133
  - lib/seatschart/models/get_api_workspace_settings200_response_sources.rb
132
134
  - lib/seatschart/models/get_api_workspaces200_response.rb
133
135
  - lib/seatschart/models/get_api_workspaces200_response_items_inner.rb
136
+ - lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response.rb
137
+ - lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response_invitations_inner.rb
138
+ - lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response.rb
139
+ - lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner.rb
140
+ - lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response.rb
141
+ - lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response_members_inner.rb
142
+ - lib/seatschart/models/get_api_workspaces_overview200_response.rb
143
+ - lib/seatschart/models/get_api_workspaces_overview200_response_account.rb
144
+ - lib/seatschart/models/get_api_workspaces_overview200_response_account_charts.rb
145
+ - lib/seatschart/models/get_api_workspaces_overview200_response_account_plan.rb
146
+ - lib/seatschart/models/get_api_workspaces_overview200_response_items_inner.rb
147
+ - lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_revenue.rb
148
+ - lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_usage.rb
149
+ - lib/seatschart/models/get_api_workspaces_overview200_response_seats.rb
150
+ - lib/seatschart/models/get_api_workspaces_overview200_response_seats_overage.rb
151
+ - lib/seatschart/models/get_api_workspaces_overview200_response_seats_projected.rb
152
+ - lib/seatschart/models/get_api_workspaces_overview200_response_totals.rb
153
+ - lib/seatschart/models/get_api_workspaces_overview200_response_totals_revenue.rb
154
+ - lib/seatschart/models/get_api_workspaces_overview200_response_totals_seats.rb
134
155
  - lib/seatschart/models/patch_api_charts_by_chart_id_categories_by_category_id_request.rb
135
156
  - lib/seatschart/models/patch_api_charts_by_chart_id_request.rb
136
157
  - lib/seatschart/models/patch_api_events_by_event_id_inventory_channels_by_channel_key_id_request.rb
@@ -151,6 +172,9 @@ files:
151
172
  - lib/seatschart/models/patch_api_workspace_integration_request.rb
152
173
  - lib/seatschart/models/patch_api_workspace_request.rb
153
174
  - lib/seatschart/models/patch_api_workspace_settings_request.rb
175
+ - lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb
176
+ - lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request.rb
177
+ - lib/seatschart/models/patch_api_workspaces_by_workspace_id_request.rb
154
178
  - lib/seatschart/models/post_api_auth2fa_disable_request.rb
155
179
  - lib/seatschart/models/post_api_auth2fa_enable_request.rb
156
180
  - lib/seatschart/models/post_api_auth2fa_enroll_confirm_request.rb
@@ -159,9 +183,11 @@ files:
159
183
  - lib/seatschart/models/post_api_auth_accept_invite_request.rb
160
184
  - lib/seatschart/models/post_api_auth_login_request.rb
161
185
  - lib/seatschart/models/post_api_auth_logout_request.rb
186
+ - lib/seatschart/models/post_api_auth_new_workspace_request.rb
162
187
  - lib/seatschart/models/post_api_auth_refresh_request.rb
163
188
  - lib/seatschart/models/post_api_auth_signup_request.rb
164
189
  - lib/seatschart/models/post_api_auth_switch_workspace_request.rb
190
+ - lib/seatschart/models/post_api_billing_actions_change_plan_request.rb
165
191
  - lib/seatschart/models/post_api_billing_checkout_session_request.rb
166
192
  - lib/seatschart/models/post_api_billing_confirm_checkout_request.rb
167
193
  - lib/seatschart/models/post_api_charts_by_chart_id_actions_archive200_response.rb
@@ -270,8 +296,20 @@ files:
270
296
  - lib/seatschart/models/post_api_ticket_buyers_request.rb
271
297
  - lib/seatschart/models/post_api_viewer_tokens_request.rb
272
298
  - lib/seatschart/models/post_api_webhooks_request.rb
299
+ - lib/seatschart/models/post_api_workspaces200_response.rb
300
+ - lib/seatschart/models/post_api_workspaces200_response_api_key.rb
301
+ - lib/seatschart/models/post_api_workspaces200_response_template.rb
302
+ - lib/seatschart/models/post_api_workspaces200_response_template_webhooks_inner.rb
303
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response.rb
304
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request.rb
305
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response.rb
306
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response_invitation.rb
307
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations_request.rb
308
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response.rb
309
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key.rb
310
+ - lib/seatschart/models/post_api_workspaces_by_workspace_id_keys_request.rb
273
311
  - lib/seatschart/models/post_api_workspaces_request.rb
274
- - lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb
312
+ - lib/seatschart/models/post_api_workspaces_request_issue_key.rb
275
313
  - lib/seatschart/models/put_api_charts_by_chart_id_tags_request.rb
276
314
  - lib/seatschart/models/put_api_charts_by_chart_id_versions_by_version_thumbnail_request.rb
277
315
  - lib/seatschart/models/put_api_events_by_event_id_inventory_channels_definitions_request.rb
@@ -292,6 +330,7 @@ files:
292
330
  - lib/seatschart/models/put_internal_status_notices_request_notices_inner.rb
293
331
  - lib/seatschart/retry.rb
294
332
  - lib/seatschart/version.rb
333
+ - lib/seatschart/workspaces.rb
295
334
  homepage: https://github.com/seatschart
296
335
  licenses:
297
336
  - MIT