docs/WebhooksApi.md in launchdarkly_api-5.4.0 vs docs/WebhooksApi.md in launchdarkly_api-6.0.0

- old
+ new

@@ -1,269 +1,365 @@ # LaunchDarklyApi::WebhooksApi -All URIs are relative to *https://app.launchdarkly.com/api/v2* +All URIs are relative to *https://app.launchdarkly.com* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /webhooks/{resourceId} | Delete a webhook by ID. -[**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /webhooks/{resourceId} | Get a webhook by ID. -[**get_webhooks**](WebhooksApi.md#get_webhooks) | **GET** /webhooks | Fetch a list of all webhooks. -[**patch_webhook**](WebhooksApi.md#patch_webhook) | **PATCH** /webhooks/{resourceId} | Modify a webhook by ID. -[**post_webhook**](WebhooksApi.md#post_webhook) | **POST** /webhooks | Create a webhook. +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /api/v2/webhooks/{id} | Delete webhook | +| [**get_all_webhooks**](WebhooksApi.md#get_all_webhooks) | **GET** /api/v2/webhooks | List webhooks | +| [**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /api/v2/webhooks/{id} | Get webhook | +| [**patch_webhook**](WebhooksApi.md#patch_webhook) | **PATCH** /api/v2/webhooks/{id} | Update webhook | +| [**post_webhook**](WebhooksApi.md#post_webhook) | **POST** /api/v2/webhooks | Creates a webhook | -# **delete_webhook** -> delete_webhook(resource_id, ) +## delete_webhook +> delete_webhook(id) + +Delete webhook + Delete a webhook by ID. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'launchdarkly_api' # setup authorization LaunchDarklyApi.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' + # Configure API key authorization: ApiKey + config.api_key['ApiKey'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' + # config.api_key_prefix['ApiKey'] = 'Bearer' end api_instance = LaunchDarklyApi::WebhooksApi.new +id = 'id_example' # String | The ID of the webhook to delete -resource_id = 'resource_id_example' # String | The resource ID. +begin + # Delete webhook + api_instance.delete_webhook(id) +rescue LaunchDarklyApi::ApiError => e + puts "Error when calling WebhooksApi->delete_webhook: #{e}" +end +``` +#### Using the delete_webhook_with_http_info variant +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> <Array(nil, Integer, Hash)> delete_webhook_with_http_info(id) + +```ruby begin - #Delete a webhook by ID. - api_instance.delete_webhook(resource_id, ) + # Delete webhook + data, status_code, headers = api_instance.delete_webhook_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue LaunchDarklyApi::ApiError => e - puts "Exception when calling WebhooksApi->delete_webhook: #{e}" + puts "Error when calling WebhooksApi->delete_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **resource_id** | **String**| The resource ID. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The ID of the webhook to delete | | ### Return type nil (empty response body) ### Authorization -[Token](../README.md#Token) +[ApiKey](../README.md#ApiKey) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: Not defined +## get_all_webhooks -# **get_webhook** -> Webhook get_webhook(resource_id, ) +> <Webhooks> get_all_webhooks -Get a webhook by ID. +List webhooks -### Example +Fetch a list of all webhooks. + +### Examples + ```ruby -# load the gem +require 'time' require 'launchdarkly_api' # setup authorization LaunchDarklyApi.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' + # Configure API key authorization: ApiKey + config.api_key['ApiKey'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' + # config.api_key_prefix['ApiKey'] = 'Bearer' end api_instance = LaunchDarklyApi::WebhooksApi.new -resource_id = 'resource_id_example' # String | The resource ID. +begin + # List webhooks + result = api_instance.get_all_webhooks + p result +rescue LaunchDarklyApi::ApiError => e + puts "Error when calling WebhooksApi->get_all_webhooks: #{e}" +end +``` +#### Using the get_all_webhooks_with_http_info variant +This returns an Array which contains the response data, status code and headers. + +> <Array(<Webhooks>, Integer, Hash)> get_all_webhooks_with_http_info + +```ruby begin - #Get a webhook by ID. - result = api_instance.get_webhook(resource_id, ) - p result + # List webhooks + data, status_code, headers = api_instance.get_all_webhooks_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => <Webhooks> rescue LaunchDarklyApi::ApiError => e - puts "Exception when calling WebhooksApi->get_webhook: #{e}" + puts "Error when calling WebhooksApi->get_all_webhooks_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **resource_id** | **String**| The resource ID. | +This endpoint does not need any parameter. ### Return type -[**Webhook**](Webhook.md) +[**Webhooks**](Webhooks.md) ### Authorization -[Token](../README.md#Token) +[ApiKey](../README.md#ApiKey) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_webhook -# **get_webhooks** -> Webhooks get_webhooks +> <Webhook> get_webhook(id) -Fetch a list of all webhooks. +Get webhook -### Example +Get a single webhook by ID. + +### Examples + ```ruby -# load the gem +require 'time' require 'launchdarkly_api' # setup authorization LaunchDarklyApi.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' + # Configure API key authorization: ApiKey + config.api_key['ApiKey'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' + # config.api_key_prefix['ApiKey'] = 'Bearer' end api_instance = LaunchDarklyApi::WebhooksApi.new +id = 'id_example' # String | The ID of the webhook begin - #Fetch a list of all webhooks. - result = api_instance.get_webhooks + # Get webhook + result = api_instance.get_webhook(id) p result rescue LaunchDarklyApi::ApiError => e - puts "Exception when calling WebhooksApi->get_webhooks: #{e}" + puts "Error when calling WebhooksApi->get_webhook: #{e}" end ``` +#### Using the get_webhook_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> <Array(<Webhook>, Integer, Hash)> get_webhook_with_http_info(id) + +```ruby +begin + # Get webhook + data, status_code, headers = api_instance.get_webhook_with_http_info(id) + p status_code # => 2xx + p headers # => { ... } + p data # => <Webhook> +rescue LaunchDarklyApi::ApiError => e + puts "Error when calling WebhooksApi->get_webhook_with_http_info: #{e}" +end +``` + ### Parameters -This endpoint does not need any parameter. +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The ID of the webhook | | + ### Return type -[**Webhooks**](Webhooks.md) +[**Webhook**](Webhook.md) ### Authorization -[Token](../README.md#Token) +[ApiKey](../README.md#ApiKey) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## patch_webhook -# **patch_webhook** -> Webhook patch_webhook(resource_id, patch_delta) +> <Webhook> patch_webhook(id, patch_operation) -Modify a webhook by ID. +Update webhook -### Example +Update a webhook's settings. The request should be a valid JSON Patch document describing the changes to be made to the webhook. + +### Examples + ```ruby -# load the gem +require 'time' require 'launchdarkly_api' # setup authorization LaunchDarklyApi.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' + # Configure API key authorization: ApiKey + config.api_key['ApiKey'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' + # config.api_key_prefix['ApiKey'] = 'Bearer' end api_instance = LaunchDarklyApi::WebhooksApi.new +id = 'id_example' # String | The ID of the webhook to update +patch_operation = [LaunchDarklyApi::PatchOperation.new({op: 'replace', path: '/biscuits', value: Chocolate Digestive})] # Array<PatchOperation> | -resource_id = 'resource_id_example' # String | The resource ID. +begin + # Update webhook + result = api_instance.patch_webhook(id, patch_operation) + p result +rescue LaunchDarklyApi::ApiError => e + puts "Error when calling WebhooksApi->patch_webhook: #{e}" +end +``` -patch_delta = [LaunchDarklyApi::PatchOperation.new] # Array<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' +#### Using the patch_webhook_with_http_info variant +This returns an Array which contains the response data, status code and headers. +> <Array(<Webhook>, Integer, Hash)> patch_webhook_with_http_info(id, patch_operation) + +```ruby begin - #Modify a webhook by ID. - result = api_instance.patch_webhook(resource_id, patch_delta) - p result + # Update webhook + data, status_code, headers = api_instance.patch_webhook_with_http_info(id, patch_operation) + p status_code # => 2xx + p headers # => { ... } + p data # => <Webhook> rescue LaunchDarklyApi::ApiError => e - puts "Exception when calling WebhooksApi->patch_webhook: #{e}" + puts "Error when calling WebhooksApi->patch_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **resource_id** | **String**| The resource ID. | - **patch_delta** | [**Array&lt;PatchOperation&gt;**](PatchOperation.md)| Requires a JSON Patch representation of the desired changes to the project. &#39;http://jsonpatch.com/&#39; | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The ID of the webhook to update | | +| **patch_operation** | [**Array&lt;PatchOperation&gt;**](PatchOperation.md) | | | ### Return type [**Webhook**](Webhook.md) ### Authorization -[Token](../README.md#Token) +[ApiKey](../README.md#ApiKey) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## post_webhook -# **post_webhook** -> Webhook post_webhook(webhook_body) +> <Webhook> post_webhook(webhook_post) -Create a webhook. +Creates a webhook -### Example +Create a new webhook + +### Examples + ```ruby -# load the gem +require 'time' require 'launchdarkly_api' # setup authorization LaunchDarklyApi.configure do |config| - # Configure API key authorization: Token - config.api_key['Authorization'] = 'YOUR API KEY' + # Configure API key authorization: ApiKey + config.api_key['ApiKey'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['Authorization'] = 'Bearer' + # config.api_key_prefix['ApiKey'] = 'Bearer' end api_instance = LaunchDarklyApi::WebhooksApi.new +webhook_post = LaunchDarklyApi::WebhookPost.new({url: 'http://www.example.com', sign: true, on: true}) # WebhookPost | -webhook_body = LaunchDarklyApi::WebhookBody.new # WebhookBody | New webhook. +begin + # Creates a webhook + result = api_instance.post_webhook(webhook_post) + p result +rescue LaunchDarklyApi::ApiError => e + puts "Error when calling WebhooksApi->post_webhook: #{e}" +end +``` +#### Using the post_webhook_with_http_info variant +This returns an Array which contains the response data, status code and headers. + +> <Array(<Webhook>, Integer, Hash)> post_webhook_with_http_info(webhook_post) + +```ruby begin - #Create a webhook. - result = api_instance.post_webhook(webhook_body) - p result + # Creates a webhook + data, status_code, headers = api_instance.post_webhook_with_http_info(webhook_post) + p status_code # => 2xx + p headers # => { ... } + p data # => <Webhook> rescue LaunchDarklyApi::ApiError => e - puts "Exception when calling WebhooksApi->post_webhook: #{e}" + puts "Error when calling WebhooksApi->post_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_body** | [**WebhookBody**](WebhookBody.md)| New webhook. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_post** | [**WebhookPost**](WebhookPost.md) | | | ### Return type [**Webhook**](Webhook.md) ### Authorization -[Token](../README.md#Token) +[ApiKey](../README.md#ApiKey) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json