chore: rename list inbox

pull/2457/head
Steven 2 years ago
parent 4f1bb55e55
commit 18107248aa

@ -3,37 +3,39 @@ package v2
import ( import (
"context" "context"
"fmt" "fmt"
"time"
"github.com/pkg/errors" "github.com/pkg/errors"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
apiv2pb "github.com/usememos/memos/proto/gen/api/v2" apiv2pb "github.com/usememos/memos/proto/gen/api/v2"
"github.com/usememos/memos/store" "github.com/usememos/memos/store"
) )
func (s *APIV2Service) ListInbox(ctx context.Context, _ *apiv2pb.ListInboxRequest) (*apiv2pb.ListInboxResponse, error) { func (s *APIV2Service) ListInboxes(ctx context.Context, _ *apiv2pb.ListInboxesRequest) (*apiv2pb.ListInboxesResponse, error) {
user, err := getCurrentUser(ctx, s.Store) user, err := getCurrentUser(ctx, s.Store)
if err != nil { if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get user") return nil, status.Errorf(codes.Internal, "failed to get user")
} }
inboxList, err := s.Store.ListInbox(ctx, &store.FindInbox{ inboxes, err := s.Store.ListInboxes(ctx, &store.FindInbox{
ReceiverID: &user.ID, ReceiverID: &user.ID,
}) })
if err != nil { if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list inbox: %v", err) return nil, status.Errorf(codes.Internal, "failed to list inbox: %v", err)
} }
response := &apiv2pb.ListInboxResponse{ response := &apiv2pb.ListInboxesResponse{
Inbox: []*apiv2pb.Inbox{}, Inboxes: []*apiv2pb.Inbox{},
} }
for _, inbox := range inboxList { for _, inbox := range inboxes {
inboxMessage, err := s.convertInboxFromStore(ctx, inbox) inboxMessage, err := s.convertInboxFromStore(ctx, inbox)
if err != nil { if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert inbox from store: %v", err) return nil, status.Errorf(codes.Internal, "failed to convert inbox from store: %v", err)
} }
response.Inbox = append(response.Inbox, inboxMessage) response.Inboxes = append(response.Inboxes, inboxMessage)
} }
return response, nil return response, nil
@ -103,10 +105,11 @@ func (s *APIV2Service) convertInboxFromStore(ctx context.Context, inbox *store.I
} }
return &apiv2pb.Inbox{ return &apiv2pb.Inbox{
Name: fmt.Sprintf("inbox/%d", inbox.ID), Name: fmt.Sprintf("inboxes/%d", inbox.ID),
Sender: fmt.Sprintf("users/%s", sender.Username), Sender: fmt.Sprintf("users/%s", sender.Username),
Receiver: fmt.Sprintf("users/%s", receiver.Username), Receiver: fmt.Sprintf("users/%s", receiver.Username),
Status: convertInboxStatusFromStore(inbox.Status), Status: convertInboxStatusFromStore(inbox.Status),
CreateTime: timestamppb.New(time.Unix(inbox.CreatedTs, 0)),
Type: apiv2pb.Inbox_Type(inbox.Message.Type), Type: apiv2pb.Inbox_Type(inbox.Message.Type),
ActivityId: inbox.Message.ActivityId, ActivityId: inbox.Message.ActivityId,
}, nil }, nil

