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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bbf500c95050180ca08ecccc9dc9660ffa6b1646d816bf90d52bef6753f64ba7
4
- data.tar.gz: ed22fd40429b7b321fea64c13b8ecedf9d7eaf9bb932fc63334c68cbad5c990c
3
+ metadata.gz: 590c96bfa128894d11dd556141fd811e137e0465115e0d29aecac3a5eeb4c190
4
+ data.tar.gz: '0289a7df24571425b5aa5ad678c88b4f357e4fa53251a8c9a435774d99016936'
5
5
  SHA512:
6
- metadata.gz: 996547fffc7b78bee7346e9a39aba7a04a21e66cd8ad6751ae3c592a622d5f928f37567b73723ffcc92f1b627ef2eafe003be6a0f3198b3044e9a1f9a93bf967
7
- data.tar.gz: a1d73694b0dd53588af105c2b701656aa1e2e0c62ff63cdbe064e3266ad639f6dbc8cc40582fe65e29f989b8f9b30418088cb6c15e409cc3a232f5523b4d2dbc
6
+ metadata.gz: 3fc2f7be846627bbef83a72c58ea55479bd62a668af9adb878298222e954105815b8ffd38ac1988cdf735c33bf41780fc29013770e90c3071c9ce663e08a2168
7
+ data.tar.gz: 2c149651a3cb6789590b3ee99e8e8a760ced17201f00b93020fa4881f145cf1a219a47f38b59f5b65848d6ef6a1c467a93ff5878239c18bc6db2b6c79e6f4d86
data/README.md CHANGED
@@ -72,6 +72,21 @@ rescue SeatsChart::Retry::TimeoutError => e # e.error_code == 'timeout', e.attem
72
72
  end
73
73
  ```
74
74
 
75
+ ## One workspace per organizer
76
+
77
+ Ticketing platforms give each organizer its own workspace and operate all of them with one workspace admin key. `forWorkspace` scopes a client to one workspace (its id or external id) with `X-Workspace-Key`; the `Workspaces` helper provisions an organizer (`externalId`, `templateWorkspaceId`, `issueKey`, always with an `Idempotency-Key`) and covers `getByExternalId`, keys, members, invitations and the consolidated overview. The generated `WorkspaceApi` methods stay available.
78
+
79
+ ```ruby
80
+ workspaces = SeatsChart::Workspaces.new(platform) # platform: a SeatsChart::ApiClient with the workspace admin key
81
+ created = workspaces.create({ displayName: 'Teatro Aurora', externalId: 'org-1042', templateWorkspaceId: 'org-template',
82
+ issueKey: { name: 'Server key' } }, idempotency_key: 'provision-org-1042')
83
+ org = SeatsChart.for_workspace('org-1042', platform) # every call through org sends X-Workspace-Key
84
+ events = SeatsChart::EventsApi.new(org)
85
+ workspaces.keys.rotate('org-1042', created.api_key.id)
86
+ workspaces.invitations.create('org-1042', { email: 'box-office@teatro-aurora.example', role: 'viewer' })
87
+ workspaces.list_all_overview(created_by_api: true).each { |row| puts "#{row.external_id} #{row.seats.sold}" }
88
+ ```
89
+
75
90
  <!-- seatschart:intro -->
76
91
 
77
92
  # seatschart
@@ -83,7 +98,7 @@ Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api
83
98
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
84
99
 
85
100
  - API version: 1.0.0
86
- - Package version: 0.4.0
101
+ - Package version: 0.5.0
87
102
  - Generator version: 7.11.0
88
103
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
89
104
 
@@ -96,7 +111,7 @@ gem install seatschart
96
111
  or add it to the Gemfile:
97
112
 
98
113
  ```ruby
