Module: JPSClient::API::Webhook

Included in:
Client
Defined in:
lib/jpsclient/api/webhook.rb

Overview

Webhook 相关 API 自动生成的模块,处理 webhook 相关接口

Instance Method Summary collapse

Instance Method Details

#create_callback(params: {}) ⇒ Hash

Create Callback

Parameters:

  • params (Hash) (defaults to: {})

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



11
12
13
14
15
16
17
18
# File 'lib/jpsclient/api/webhook.rb', line 11

def create_callback(params: {})
  config = @request_config && @request_config["webhook_callback"]
  raise JPSClient::ExceptionError, "Missing config for webhook_callback" unless config && config["url"]

  path = config["url"]

  return request_with_auth(:post, path, body: params)
end

#create_event(params: {}) ⇒ Hash

Create Event

Parameters:

  • params (Hash) (defaults to: {})

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



24
25
26
27
28
29
30
31
# File 'lib/jpsclient/api/webhook.rb', line 24

def create_event(params: {})
  config = @request_config && @request_config["webhook_event"]
  raise JPSClient::ExceptionError, "Missing config for webhook_event" unless config && config["url"]

  path = config["url"]

  return request_with_auth(:post, path, body: params)
end