123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- syntax = "proto3";
- package memos.api.v1;
- import "api/v1/common.proto";
- import "api/v1/memo_service.proto";
- import "google/api/annotations.proto";
- import "google/api/client.proto";
- import "google/protobuf/empty.proto";
- import "google/protobuf/field_mask.proto";
- import "google/protobuf/timestamp.proto";
- option go_package = "gen/api/v1";
- service WebhookService {
- // CreateWebhook creates a new webhook.
- rpc CreateWebhook(CreateWebhookRequest) returns (Webhook) {
- option (google.api.http) = {
- post: "/api/v1/webhooks"
- body: "*"
- };
- }
- // GetWebhook returns a webhook by id.
- rpc GetWebhook(GetWebhookRequest) returns (Webhook) {
- option (google.api.http) = {get: "/api/v1/webhooks/{id}"};
- option (google.api.method_signature) = "id";
- }
- // ListWebhooks returns a list of webhooks.
- rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) {
- option (google.api.http) = {get: "/api/v1/webhooks"};
- }
- // UpdateWebhook updates a webhook.
- rpc UpdateWebhook(UpdateWebhookRequest) returns (Webhook) {
- option (google.api.http) = {
- patch: "/api/v1/webhooks/{webhook.id}"
- body: "webhook"
- };
- option (google.api.method_signature) = "webhook,update_mask";
- }
- // DeleteWebhook deletes a webhook by id.
- rpc DeleteWebhook(DeleteWebhookRequest) returns (google.protobuf.Empty) {
- option (google.api.http) = {delete: "/api/v1/webhooks/{id}"};
- option (google.api.method_signature) = "id";
- }
- }
- message Webhook {
- int32 id = 1;
- int32 creator_id = 2;
- google.protobuf.Timestamp create_time = 3;
- google.protobuf.Timestamp update_time = 4;
- RowStatus row_status = 5;
- string name = 6;
- string url = 7;
- }
- message CreateWebhookRequest {
- string name = 1;
- string url = 2;
- }
- message GetWebhookRequest {
- int32 id = 1;
- }
- message ListWebhooksRequest {
- int32 creator_id = 1;
- }
- message ListWebhooksResponse {
- repeated Webhook webhooks = 1;
- }
- message UpdateWebhookRequest {
- Webhook webhook = 1;
- google.protobuf.FieldMask update_mask = 2;
- }
- message DeleteWebhookRequest {
- int32 id = 1;
- }
- message WebhookRequestPayload {
- string url = 1;
- string activity_type = 2;
- int32 creator_id = 3;
- google.protobuf.Timestamp create_time = 4;
- Memo memo = 5;
- }
|