license_manager 0.3.0 → 0.3.2
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/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/docs/IntegrationsApi.md +361 -0
- data/docs/License.md +2 -0
- data/docs/LicenseCustomer.md +22 -0
- data/docs/LicensesApi.md +4 -4
- data/docs/SlackAuthorize.md +18 -0
- data/docs/SlackConnection.md +38 -0
- data/docs/SlackIntegration.md +20 -0
- data/docs/UpdateSlackConnection.md +18 -0
- data/lib/license_manager/api/integrations_api.rb +326 -0
- data/lib/license_manager/api/licenses_api.rb +4 -4
- data/lib/license_manager/models/license.rb +27 -1
- data/lib/license_manager/models/license_customer.rb +217 -0
- data/lib/license_manager/models/slack_authorize.rb +178 -0
- data/lib/license_manager/models/slack_connection.rb +387 -0
- data/lib/license_manager/models/slack_integration.rb +207 -0
- data/lib/license_manager/models/update_slack_connection.rb +192 -0
- data/lib/license_manager/version.rb +1 -1
- data/lib/license_manager.rb +5 -0
- data/openapi.json +682 -4
- data/spec/api/integrations_api_spec.rb +61 -0
- data/spec/api/licenses_api_spec.rb +2 -2
- data/spec/models/license_customer_spec.rb +48 -0
- data/spec/models/license_spec.rb +6 -0
- data/spec/models/slack_authorize_spec.rb +36 -0
- data/spec/models/slack_connection_spec.rb +104 -0
- data/spec/models/slack_integration_spec.rb +42 -0
- data/spec/models/update_slack_connection_spec.rb +40 -0
- metadata +21 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20647dd29895350d4dadc4bab710756eb748a814c67e08a7c8a9e0661b472caa
|
|
4
|
+
data.tar.gz: '004191f59667807fb23c21aaf7548ca7fa6c821254603a285fb51bde85d511ab'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 446e1c8285486571af235bdd1f162ba2d8fd2b44788051b019249f5b2e0c75a78146a107c2182d76eb01db4cf4b4147748e6a642740b53f9e0673158702ccb20
|
|
7
|
+
data.tar.gz: '093cdc1dee0f7f4dbdcf7039996b9a9ae76377dd347df40f6315114d35d84544aba352e2d7d15e3442ed7012c61ba3f025d1f15ef3aad3cdabd44025a300f303'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.2 (2026-11-05)
|
|
4
|
+
|
|
5
|
+
### Changes
|
|
6
|
+
|
|
7
|
+
- `GET /v1/products/{productId}/integrations/slack`: endpoint added
|
|
8
|
+
- `POST /v1/products/{productId}/integrations/slack/authorize`: endpoint added
|
|
9
|
+
- `DELETE /v1/slack-connections/{id}`: endpoint added
|
|
10
|
+
- `PATCH /v1/slack-connections/{id}`: endpoint added
|
|
11
|
+
- `POST /v1/slack-connections/{id}/test`: endpoint added
|
|
12
|
+
|
|
13
|
+
## 0.3.1 (2026-11-04)
|
|
14
|
+
|
|
15
|
+
### Changes
|
|
16
|
+
|
|
17
|
+
- `GET /v1/customers/{customerId}/licenses`: added the required property `data/items/customer` to the response with the `200` status
|
|
18
|
+
- `GET /v1/licenses/{id}`: added the required property `customer` to the response with the `200` status
|
|
19
|
+
- `PATCH /v1/licenses/{id}`: added the required property `customer` to the response with the `200` status
|
|
20
|
+
- `POST /v1/licenses/{id}/cancel`: added the required property `customer` to the response with the `200` status
|
|
21
|
+
- `GET /v1/products/{productId}/licenses`: added the required property `data/items/customer` to the response with the `200` status
|
|
22
|
+
- `POST /v1/products/{productId}/licenses`: added the required property `customer` to the response with the `201` status
|
|
23
|
+
|
|
3
24
|
## 0.3.0 (2026-10-27)
|
|
4
25
|
|
|
5
26
|
### Breaking changes
|
data/README.md
CHANGED
|
@@ -85,7 +85,7 @@ Every method is documented, with its parameters and responses, in the [`docs`](d
|
|
|
85
85
|
| [`ReleasesApi`](docs/ReleasesApi.md) | `list_releases`, `create_release`, `get_release`, `delete_release`, `update_release` |
|
|
86
86
|
| [`TokensApi`](docs/TokensApi.md) | `create_customer_token`, `create_license_token`, `create_machine_token` |
|
|
87
87
|
| [`EventsApi`](docs/EventsApi.md) | `list_policy_events`, `list_license_events` |
|
|
88
|
-
| [`IntegrationsApi`](docs/IntegrationsApi.md) | `get_stripe_integration`, `connect_stripe`, `disconnect_integration`, `update_integration`, `check_integration`, `list_stripe_prices`, `create_stripe_mapping`, `delete_stripe_mapping`, `update_stripe_mapping` |
|
|
88
|
+
| [`IntegrationsApi`](docs/IntegrationsApi.md) | `get_stripe_integration`, `connect_stripe`, `disconnect_integration`, `update_integration`, `check_integration`, `list_stripe_prices`, `create_stripe_mapping`, `delete_stripe_mapping`, `update_stripe_mapping`, `get_slack_integration`, `authorize_slack`, `delete_slack_connection`, `update_slack_connection`, `test_slack_connection` |
|
|
89
89
|
|
|
90
90
|
## Versioning
|
|
91
91
|
|
data/docs/IntegrationsApi.md
CHANGED
|
@@ -4,17 +4,93 @@ All URIs are relative to *https://api.licensemanager.dev*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**authorize_slack**](IntegrationsApi.md#authorize_slack) | **POST** /v1/products/{productId}/integrations/slack/authorize | Start connecting a Slack channel |
|
|
7
8
|
| [**check_integration**](IntegrationsApi.md#check_integration) | **POST** /v1/integrations/{id}/check | Check an integration |
|
|
8
9
|
| [**connect_stripe**](IntegrationsApi.md#connect_stripe) | **PUT** /v1/products/{productId}/integrations/stripe | Connect Stripe |
|
|
9
10
|
| [**create_stripe_mapping**](IntegrationsApi.md#create_stripe_mapping) | **POST** /v1/products/{productId}/integrations/stripe/mappings | Map a Stripe price to a policy |
|
|
11
|
+
| [**delete_slack_connection**](IntegrationsApi.md#delete_slack_connection) | **DELETE** /v1/slack-connections/{id} | Remove a Slack connection |
|
|
10
12
|
| [**delete_stripe_mapping**](IntegrationsApi.md#delete_stripe_mapping) | **DELETE** /v1/integration-mappings/{id} | Delete a mapping |
|
|
11
13
|
| [**disconnect_integration**](IntegrationsApi.md#disconnect_integration) | **DELETE** /v1/integrations/{id} | Disconnect an integration |
|
|
14
|
+
| [**get_slack_integration**](IntegrationsApi.md#get_slack_integration) | **GET** /v1/products/{productId}/integrations/slack | Get the Slack integration of a product |
|
|
12
15
|
| [**get_stripe_integration**](IntegrationsApi.md#get_stripe_integration) | **GET** /v1/products/{productId}/integrations/stripe | Get the Stripe integration of a product |
|
|
13
16
|
| [**list_stripe_prices**](IntegrationsApi.md#list_stripe_prices) | **GET** /v1/integrations/{id}/stripe/prices | List the Stripe prices of an integration |
|
|
17
|
+
| [**test_slack_connection**](IntegrationsApi.md#test_slack_connection) | **POST** /v1/slack-connections/{id}/test | Send a test message to a Slack channel |
|
|
14
18
|
| [**update_integration**](IntegrationsApi.md#update_integration) | **PATCH** /v1/integrations/{id} | Update an integration |
|
|
19
|
+
| [**update_slack_connection**](IntegrationsApi.md#update_slack_connection) | **PATCH** /v1/slack-connections/{id} | Update a Slack connection |
|
|
15
20
|
| [**update_stripe_mapping**](IntegrationsApi.md#update_stripe_mapping) | **PATCH** /v1/integration-mappings/{id} | Change the policy of a mapping |
|
|
16
21
|
|
|
17
22
|
|
|
23
|
+
## authorize_slack
|
|
24
|
+
|
|
25
|
+
> <SlackAuthorize> authorize_slack(product_id)
|
|
26
|
+
|
|
27
|
+
Start connecting a Slack channel
|
|
28
|
+
|
|
29
|
+
Returns the URL of Slack's consent screen, where the user picks the channel getting the product's notifications. Slack then redirects to the app's integrations page. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
30
|
+
|
|
31
|
+
### Examples
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
require 'time'
|
|
35
|
+
require 'license_manager'
|
|
36
|
+
# setup authorization
|
|
37
|
+
LicenseManager.configure do |config|
|
|
38
|
+
# Configure API key authorization: apiKey
|
|
39
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
40
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
41
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
api_instance = LicenseManager::IntegrationsApi.new
|
|
45
|
+
product_id = 'x7Kp2QaZ' # String |
|
|
46
|
+
|
|
47
|
+
begin
|
|
48
|
+
# Start connecting a Slack channel
|
|
49
|
+
result = api_instance.authorize_slack(product_id)
|
|
50
|
+
p result
|
|
51
|
+
rescue LicenseManager::ApiError => e
|
|
52
|
+
puts "Error when calling IntegrationsApi->authorize_slack: #{e}"
|
|
53
|
+
end
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Using the authorize_slack_with_http_info variant
|
|
57
|
+
|
|
58
|
+
This returns an Array which contains the response data, status code and headers.
|
|
59
|
+
|
|
60
|
+
> <Array(<SlackAuthorize>, Integer, Hash)> authorize_slack_with_http_info(product_id)
|
|
61
|
+
|
|
62
|
+
```ruby
|
|
63
|
+
begin
|
|
64
|
+
# Start connecting a Slack channel
|
|
65
|
+
data, status_code, headers = api_instance.authorize_slack_with_http_info(product_id)
|
|
66
|
+
p status_code # => 2xx
|
|
67
|
+
p headers # => { ... }
|
|
68
|
+
p data # => <SlackAuthorize>
|
|
69
|
+
rescue LicenseManager::ApiError => e
|
|
70
|
+
puts "Error when calling IntegrationsApi->authorize_slack_with_http_info: #{e}"
|
|
71
|
+
end
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Parameters
|
|
75
|
+
|
|
76
|
+
| Name | Type | Description | Notes |
|
|
77
|
+
| ---- | ---- | ----------- | ----- |
|
|
78
|
+
| **product_id** | **String** | | |
|
|
79
|
+
|
|
80
|
+
### Return type
|
|
81
|
+
|
|
82
|
+
[**SlackAuthorize**](SlackAuthorize.md)
|
|
83
|
+
|
|
84
|
+
### Authorization
|
|
85
|
+
|
|
86
|
+
[apiKey](../README.md#apiKey)
|
|
87
|
+
|
|
88
|
+
### HTTP request headers
|
|
89
|
+
|
|
90
|
+
- **Content-Type**: Not defined
|
|
91
|
+
- **Accept**: application/json
|
|
92
|
+
|
|
93
|
+
|
|
18
94
|
## check_integration
|
|
19
95
|
|
|
20
96
|
> <Integration> check_integration(id)
|
|
@@ -232,6 +308,76 @@ end
|
|
|
232
308
|
- **Accept**: application/json
|
|
233
309
|
|
|
234
310
|
|
|
311
|
+
## delete_slack_connection
|
|
312
|
+
|
|
313
|
+
> delete_slack_connection(id)
|
|
314
|
+
|
|
315
|
+
Remove a Slack connection
|
|
316
|
+
|
|
317
|
+
Stops posting to the channel and revokes the installation's token in Slack. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
318
|
+
|
|
319
|
+
### Examples
|
|
320
|
+
|
|
321
|
+
```ruby
|
|
322
|
+
require 'time'
|
|
323
|
+
require 'license_manager'
|
|
324
|
+
# setup authorization
|
|
325
|
+
LicenseManager.configure do |config|
|
|
326
|
+
# Configure API key authorization: apiKey
|
|
327
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
328
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
329
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
api_instance = LicenseManager::IntegrationsApi.new
|
|
333
|
+
id = 's4Hq8ZpLm' # String |
|
|
334
|
+
|
|
335
|
+
begin
|
|
336
|
+
# Remove a Slack connection
|
|
337
|
+
api_instance.delete_slack_connection(id)
|
|
338
|
+
rescue LicenseManager::ApiError => e
|
|
339
|
+
puts "Error when calling IntegrationsApi->delete_slack_connection: #{e}"
|
|
340
|
+
end
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### Using the delete_slack_connection_with_http_info variant
|
|
344
|
+
|
|
345
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
346
|
+
|
|
347
|
+
> <Array(nil, Integer, Hash)> delete_slack_connection_with_http_info(id)
|
|
348
|
+
|
|
349
|
+
```ruby
|
|
350
|
+
begin
|
|
351
|
+
# Remove a Slack connection
|
|
352
|
+
data, status_code, headers = api_instance.delete_slack_connection_with_http_info(id)
|
|
353
|
+
p status_code # => 2xx
|
|
354
|
+
p headers # => { ... }
|
|
355
|
+
p data # => nil
|
|
356
|
+
rescue LicenseManager::ApiError => e
|
|
357
|
+
puts "Error when calling IntegrationsApi->delete_slack_connection_with_http_info: #{e}"
|
|
358
|
+
end
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Parameters
|
|
362
|
+
|
|
363
|
+
| Name | Type | Description | Notes |
|
|
364
|
+
| ---- | ---- | ----------- | ----- |
|
|
365
|
+
| **id** | **String** | | |
|
|
366
|
+
|
|
367
|
+
### Return type
|
|
368
|
+
|
|
369
|
+
nil (empty response body)
|
|
370
|
+
|
|
371
|
+
### Authorization
|
|
372
|
+
|
|
373
|
+
[apiKey](../README.md#apiKey)
|
|
374
|
+
|
|
375
|
+
### HTTP request headers
|
|
376
|
+
|
|
377
|
+
- **Content-Type**: Not defined
|
|
378
|
+
- **Accept**: application/json
|
|
379
|
+
|
|
380
|
+
|
|
235
381
|
## delete_stripe_mapping
|
|
236
382
|
|
|
237
383
|
> delete_stripe_mapping(id)
|
|
@@ -372,6 +518,77 @@ nil (empty response body)
|
|
|
372
518
|
- **Accept**: application/json
|
|
373
519
|
|
|
374
520
|
|
|
521
|
+
## get_slack_integration
|
|
522
|
+
|
|
523
|
+
> <SlackIntegration> get_slack_integration(product_id)
|
|
524
|
+
|
|
525
|
+
Get the Slack integration of a product
|
|
526
|
+
|
|
527
|
+
Slack channels getting notifications about the product's licenses: purchases, renewals, failed payments and cancellations. Doesn't accept tokens: only API keys and sessions.
|
|
528
|
+
|
|
529
|
+
### Examples
|
|
530
|
+
|
|
531
|
+
```ruby
|
|
532
|
+
require 'time'
|
|
533
|
+
require 'license_manager'
|
|
534
|
+
# setup authorization
|
|
535
|
+
LicenseManager.configure do |config|
|
|
536
|
+
# Configure API key authorization: apiKey
|
|
537
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
538
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
539
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
540
|
+
end
|
|
541
|
+
|
|
542
|
+
api_instance = LicenseManager::IntegrationsApi.new
|
|
543
|
+
product_id = 'x7Kp2QaZ' # String |
|
|
544
|
+
|
|
545
|
+
begin
|
|
546
|
+
# Get the Slack integration of a product
|
|
547
|
+
result = api_instance.get_slack_integration(product_id)
|
|
548
|
+
p result
|
|
549
|
+
rescue LicenseManager::ApiError => e
|
|
550
|
+
puts "Error when calling IntegrationsApi->get_slack_integration: #{e}"
|
|
551
|
+
end
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
#### Using the get_slack_integration_with_http_info variant
|
|
555
|
+
|
|
556
|
+
This returns an Array which contains the response data, status code and headers.
|
|
557
|
+
|
|
558
|
+
> <Array(<SlackIntegration>, Integer, Hash)> get_slack_integration_with_http_info(product_id)
|
|
559
|
+
|
|
560
|
+
```ruby
|
|
561
|
+
begin
|
|
562
|
+
# Get the Slack integration of a product
|
|
563
|
+
data, status_code, headers = api_instance.get_slack_integration_with_http_info(product_id)
|
|
564
|
+
p status_code # => 2xx
|
|
565
|
+
p headers # => { ... }
|
|
566
|
+
p data # => <SlackIntegration>
|
|
567
|
+
rescue LicenseManager::ApiError => e
|
|
568
|
+
puts "Error when calling IntegrationsApi->get_slack_integration_with_http_info: #{e}"
|
|
569
|
+
end
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### Parameters
|
|
573
|
+
|
|
574
|
+
| Name | Type | Description | Notes |
|
|
575
|
+
| ---- | ---- | ----------- | ----- |
|
|
576
|
+
| **product_id** | **String** | | |
|
|
577
|
+
|
|
578
|
+
### Return type
|
|
579
|
+
|
|
580
|
+
[**SlackIntegration**](SlackIntegration.md)
|
|
581
|
+
|
|
582
|
+
### Authorization
|
|
583
|
+
|
|
584
|
+
[apiKey](../README.md#apiKey)
|
|
585
|
+
|
|
586
|
+
### HTTP request headers
|
|
587
|
+
|
|
588
|
+
- **Content-Type**: Not defined
|
|
589
|
+
- **Accept**: application/json
|
|
590
|
+
|
|
591
|
+
|
|
375
592
|
## get_stripe_integration
|
|
376
593
|
|
|
377
594
|
> <StripeIntegration> get_stripe_integration(product_id)
|
|
@@ -514,6 +731,77 @@ end
|
|
|
514
731
|
- **Accept**: application/json
|
|
515
732
|
|
|
516
733
|
|
|
734
|
+
## test_slack_connection
|
|
735
|
+
|
|
736
|
+
> <SlackConnection> test_slack_connection(id)
|
|
737
|
+
|
|
738
|
+
Send a test message to a Slack channel
|
|
739
|
+
|
|
740
|
+
Posts a message to the channel, to check it gets the notifications. Marks the connection `revoked` when Slack says it won't work again. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
741
|
+
|
|
742
|
+
### Examples
|
|
743
|
+
|
|
744
|
+
```ruby
|
|
745
|
+
require 'time'
|
|
746
|
+
require 'license_manager'
|
|
747
|
+
# setup authorization
|
|
748
|
+
LicenseManager.configure do |config|
|
|
749
|
+
# Configure API key authorization: apiKey
|
|
750
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
751
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
752
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
753
|
+
end
|
|
754
|
+
|
|
755
|
+
api_instance = LicenseManager::IntegrationsApi.new
|
|
756
|
+
id = 's4Hq8ZpLm' # String |
|
|
757
|
+
|
|
758
|
+
begin
|
|
759
|
+
# Send a test message to a Slack channel
|
|
760
|
+
result = api_instance.test_slack_connection(id)
|
|
761
|
+
p result
|
|
762
|
+
rescue LicenseManager::ApiError => e
|
|
763
|
+
puts "Error when calling IntegrationsApi->test_slack_connection: #{e}"
|
|
764
|
+
end
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
#### Using the test_slack_connection_with_http_info variant
|
|
768
|
+
|
|
769
|
+
This returns an Array which contains the response data, status code and headers.
|
|
770
|
+
|
|
771
|
+
> <Array(<SlackConnection>, Integer, Hash)> test_slack_connection_with_http_info(id)
|
|
772
|
+
|
|
773
|
+
```ruby
|
|
774
|
+
begin
|
|
775
|
+
# Send a test message to a Slack channel
|
|
776
|
+
data, status_code, headers = api_instance.test_slack_connection_with_http_info(id)
|
|
777
|
+
p status_code # => 2xx
|
|
778
|
+
p headers # => { ... }
|
|
779
|
+
p data # => <SlackConnection>
|
|
780
|
+
rescue LicenseManager::ApiError => e
|
|
781
|
+
puts "Error when calling IntegrationsApi->test_slack_connection_with_http_info: #{e}"
|
|
782
|
+
end
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
### Parameters
|
|
786
|
+
|
|
787
|
+
| Name | Type | Description | Notes |
|
|
788
|
+
| ---- | ---- | ----------- | ----- |
|
|
789
|
+
| **id** | **String** | | |
|
|
790
|
+
|
|
791
|
+
### Return type
|
|
792
|
+
|
|
793
|
+
[**SlackConnection**](SlackConnection.md)
|
|
794
|
+
|
|
795
|
+
### Authorization
|
|
796
|
+
|
|
797
|
+
[apiKey](../README.md#apiKey)
|
|
798
|
+
|
|
799
|
+
### HTTP request headers
|
|
800
|
+
|
|
801
|
+
- **Content-Type**: Not defined
|
|
802
|
+
- **Accept**: application/json
|
|
803
|
+
|
|
804
|
+
|
|
517
805
|
## update_integration
|
|
518
806
|
|
|
519
807
|
> <Integration> update_integration(id, update_integration)
|
|
@@ -587,6 +875,79 @@ end
|
|
|
587
875
|
- **Accept**: application/json
|
|
588
876
|
|
|
589
877
|
|
|
878
|
+
## update_slack_connection
|
|
879
|
+
|
|
880
|
+
> <SlackConnection> update_slack_connection(id, update_slack_connection)
|
|
881
|
+
|
|
882
|
+
Update a Slack connection
|
|
883
|
+
|
|
884
|
+
Changes the notifications the channel gets. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
885
|
+
|
|
886
|
+
### Examples
|
|
887
|
+
|
|
888
|
+
```ruby
|
|
889
|
+
require 'time'
|
|
890
|
+
require 'license_manager'
|
|
891
|
+
# setup authorization
|
|
892
|
+
LicenseManager.configure do |config|
|
|
893
|
+
# Configure API key authorization: apiKey
|
|
894
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
895
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
896
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
897
|
+
end
|
|
898
|
+
|
|
899
|
+
api_instance = LicenseManager::IntegrationsApi.new
|
|
900
|
+
id = 's4Hq8ZpLm' # String |
|
|
901
|
+
update_slack_connection = LicenseManager::UpdateSlackConnection.new({events: [purchased, canceled]}) # UpdateSlackConnection |
|
|
902
|
+
|
|
903
|
+
begin
|
|
904
|
+
# Update a Slack connection
|
|
905
|
+
result = api_instance.update_slack_connection(id, update_slack_connection)
|
|
906
|
+
p result
|
|
907
|
+
rescue LicenseManager::ApiError => e
|
|
908
|
+
puts "Error when calling IntegrationsApi->update_slack_connection: #{e}"
|
|
909
|
+
end
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
#### Using the update_slack_connection_with_http_info variant
|
|
913
|
+
|
|
914
|
+
This returns an Array which contains the response data, status code and headers.
|
|
915
|
+
|
|
916
|
+
> <Array(<SlackConnection>, Integer, Hash)> update_slack_connection_with_http_info(id, update_slack_connection)
|
|
917
|
+
|
|
918
|
+
```ruby
|
|
919
|
+
begin
|
|
920
|
+
# Update a Slack connection
|
|
921
|
+
data, status_code, headers = api_instance.update_slack_connection_with_http_info(id, update_slack_connection)
|
|
922
|
+
p status_code # => 2xx
|
|
923
|
+
p headers # => { ... }
|
|
924
|
+
p data # => <SlackConnection>
|
|
925
|
+
rescue LicenseManager::ApiError => e
|
|
926
|
+
puts "Error when calling IntegrationsApi->update_slack_connection_with_http_info: #{e}"
|
|
927
|
+
end
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
### Parameters
|
|
931
|
+
|
|
932
|
+
| Name | Type | Description | Notes |
|
|
933
|
+
| ---- | ---- | ----------- | ----- |
|
|
934
|
+
| **id** | **String** | | |
|
|
935
|
+
| **update_slack_connection** | [**UpdateSlackConnection**](UpdateSlackConnection.md) | | |
|
|
936
|
+
|
|
937
|
+
### Return type
|
|
938
|
+
|
|
939
|
+
[**SlackConnection**](SlackConnection.md)
|
|
940
|
+
|
|
941
|
+
### Authorization
|
|
942
|
+
|
|
943
|
+
[apiKey](../README.md#apiKey)
|
|
944
|
+
|
|
945
|
+
### HTTP request headers
|
|
946
|
+
|
|
947
|
+
- **Content-Type**: application/json
|
|
948
|
+
- **Accept**: application/json
|
|
949
|
+
|
|
950
|
+
|
|
590
951
|
## update_stripe_mapping
|
|
591
952
|
|
|
592
953
|
> <IntegrationMapping> update_stripe_mapping(id, update_integration_mapping)
|
data/docs/License.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **product_id** | **String** | | |
|
|
9
9
|
| **policy_id** | **String** | | |
|
|
10
10
|
| **customer_id** | **String** | | |
|
|
11
|
+
| **customer** | [**LicenseCustomer**](LicenseCustomer.md) | | |
|
|
11
12
|
| **key** | **String** | Unique within the product. Case sensitive: `validateKey` compares keys exactly. | |
|
|
12
13
|
| **created_at** | **Time** | | |
|
|
13
14
|
| **expires_at** | **Time** | `null` when the license never expires. | |
|
|
@@ -38,6 +39,7 @@ instance = LicenseManager::License.new(
|
|
|
38
39
|
product_id: x7Kp2QaZ,
|
|
39
40
|
policy_id: p4Rt8LmQ,
|
|
40
41
|
customer_id: c9Wd3RtE,
|
|
42
|
+
customer: null,
|
|
41
43
|
key: 7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF,
|
|
42
44
|
created_at: 2026-01-15T09:30:00.000Z,
|
|
43
45
|
expires_at: 2027-01-15T09:30:00.000Z,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# LicenseManager::LicenseCustomer
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | |
|
|
8
|
+
| **email** | **String** | | |
|
|
9
|
+
| **name** | **String** | Display name of the customer. `null` when unknown. | |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'license_manager'
|
|
15
|
+
|
|
16
|
+
instance = LicenseManager::LicenseCustomer.new(
|
|
17
|
+
id: c9Wd3RtE,
|
|
18
|
+
email: jane@example.com,
|
|
19
|
+
name: Jane Doe
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/LicensesApi.md
CHANGED
|
@@ -479,7 +479,7 @@ opts = {
|
|
|
479
479
|
page: 1, # Integer | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.
|
|
480
480
|
page_size: 20, # Integer | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.
|
|
481
481
|
sort: 'key', # String | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.
|
|
482
|
-
search: 'X9ZPA', # String | Case-insensitive text the key contains.
|
|
482
|
+
search: 'X9ZPA', # String | Case-insensitive text the key or the email of the customer contains.
|
|
483
483
|
key: '7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF', # String | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.
|
|
484
484
|
policy_id: 'p4Rt8LmQ', # String | Only returns the licenses following this policy.
|
|
485
485
|
machine_version: '2.3.1', # String | Only returns the licenses with at least one active machine running this version of the product.
|
|
@@ -534,7 +534,7 @@ end
|
|
|
534
534
|
| **page** | **Integer** | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`. | [optional][default to 1] |
|
|
535
535
|
| **page_size** | **Integer** | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`. | [optional][default to 20] |
|
|
536
536
|
| **sort** | **String** | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`. | [optional][default to '-createdAt'] |
|
|
537
|
-
| **search** | **String** | Case-insensitive text the key contains. | [optional] |
|
|
537
|
+
| **search** | **String** | Case-insensitive text the key or the email of the customer contains. | [optional] |
|
|
538
538
|
| **key** | **String** | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`. | [optional] |
|
|
539
539
|
| **policy_id** | **String** | Only returns the licenses following this policy. | [optional] |
|
|
540
540
|
| **machine_version** | **String** | Only returns the licenses with at least one active machine running this version of the product. | [optional] |
|
|
@@ -594,7 +594,7 @@ opts = {
|
|
|
594
594
|
page: 1, # Integer | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.
|
|
595
595
|
page_size: 20, # Integer | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.
|
|
596
596
|
sort: 'key', # String | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.
|
|
597
|
-
search: 'X9ZPA', # String | Case-insensitive text the key contains.
|
|
597
|
+
search: 'X9ZPA', # String | Case-insensitive text the key or the email of the customer contains.
|
|
598
598
|
key: '7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF', # String | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.
|
|
599
599
|
policy_id: 'p4Rt8LmQ', # String | Only returns the licenses following this policy.
|
|
600
600
|
customer_id: 'c9Wd3RtE', # String | Only returns the licenses of this customer.
|
|
@@ -650,7 +650,7 @@ end
|
|
|
650
650
|
| **page** | **Integer** | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`. | [optional][default to 1] |
|
|
651
651
|
| **page_size** | **Integer** | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`. | [optional][default to 20] |
|
|
652
652
|
| **sort** | **String** | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`. | [optional][default to '-createdAt'] |
|
|
653
|
-
| **search** | **String** | Case-insensitive text the key contains. | [optional] |
|
|
653
|
+
| **search** | **String** | Case-insensitive text the key or the email of the customer contains. | [optional] |
|
|
654
654
|
| **key** | **String** | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`. | [optional] |
|
|
655
655
|
| **policy_id** | **String** | Only returns the licenses following this policy. | [optional] |
|
|
656
656
|
| **customer_id** | **String** | Only returns the licenses of this customer. | [optional] |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# LicenseManager::SlackAuthorize
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **url** | **String** | Slack's consent screen: open it in the browser to pick the channel. Valid 10 minutes. | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'license_manager'
|
|
13
|
+
|
|
14
|
+
instance = LicenseManager::SlackAuthorize.new(
|
|
15
|
+
url: https://slack.com/oauth/v2/authorize?client_id=…
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# LicenseManager::SlackConnection
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | | |
|
|
8
|
+
| **team_id** | **String** | | |
|
|
9
|
+
| **team_name** | **String** | | |
|
|
10
|
+
| **channel_id** | **String** | | |
|
|
11
|
+
| **channel_name** | **String** | Name of the channel when it was connected, with its `#`. | |
|
|
12
|
+
| **configuration_url** | **String** | Page of the installation in Slack. | |
|
|
13
|
+
| **events** | **Array<String>** | Notifications the channel gets: `purchased` (a license bought through Stripe), `renewed` (a subscription renewal paid), `payment_failed` (a subscription payment failed) and `canceled` (a license canceled, or its subscription ended). | |
|
|
14
|
+
| **status** | **String** | `revoked` once Slack refuses the messages, like when the app was removed from the workspace or the channel deleted: remove it and add it again. | |
|
|
15
|
+
| **status_reason** | **String** | | |
|
|
16
|
+
| **last_sent_at** | **Time** | | |
|
|
17
|
+
| **created_at** | **Time** | | |
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
require 'license_manager'
|
|
23
|
+
|
|
24
|
+
instance = LicenseManager::SlackConnection.new(
|
|
25
|
+
id: s4Hq8ZpLm,
|
|
26
|
+
team_id: T0123ABCD,
|
|
27
|
+
team_name: Acme,
|
|
28
|
+
channel_id: C0456EFGH,
|
|
29
|
+
channel_name: #sales,
|
|
30
|
+
configuration_url: null,
|
|
31
|
+
events: null,
|
|
32
|
+
status: null,
|
|
33
|
+
status_reason: null,
|
|
34
|
+
last_sent_at: null,
|
|
35
|
+
created_at: null
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# LicenseManager::SlackIntegration
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **configured** | **Boolean** | Whether the server has a Slack app to connect channels with: `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` are set. | |
|
|
8
|
+
| **connections** | [**Array<SlackConnection>**](SlackConnection.md) | Slack channels getting the product's notifications. | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'license_manager'
|
|
14
|
+
|
|
15
|
+
instance = LicenseManager::SlackIntegration.new(
|
|
16
|
+
configured: null,
|
|
17
|
+
connections: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# LicenseManager::UpdateSlackConnection
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **events** | **Array<String>** | Notifications the channel gets. | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'license_manager'
|
|
13
|
+
|
|
14
|
+
instance = LicenseManager::UpdateSlackConnection.new(
|
|
15
|
+
events: [purchased, canceled]
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|