seatschart 0.4.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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -9
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/auth_api.rb +4 -4
  5. data/lib/seatschart/api/billing_api.rb +93 -12
  6. data/lib/seatschart/api/charts_api.rb +52 -52
  7. data/lib/seatschart/api/events_api.rb +110 -104
  8. data/lib/seatschart/api/seasons_api.rb +88 -88
  9. data/lib/seatschart/api/seats_api.rb +6 -6
  10. data/lib/seatschart/api/usage_api.rb +4 -4
  11. data/lib/seatschart/api/workspace_api.rb +52 -40
  12. data/lib/seatschart/models/{api_error.rb → api_error_body.rb} +7 -7
  13. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_members_by_user_id200_response.rb +221 -0
  14. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response.rb +239 -0
  15. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response_invitations_inner.rb +286 -0
  16. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response.rb +239 -0
  17. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response_members_inner.rb +288 -0
  18. data/lib/seatschart/models/get_api_workspaces_overview200_response.rb +288 -0
  19. data/lib/seatschart/models/get_api_workspaces_overview200_response_account.rb +270 -0
  20. data/lib/seatschart/models/get_api_workspaces_overview200_response_account_charts.rb +233 -0
  21. data/lib/seatschart/models/get_api_workspaces_overview200_response_account_plan.rb +237 -0
  22. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner.rb +439 -0
  23. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_revenue.rb +234 -0
  24. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_usage.rb +271 -0
  25. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats.rb +431 -0
  26. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_overage.rb +233 -0
  27. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_projected.rb +237 -0
  28. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals.rb +318 -0
  29. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_revenue.rb +238 -0
  30. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_seats.rb +253 -0
  31. data/lib/seatschart/models/post_api_billing_actions_change_plan_request.rb +256 -0
  32. data/lib/seatschart/models/post_api_events_by_event_id_actions_update_extra_data_request_objects_inner.rb +0 -2
  33. data/lib/seatschart/models/post_api_sandboxes201_response.rb +0 -4
  34. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +0 -2
  35. data/lib/seatschart/models/post_api_workspaces200_response.rb +0 -4
  36. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response.rb +238 -0
  37. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response_invitation.rb +286 -0
  38. data/lib/seatschart/version.rb +1 -1
  39. data/lib/seatschart/workspaces.rb +172 -0
  40. data/lib/seatschart.rb +23 -3
  41. metadata +25 -5
  42. data/lib/seatschart/models/get_api_workspaces_created_by_api_parameter.rb +0 -103
  43. data/lib/seatschart/models/get_api_workspaces_overview_created_by_api_parameter.rb +0 -103
@@ -1,103 +0,0 @@
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
- module GetApiWorkspacesCreatedByApiParameter
18
- class << self
19
- # List of class defined in anyOf (OpenAPI v3)
20
- def openapi_any_of
21
- [
22
- :'Boolean'
23
- ]
24
- end
25
-
26
- # Builds the object
27
- # @param [Mixed] Data to be matched against the list of anyOf items
28
- # @return [Object] Returns the model or the data itself
29
- def build(data)
30
- # Go through the list of anyOf items and attempt to identify the appropriate one.
31
- # Note:
32
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
33
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
34
- # - TODO: scalar values are de facto behaving as if they were nullable.
35
- # - TODO: logging when debugging is set.
36
- openapi_any_of.each do |klass|
37
- begin
38
- next if klass == :AnyType # "nullable: true"
39
- typed_data = find_and_cast_into_type(klass, data)
40
- return typed_data if typed_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.parse(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 = SeatsChart.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
@@ -1,103 +0,0 @@
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
- module GetApiWorkspacesOverviewCreatedByApiParameter
18
- class << self
19
- # List of class defined in anyOf (OpenAPI v3)
20
- def openapi_any_of
21
- [
22
- :'Boolean'
23
- ]
24
- end
25
-
26
- # Builds the object
27
- # @param [Mixed] Data to be matched against the list of anyOf items
28
- # @return [Object] Returns the model or the data itself
29
- def build(data)
30
- # Go through the list of anyOf items and attempt to identify the appropriate one.
31
- # Note:
32
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
33
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
34
- # - TODO: scalar values are de facto behaving as if they were nullable.
35
- # - TODO: logging when debugging is set.
36
- openapi_any_of.each do |klass|
37
- begin
38
- next if klass == :AnyType # "nullable: true"
39
- typed_data = find_and_cast_into_type(klass, data)
40
- return typed_data if typed_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.parse(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 = SeatsChart.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