lib/phrase/api/webhooks_api.rb in phrase-1.0.1 vs lib/phrase/api/webhooks_api.rb in phrase-1.0.2
- old
+ new
@@ -11,23 +11,23 @@
# Create a new webhook.
# @param project_id [String] Project ID
# @param webhook_create_parameters [WebhookCreateParameters]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
- # @return [nil]
+ # @return [Webhook]
def webhook_create(project_id, webhook_create_parameters, opts = {})
- webhook_create_with_http_info(project_id, webhook_create_parameters, opts)
- nil
+ data, _status_code, _headers = webhook_create_with_http_info(project_id, webhook_create_parameters, opts)
+ data
end
# Create a webhook
# Create a new webhook.
# @param project_id [String] Project ID
# @param webhook_create_parameters [WebhookCreateParameters]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
- # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers
+ # @return [Array<(Response<(Webhook)>, Integer, Hash)>] Response<(Webhook)> data, response status code and response headers
def webhook_create_with_http_info(project_id, webhook_create_parameters, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: WebhooksApi.webhook_create ...'
end
# verify the required parameter 'project_id' is set
@@ -44,10 +44,12 @@
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
+ # HTTP header 'Accept' (if needed)
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
# form parameters
@@ -55,11 +57,11 @@
# http body (model)
post_body = opts[:body] || @api_client.object_to_http_body(webhook_create_parameters)
# return_type
- return_type = opts[:return_type]
+ return_type = opts[:return_type] || 'Webhook'
# auth_names
auth_names = opts[:auth_names] || ['Basic', 'Token']
new_options = opts.merge(
@@ -85,21 +87,21 @@
# @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @return [nil]
def webhook_delete(project_id, id, opts = {})
- webhook_delete_with_http_info(project_id, id, opts)
- nil
+ data, _status_code, _headers = webhook_delete_with_http_info(project_id, id, opts)
+ data
end
# Delete a webhook
# Delete an existing webhook.
# @param project_id [String] Project ID
# @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
- # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
def webhook_delete_with_http_info(project_id, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: WebhooksApi.webhook_delete ...'
end
# verify the required parameter 'project_id' is set
@@ -227,20 +229,20 @@
# @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @return [nil]
def webhook_test(project_id, id, opts = {})
- webhook_test_with_http_info(project_id, id, opts)
- nil
+ data, _status_code, _headers = webhook_test_with_http_info(project_id, id, opts)
+ data
end
# Test a webhook
# Perform a test request for a webhook.
# @param project_id [String] Project ID
# @param id [String] ID
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
- # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
def webhook_test_with_http_info(project_id, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: WebhooksApi.webhook_test ...'
end
# verify the required parameter 'project_id' is set