Skip to content

Latest commit

 

History

History
295 lines (188 loc) · 14 KB

WebhookApi.md

File metadata and controls

295 lines (188 loc) · 14 KB

\WebhookApi

All URIs are relative to http://localhost/api/v2.0

Method HTTP request Description
CreateWebhookPolicyOfProject Post /projects/{project_name_or_id}/webhook/policies Create project webhook policy.
DeleteWebhookPolicyOfProject Delete /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} Delete webhook policy of a project
GetSupportedEventTypes Get /projects/{project_name_or_id}/webhook/events Get supported event types and notify types.
GetWebhookPolicyOfProject Get /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} Get project webhook policy
LastTrigger Get /projects/{project_name_or_id}/webhook/lasttrigger Get project webhook policy last trigger info
ListWebhookPoliciesOfProject Get /projects/{project_name_or_id}/webhook/policies List project webhook policies.
UpdateWebhookPolicyOfProject Put /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} Update webhook policy of a project.

CreateWebhookPolicyOfProject

CreateWebhookPolicyOfProject(ctx, projectNameOrId, policy, optional) Create project webhook policy.

This endpoint create a webhook policy if the project does not have one.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
policy WebhookPolicy Properties "targets" and "event_types" needed.
optional *WebhookApiCreateWebhookPolicyOfProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiCreateWebhookPolicyOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

(empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteWebhookPolicyOfProject

DeleteWebhookPolicyOfProject(ctx, projectNameOrId, webhookPolicyId, optional) Delete webhook policy of a project

This endpoint is aimed to delete webhookpolicy of a project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
webhookPolicyId int64 The ID of the webhook policy
optional *WebhookApiDeleteWebhookPolicyOfProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiDeleteWebhookPolicyOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

(empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSupportedEventTypes

SupportedWebhookEventTypes GetSupportedEventTypes(ctx, projectNameOrId, optional) Get supported event types and notify types.

Get supportted event types and notify types.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
optional *WebhookApiGetSupportedEventTypesOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiGetSupportedEventTypesOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

SupportedWebhookEventTypes

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetWebhookPolicyOfProject

WebhookPolicy GetWebhookPolicyOfProject(ctx, projectNameOrId, webhookPolicyId, optional) Get project webhook policy

This endpoint returns specified webhook policy of a project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
webhookPolicyId int64 The ID of the webhook policy
optional *WebhookApiGetWebhookPolicyOfProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiGetWebhookPolicyOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

WebhookPolicy

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

LastTrigger

[]WebhookLastTrigger LastTrigger(ctx, projectNameOrId, optional) Get project webhook policy last trigger info

This endpoint returns last trigger information of project webhook policy.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
optional *WebhookApiLastTriggerOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiLastTriggerOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

[]WebhookLastTrigger

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListWebhookPoliciesOfProject

[]WebhookPolicy ListWebhookPoliciesOfProject(ctx, projectNameOrId, optional) List project webhook policies.

This endpoint returns webhook policies of a project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
optional *WebhookApiListWebhookPoliciesOfProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiListWebhookPoliciesOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false] sort | optional.String| Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2" | q | optional.String| Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=v)", "range(k=[minmax])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=v2,k3=[minmax] | page | optional.Int64| The page number | [default to 1] pageSize | optional.Int64| The size of per page | [default to 10]

Return type

[]WebhookPolicy

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateWebhookPolicyOfProject

UpdateWebhookPolicyOfProject(ctx, projectNameOrId, webhookPolicyId, policy, optional) Update webhook policy of a project.

This endpoint is aimed to update the webhook policy of a project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectNameOrId string The name or id of the project
webhookPolicyId int64 The ID of the webhook policy
policy WebhookPolicy All properties needed except "id", "project_id", "creation_time", "update_time".
optional *WebhookApiUpdateWebhookPolicyOfProjectOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a WebhookApiUpdateWebhookPolicyOfProjectOpts struct

Name Type Description Notes

xRequestId | optional.String| An unique ID for the request | xIsResourceName | optional.Bool| The flag to indicate whether the parameter which supports both name and id in the path is the name of the resource. When the X-Is-Resource-Name is false and the parameter can be converted to an integer, the parameter will be as an id, otherwise, it will be as a name. | [default to false]

Return type

(empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]