@ -5,31 +5,32 @@ package memos.api.v2;
import "google/api/annotations.proto"; import "google/api/annotations.proto";
import "google/api/client.proto"; import "google/api/client.proto";
import "google/protobuf/field_mask.proto"; import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gen/api/v2"; option go_package = "gen/api/v2";
service InboxService { service InboxService {
rpc ListInbox(ListInboxRequest) returns (ListInboxResponse) { rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
option (google.api.http) = {get: "/api/v2/inbox"}; option (google.api.http) = {get: "/api/v2/inboxes"};
} }
rpc UpdateInbox(UpdateInboxRequest) returns (UpdateInboxResponse) { rpc UpdateInbox(UpdateInboxRequest) returns (UpdateInboxResponse) {
option (google.api.http) = { option (google.api.http) = {
patch: "/v2/inbox" patch: "/v2/inboxes"
body: "inbox" body: "inbox"
}; };
option (google.api.method_signature) = "inbox,update_mask"; option (google.api.method_signature) = "inbox,update_mask";
} }
rpc DeleteInbox(DeleteInboxRequest) returns (DeleteInboxResponse) { rpc DeleteInbox(DeleteInboxRequest) returns (DeleteInboxResponse) {
option (google.api.http) = {delete: "/v2/{name=inbox/*}"}; option (google.api.http) = {delete: "/v2/{name=inboxes/*}"};
option (google.api.method_signature) = "name"; option (google.api.method_signature) = "name";
} }
} }
message Inbox { message Inbox {
// The name of the inbox. // The name of the inbox.
// Format: inbox/{id} // Format: inboxes/{id}
string name = 1; string name = 1;
// Format: users/{username} // Format: users/{username}
string sender = 2; string sender = 2;
@ -44,22 +45,24 @@ message Inbox {
} }
Status status = 4; Status status = 4;
google.protobuf.Timestamp create_time = 5;
enum Type { enum Type {
TYPE_UNSPECIFIED = 0; TYPE_UNSPECIFIED = 0;
TYPE_MEMO_COMMENT = 1; TYPE_MEMO_COMMENT = 1;
} }
Type type = 5; Type type = 6;
optional int32 activity_id = 6; optional int32 activity_id = 7;
} }
message ListInboxRequest { message ListInboxesRequest {
// Format: /users/{username} // Format: users/{username}
string user = 1; string user = 1;
} }
message ListInboxResponse { message ListInboxesResponse {
repeated Inbox inbox = 1; repeated Inbox inboxes = 1;
} }
message UpdateInboxRequest { message UpdateInboxRequest {
@ -74,7 +77,7 @@ message UpdateInboxResponse {
message DeleteInboxRequest { message DeleteInboxRequest {
// The name of the inbox to delete. // The name of the inbox to delete.
// Format: inbox/{inbox} // Format: inboxes/{inbox}
string name = 1; string name = 1;
} }

@ -10,8 +10,8 @@
- [DeleteInboxRequest](#memos-api-v2-DeleteInboxRequest) - [DeleteInboxRequest](#memos-api-v2-DeleteInboxRequest)
- [DeleteInboxResponse](#memos-api-v2-DeleteInboxResponse) - [DeleteInboxResponse](#memos-api-v2-DeleteInboxResponse)
- [Inbox](#memos-api-v2-Inbox) - [Inbox](#memos-api-v2-Inbox)
- [ListInboxRequest](#memos-api-v2-ListInboxRequest) - [ListInboxesRequest](#memos-api-v2-ListInboxesRequest)
- [ListInboxResponse](#memos-api-v2-ListInboxResponse) - [ListInboxesResponse](#memos-api-v2-ListInboxesResponse)
- [UpdateInboxRequest](#memos-api-v2-UpdateInboxRequest) - [UpdateInboxRequest](#memos-api-v2-UpdateInboxRequest)
- [UpdateInboxResponse](#memos-api-v2-UpdateInboxResponse) - [UpdateInboxResponse](#memos-api-v2-UpdateInboxResponse)
@ -138,7 +138,7 @@
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| name | [string](#string) | | The name of the inbox to delete. Format: inbox/{inbox} | | name | [string](#string) | | The name of the inbox to delete. Format: inboxes/{inbox} |
@ -163,10 +163,11 @@
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| name | [string](#string) | | The name of the inbox. Format: inbox/{id} | | name | [string](#string) | | The name of the inbox. Format: inboxes/{id} |
| sender | [string](#string) | | Format: users/{username} | | sender | [string](#string) | | Format: users/{username} |
| receiver | [string](#string) | | Format: users/{username} | | receiver | [string](#string) | | Format: users/{username} |
| status | [Inbox.Status](#memos-api-v2-Inbox-Status) | | | | status | [Inbox.Status](#memos-api-v2-Inbox-Status) | | |
| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| type | [Inbox.Type](#memos-api-v2-Inbox-Type) | | | | type | [Inbox.Type](#memos-api-v2-Inbox-Type) | | |
| activity_id | [int32](#int32) | optional | | | activity_id | [int32](#int32) | optional | |
@ -175,30 +176,30 @@
<a name="memos-api-v2-ListInboxRequest"></a> <a name="memos-api-v2-ListInboxesRequest"></a>
### ListInboxRequest ### ListInboxesRequest
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| user | [string](#string) | | Format: /users/{username} | | user | [string](#string) | | Format: users/{username} |
<a name="memos-api-v2-ListInboxResponse"></a> <a name="memos-api-v2-ListInboxesResponse"></a>
### ListInboxResponse ### ListInboxesResponse
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| inbox | [Inbox](#memos-api-v2-Inbox) | repeated | | | inboxes | [Inbox](#memos-api-v2-Inbox) | repeated | |
@ -275,7 +276,7 @@
| Method Name | Request Type | Response Type | Description | | Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------| | ----------- | ------------ | ------------- | ------------|
| ListInbox | [ListInboxRequest](#memos-api-v2-ListInboxRequest) | [ListInboxResponse](#memos-api-v2-ListInboxResponse) | | | ListInboxes | [ListInboxesRequest](#memos-api-v2-ListInboxesRequest) | [ListInboxesResponse](#memos-api-v2-ListInboxesResponse) | |
| UpdateInbox | [UpdateInboxRequest](#memos-api-v2-UpdateInboxRequest) | [UpdateInboxResponse](#memos-api-v2-UpdateInboxResponse) | | | UpdateInbox | [UpdateInboxRequest](#memos-api-v2-UpdateInboxRequest) | [UpdateInboxResponse](#memos-api-v2-UpdateInboxResponse) | |
| DeleteInbox | [DeleteInboxRequest](#memos-api-v2-DeleteInboxRequest) | [DeleteInboxResponse](#memos-api-v2-DeleteInboxResponse) | | | DeleteInbox | [DeleteInboxRequest](#memos-api-v2-DeleteInboxRequest) | [DeleteInboxResponse](#memos-api-v2-DeleteInboxResponse) | |

@ -11,6 +11,7 @@ import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
) )
@ -126,15 +127,16 @@ type Inbox struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// The name of the inbox. // The name of the inbox.
// Format: inbox/{id} // Format: inboxes/{id}
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Format: users/{username} // Format: users/{username}
Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
// Format: users/{username} // Format: users/{username}
Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"` Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"`
Status Inbox_Status `protobuf:"varint,4,opt,name=status,proto3,enum=memos.api.v2.Inbox_Status" json:"status,omitempty"` Status Inbox_Status `protobuf:"varint,4,opt,name=status,proto3,enum=memos.api.v2.Inbox_Status" json:"status,omitempty"`
Type Inbox_Type `protobuf:"varint,5,opt,name=type,proto3,enum=memos.api.v2.Inbox_Type" json:"type,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
ActivityId *int32 `protobuf:"varint,6,opt,name=activity_id,json=activityId,proto3,oneof" json:"activity_id,omitempty"` Type Inbox_Type `protobuf:"varint,6,opt,name=type,proto3,enum=memos.api.v2.Inbox_Type" json:"type,omitempty"`
ActivityId *int32 `protobuf:"varint,7,opt,name=activity_id,json=activityId,proto3,oneof" json:"activity_id,omitempty"`
} }
func (x *Inbox) Reset() { func (x *Inbox) Reset() {
@ -197,6 +199,13 @@ func (x *Inbox) GetStatus() Inbox_Status {
return Inbox_STATUS_UNSPECIFIED return Inbox_STATUS_UNSPECIFIED
} }
func (x *Inbox) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *Inbox) GetType() Inbox_Type { func (x *Inbox) GetType() Inbox_Type {
if x != nil { if x != nil {
return x.Type return x.Type
@ -211,17 +220,17 @@ func (x *Inbox) GetActivityId() int32 {
return 0 return 0
} }
type ListInboxRequest struct { type ListInboxesRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// Format: /users/{username} // Format: users/{username}
User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
} }
func (x *ListInboxRequest) Reset() { func (x *ListInboxesRequest) Reset() {
*x = ListInboxRequest{} *x = ListInboxesRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_api_v2_inbox_service_proto_msgTypes[1] mi := &file_api_v2_inbox_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -229,13 +238,13 @@ func (x *ListInboxRequest) Reset() {
} }
} }
func (x *ListInboxRequest) String() string { func (x *ListInboxesRequest) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*ListInboxRequest) ProtoMessage() {} func (*ListInboxesRequest) ProtoMessage() {}
func (x *ListInboxRequest) ProtoReflect() protoreflect.Message { func (x *ListInboxesRequest) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_inbox_service_proto_msgTypes[1] mi := &file_api_v2_inbox_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -247,28 +256,28 @@ func (x *ListInboxRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use ListInboxRequest.ProtoReflect.Descriptor instead. // Deprecated: Use ListInboxesRequest.ProtoReflect.Descriptor instead.
func (*ListInboxRequest) Descriptor() ([]byte, []int) { func (*ListInboxesRequest) Descriptor() ([]byte, []int) {
return file_api_v2_inbox_service_proto_rawDescGZIP(), []int{1} return file_api_v2_inbox_service_proto_rawDescGZIP(), []int{1}
} }
func (x *ListInboxRequest) GetUser() string { func (x *ListInboxesRequest) GetUser() string {
if x != nil { if x != nil {
return x.User return x.User
} }
return "" return ""
} }
type ListInboxResponse struct { type ListInboxesResponse struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Inbox []*Inbox `protobuf:"bytes,1,rep,name=inbox,proto3" json:"inbox,omitempty"` Inboxes []*Inbox `protobuf:"bytes,1,rep,name=inboxes,proto3" json:"inboxes,omitempty"`
} }
func (x *ListInboxResponse) Reset() { func (x *ListInboxesResponse) Reset() {
*x = ListInboxResponse{} *x = ListInboxesResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_api_v2_inbox_service_proto_msgTypes[2] mi := &file_api_v2_inbox_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -276,13 +285,13 @@ func (x *ListInboxResponse) Reset() {
} }
} }
func (x *ListInboxResponse) String() string { func (x *ListInboxesResponse) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*ListInboxResponse) ProtoMessage() {} func (*ListInboxesResponse) ProtoMessage() {}
func (x *ListInboxResponse) ProtoReflect() protoreflect.Message { func (x *ListInboxesResponse) ProtoReflect() protoreflect.Message {
mi := &file_api_v2_inbox_service_proto_msgTypes[2] mi := &file_api_v2_inbox_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -294,14 +303,14 @@ func (x *ListInboxResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use ListInboxResponse.ProtoReflect.Descriptor instead. // Deprecated: Use ListInboxesResponse.ProtoReflect.Descriptor instead.
func (*ListInboxResponse) Descriptor() ([]byte, []int) { func (*ListInboxesResponse) Descriptor() ([]byte, []int) {
return file_api_v2_inbox_service_proto_rawDescGZIP(), []int{2} return file_api_v2_inbox_service_proto_rawDescGZIP(), []int{2}
} }
func (x *ListInboxResponse) GetInbox() []*Inbox { func (x *ListInboxesResponse) GetInboxes() []*Inbox {
if x != nil { if x != nil {
return x.Inbox return x.Inboxes
} }
return nil return nil
} }
@ -414,7 +423,7 @@ type DeleteInboxRequest struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// The name of the inbox to delete. // The name of the inbox to delete.
// Format: inbox/{inbox} // Format: inboxes/{inbox}
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
} }
@ -506,86 +515,93 @@ var file_api_v2_inbox_service_proto_rawDesc = []byte{
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x12, 0x0a, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x12,
0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65,
0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65,
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x53, 0x74, 0x61, 0x74,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x54, 0x79, 0x70, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72,
0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x44, 0x0a, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65,
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
0x0a, 0x0a, 0x06, 0x55, 0x4e, 0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,
0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x44, 0x10, 0x03, 0x22, 0x33, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x63,
0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x44, 0x0a, 0x06, 0x53,
0x00, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x43, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63, 0x74, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a,
0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x06, 0x55, 0x4e, 0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x45, 0x41,
0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10,
0x03, 0x22, 0x33, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x4f, 0x5f, 0x43, 0x4f, 0x4d,
0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e,
0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72,
0x22, 0x3e, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x22, 0x44, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x78,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x69,
0x22, 0x7c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x22, 0x7c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x05,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65,
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78,
0x78, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46,
0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x40, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x40, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x69,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d,
0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52,
0x22, 0x28, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x22, 0x28, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52,
0x65, 0x32, 0xed, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf9, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f,
0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74,
0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78,
0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f,
0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62,
0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3,
0x32, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x80, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e,
0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62,
0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0xda, 0x41, 0x11, 0x69,
0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0xda, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x32, 0x0b, 0x2f,
0x11, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x77, 0x0a, 0x0b, 0x44, 0x65,
0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x32,
0x09, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x75, 0x0a, 0x0b, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f,
0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49,
0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65,
0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23,
0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f,
0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2f, 0x2a, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73,
0x7d, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x2f, 0x2a, 0x7d, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x11, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x11, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53,
0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d,
0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2,
0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70,
0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69,
0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c,
0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62,
0x72, 0x6f, 0x74, 0x6f, 0x33, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -606,32 +622,34 @@ var file_api_v2_inbox_service_proto_goTypes = []interface{}{
(Inbox_Status)(0), // 0: memos.api.v2.Inbox.Status (Inbox_Status)(0), // 0: memos.api.v2.Inbox.Status
(Inbox_Type)(0), // 1: memos.api.v2.Inbox.Type (Inbox_Type)(0), // 1: memos.api.v2.Inbox.Type
(*Inbox)(nil), // 2: memos.api.v2.Inbox (*Inbox)(nil), // 2: memos.api.v2.Inbox
(*ListInboxRequest)(nil), // 3: memos.api.v2.ListInboxRequest (*ListInboxesRequest)(nil), // 3: memos.api.v2.ListInboxesRequest
(*ListInboxResponse)(nil), // 4: memos.api.v2.ListInboxResponse (*ListInboxesResponse)(nil), // 4: memos.api.v2.ListInboxesResponse
(*UpdateInboxRequest)(nil), // 5: memos.api.v2.UpdateInboxRequest (*UpdateInboxRequest)(nil), // 5: memos.api.v2.UpdateInboxRequest
(*UpdateInboxResponse)(nil), // 6: memos.api.v2.UpdateInboxResponse (*UpdateInboxResponse)(nil), // 6: memos.api.v2.UpdateInboxResponse
(*DeleteInboxRequest)(nil), // 7: memos.api.v2.DeleteInboxRequest (*DeleteInboxRequest)(nil), // 7: memos.api.v2.DeleteInboxRequest
(*DeleteInboxResponse)(nil), // 8: memos.api.v2.DeleteInboxResponse (*DeleteInboxResponse)(nil), // 8: memos.api.v2.DeleteInboxResponse
(*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
(*fieldmaskpb.FieldMask)(nil), // 10: google.protobuf.FieldMask
} }
var file_api_v2_inbox_service_proto_depIdxs = []int32{ var file_api_v2_inbox_service_proto_depIdxs = []int32{
0, // 0: memos.api.v2.Inbox.status:type_name -> memos.api.v2.Inbox.Status 0, // 0: memos.api.v2.Inbox.status:type_name -> memos.api.v2.Inbox.Status
1, // 1: memos.api.v2.Inbox.type:type_name -> memos.api.v2.Inbox.Type 9, // 1: memos.api.v2.Inbox.create_time:type_name -> google.protobuf.Timestamp
2, // 2: memos.api.v2.ListInboxResponse.inbox:type_name -> memos.api.v2.Inbox 1, // 2: memos.api.v2.Inbox.type:type_name -> memos.api.v2.Inbox.Type
2, // 3: memos.api.v2.UpdateInboxRequest.inbox:type_name -> memos.api.v2.Inbox 2, // 3: memos.api.v2.ListInboxesResponse.inboxes:type_name -> memos.api.v2.Inbox
9, // 4: memos.api.v2.UpdateInboxRequest.update_mask:type_name -> google.protobuf.FieldMask 2, // 4: memos.api.v2.UpdateInboxRequest.inbox:type_name -> memos.api.v2.Inbox
2, // 5: memos.api.v2.UpdateInboxResponse.inbox:type_name -> memos.api.v2.Inbox 10, // 5: memos.api.v2.UpdateInboxRequest.update_mask:type_name -> google.protobuf.FieldMask
3, // 6: memos.api.v2.InboxService.ListInbox:input_type -> memos.api.v2.ListInboxRequest 2, // 6: memos.api.v2.UpdateInboxResponse.inbox:type_name -> memos.api.v2.Inbox
5, // 7: memos.api.v2.InboxService.UpdateInbox:input_type -> memos.api.v2.UpdateInboxRequest 3, // 7: memos.api.v2.InboxService.ListInboxes:input_type -> memos.api.v2.ListInboxesRequest
7, // 8: memos.api.v2.InboxService.DeleteInbox:input_type -> memos.api.v2.DeleteInboxRequest 5, // 8: memos.api.v2.InboxService.UpdateInbox:input_type -> memos.api.v2.UpdateInboxRequest
4, // 9: memos.api.v2.InboxService.ListInbox:output_type -> memos.api.v2.ListInboxResponse 7, // 9: memos.api.v2.InboxService.DeleteInbox:input_type -> memos.api.v2.DeleteInboxRequest
6, // 10: memos.api.v2.InboxService.UpdateInbox:output_type -> memos.api.v2.UpdateInboxResponse 4, // 10: memos.api.v2.InboxService.ListInboxes:output_type -> memos.api.v2.ListInboxesResponse
8, // 11: memos.api.v2.InboxService.DeleteInbox:output_type -> memos.api.v2.DeleteInboxResponse 6, // 11: memos.api.v2.InboxService.UpdateInbox:output_type -> memos.api.v2.UpdateInboxResponse
9, // [9:12] is the sub-list for method output_type 8, // 12: memos.api.v2.InboxService.DeleteInbox:output_type -> memos.api.v2.DeleteInboxResponse
6, // [6:9] is the sub-list for method input_type 10, // [10:13] is the sub-list for method output_type
6, // [6:6] is the sub-list for extension type_name 7, // [7:10] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension extendee 7, // [7:7] is the sub-list for extension type_name
0, // [0:6] is the sub-list for field type_name 7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
} }
func init() { file_api_v2_inbox_service_proto_init() } func init() { file_api_v2_inbox_service_proto_init() }
@ -653,7 +671,7 @@ func file_api_v2_inbox_service_proto_init() {
} }
} }
file_api_v2_inbox_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v2_inbox_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListInboxRequest); i { switch v := v.(*ListInboxesRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -665,7 +683,7 @@ func file_api_v2_inbox_service_proto_init() {
} }
} }
file_api_v2_inbox_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v2_inbox_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListInboxResponse); i { switch v := v.(*ListInboxesResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:

@ -32,37 +32,37 @@ var _ = utilities.NewDoubleArray
var _ = metadata.Join var _ = metadata.Join
var ( var (
filter_InboxService_ListInbox_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} filter_InboxService_ListInboxes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
) )
func request_InboxService_ListInbox_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_InboxService_ListInboxes_0(ctx context.Context, marshaler runtime.Marshaler, client InboxServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListInboxRequest var protoReq ListInboxesRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_ListInbox_0); err != nil { if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_ListInboxes_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
msg, err := client.ListInbox(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.ListInboxes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
func local_request_InboxService_ListInbox_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func local_request_InboxService_ListInboxes_0(ctx context.Context, marshaler runtime.Marshaler, server InboxServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListInboxRequest var protoReq ListInboxesRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil { if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_ListInbox_0); err != nil { if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InboxService_ListInboxes_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
} }
msg, err := server.ListInbox(ctx, &protoReq) msg, err := server.ListInboxes(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
@ -191,7 +191,7 @@ func local_request_InboxService_DeleteInbox_0(ctx context.Context, marshaler run
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInboxServiceHandlerFromEndpoint instead. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInboxServiceHandlerFromEndpoint instead.
func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InboxServiceServer) error { func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InboxServiceServer) error {
mux.Handle("GET", pattern_InboxService_ListInbox_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_InboxService_ListInboxes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream var stream runtime.ServerTransportStream
@ -199,12 +199,12 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error var err error
var annotatedContext context.Context var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/ListInbox", runtime.WithHTTPPathPattern("/api/v2/inbox")) annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v2/inboxes"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := local_request_InboxService_ListInbox_0(annotatedContext, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_InboxService_ListInboxes_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil { if err != nil {
@ -212,7 +212,7 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
return return
} }
forward_InboxService_ListInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_InboxService_ListInboxes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
@ -224,7 +224,7 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error var err error
var annotatedContext context.Context var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/v2/inbox")) annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/v2/inboxes"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
@ -249,7 +249,7 @@ func RegisterInboxServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error var err error
var annotatedContext context.Context var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/v2/{name=inbox/*}")) annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/v2/{name=inboxes/*}"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
@ -307,25 +307,25 @@ func RegisterInboxServiceHandler(ctx context.Context, mux *runtime.ServeMux, con
// "InboxServiceClient" to call the correct interceptors. // "InboxServiceClient" to call the correct interceptors.
func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InboxServiceClient) error { func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InboxServiceClient) error {
mux.Handle("GET", pattern_InboxService_ListInbox_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_InboxService_ListInboxes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error var err error
var annotatedContext context.Context var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/ListInbox", runtime.WithHTTPPathPattern("/api/v2/inbox")) annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/ListInboxes", runtime.WithHTTPPathPattern("/api/v2/inboxes"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := request_InboxService_ListInbox_0(annotatedContext, inboundMarshaler, client, req, pathParams) resp, md, err := request_InboxService_ListInboxes_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil { if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return return
} }
forward_InboxService_ListInbox_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_InboxService_ListInboxes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
@ -335,7 +335,7 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error var err error
var annotatedContext context.Context var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/v2/inbox")) annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/UpdateInbox", runtime.WithHTTPPathPattern("/v2/inboxes"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
@ -357,7 +357,7 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error var err error
var annotatedContext context.Context var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/v2/{name=inbox/*}")) annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.InboxService/DeleteInbox", runtime.WithHTTPPathPattern("/v2/{name=inboxes/*}"))
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
@ -377,15 +377,15 @@ func RegisterInboxServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu
} }
var ( var (
pattern_InboxService_ListInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "inbox"}, "")) pattern_InboxService_ListInboxes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "inboxes"}, ""))
pattern_InboxService_UpdateInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "inbox"}, "")) pattern_InboxService_UpdateInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "inboxes"}, ""))
pattern_InboxService_DeleteInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v2", "inbox", "name"}, "")) pattern_InboxService_DeleteInbox_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v2", "inboxes", "name"}, ""))
) )
var ( var (
forward_InboxService_ListInbox_0 = runtime.ForwardResponseMessage forward_InboxService_ListInboxes_0 = runtime.ForwardResponseMessage
forward_InboxService_UpdateInbox_0 = runtime.ForwardResponseMessage forward_InboxService_UpdateInbox_0 = runtime.ForwardResponseMessage

@ -19,7 +19,7 @@ import (
const _ = grpc.SupportPackageIsVersion7 const _ = grpc.SupportPackageIsVersion7
const ( const (
InboxService_ListInbox_FullMethodName = "/memos.api.v2.InboxService/ListInbox" InboxService_ListInboxes_FullMethodName = "/memos.api.v2.InboxService/ListInboxes"
InboxService_UpdateInbox_FullMethodName = "/memos.api.v2.InboxService/UpdateInbox" InboxService_UpdateInbox_FullMethodName = "/memos.api.v2.InboxService/UpdateInbox"
InboxService_DeleteInbox_FullMethodName = "/memos.api.v2.InboxService/DeleteInbox" InboxService_DeleteInbox_FullMethodName = "/memos.api.v2.InboxService/DeleteInbox"
) )
@ -28,7 +28,7 @@ const (
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type InboxServiceClient interface { type InboxServiceClient interface {
ListInbox(ctx context.Context, in *ListInboxRequest, opts ...grpc.CallOption) (*ListInboxResponse, error) ListInboxes(ctx context.Context, in *ListInboxesRequest, opts ...grpc.CallOption) (*ListInboxesResponse, error)
UpdateInbox(ctx context.Context, in *UpdateInboxRequest, opts ...grpc.CallOption) (*UpdateInboxResponse, error) UpdateInbox(ctx context.Context, in *UpdateInboxRequest, opts ...grpc.CallOption) (*UpdateInboxResponse, error)
DeleteInbox(ctx context.Context, in *DeleteInboxRequest, opts ...grpc.CallOption) (*DeleteInboxResponse, error) DeleteInbox(ctx context.Context, in *DeleteInboxRequest, opts ...grpc.CallOption) (*DeleteInboxResponse, error)
} }
@ -41,9 +41,9 @@ func NewInboxServiceClient(cc grpc.ClientConnInterface) InboxServiceClient {
return &inboxServiceClient{cc} return &inboxServiceClient{cc}
} }
func (c *inboxServiceClient) ListInbox(ctx context.Context, in *ListInboxRequest, opts ...grpc.CallOption) (*ListInboxResponse, error) { func (c *inboxServiceClient) ListInboxes(ctx context.Context, in *ListInboxesRequest, opts ...grpc.CallOption) (*ListInboxesResponse, error) {
out := new(ListInboxResponse) out := new(ListInboxesResponse)
err := c.cc.Invoke(ctx, InboxService_ListInbox_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, InboxService_ListInboxes_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -72,7 +72,7 @@ func (c *inboxServiceClient) DeleteInbox(ctx context.Context, in *DeleteInboxReq
// All implementations must embed UnimplementedInboxServiceServer // All implementations must embed UnimplementedInboxServiceServer
// for forward compatibility // for forward compatibility
type InboxServiceServer interface { type InboxServiceServer interface {
ListInbox(context.Context, *ListInboxRequest) (*ListInboxResponse, error) ListInboxes(context.Context, *ListInboxesRequest) (*ListInboxesResponse, error)
UpdateInbox(context.Context, *UpdateInboxRequest) (*UpdateInboxResponse, error) UpdateInbox(context.Context, *UpdateInboxRequest) (*UpdateInboxResponse, error)
DeleteInbox(context.Context, *DeleteInboxRequest) (*DeleteInboxResponse, error) DeleteInbox(context.Context, *DeleteInboxRequest) (*DeleteInboxResponse, error)
mustEmbedUnimplementedInboxServiceServer() mustEmbedUnimplementedInboxServiceServer()
@ -82,8 +82,8 @@ type InboxServiceServer interface {
type UnimplementedInboxServiceServer struct { type UnimplementedInboxServiceServer struct {
} }
func (UnimplementedInboxServiceServer) ListInbox(context.Context, *ListInboxRequest) (*ListInboxResponse, error) { func (UnimplementedInboxServiceServer) ListInboxes(context.Context, *ListInboxesRequest) (*ListInboxesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListInbox not implemented") return nil, status.Errorf(codes.Unimplemented, "method ListInboxes not implemented")
} }
func (UnimplementedInboxServiceServer) UpdateInbox(context.Context, *UpdateInboxRequest) (*UpdateInboxResponse, error) { func (UnimplementedInboxServiceServer) UpdateInbox(context.Context, *UpdateInboxRequest) (*UpdateInboxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateInbox not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateInbox not implemented")
@ -104,20 +104,20 @@ func RegisterInboxServiceServer(s grpc.ServiceRegistrar, srv InboxServiceServer)
s.RegisterService(&InboxService_ServiceDesc, srv) s.RegisterService(&InboxService_ServiceDesc, srv)
} }
func _InboxService_ListInbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _InboxService_ListInboxes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListInboxRequest) in := new(ListInboxesRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(InboxServiceServer).ListInbox(ctx, in) return srv.(InboxServiceServer).ListInboxes(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: InboxService_ListInbox_FullMethodName, FullMethod: InboxService_ListInboxes_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(InboxServiceServer).ListInbox(ctx, req.(*ListInboxRequest)) return srv.(InboxServiceServer).ListInboxes(ctx, req.(*ListInboxesRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -166,8 +166,8 @@ var InboxService_ServiceDesc = grpc.ServiceDesc{
HandlerType: (*InboxServiceServer)(nil), HandlerType: (*InboxServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "ListInbox", MethodName: "ListInboxes",
Handler: _InboxService_ListInbox_Handler, Handler: _InboxService_ListInboxes_Handler,
}, },
{ {
MethodName: "UpdateInbox", MethodName: "UpdateInbox",

@ -12,7 +12,7 @@ func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox
} }
// nolint // nolint
func (d *DB) ListInbox(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) { func (d *DB) ListInboxes(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) {
return nil, nil return nil, nil
} }

@ -36,7 +36,7 @@ func (d *DB) CreateInbox(ctx context.Context, create *store.Inbox) (*store.Inbox
return create, nil return create, nil
} }
func (d *DB) ListInbox(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) { func (d *DB) ListInboxes(ctx context.Context, find *store.FindInbox) ([]*store.Inbox, error) {
where, args := []string{"1 = 1"}, []any{} where, args := []string{"1 = 1"}, []any{}
if find.ID != nil { if find.ID != nil {

@ -84,7 +84,7 @@ type Driver interface {
// Inbox model related methods. // Inbox model related methods.
CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error) CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
ListInbox(ctx context.Context, find *FindInbox) ([]*Inbox, error) ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error)
UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error) UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error)
DeleteInbox(ctx context.Context, delete *DeleteInbox) error DeleteInbox(ctx context.Context, delete *DeleteInbox) error
} }

@ -44,8 +44,8 @@ func (s *Store) CreateInbox(ctx context.Context, create *Inbox) (*Inbox, error)
return s.driver.CreateInbox(ctx, create) return s.driver.CreateInbox(ctx, create)
} }
func (s *Store) ListInbox(ctx context.Context, find *FindInbox) ([]*Inbox, error) { func (s *Store) ListInboxes(ctx context.Context, find *FindInbox) ([]*Inbox, error) {
return s.driver.ListInbox(ctx, find) return s.driver.ListInboxes(ctx, find)
} }
func (s *Store) UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error) { func (s *Store) UpdateInbox(ctx context.Context, update *UpdateInbox) (*Inbox, error) {

@ -28,7 +28,7 @@ func TestInboxStore(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.NotNil(t, inbox) require.NotNil(t, inbox)
require.Equal(t, create.Message, inbox.Message) require.Equal(t, create.Message, inbox.Message)
inboxes, err := ts.ListInbox(ctx, &store.FindInbox{ inboxes, err := ts.ListInboxes(ctx, &store.FindInbox{
ReceiverID: &user.ID, ReceiverID: &user.ID,
}) })
require.NoError(t, err) require.NoError(t, err)
@ -45,7 +45,7 @@ func TestInboxStore(t *testing.T) {
ID: inbox.ID, ID: inbox.ID,
}) })
require.NoError(t, err) require.NoError(t, err)
inboxes, err = ts.ListInbox(ctx, &store.FindInbox{ inboxes, err = ts.ListInboxes(ctx, &store.FindInbox{
ReceiverID: &user.ID, ReceiverID: &user.ID,
}) })
require.NoError(t, err) require.NoError(t, err)

Loading…
Cancel
Save