99
- gem 'seatschart', '~> 0.4.0'
114
+ gem 'seatschart', '~> 0.5.0'
100
115
  ```
101
116
 
102
117
  ## Getting Started
@@ -160,10 +175,11 @@ Class | Method | HTTP request | Description
160
175
  *SeatsChart::AuthApi* | [**post_api_auth_refresh**](docs/AuthApi.md#post_api_auth_refresh) | **POST** /api/auth/refresh | Rotate refresh token and issue new access JWT
161
176
  *SeatsChart::AuthApi* | [**post_api_auth_signup**](docs/AuthApi.md#post_api_auth_signup) | **POST** /api/auth/signup | Create account and workspace
162
177
  *SeatsChart::AuthApi* | [**post_api_auth_switch_workspace**](docs/AuthApi.md#post_api_auth_switch_workspace) | **POST** /api/auth/switch-workspace | Switch active workspace
163
- *SeatsChart::BillingApi* | [**get_api_billing**](docs/BillingApi.md#get_api_billing) | **GET** /api/billing | Get billing status and plan usage
164
- *SeatsChart::BillingApi* | [**post_api_billing_checkout_session**](docs/BillingApi.md#post_api_billing_checkout_session) | **POST** /api/billing/checkout-session | Create Stripe Checkout session for a paid plan
165
- *SeatsChart::BillingApi* | [**post_api_billing_confirm_checkout**](docs/BillingApi.md#post_api_billing_confirm_checkout) | **POST** /api/billing/confirm-checkout | Confirm checkout session and sync plan
166
- *SeatsChart::BillingApi* | [**post_api_billing_portal_session**](docs/BillingApi.md#post_api_billing_portal_session) | **POST** /api/billing/portal-session | Create Stripe Customer Portal session
178
+ *SeatsChart::BillingApi* | [**get_api_billing**](docs/BillingApi.md#get_api_billing) | **GET** /api/billing | Get the billing account, its plan and usage
179
+ *SeatsChart::BillingApi* | [**post_api_billing_actions_change_plan**](docs/BillingApi.md#post_api_billing_actions_change_plan) | **POST** /api/billing/actions/change-plan | Leave Ultra On-Demand for the Free plan (the whole account)
180
+ *SeatsChart::BillingApi* | [**post_api_billing_checkout_session**](docs/BillingApi.md#post_api_billing_checkout_session) | **POST** /api/billing/checkout-session | Create Stripe Checkout session for a paid plan (the whole account)
181
+ *SeatsChart::BillingApi* | [**post_api_billing_confirm_checkout**](docs/BillingApi.md#post_api_billing_confirm_checkout) | **POST** /api/billing/confirm-checkout | Confirm checkout session and sync the account plan
182
+ *SeatsChart::BillingApi* | [**post_api_billing_portal_session**](docs/BillingApi.md#post_api_billing_portal_session) | **POST** /api/billing/portal-session | Create Stripe Customer Portal session (the account subscription)
167
183
  *SeatsChart::BillingApi* | [**post_api_billing_webhook**](docs/BillingApi.md#post_api_billing_webhook) | **POST** /api/billing/webhook | Stripe webhook
168
184
  *SeatsChart::ChartsApi* | [**delete_api_charts_by_chart_id**](docs/ChartsApi.md#delete_api_charts_by_chart_id) | **DELETE** /api/charts/{chartId} | Delete chart permanently
169
185
  *SeatsChart::ChartsApi* | [**delete_api_charts_by_chart_id_categories_by_category_id**](docs/ChartsApi.md#delete_api_charts_by_chart_id_categories_by_category_id) | **DELETE** /api/charts/{chartId}/categories/{categoryId} | Delete a category from the chart draft
@@ -522,11 +538,12 @@ Class | Method | HTTP request | Description
522
538
 
523
539
  ## Documentation for Models
524
540
 
525
- - [SeatsChart::ApiError](docs/ApiError.md)
541
+ - [SeatsChart::ApiErrorBody](docs/ApiErrorBody.md)
526
542
  - [SeatsChart::ApiErrorParamsValue](docs/ApiErrorParamsValue.md)
527
543
  - [SeatsChart::DeleteApiSandboxesBySandboxId200Response](docs/DeleteApiSandboxesBySandboxId200Response.md)
528
544
  - [SeatsChart::DeleteApiWorkspacesByWorkspaceId200Response](docs/DeleteApiWorkspacesByWorkspaceId200Response.md)
529
545
  - [SeatsChart::DeleteApiWorkspacesByWorkspaceIdKeysByKeyId200Response](docs/DeleteApiWorkspacesByWorkspaceIdKeysByKeyId200Response.md)
546
+ - [SeatsChart::DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response](docs/DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response.md)
530
547
  - [SeatsChart::GetApiChartsByChartIdVersions200Response](docs/GetApiChartsByChartIdVersions200Response.md)
531
548
  - [SeatsChart::GetApiChartsByChartIdVersions200ResponseItemsInner](docs/GetApiChartsByChartIdVersions200ResponseItemsInner.md)
532
549
  - [SeatsChart::GetApiChartsByChartIdVersions200ResponseItemsInnerPublishedBy](docs/GetApiChartsByChartIdVersions200ResponseItemsInnerPublishedBy.md)
@@ -564,10 +581,25 @@ Class | Method | HTTP request | Description
564
581
  - [SeatsChart::GetApiWorkspaceSettings200ResponseSources](docs/GetApiWorkspaceSettings200ResponseSources.md)
565
582
  - [SeatsChart::GetApiWorkspaces200Response](docs/GetApiWorkspaces200Response.md)
566
583
  - [SeatsChart::GetApiWorkspaces200ResponseItemsInner](docs/GetApiWorkspaces200ResponseItemsInner.md)
584
+ - [SeatsChart::GetApiWorkspacesByWorkspaceIdInvitations200Response](docs/GetApiWorkspacesByWorkspaceIdInvitations200Response.md)
585
+ - [SeatsChart::GetApiWorkspacesByWorkspaceIdInvitations200ResponseInvitationsInner](docs/GetApiWorkspacesByWorkspaceIdInvitations200ResponseInvitationsInner.md)
567
586
  - [SeatsChart::GetApiWorkspacesByWorkspaceIdKeys200Response](docs/GetApiWorkspacesByWorkspaceIdKeys200Response.md)
568
587
  - [SeatsChart::GetApiWorkspacesByWorkspaceIdKeys200ResponseApiKeysInner](docs/GetApiWorkspacesByWorkspaceIdKeys200ResponseApiKeysInner.md)
569
- - [SeatsChart::GetApiWorkspacesCreatedByApiParameter](docs/GetApiWorkspacesCreatedByApiParameter.md)
570
- - [SeatsChart::GetApiWorkspacesOverviewCreatedByApiParameter](docs/GetApiWorkspacesOverviewCreatedByApiParameter.md)
588
+ - [SeatsChart::GetApiWorkspacesByWorkspaceIdMembers200Response](docs/GetApiWorkspacesByWorkspaceIdMembers200Response.md)
589
+ - [SeatsChart::GetApiWorkspacesByWorkspaceIdMembers200ResponseMembersInner](docs/GetApiWorkspacesByWorkspaceIdMembers200ResponseMembersInner.md)
590
+ - [SeatsChart::GetApiWorkspacesOverview200Response](docs/GetApiWorkspacesOverview200Response.md)
591
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseAccount](docs/GetApiWorkspacesOverview200ResponseAccount.md)
592
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseAccountCharts](docs/GetApiWorkspacesOverview200ResponseAccountCharts.md)
593
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseAccountPlan](docs/GetApiWorkspacesOverview200ResponseAccountPlan.md)
594
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseItemsInner](docs/GetApiWorkspacesOverview200ResponseItemsInner.md)
595
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseItemsInnerRevenue](docs/GetApiWorkspacesOverview200ResponseItemsInnerRevenue.md)
596
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseItemsInnerUsage](docs/GetApiWorkspacesOverview200ResponseItemsInnerUsage.md)
597
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseSeats](docs/GetApiWorkspacesOverview200ResponseSeats.md)
598
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseSeatsOverage](docs/GetApiWorkspacesOverview200ResponseSeatsOverage.md)
599
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseSeatsProjected](docs/GetApiWorkspacesOverview200ResponseSeatsProjected.md)
600
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseTotals](docs/GetApiWorkspacesOverview200ResponseTotals.md)
601
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseTotalsRevenue](docs/GetApiWorkspacesOverview200ResponseTotalsRevenue.md)
602
+ - [SeatsChart::GetApiWorkspacesOverview200ResponseTotalsSeats](docs/GetApiWorkspacesOverview200ResponseTotalsSeats.md)
571
603
  - [SeatsChart::PatchApiChartsByChartIdCategoriesByCategoryIdRequest](docs/PatchApiChartsByChartIdCategoriesByCategoryIdRequest.md)
572
604
  - [SeatsChart::PatchApiChartsByChartIdRequest](docs/PatchApiChartsByChartIdRequest.md)
573
605
  - [SeatsChart::PatchApiEventsByEventIdInventoryChannelsByChannelKeyIdRequest](docs/PatchApiEventsByEventIdInventoryChannelsByChannelKeyIdRequest.md)
@@ -603,6 +635,7 @@ Class | Method | HTTP request | Description
603
635
  - [SeatsChart::PostApiAuthRefreshRequest](docs/PostApiAuthRefreshRequest.md)
604
636
  - [SeatsChart::PostApiAuthSignupRequest](docs/PostApiAuthSignupRequest.md)
605
637
  - [SeatsChart::PostApiAuthSwitchWorkspaceRequest](docs/PostApiAuthSwitchWorkspaceRequest.md)
638
+ - [SeatsChart::PostApiBillingActionsChangePlanRequest](docs/PostApiBillingActionsChangePlanRequest.md)
606
639
  - [SeatsChart::PostApiBillingCheckoutSessionRequest](docs/PostApiBillingCheckoutSessionRequest.md)
607
640
  - [SeatsChart::PostApiBillingConfirmCheckoutRequest](docs/PostApiBillingConfirmCheckoutRequest.md)
608
641
  - [SeatsChart::PostApiChartsByChartIdActionsArchive200Response](docs/PostApiChartsByChartIdActionsArchive200Response.md)
@@ -717,6 +750,8 @@ Class | Method | HTTP request | Description
717
750
  - [SeatsChart::PostApiWorkspaces200ResponseTemplateWebhooksInner](docs/PostApiWorkspaces200ResponseTemplateWebhooksInner.md)
718
751
  - [SeatsChart::PostApiWorkspacesByWorkspaceIdActionsDelete200Response](docs/PostApiWorkspacesByWorkspaceIdActionsDelete200Response.md)
719
752
  - [SeatsChart::PostApiWorkspacesByWorkspaceIdActionsDeleteRequest](docs/PostApiWorkspacesByWorkspaceIdActionsDeleteRequest.md)
753
+ - [SeatsChart::PostApiWorkspacesByWorkspaceIdInvitations201Response](docs/PostApiWorkspacesByWorkspaceIdInvitations201Response.md)
754
+ - [SeatsChart::PostApiWorkspacesByWorkspaceIdInvitations201ResponseInvitation](docs/PostApiWorkspacesByWorkspaceIdInvitations201ResponseInvitation.md)
720
755
  - [SeatsChart::PostApiWorkspacesByWorkspaceIdInvitationsRequest](docs/PostApiWorkspacesByWorkspaceIdInvitationsRequest.md)
721
756
  - [SeatsChart::PostApiWorkspacesByWorkspaceIdKeys201Response](docs/PostApiWorkspacesByWorkspaceIdKeys201Response.md)
722
757
  - [SeatsChart::PostApiWorkspacesByWorkspaceIdKeys201ResponseApiKey](docs/PostApiWorkspacesByWorkspaceIdKeys201ResponseApiKey.md)
@@ -20,7 +20,7 @@ module SeatsChart
20
20
  @api_client = api_client
21
21
  end
22
22
  # List recent workspace audit log entries
23
- # Append-only config change history for the JWT tenant. Requires `workspace_admin`. Each entry carries where the change came from when known: `ip` (client IP truncated to /24 for IPv4 or /48 for IPv6), `userAgent` and `requestId` (the `x-request-id` of the request that made it); these are never part of the public event log or its webhooks.
23
+ # Append-only config change history for the JWT tenant. Requires `workspace_admin`. Each entry carries where the change came from when known: `ip` (client IP truncated to /24 for IPv4 or /48 for IPv6), `userAgent` and `requestId` (the `x-request-id` of the request that made it); these are never part of the public event log or its webhooks. `summary` is an English sentence; `data` holds the details of the change (the audit metadata without those private fields, as in the event log), from which clients can render the entry in another language.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [Float] :limit (default to 50)
26
26
  # @return [nil]
@@ -30,7 +30,7 @@ module SeatsChart
30
30
  end
31
31
 
32
32
  # List recent workspace audit log entries
33
- # Append-only config change history for the JWT tenant. Requires &#x60;workspace_admin&#x60;. Each entry carries where the change came from when known: &#x60;ip&#x60; (client IP truncated to /24 for IPv4 or /48 for IPv6), &#x60;userAgent&#x60; and &#x60;requestId&#x60; (the &#x60;x-request-id&#x60; of the request that made it); these are never part of the public event log or its webhooks.
33
+ # Append-only config change history for the JWT tenant. Requires &#x60;workspace_admin&#x60;. Each entry carries where the change came from when known: &#x60;ip&#x60; (client IP truncated to /24 for IPv4 or /48 for IPv6), &#x60;userAgent&#x60; and &#x60;requestId&#x60; (the &#x60;x-request-id&#x60; of the request that made it); these are never part of the public event log or its webhooks. &#x60;summary&#x60; is an English sentence; &#x60;data&#x60; holds the details of the change (the audit metadata without those private fields, as in the event log), from which clients can render the entry in another language.
34
34
  # @param [Hash] opts the optional parameters
35
35
  # @option opts [Float] :limit (default to 50)
36
36
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
@@ -142,7 +142,7 @@ module SeatsChart
142
142
  end
143
143
 
144
144
  # Current dashboard user
145
- # Returns the authenticated user when the Bearer token was issued by `/auth/login` or `/auth/signup`.
145
+ # Returns the authenticated user when the Bearer token was issued by `/auth/login` or `/auth/signup`. `user.seatAllowance` is set when the workspace is on Free and used at least 80% of its seats of the month: `state` `near`, or `reached` when its events accept no new holds until `resumesAt` (the next UTC month) or an upgrade (holds already taken can still be confirmed); null otherwise. The seats are counted over every workspace of the billing account; `managedBy` is the e-mail of the account owner when the caller is not the owner (only the owner upgrades).
146
146
  # @param [Hash] opts the optional parameters
147
147
  # @return [nil]
148
148
  def get_api_auth_me(opts = {})
@@ -151,7 +151,7 @@ module SeatsChart
151
151
  end
152
152
 
153
153
  # Current dashboard user
154
- # Returns the authenticated user when the Bearer token was issued by &#x60;/auth/login&#x60; or &#x60;/auth/signup&#x60;.
154
+ # Returns the authenticated user when the Bearer token was issued by &#x60;/auth/login&#x60; or &#x60;/auth/signup&#x60;. &#x60;user.seatAllowance&#x60; is set when the workspace is on Free and used at least 80% of its seats of the month: &#x60;state&#x60; &#x60;near&#x60;, or &#x60;reached&#x60; when its events accept no new holds until &#x60;resumesAt&#x60; (the next UTC month) or an upgrade (holds already taken can still be confirmed); null otherwise. The seats are counted over every workspace of the billing account; &#x60;managedBy&#x60; is the e-mail of the account owner when the caller is not the owner (only the owner upgrades).
155
155
  # @param [Hash] opts the optional parameters
156
156
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
157
157
  def get_api_auth_me_with_http_info(opts = {})
@@ -1108,7 +1108,7 @@ module SeatsChart
1108
1108
  end
1109
1109
 
1110
1110
  # Create account and workspace
1111
- # Registers a new user, provisions a tenant workspace, and returns an HS256 dashboard JWT (`tenant_id`, `sub`, `email`, `role`).
1111
+ # Registers a new user, provisions a tenant workspace, and returns an HS256 dashboard JWT (`tenant_id`, `sub`, `email`, `role`, `is_test`).
1112
1112
  # @param post_api_auth_signup_request [PostApiAuthSignupRequest]
1113
1113
  # @param [Hash] opts the optional parameters
1114
1114
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -1119,7 +1119,7 @@ module SeatsChart
1119
1119
  end
1120
1120
 
1121
1121
  # Create account and workspace
1122
- # Registers a new user, provisions a tenant workspace, and returns an HS256 dashboard JWT (&#x60;tenant_id&#x60;, &#x60;sub&#x60;, &#x60;email&#x60;, &#x60;role&#x60;).
1122
+ # Registers a new user, provisions a tenant workspace, and returns an HS256 dashboard JWT (&#x60;tenant_id&#x60;, &#x60;sub&#x60;, &#x60;email&#x60;, &#x60;role&#x60;, &#x60;is_test&#x60;).
1123
1123
  # @param post_api_auth_signup_request [PostApiAuthSignupRequest]
1124
1124
  # @param [Hash] opts the optional parameters
1125
1125
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -19,8 +19,8 @@ module SeatsChart
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Get billing status and plan usage
23
- # Plan, subscription, usage against the limits and the plan catalogue. `managedByPlatform` is true for a workspace a ticketing platform provisioned with its workspace admin key: it is billed to the platform account, so only that platform admin may open checkout or the billing portal (`canManageBilling`); everyone else gets 403 `billing_managed_by_platform` there, and plan-limit refusals carry `billingManagedByPlatform: true` instead of an upgrade prompt.
22
+ # Get the billing account, its plan and usage
23
+ # One plan per account: the plan, its limits and the Stripe subscription belong to the billing account that owns the workspace, and apply to every workspace of the account. `account` names the owner (who alone may change the plan, from a dashboard session: `canManageBilling`), the workspaces it covers (listed to the owner) and the account's chart and event counts, which the caps count together. `usage` holds this workspace's counts (charts, events, embed domains and used objects this month); embed domains stay limited per workspace. `seats` is the used seats of the month over every production workspace of the account against the included seats, the overage so far and projected, and its cost. On Ultra On-Demand (`isSalesManaged`) the owner may switch to a paid plan through checkout (the account stays on Ultra until the checkout is confirmed) or to Free with `POST /billing/actions/change-plan`. `managedByPlatform` is true for a workspace a ticketing platform provisioned with its workspace admin key: it belongs to the platform admin's account, and plan-limit refusals carry `billingManagedByPlatform: true` instead of an upgrade prompt.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @return [nil]
26
26
  def get_api_billing(opts = {})
@@ -28,8 +28,8 @@ module SeatsChart
28
28
  nil
29
29
  end
30
30
 
31
- # Get billing status and plan usage
32
- # Plan, subscription, usage against the limits and the plan catalogue. &#x60;managedByPlatform&#x60; is true for a workspace a ticketing platform provisioned with its workspace admin key: it is billed to the platform account, so only that platform admin may open checkout or the billing portal (&#x60;canManageBilling&#x60;); everyone else gets 403 &#x60;billing_managed_by_platform&#x60; there, and plan-limit refusals carry &#x60;billingManagedByPlatform: true&#x60; instead of an upgrade prompt.
31
+ # Get the billing account, its plan and usage
32
+ # One plan per account: the plan, its limits and the Stripe subscription belong to the billing account that owns the workspace, and apply to every workspace of the account. &#x60;account&#x60; names the owner (who alone may change the plan, from a dashboard session: &#x60;canManageBilling&#x60;), the workspaces it covers (listed to the owner) and the account&#39;s chart and event counts, which the caps count together. &#x60;usage&#x60; holds this workspace&#39;s counts (charts, events, embed domains and used objects this month); embed domains stay limited per workspace. &#x60;seats&#x60; is the used seats of the month over every production workspace of the account against the included seats, the overage so far and projected, and its cost. On Ultra On-Demand (&#x60;isSalesManaged&#x60;) the owner may switch to a paid plan through checkout (the account stays on Ultra until the checkout is confirmed) or to Free with &#x60;POST /billing/actions/change-plan&#x60;. &#x60;managedByPlatform&#x60; is true for a workspace a ticketing platform provisioned with its workspace admin key: it belongs to the platform admin&#39;s account, and plan-limit refusals carry &#x60;billingManagedByPlatform: true&#x60; instead of an upgrade prompt.
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
35
  def get_api_billing_with_http_info(opts = {})
@@ -74,8 +74,85 @@ module SeatsChart
74
74
  return data, status_code, headers
75
75
  end
76
76
 
77
- # Create Stripe Checkout session for a paid plan
78
- # Returns `{ url }` of a Stripe Checkout for `planId` (`starter` | `pro`). 409 `ERR_SUBSCRIPTION_EXISTS` when the workspace already has a live subscription (change plans in the billing portal: `POST /billing/portal-session`), 409 `test_workspace_not_billable` in a test workspace, 400 `plan_requires_sales` for `ultra` (Ultra On-Demand is arranged with the SeatsChart team), 409 `plan_managed_by_sales` on an Ultra On-Demand workspace,503 `stripe_not_configured` when billing is not set up.
77
+ # Leave Ultra On-Demand for the Free plan (the whole account)
78
+ # Moves an Ultra On-Demand billing account to Free right away, with no payment: every workspace of the account moves at once, the Ultra limits end now and the Free limits apply (the agreed custom limits are cleared). Charts, events and embed domains above the Free limits are kept and keep working; new ones are refused (402 `plan_limit_exceeded`) until the account is back within the limits or upgrades. Returns `{ changed, previousPlanId, planId, limits, usage, withinLimits, workspaces }` (`usage`: the account's charts and events, this workspace's embed domains; `workspaces`: the workspaces that moved); an account already on Free answers 200 with `changed: false`. Audited once on the account and once on this workspace as `billing.plan_changed`. Account owner only, from a dashboard session: the other admins get 403 `billing_managed_by_owner` (with `managedBy`), the members of a workspace a ticketing platform manages 403 `billing_managed_by_platform`, API keys 403 `forbidden` (`ERR_PARTNER_SCOPE`). Send an `Idempotency-Key` to make retries safe (the first result is replayed for 24 hours; another body with the same key: 422 `idempotency_key_reused`). 400 `checkout_required` for a paid plan (use `POST /billing/checkout-session`), 400 `plan_requires_sales` for `ultra`, 409 `ERR_SUBSCRIPTION_EXISTS` with a paid subscription (change it in the billing portal), 409 `test_workspace_not_billable` in a test workspace.
79
+ # @param post_api_billing_actions_change_plan_request [PostApiBillingActionsChangePlanRequest]
80
+ # @param [Hash] opts the optional parameters
81
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
82
+ # @return [nil]
83
+ def post_api_billing_actions_change_plan(post_api_billing_actions_change_plan_request, opts = {})
84
+ post_api_billing_actions_change_plan_with_http_info(post_api_billing_actions_change_plan_request, opts)
85
+ nil
86
+ end
87
+
88
+ # Leave Ultra On-Demand for the Free plan (the whole account)
89
+ # Moves an Ultra On-Demand billing account to Free right away, with no payment: every workspace of the account moves at once, the Ultra limits end now and the Free limits apply (the agreed custom limits are cleared). Charts, events and embed domains above the Free limits are kept and keep working; new ones are refused (402 &#x60;plan_limit_exceeded&#x60;) until the account is back within the limits or upgrades. Returns &#x60;{ changed, previousPlanId, planId, limits, usage, withinLimits, workspaces }&#x60; (&#x60;usage&#x60;: the account&#39;s charts and events, this workspace&#39;s embed domains; &#x60;workspaces&#x60;: the workspaces that moved); an account already on Free answers 200 with &#x60;changed: false&#x60;. Audited once on the account and once on this workspace as &#x60;billing.plan_changed&#x60;. Account owner only, from a dashboard session: the other admins get 403 &#x60;billing_managed_by_owner&#x60; (with &#x60;managedBy&#x60;), the members of a workspace a ticketing platform manages 403 &#x60;billing_managed_by_platform&#x60;, API keys 403 &#x60;forbidden&#x60; (&#x60;ERR_PARTNER_SCOPE&#x60;). Send an &#x60;Idempotency-Key&#x60; to make retries safe (the first result is replayed for 24 hours; another body with the same key: 422 &#x60;idempotency_key_reused&#x60;). 400 &#x60;checkout_required&#x60; for a paid plan (use &#x60;POST /billing/checkout-session&#x60;), 400 &#x60;plan_requires_sales&#x60; for &#x60;ultra&#x60;, 409 &#x60;ERR_SUBSCRIPTION_EXISTS&#x60; with a paid subscription (change it in the billing portal), 409 &#x60;test_workspace_not_billable&#x60; in a test workspace.
90
+ # @param post_api_billing_actions_change_plan_request [PostApiBillingActionsChangePlanRequest]
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
93
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
94
+ def post_api_billing_actions_change_plan_with_http_info(post_api_billing_actions_change_plan_request, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: BillingApi.post_api_billing_actions_change_plan ...'
97
+ end
98
+ # verify the required parameter 'post_api_billing_actions_change_plan_request' is set
99
+ if @api_client.config.client_side_validation && post_api_billing_actions_change_plan_request.nil?
100
+ fail ArgumentError, "Missing the required parameter 'post_api_billing_actions_change_plan_request' when calling BillingApi.post_api_billing_actions_change_plan"
101
+ end
102
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
103
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling BillingApi.post_api_billing_actions_change_plan, the character length must be smaller than or equal to 255.'
104
+ end
105
+
106
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
107
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling BillingApi.post_api_billing_actions_change_plan, the character length must be great than or equal to 1.'
108
+ end
109
+
110
+ # resource path
111
+ local_var_path = '/api/billing/actions/change-plan'
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Content-Type'
119
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
120
+ if !content_type.nil?
121
+ header_params['Content-Type'] = content_type
122
+ end
123
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_billing_actions_change_plan_request)
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type]
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
136
+
137
+ new_options = opts.merge(
138
+ :operation => :"BillingApi.post_api_billing_actions_change_plan",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: BillingApi#post_api_billing_actions_change_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # Create Stripe Checkout session for a paid plan (the whole account)
155
+ # Returns `{ url }` of a Stripe Checkout for `planId` (`starter` | `pro` | `business` | `scale`), with the metered seat overage line of the plan when configured. The subscription is the billing account's: once confirmed, every workspace of the account moves to the plan. Only the account owner, from a dashboard session: other admins get 403 `billing_managed_by_owner` (with `managedBy`, the owner's e-mail), the members of a workspace a ticketing platform manages 403 `billing_managed_by_platform`, API keys 403. 409 `ERR_SUBSCRIPTION_EXISTS` when the account already has a live subscription (change plans in the billing portal: `POST /billing/portal-session`), 409 `test_workspace_not_billable` in a test workspace, 400 `plan_requires_sales` for `ultra` (Ultra On-Demand is arranged with the SeatsChart team), 503 `stripe_not_configured` when billing is not set up. On an Ultra On-Demand account the checkout is how the owner moves to a paid plan: the account stays on Ultra until the checkout is confirmed (`POST /billing/confirm-checkout` or the Stripe webhook); the confirmed subscription then replaces Ultra (plan, limits of the plan, agreed custom limits cleared).
79
156
  # @param post_api_billing_checkout_session_request [PostApiBillingCheckoutSessionRequest]
80
157
  # @param [Hash] opts the optional parameters
81
158
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -85,8 +162,8 @@ module SeatsChart
85
162
  nil
86
163
  end
87
164
 
88
- # Create Stripe Checkout session for a paid plan
89
- # Returns &#x60;{ url }&#x60; of a Stripe Checkout for &#x60;planId&#x60; (&#x60;starter&#x60; | &#x60;pro&#x60;). 409 &#x60;ERR_SUBSCRIPTION_EXISTS&#x60; when the workspace already has a live subscription (change plans in the billing portal: &#x60;POST /billing/portal-session&#x60;), 409 &#x60;test_workspace_not_billable&#x60; in a test workspace, 400 &#x60;plan_requires_sales&#x60; for &#x60;ultra&#x60; (Ultra On-Demand is arranged with the SeatsChart team), 409 &#x60;plan_managed_by_sales&#x60; on an Ultra On-Demand workspace,503 &#x60;stripe_not_configured&#x60; when billing is not set up.
165
+ # Create Stripe Checkout session for a paid plan (the whole account)
166
+ # Returns &#x60;{ url }&#x60; of a Stripe Checkout for &#x60;planId&#x60; (&#x60;starter&#x60; | &#x60;pro&#x60; | &#x60;business&#x60; | &#x60;scale&#x60;), with the metered seat overage line of the plan when configured. The subscription is the billing account&#39;s: once confirmed, every workspace of the account moves to the plan. Only the account owner, from a dashboard session: other admins get 403 &#x60;billing_managed_by_owner&#x60; (with &#x60;managedBy&#x60;, the owner&#39;s e-mail), the members of a workspace a ticketing platform manages 403 &#x60;billing_managed_by_platform&#x60;, API keys 403. 409 &#x60;ERR_SUBSCRIPTION_EXISTS&#x60; when the account already has a live subscription (change plans in the billing portal: &#x60;POST /billing/portal-session&#x60;), 409 &#x60;test_workspace_not_billable&#x60; in a test workspace, 400 &#x60;plan_requires_sales&#x60; for &#x60;ultra&#x60; (Ultra On-Demand is arranged with the SeatsChart team), 503 &#x60;stripe_not_configured&#x60; when billing is not set up. On an Ultra On-Demand account the checkout is how the owner moves to a paid plan: the account stays on Ultra until the checkout is confirmed (&#x60;POST /billing/confirm-checkout&#x60; or the Stripe webhook); the confirmed subscription then replaces Ultra (plan, limits of the plan, agreed custom limits cleared).
90
167
  # @param post_api_billing_checkout_session_request [PostApiBillingCheckoutSessionRequest]
91
168
  # @param [Hash] opts the optional parameters
92
169
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -151,7 +228,8 @@ module SeatsChart
151
228
  return data, status_code, headers
152
229
  end
153
230
 
154
- # Confirm checkout session and sync plan
231
+ # Confirm checkout session and sync the account plan
232
+ # Reads the completed Stripe Checkout session of this workspace's billing account and applies its subscription to the account: every workspace of the account moves to the plan at once (audited once on the account and once on the workspace as `billing.plan_changed`). A checkout started on an Ultra On-Demand account replaces Ultra once paid; any other Stripe subscription never changes an Ultra account. Account owner only (dashboard session).
155
233
  # @param post_api_billing_confirm_checkout_request [PostApiBillingConfirmCheckoutRequest]
156
234
  # @param [Hash] opts the optional parameters
157
235
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -161,7 +239,8 @@ module SeatsChart
161
239
  nil
162
240
  end
163
241
 
164
- # Confirm checkout session and sync plan
242
+ # Confirm checkout session and sync the account plan
243
+ # Reads the completed Stripe Checkout session of this workspace&#39;s billing account and applies its subscription to the account: every workspace of the account moves to the plan at once (audited once on the account and once on the workspace as &#x60;billing.plan_changed&#x60;). A checkout started on an Ultra On-Demand account replaces Ultra once paid; any other Stripe subscription never changes an Ultra account. Account owner only (dashboard session).
165
244
  # @param post_api_billing_confirm_checkout_request [PostApiBillingConfirmCheckoutRequest]
166
245
  # @param [Hash] opts the optional parameters
167
246
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -226,7 +305,8 @@ module SeatsChart
226
305
  return data, status_code, headers
227
306
  end
228
307
 
229
- # Create Stripe Customer Portal session
308
+ # Create Stripe Customer Portal session (the account subscription)
309
+ # Returns `{ url }` of the Stripe billing portal of the billing account (change or cancel the subscription; the change applies to every workspace of the account). Account owner only, from a dashboard session (403 `billing_managed_by_owner` with `managedBy` for the other admins, 403 `billing_managed_by_platform` for the members of a workspace a ticketing platform manages). 409 `plan_managed_by_sales` on Ultra On-Demand (no Stripe subscription: switch plan with checkout or `POST /billing/actions/change-plan`), 409 `test_workspace_not_billable` in a test workspace.
230
310
  # @param [Hash] opts the optional parameters
231
311
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
232
312
  # @return [nil]
@@ -235,7 +315,8 @@ module SeatsChart
235
315
  nil
236
316
  end
237
317
 
238
- # Create Stripe Customer Portal session
318
+ # Create Stripe Customer Portal session (the account subscription)
319
+ # Returns &#x60;{ url }&#x60; of the Stripe billing portal of the billing account (change or cancel the subscription; the change applies to every workspace of the account). Account owner only, from a dashboard session (403 &#x60;billing_managed_by_owner&#x60; with &#x60;managedBy&#x60; for the other admins, 403 &#x60;billing_managed_by_platform&#x60; for the members of a workspace a ticketing platform manages). 409 &#x60;plan_managed_by_sales&#x60; on Ultra On-Demand (no Stripe subscription: switch plan with checkout or &#x60;POST /billing/actions/change-plan&#x60;), 409 &#x60;test_workspace_not_billable&#x60; in a test workspace.
239
320
  # @param [Hash] opts the optional parameters
240
321
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
241
322
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers