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.
- checksums.yaml +4 -4
- data/README.md +44 -9
- data/lib/seatschart/api/audit_api.rb +2 -2
- data/lib/seatschart/api/auth_api.rb +4 -4
- data/lib/seatschart/api/billing_api.rb +93 -12
- data/lib/seatschart/api/charts_api.rb +52 -52
- data/lib/seatschart/api/events_api.rb +110 -104
- data/lib/seatschart/api/seasons_api.rb +88 -88
- data/lib/seatschart/api/seats_api.rb +6 -6
- data/lib/seatschart/api/usage_api.rb +4 -4
- data/lib/seatschart/api/workspace_api.rb +52 -40
- data/lib/seatschart/models/{api_error.rb → api_error_body.rb} +7 -7
- data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_members_by_user_id200_response.rb +221 -0
- data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response.rb +239 -0
- data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response_invitations_inner.rb +286 -0
- data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response.rb +239 -0
- data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response_members_inner.rb +288 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response.rb +288 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_account.rb +270 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_account_charts.rb +233 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_account_plan.rb +237 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner.rb +439 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_revenue.rb +234 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_usage.rb +271 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_seats.rb +431 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_overage.rb +233 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_projected.rb +237 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_totals.rb +318 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_revenue.rb +238 -0
- data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_seats.rb +253 -0
- data/lib/seatschart/models/post_api_billing_actions_change_plan_request.rb +256 -0
- data/lib/seatschart/models/post_api_events_by_event_id_actions_update_extra_data_request_objects_inner.rb +0 -2
- data/lib/seatschart/models/post_api_sandboxes201_response.rb +0 -4
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +0 -2
- data/lib/seatschart/models/post_api_workspaces200_response.rb +0 -4
- data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response.rb +238 -0
- data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response_invitation.rb +286 -0
- data/lib/seatschart/version.rb +1 -1
- data/lib/seatschart/workspaces.rb +172 -0
- data/lib/seatschart.rb +23 -3
- metadata +25 -5
- data/lib/seatschart/models/get_api_workspaces_created_by_api_parameter.rb +0 -103
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 590c96bfa128894d11dd556141fd811e137e0465115e0d29aecac3a5eeb4c190
|
|
4
|
+
data.tar.gz: '0289a7df24571425b5aa5ad678c88b4f357e4fa53251a8c9a435774d99016936'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
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
|
|
164
|
-
*SeatsChart::BillingApi* | [**
|
|
165
|
-
*SeatsChart::BillingApi* | [**
|
|
166
|
-
*SeatsChart::BillingApi* | [**
|
|
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::
|
|
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::
|
|
570
|
-
- [SeatsChart::
|
|
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 `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.
|
|
33
|
+
# 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.
|
|
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 `/auth/login` or `/auth/signup`.
|
|
154
|
+
# 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).
|
|
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 (`tenant_id`, `sub`, `email`, `role`).
|
|
1122
|
+
# Registers a new user, provisions a tenant workspace, and returns an HS256 dashboard JWT (`tenant_id`, `sub`, `email`, `role`, `is_test`).
|
|
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
|
|
23
|
-
#
|
|
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
|
|
32
|
-
#
|
|
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. `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.
|
|
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
|
-
#
|
|
78
|
-
#
|
|
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 `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.
|
|
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 `{ url }` of a Stripe Checkout for `planId` (`starter` | `pro`). 409 `ERR_SUBSCRIPTION_EXISTS` when the
|
|
165
|
+
# Create Stripe Checkout session for a paid plan (the whole account)
|
|
166
|
+
# 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).
|
|
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'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).
|
|
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 `{ 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.
|
|
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
|