license_manager 0.3.1 → 0.3.3
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 +27 -0
- data/README.md +1 -1
- data/docs/IntegrationsApi.md +361 -0
- data/docs/License.md +1 -1
- 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/models/license.rb +2 -15
- 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 +4 -0
- data/license_manager.gemspec +9 -3
- data/openapi.json +650 -7
- data/spec/api/integrations_api_spec.rb +61 -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 +25 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84013ac7d9c28271647dd18819bc70dd898cfb1288da389456fc1235f7a51906
|
|
4
|
+
data.tar.gz: 95ab30ee9f61fe92885cbe869040e5a84d69c0fbb932fed51e524a927c3caf9b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c5ebe6ffa873d4c46ce31fb4d63dc4a46da24c49688fbaeebdfe4de5d39d75c338eb7822cc45c378ded4c24b2c0142644c95dc413697399a2f77ef9713ce57a
|
|
7
|
+
data.tar.gz: d73a8a3a5b929f6c8c404452ae0230e242da223cf1501fb0aac0164286195c98000e8b45ca1af9b66bb5d018cafa6d03abeff9aee5850831b657420b049d039b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 (2026-11-06)
|
|
4
|
+
|
|
5
|
+
### Potentially breaking changes
|
|
6
|
+
|
|
7
|
+
- `GET /v1/customers/{customerId}/licenses`: removed `#/components/schemas/CancellationReason, subschema #2` from the `data/items/cancellationReason` response property `allOf` list for the response status `200`
|
|
8
|
+
- `GET /v1/customers/{customerId}/licenses`: added `#/components/schemas/CancellationReason, subschema #2` to the `data/items/cancellationReason` response property `anyOf` list for the response status `200`
|
|
9
|
+
- `GET /v1/licenses/{id}`: removed `#/components/schemas/CancellationReason, subschema #2` from the `cancellationReason` response property `allOf` list for the response status `200`
|
|
10
|
+
- `GET /v1/licenses/{id}`: added `#/components/schemas/CancellationReason, subschema #2` to the `cancellationReason` response property `anyOf` list for the response status `200`
|
|
11
|
+
- `PATCH /v1/licenses/{id}`: removed `#/components/schemas/CancellationReason, subschema #2` from the `cancellationReason` response property `allOf` list for the response status `200`
|
|
12
|
+
- `PATCH /v1/licenses/{id}`: added `#/components/schemas/CancellationReason, subschema #2` to the `cancellationReason` response property `anyOf` list for the response status `200`
|
|
13
|
+
- `POST /v1/licenses/{id}/cancel`: removed `#/components/schemas/CancellationReason, subschema #2` from the `cancellationReason` response property `allOf` list for the response status `200`
|
|
14
|
+
- `POST /v1/licenses/{id}/cancel`: added `#/components/schemas/CancellationReason, subschema #2` to the `cancellationReason` response property `anyOf` list for the response status `200`
|
|
15
|
+
- `GET /v1/products/{productId}/licenses`: removed `#/components/schemas/CancellationReason, subschema #2` from the `data/items/cancellationReason` response property `allOf` list for the response status `200`
|
|
16
|
+
- `GET /v1/products/{productId}/licenses`: added `#/components/schemas/CancellationReason, subschema #2` to the `data/items/cancellationReason` response property `anyOf` list for the response status `200`
|
|
17
|
+
- `POST /v1/products/{productId}/licenses`: removed `#/components/schemas/CancellationReason, subschema #2` from the `cancellationReason` response property `allOf` list for the response status `201`
|
|
18
|
+
- `POST /v1/products/{productId}/licenses`: added `#/components/schemas/CancellationReason, subschema #2` to the `cancellationReason` response property `anyOf` list for the response status `201`
|
|
19
|
+
|
|
20
|
+
## 0.3.2 (2026-11-05)
|
|
21
|
+
|
|
22
|
+
### Changes
|
|
23
|
+
|
|
24
|
+
- `GET /v1/products/{productId}/integrations/slack`: endpoint added
|
|
25
|
+
- `POST /v1/products/{productId}/integrations/slack/authorize`: endpoint added
|
|
26
|
+
- `DELETE /v1/slack-connections/{id}`: endpoint added
|
|
27
|
+
- `PATCH /v1/slack-connections/{id}`: endpoint added
|
|
28
|
+
- `POST /v1/slack-connections/{id}/test`: endpoint added
|
|
29
|
+
|
|
3
30
|
## 0.3.1 (2026-11-04)
|
|
4
31
|
|
|
5
32
|
### 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
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
| **status** | [**LicenseStatus**](LicenseStatus.md) | | |
|
|
24
24
|
| **cancellable_until** | **Time** | End of the money back guarantee: until then, the customer can cancel the license from the customer portal, or with a token. Set from the policy's `moneyBackGuaranteeDays` when the license is created. `null` when the customer can't cancel it. | |
|
|
25
25
|
| **canceled_at** | **Time** | When the license was canceled: validating its key fails since. `null` when it wasn't. | |
|
|
26
|
-
| **cancellation_reason** | [**CancellationReason**](CancellationReason.md) |
|
|
26
|
+
| **cancellation_reason** | [**CancellationReason**](CancellationReason.md) | Why the license was canceled. `null` when it wasn't. | |
|
|
27
27
|
| **subscription** | [**LicenseSubscription**](LicenseSubscription.md) | | |
|
|
28
28
|
| **cancellation_comment** | **String** | Comment given when the license was canceled. `null` when there's none. | |
|
|
29
29
|
| **stripe_refund_id** | **String** | Id of the Stripe refund of the license's payment once it was canceled, through the Stripe integration. `null` otherwise. | |
|
|
@@ -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
|
+
|