123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- // Copyright 2021 EMQ Technologies Co., Ltd.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- syntax = "proto3";
- package messaging;
- import "google/api/annotations.proto";
- import "google/protobuf/empty.proto";
- service Messaging {
- rpc GetMessage(GetMessageRequest) returns (Message) {
- option (google.api.http) = {
- get: "/v1/{name=messages/*}"
- };
- }
- rpc SearchMessage(SearchMessageRequest) returns (Message) {
- option (google.api.http) = {
- get:"/v1/messages/filter/{message_id}"
- };
- }
- rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
- option (google.api.http) = {
- put: "/v1/messages/{message_id}"
- body: "message"
- };
- }
- rpc PatchMessage(PatchMessageRequest) returns (Message) {
- option (google.api.http) = {
- patch: "/v1/messages/{message_id}"
- body: "*"
- };
- }
- }
- message GetMessageRequest {
- string name = 1; // Mapped to URL path.
- }
- message Message {
- string text = 1; // The resource content.
- }
- message SearchMessageRequest {
- message SubMessage {
- string subfield = 1;
- }
- string message_id = 1; // Mapped to URL path.
- int64 revision = 2; // Mapped to URL query parameter `revision`.
- SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
- }
- message UpdateMessageRequest {
- string message_id = 1; // mapped to the URL
- Message message = 2; // mapped to the body
- }
- message PatchMessageRequest {
- string message_id = 1;
- string text = 2;
- }
|