From da9b6b22be35cbe9b144ee6b0a6b341ac36abc3e Mon Sep 17 00:00:00 2001 From: pyshx Date: Wed, 5 Feb 2025 22:07:14 +0530 Subject: [PATCH 1/2] chore(server): internal api v1 specification --- server/docs/api.md | 299 +++++++ server/proto/v1/internal_api.pb.go | 1068 +++++++++++++++++++++++ server/proto/v1/internal_api.proto | 110 +++ server/proto/v1/internal_api_grpc.pb.go | 277 ++++++ 4 files changed, 1754 insertions(+) create mode 100644 server/docs/api.md create mode 100644 server/proto/v1/internal_api.pb.go create mode 100644 server/proto/v1/internal_api.proto create mode 100644 server/proto/v1/internal_api_grpc.pb.go diff --git a/server/docs/api.md b/server/docs/api.md new file mode 100644 index 0000000000..0437a0b9a6 --- /dev/null +++ b/server/docs/api.md @@ -0,0 +1,299 @@ +# Protocol Documentation + + +## Table of Contents + +- [proto/v1/internal_api.proto](#proto_v1_internal_api-proto) + - [AuthRequest](#reearth-cms-v1-AuthRequest) + - [AuthResponse](#reearth-cms-v1-AuthResponse) + - [ExportRequest](#reearth-cms-v1-ExportRequest) + - [ExportURLResponse](#reearth-cms-v1-ExportURLResponse) + - [ListModelsRequest](#reearth-cms-v1-ListModelsRequest) + - [ListModelsResponse](#reearth-cms-v1-ListModelsResponse) + - [ListProjectsRequest](#reearth-cms-v1-ListProjectsRequest) + - [ListProjectsResponse](#reearth-cms-v1-ListProjectsResponse) + - [Model](#reearth-cms-v1-Model) + - [Project](#reearth-cms-v1-Project) + - [ProjectPublication](#reearth-cms-v1-ProjectPublication) + - [RefreshTokenRequest](#reearth-cms-v1-RefreshTokenRequest) + + - [ProjectPublicationScope](#reearth-cms-v1-ProjectPublicationScope) + + - [ReEarthCMS](#reearth-cms-v1-ReEarthCMS) + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## proto/v1/internal_api.proto + + + + + +### AuthRequest +Auth messages + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| api_key | [string](#string) | | | + + + + + + + + +### AuthResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| access_token | [string](#string) | | | +| refresh_token | [string](#string) | | | +| expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### ExportRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| project_id | [string](#string) | | | +| model_id | [string](#string) | | | +| expires_in_seconds | [int32](#int32) | | | + + + + + + + + +### ExportURLResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| url | [string](#string) | | | +| expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### ListModelsRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| project_id | [string](#string) | | | +| page_size | [int32](#int32) | | | +| page_token | [string](#string) | | | + + + + + + + + +### ListModelsResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| models | [Model](#reearth-cms-v1-Model) | repeated | | +| next_page_token | [string](#string) | | | +| total_count | [int32](#int32) | | | + + + + + + + + +### ListProjectsRequest +Request messages + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| workspace_id | [string](#string) | | | +| page_size | [int32](#int32) | | | +| page_token | [string](#string) | | | + + + + + + + + +### ListProjectsResponse +Response messages + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| projects | [Project](#reearth-cms-v1-Project) | repeated | | +| next_page_token | [string](#string) | | | +| total_count | [int32](#int32) | | | + + + + + + + + +### Model + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | +| project_id | [string](#string) | | | +| name | [string](#string) | | | +| description | [string](#string) | | | +| key | [string](#string) | | | +| public | [bool](#bool) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### Project +Core messages + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | +| name | [string](#string) | | | +| description | [string](#string) | | | +| workspace_id | [string](#string) | | | +| publication | [ProjectPublication](#reearth-cms-v1-ProjectPublication) | | | +| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | + + + + + + + + +### ProjectPublication + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| scope | [ProjectPublicationScope](#reearth-cms-v1-ProjectPublicationScope) | | | +| asset_public | [bool](#bool) | | | +| token | [string](#string) | optional | | + + + + + + + + +### RefreshTokenRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| refresh_token | [string](#string) | | | + + + + + + + + + + +### ProjectPublicationScope + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| SCOPE_UNSPECIFIED | 0 | | +| PUBLIC | 1 | | +| LIMITED | 2 | | +| PRIVATE | 3 | | + + + + + + + + + +### ReEarthCMS + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Authenticate | [AuthRequest](#reearth-cms-v1-AuthRequest) | [AuthResponse](#reearth-cms-v1-AuthResponse) | Auth | +| RefreshToken | [RefreshTokenRequest](#reearth-cms-v1-RefreshTokenRequest) | [AuthResponse](#reearth-cms-v1-AuthResponse) | | +| ListProjects | [ListProjectsRequest](#reearth-cms-v1-ListProjectsRequest) | [ListProjectsResponse](#reearth-cms-v1-ListProjectsResponse) | Main operations | +| ListModels | [ListModelsRequest](#reearth-cms-v1-ListModelsRequest) | [ListModelsResponse](#reearth-cms-v1-ListModelsResponse) | | +| GetModelGeoJSONExportURL | [ExportRequest](#reearth-cms-v1-ExportRequest) | [ExportURLResponse](#reearth-cms-v1-ExportURLResponse) | | + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/server/proto/v1/internal_api.pb.go b/server/proto/v1/internal_api.pb.go new file mode 100644 index 0000000000..b676042e7d --- /dev/null +++ b/server/proto/v1/internal_api.pb.go @@ -0,0 +1,1068 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.4 +// protoc v5.29.3 +// source: proto/v1/internal_api.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ProjectPublicationScope int32 + +const ( + ProjectPublicationScope_SCOPE_UNSPECIFIED ProjectPublicationScope = 0 + ProjectPublicationScope_PUBLIC ProjectPublicationScope = 1 + ProjectPublicationScope_LIMITED ProjectPublicationScope = 2 + ProjectPublicationScope_PRIVATE ProjectPublicationScope = 3 +) + +// Enum value maps for ProjectPublicationScope. +var ( + ProjectPublicationScope_name = map[int32]string{ + 0: "SCOPE_UNSPECIFIED", + 1: "PUBLIC", + 2: "LIMITED", + 3: "PRIVATE", + } + ProjectPublicationScope_value = map[string]int32{ + "SCOPE_UNSPECIFIED": 0, + "PUBLIC": 1, + "LIMITED": 2, + "PRIVATE": 3, + } +) + +func (x ProjectPublicationScope) Enum() *ProjectPublicationScope { + p := new(ProjectPublicationScope) + *p = x + return p +} + +func (x ProjectPublicationScope) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProjectPublicationScope) Descriptor() protoreflect.EnumDescriptor { + return file_proto_v1_internal_api_proto_enumTypes[0].Descriptor() +} + +func (ProjectPublicationScope) Type() protoreflect.EnumType { + return &file_proto_v1_internal_api_proto_enumTypes[0] +} + +func (x ProjectPublicationScope) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProjectPublicationScope.Descriptor instead. +func (ProjectPublicationScope) EnumDescriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{0} +} + +// Auth messages +type AuthRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AuthRequest) Reset() { + *x = AuthRequest{} + mi := &file_proto_v1_internal_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AuthRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthRequest) ProtoMessage() {} + +func (x *AuthRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead. +func (*AuthRequest) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{0} +} + +func (x *AuthRequest) GetApiKey() string { + if x != nil { + return x.ApiKey + } + return "" +} + +type RefreshTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RefreshTokenRequest) Reset() { + *x = RefreshTokenRequest{} + mi := &file_proto_v1_internal_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RefreshTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenRequest) ProtoMessage() {} + +func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead. +func (*RefreshTokenRequest) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{1} +} + +func (x *RefreshTokenRequest) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +type AuthResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AuthResponse) Reset() { + *x = AuthResponse{} + mi := &file_proto_v1_internal_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AuthResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthResponse) ProtoMessage() {} + +func (x *AuthResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead. +func (*AuthResponse) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{2} +} + +func (x *AuthResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *AuthResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *AuthResponse) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +// Core messages +type Project struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + WorkspaceId string `protobuf:"bytes,4,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + Publication *ProjectPublication `protobuf:"bytes,5,opt,name=publication,proto3" json:"publication,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Project) Reset() { + *x = Project{} + mi := &file_proto_v1_internal_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Project) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Project) ProtoMessage() {} + +func (x *Project) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Project.ProtoReflect.Descriptor instead. +func (*Project) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{3} +} + +func (x *Project) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Project) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Project) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Project) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *Project) GetPublication() *ProjectPublication { + if x != nil { + return x.Publication + } + return nil +} + +func (x *Project) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Project) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type ProjectPublication struct { + state protoimpl.MessageState `protogen:"open.v1"` + Scope ProjectPublicationScope `protobuf:"varint,1,opt,name=scope,proto3,enum=reearth.cms.v1.ProjectPublicationScope" json:"scope,omitempty"` + AssetPublic bool `protobuf:"varint,2,opt,name=asset_public,json=assetPublic,proto3" json:"asset_public,omitempty"` + Token *string `protobuf:"bytes,3,opt,name=token,proto3,oneof" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProjectPublication) Reset() { + *x = ProjectPublication{} + mi := &file_proto_v1_internal_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProjectPublication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectPublication) ProtoMessage() {} + +func (x *ProjectPublication) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectPublication.ProtoReflect.Descriptor instead. +func (*ProjectPublication) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{4} +} + +func (x *ProjectPublication) GetScope() ProjectPublicationScope { + if x != nil { + return x.Scope + } + return ProjectPublicationScope_SCOPE_UNSPECIFIED +} + +func (x *ProjectPublication) GetAssetPublic() bool { + if x != nil { + return x.AssetPublic + } + return false +} + +func (x *ProjectPublication) GetToken() string { + if x != nil && x.Token != nil { + return *x.Token + } + return "" +} + +type Model struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"` + Public bool `protobuf:"varint,6,opt,name=public,proto3" json:"public,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Model) Reset() { + *x = Model{} + mi := &file_proto_v1_internal_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Model) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Model) ProtoMessage() {} + +func (x *Model) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Model.ProtoReflect.Descriptor instead. +func (*Model) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{5} +} + +func (x *Model) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Model) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *Model) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Model) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Model) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Model) GetPublic() bool { + if x != nil { + return x.Public + } + return false +} + +func (x *Model) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Model) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +// Request messages +type ListProjectsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProjectsRequest) Reset() { + *x = ListProjectsRequest{} + mi := &file_proto_v1_internal_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProjectsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProjectsRequest) ProtoMessage() {} + +func (x *ListProjectsRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProjectsRequest.ProtoReflect.Descriptor instead. +func (*ListProjectsRequest) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{6} +} + +func (x *ListProjectsRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *ListProjectsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListProjectsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type ListModelsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListModelsRequest) Reset() { + *x = ListModelsRequest{} + mi := &file_proto_v1_internal_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListModelsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListModelsRequest) ProtoMessage() {} + +func (x *ListModelsRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListModelsRequest.ProtoReflect.Descriptor instead. +func (*ListModelsRequest) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{7} +} + +func (x *ListModelsRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListModelsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListModelsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type ExportRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + ModelId string `protobuf:"bytes,2,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"` + ExpiresInSeconds int32 `protobuf:"varint,3,opt,name=expires_in_seconds,json=expiresInSeconds,proto3" json:"expires_in_seconds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExportRequest) Reset() { + *x = ExportRequest{} + mi := &file_proto_v1_internal_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportRequest) ProtoMessage() {} + +func (x *ExportRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportRequest.ProtoReflect.Descriptor instead. +func (*ExportRequest) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{8} +} + +func (x *ExportRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ExportRequest) GetModelId() string { + if x != nil { + return x.ModelId + } + return "" +} + +func (x *ExportRequest) GetExpiresInSeconds() int32 { + if x != nil { + return x.ExpiresInSeconds + } + return 0 +} + +// Response messages +type ListProjectsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Projects []*Project `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + TotalCount int32 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProjectsResponse) Reset() { + *x = ListProjectsResponse{} + mi := &file_proto_v1_internal_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProjectsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProjectsResponse) ProtoMessage() {} + +func (x *ListProjectsResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProjectsResponse.ProtoReflect.Descriptor instead. +func (*ListProjectsResponse) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{9} +} + +func (x *ListProjectsResponse) GetProjects() []*Project { + if x != nil { + return x.Projects + } + return nil +} + +func (x *ListProjectsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListProjectsResponse) GetTotalCount() int32 { + if x != nil { + return x.TotalCount + } + return 0 +} + +type ListModelsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Models []*Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + TotalCount int32 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListModelsResponse) Reset() { + *x = ListModelsResponse{} + mi := &file_proto_v1_internal_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListModelsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListModelsResponse) ProtoMessage() {} + +func (x *ListModelsResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListModelsResponse.ProtoReflect.Descriptor instead. +func (*ListModelsResponse) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{10} +} + +func (x *ListModelsResponse) GetModels() []*Model { + if x != nil { + return x.Models + } + return nil +} + +func (x *ListModelsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListModelsResponse) GetTotalCount() int32 { + if x != nil { + return x.TotalCount + } + return 0 +} + +type ExportURLResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExportURLResponse) Reset() { + *x = ExportURLResponse{} + mi := &file_proto_v1_internal_api_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExportURLResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExportURLResponse) ProtoMessage() {} + +func (x *ExportURLResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1_internal_api_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExportURLResponse.ProtoReflect.Descriptor instead. +func (*ExportURLResponse) Descriptor() ([]byte, []int) { + return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{11} +} + +func (x *ExportURLResponse) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ExportURLResponse) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +var File_proto_v1_internal_api_proto protoreflect.FileDescriptor + +var file_proto_v1_internal_api_proto_rawDesc = string([]byte{ + 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x72, + 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, + 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, + 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x22, 0x3a, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x91, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0xae, 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0b, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, + 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, + 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x12, 0x19, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8c, 0x02, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x22, 0x74, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x6e, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x77, 0x0a, 0x0d, 0x45, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, + 0x5f, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, + 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x60, 0x0a, 0x11, 0x45, 0x78, 0x70, + 0x6f, 0x72, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x2a, 0x56, 0x0a, 0x17, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4c, 0x49, 0x4d, + 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, + 0x45, 0x10, 0x03, 0x32, 0xc2, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x45, 0x61, 0x72, 0x74, 0x68, 0x43, + 0x4d, 0x53, 0x12, 0x4b, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x53, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x23, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x72, 0x65, 0x65, 0x61, + 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, + 0x21, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x47, 0x65, 0x6f, 0x4a, 0x53, 0x4f, 0x4e, 0x45, 0x78, 0x70, 0x6f, 0x72, + 0x74, 0x55, 0x52, 0x4c, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +}) + +var ( + file_proto_v1_internal_api_proto_rawDescOnce sync.Once + file_proto_v1_internal_api_proto_rawDescData []byte +) + +func file_proto_v1_internal_api_proto_rawDescGZIP() []byte { + file_proto_v1_internal_api_proto_rawDescOnce.Do(func() { + file_proto_v1_internal_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_v1_internal_api_proto_rawDesc), len(file_proto_v1_internal_api_proto_rawDesc))) + }) + return file_proto_v1_internal_api_proto_rawDescData +} + +var file_proto_v1_internal_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proto_v1_internal_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_proto_v1_internal_api_proto_goTypes = []any{ + (ProjectPublicationScope)(0), // 0: reearth.cms.v1.ProjectPublicationScope + (*AuthRequest)(nil), // 1: reearth.cms.v1.AuthRequest + (*RefreshTokenRequest)(nil), // 2: reearth.cms.v1.RefreshTokenRequest + (*AuthResponse)(nil), // 3: reearth.cms.v1.AuthResponse + (*Project)(nil), // 4: reearth.cms.v1.Project + (*ProjectPublication)(nil), // 5: reearth.cms.v1.ProjectPublication + (*Model)(nil), // 6: reearth.cms.v1.Model + (*ListProjectsRequest)(nil), // 7: reearth.cms.v1.ListProjectsRequest + (*ListModelsRequest)(nil), // 8: reearth.cms.v1.ListModelsRequest + (*ExportRequest)(nil), // 9: reearth.cms.v1.ExportRequest + (*ListProjectsResponse)(nil), // 10: reearth.cms.v1.ListProjectsResponse + (*ListModelsResponse)(nil), // 11: reearth.cms.v1.ListModelsResponse + (*ExportURLResponse)(nil), // 12: reearth.cms.v1.ExportURLResponse + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp +} +var file_proto_v1_internal_api_proto_depIdxs = []int32{ + 13, // 0: reearth.cms.v1.AuthResponse.expires_at:type_name -> google.protobuf.Timestamp + 5, // 1: reearth.cms.v1.Project.publication:type_name -> reearth.cms.v1.ProjectPublication + 13, // 2: reearth.cms.v1.Project.created_at:type_name -> google.protobuf.Timestamp + 13, // 3: reearth.cms.v1.Project.updated_at:type_name -> google.protobuf.Timestamp + 0, // 4: reearth.cms.v1.ProjectPublication.scope:type_name -> reearth.cms.v1.ProjectPublicationScope + 13, // 5: reearth.cms.v1.Model.created_at:type_name -> google.protobuf.Timestamp + 13, // 6: reearth.cms.v1.Model.updated_at:type_name -> google.protobuf.Timestamp + 4, // 7: reearth.cms.v1.ListProjectsResponse.projects:type_name -> reearth.cms.v1.Project + 6, // 8: reearth.cms.v1.ListModelsResponse.models:type_name -> reearth.cms.v1.Model + 13, // 9: reearth.cms.v1.ExportURLResponse.expires_at:type_name -> google.protobuf.Timestamp + 1, // 10: reearth.cms.v1.ReEarthCMS.Authenticate:input_type -> reearth.cms.v1.AuthRequest + 2, // 11: reearth.cms.v1.ReEarthCMS.RefreshToken:input_type -> reearth.cms.v1.RefreshTokenRequest + 7, // 12: reearth.cms.v1.ReEarthCMS.ListProjects:input_type -> reearth.cms.v1.ListProjectsRequest + 8, // 13: reearth.cms.v1.ReEarthCMS.ListModels:input_type -> reearth.cms.v1.ListModelsRequest + 9, // 14: reearth.cms.v1.ReEarthCMS.GetModelGeoJSONExportURL:input_type -> reearth.cms.v1.ExportRequest + 3, // 15: reearth.cms.v1.ReEarthCMS.Authenticate:output_type -> reearth.cms.v1.AuthResponse + 3, // 16: reearth.cms.v1.ReEarthCMS.RefreshToken:output_type -> reearth.cms.v1.AuthResponse + 10, // 17: reearth.cms.v1.ReEarthCMS.ListProjects:output_type -> reearth.cms.v1.ListProjectsResponse + 11, // 18: reearth.cms.v1.ReEarthCMS.ListModels:output_type -> reearth.cms.v1.ListModelsResponse + 12, // 19: reearth.cms.v1.ReEarthCMS.GetModelGeoJSONExportURL:output_type -> reearth.cms.v1.ExportURLResponse + 15, // [15:20] is the sub-list for method output_type + 10, // [10:15] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_proto_v1_internal_api_proto_init() } +func file_proto_v1_internal_api_proto_init() { + if File_proto_v1_internal_api_proto != nil { + return + } + file_proto_v1_internal_api_proto_msgTypes[4].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_v1_internal_api_proto_rawDesc), len(file_proto_v1_internal_api_proto_rawDesc)), + NumEnums: 1, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_v1_internal_api_proto_goTypes, + DependencyIndexes: file_proto_v1_internal_api_proto_depIdxs, + EnumInfos: file_proto_v1_internal_api_proto_enumTypes, + MessageInfos: file_proto_v1_internal_api_proto_msgTypes, + }.Build() + File_proto_v1_internal_api_proto = out.File + file_proto_v1_internal_api_proto_goTypes = nil + file_proto_v1_internal_api_proto_depIdxs = nil +} diff --git a/server/proto/v1/internal_api.proto b/server/proto/v1/internal_api.proto new file mode 100644 index 0000000000..df2651dc6c --- /dev/null +++ b/server/proto/v1/internal_api.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package reearth.cms.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "proto/v1"; + +service ReEarthCMS { + // Auth + rpc Authenticate(AuthRequest) returns (AuthResponse) {} + rpc RefreshToken(RefreshTokenRequest) returns (AuthResponse) {} + + // Main operations + rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) {} + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) {} + rpc GetModelGeoJSONExportURL(ExportRequest) returns (ExportURLResponse) {} +} + +// Implementation note: +// Authentication should be implemented using gRPC interceptors +// JWT tokens should be passed in metadata with key "authorization" +// Format: "Bearer " + +// Auth messages +message AuthRequest { + string api_key = 1; +} + +message RefreshTokenRequest { + string refresh_token = 1; +} + +message AuthResponse { + string access_token = 1; + string refresh_token = 2; + google.protobuf.Timestamp expires_at = 3; +} + +// Core messages +message Project { + string id = 1; + string name = 2; + string description = 3; + string workspace_id = 4; + ProjectPublication publication = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; +} + +message ProjectPublication { + ProjectPublicationScope scope = 1; + bool asset_public = 2; + optional string token = 3; +} + +enum ProjectPublicationScope { + SCOPE_UNSPECIFIED = 0; + PUBLIC = 1; + LIMITED = 2; + PRIVATE = 3; +} + +message Model { + string id = 1; + string project_id = 2; + string name = 3; + string description = 4; + string key = 5; + bool public = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; +} + +// Request messages +message ListProjectsRequest { + string workspace_id = 1; + int32 page_size = 2; + string page_token = 3; +} + +message ListModelsRequest { + string project_id = 1; + int32 page_size = 2; + string page_token = 3; +} + +message ExportRequest { + string project_id = 1; + string model_id = 2; + int32 expires_in_seconds = 3; +} + +// Response messages +message ListProjectsResponse { + repeated Project projects = 1; + string next_page_token = 2; + int32 total_count = 3; +} + +message ListModelsResponse { + repeated Model models = 1; + string next_page_token = 2; + int32 total_count = 3; +} + +message ExportURLResponse { + string url = 1; + google.protobuf.Timestamp expires_at = 2; +} diff --git a/server/proto/v1/internal_api_grpc.pb.go b/server/proto/v1/internal_api_grpc.pb.go new file mode 100644 index 0000000000..2138467d66 --- /dev/null +++ b/server/proto/v1/internal_api_grpc.pb.go @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: proto/v1/internal_api.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + ReEarthCMS_Authenticate_FullMethodName = "/reearth.cms.v1.ReEarthCMS/Authenticate" + ReEarthCMS_RefreshToken_FullMethodName = "/reearth.cms.v1.ReEarthCMS/RefreshToken" + ReEarthCMS_ListProjects_FullMethodName = "/reearth.cms.v1.ReEarthCMS/ListProjects" + ReEarthCMS_ListModels_FullMethodName = "/reearth.cms.v1.ReEarthCMS/ListModels" + ReEarthCMS_GetModelGeoJSONExportURL_FullMethodName = "/reearth.cms.v1.ReEarthCMS/GetModelGeoJSONExportURL" +) + +// ReEarthCMSClient is the client API for ReEarthCMS service. +// +// 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 ReEarthCMSClient interface { + // Auth + Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) + RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error) + // Main operations + ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*ListProjectsResponse, error) + ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) + GetModelGeoJSONExportURL(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportURLResponse, error) +} + +type reEarthCMSClient struct { + cc grpc.ClientConnInterface +} + +func NewReEarthCMSClient(cc grpc.ClientConnInterface) ReEarthCMSClient { + return &reEarthCMSClient{cc} +} + +func (c *reEarthCMSClient) Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AuthResponse) + err := c.cc.Invoke(ctx, ReEarthCMS_Authenticate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reEarthCMSClient) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AuthResponse) + err := c.cc.Invoke(ctx, ReEarthCMS_RefreshToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reEarthCMSClient) ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*ListProjectsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListProjectsResponse) + err := c.cc.Invoke(ctx, ReEarthCMS_ListProjects_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reEarthCMSClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListModelsResponse) + err := c.cc.Invoke(ctx, ReEarthCMS_ListModels_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reEarthCMSClient) GetModelGeoJSONExportURL(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportURLResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ExportURLResponse) + err := c.cc.Invoke(ctx, ReEarthCMS_GetModelGeoJSONExportURL_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReEarthCMSServer is the server API for ReEarthCMS service. +// All implementations must embed UnimplementedReEarthCMSServer +// for forward compatibility. +type ReEarthCMSServer interface { + // Auth + Authenticate(context.Context, *AuthRequest) (*AuthResponse, error) + RefreshToken(context.Context, *RefreshTokenRequest) (*AuthResponse, error) + // Main operations + ListProjects(context.Context, *ListProjectsRequest) (*ListProjectsResponse, error) + ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) + GetModelGeoJSONExportURL(context.Context, *ExportRequest) (*ExportURLResponse, error) + mustEmbedUnimplementedReEarthCMSServer() +} + +// UnimplementedReEarthCMSServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReEarthCMSServer struct{} + +func (UnimplementedReEarthCMSServer) Authenticate(context.Context, *AuthRequest) (*AuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") +} +func (UnimplementedReEarthCMSServer) RefreshToken(context.Context, *RefreshTokenRequest) (*AuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") +} +func (UnimplementedReEarthCMSServer) ListProjects(context.Context, *ListProjectsRequest) (*ListProjectsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListProjects not implemented") +} +func (UnimplementedReEarthCMSServer) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListModels not implemented") +} +func (UnimplementedReEarthCMSServer) GetModelGeoJSONExportURL(context.Context, *ExportRequest) (*ExportURLResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetModelGeoJSONExportURL not implemented") +} +func (UnimplementedReEarthCMSServer) mustEmbedUnimplementedReEarthCMSServer() {} +func (UnimplementedReEarthCMSServer) testEmbeddedByValue() {} + +// UnsafeReEarthCMSServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ReEarthCMSServer will +// result in compilation errors. +type UnsafeReEarthCMSServer interface { + mustEmbedUnimplementedReEarthCMSServer() +} + +func RegisterReEarthCMSServer(s grpc.ServiceRegistrar, srv ReEarthCMSServer) { + // If the following call pancis, it indicates UnimplementedReEarthCMSServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&ReEarthCMS_ServiceDesc, srv) +} + +func _ReEarthCMS_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReEarthCMSServer).Authenticate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReEarthCMS_Authenticate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReEarthCMSServer).Authenticate(ctx, req.(*AuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReEarthCMS_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReEarthCMSServer).RefreshToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReEarthCMS_RefreshToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReEarthCMSServer).RefreshToken(ctx, req.(*RefreshTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReEarthCMS_ListProjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListProjectsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReEarthCMSServer).ListProjects(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReEarthCMS_ListProjects_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReEarthCMSServer).ListProjects(ctx, req.(*ListProjectsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReEarthCMS_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListModelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReEarthCMSServer).ListModels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReEarthCMS_ListModels_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReEarthCMSServer).ListModels(ctx, req.(*ListModelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReEarthCMS_GetModelGeoJSONExportURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReEarthCMSServer).GetModelGeoJSONExportURL(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ReEarthCMS_GetModelGeoJSONExportURL_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReEarthCMSServer).GetModelGeoJSONExportURL(ctx, req.(*ExportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ReEarthCMS_ServiceDesc is the grpc.ServiceDesc for ReEarthCMS service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ReEarthCMS_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "reearth.cms.v1.ReEarthCMS", + HandlerType: (*ReEarthCMSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Authenticate", + Handler: _ReEarthCMS_Authenticate_Handler, + }, + { + MethodName: "RefreshToken", + Handler: _ReEarthCMS_RefreshToken_Handler, + }, + { + MethodName: "ListProjects", + Handler: _ReEarthCMS_ListProjects_Handler, + }, + { + MethodName: "ListModels", + Handler: _ReEarthCMS_ListModels_Handler, + }, + { + MethodName: "GetModelGeoJSONExportURL", + Handler: _ReEarthCMS_GetModelGeoJSONExportURL_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/v1/internal_api.proto", +} From 4a72882b0708520ba3a69a92d408bf891afdd191 Mon Sep 17 00:00:00 2001 From: ymk <81808708+yk-eukarya@users.noreply.github.com> Date: Wed, 12 Feb 2025 10:56:06 +0100 Subject: [PATCH 2/2] update proto file --- server/docs/api.md | 299 ----- server/proto/v1/internal_api.pb.go | 1068 ----------------- server/proto/v1/internal_api_grpc.pb.go | 277 ----- .../internel/v1/schema.proto} | 43 +- 4 files changed, 15 insertions(+), 1672 deletions(-) delete mode 100644 server/docs/api.md delete mode 100644 server/proto/v1/internal_api.pb.go delete mode 100644 server/proto/v1/internal_api_grpc.pb.go rename server/{proto/v1/internal_api.proto => schemas/internel/v1/schema.proto} (71%) diff --git a/server/docs/api.md b/server/docs/api.md deleted file mode 100644 index 0437a0b9a6..0000000000 --- a/server/docs/api.md +++ /dev/null @@ -1,299 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [proto/v1/internal_api.proto](#proto_v1_internal_api-proto) - - [AuthRequest](#reearth-cms-v1-AuthRequest) - - [AuthResponse](#reearth-cms-v1-AuthResponse) - - [ExportRequest](#reearth-cms-v1-ExportRequest) - - [ExportURLResponse](#reearth-cms-v1-ExportURLResponse) - - [ListModelsRequest](#reearth-cms-v1-ListModelsRequest) - - [ListModelsResponse](#reearth-cms-v1-ListModelsResponse) - - [ListProjectsRequest](#reearth-cms-v1-ListProjectsRequest) - - [ListProjectsResponse](#reearth-cms-v1-ListProjectsResponse) - - [Model](#reearth-cms-v1-Model) - - [Project](#reearth-cms-v1-Project) - - [ProjectPublication](#reearth-cms-v1-ProjectPublication) - - [RefreshTokenRequest](#reearth-cms-v1-RefreshTokenRequest) - - - [ProjectPublicationScope](#reearth-cms-v1-ProjectPublicationScope) - - - [ReEarthCMS](#reearth-cms-v1-ReEarthCMS) - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## proto/v1/internal_api.proto - - - - - -### AuthRequest -Auth messages - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| api_key | [string](#string) | | | - - - - - - - - -### AuthResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| access_token | [string](#string) | | | -| refresh_token | [string](#string) | | | -| expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### ExportRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| project_id | [string](#string) | | | -| model_id | [string](#string) | | | -| expires_in_seconds | [int32](#int32) | | | - - - - - - - - -### ExportURLResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| url | [string](#string) | | | -| expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### ListModelsRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| project_id | [string](#string) | | | -| page_size | [int32](#int32) | | | -| page_token | [string](#string) | | | - - - - - - - - -### ListModelsResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| models | [Model](#reearth-cms-v1-Model) | repeated | | -| next_page_token | [string](#string) | | | -| total_count | [int32](#int32) | | | - - - - - - - - -### ListProjectsRequest -Request messages - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| workspace_id | [string](#string) | | | -| page_size | [int32](#int32) | | | -| page_token | [string](#string) | | | - - - - - - - - -### ListProjectsResponse -Response messages - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| projects | [Project](#reearth-cms-v1-Project) | repeated | | -| next_page_token | [string](#string) | | | -| total_count | [int32](#int32) | | | - - - - - - - - -### Model - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | -| project_id | [string](#string) | | | -| name | [string](#string) | | | -| description | [string](#string) | | | -| key | [string](#string) | | | -| public | [bool](#bool) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### Project -Core messages - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | -| name | [string](#string) | | | -| description | [string](#string) | | | -| workspace_id | [string](#string) | | | -| publication | [ProjectPublication](#reearth-cms-v1-ProjectPublication) | | | -| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | - - - - - - - - -### ProjectPublication - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| scope | [ProjectPublicationScope](#reearth-cms-v1-ProjectPublicationScope) | | | -| asset_public | [bool](#bool) | | | -| token | [string](#string) | optional | | - - - - - - - - -### RefreshTokenRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| refresh_token | [string](#string) | | | - - - - - - - - - - -### ProjectPublicationScope - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| SCOPE_UNSPECIFIED | 0 | | -| PUBLIC | 1 | | -| LIMITED | 2 | | -| PRIVATE | 3 | | - - - - - - - - - -### ReEarthCMS - - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| Authenticate | [AuthRequest](#reearth-cms-v1-AuthRequest) | [AuthResponse](#reearth-cms-v1-AuthResponse) | Auth | -| RefreshToken | [RefreshTokenRequest](#reearth-cms-v1-RefreshTokenRequest) | [AuthResponse](#reearth-cms-v1-AuthResponse) | | -| ListProjects | [ListProjectsRequest](#reearth-cms-v1-ListProjectsRequest) | [ListProjectsResponse](#reearth-cms-v1-ListProjectsResponse) | Main operations | -| ListModels | [ListModelsRequest](#reearth-cms-v1-ListModelsRequest) | [ListModelsResponse](#reearth-cms-v1-ListModelsResponse) | | -| GetModelGeoJSONExportURL | [ExportRequest](#reearth-cms-v1-ExportRequest) | [ExportURLResponse](#reearth-cms-v1-ExportURLResponse) | | - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -| double | | double | double | float | float64 | double | float | Float | -| float | | float | float | float | float32 | float | float | Float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | -| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - diff --git a/server/proto/v1/internal_api.pb.go b/server/proto/v1/internal_api.pb.go deleted file mode 100644 index b676042e7d..0000000000 --- a/server/proto/v1/internal_api.pb.go +++ /dev/null @@ -1,1068 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.4 -// protoc v5.29.3 -// source: proto/v1/internal_api.proto - -package v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ProjectPublicationScope int32 - -const ( - ProjectPublicationScope_SCOPE_UNSPECIFIED ProjectPublicationScope = 0 - ProjectPublicationScope_PUBLIC ProjectPublicationScope = 1 - ProjectPublicationScope_LIMITED ProjectPublicationScope = 2 - ProjectPublicationScope_PRIVATE ProjectPublicationScope = 3 -) - -// Enum value maps for ProjectPublicationScope. -var ( - ProjectPublicationScope_name = map[int32]string{ - 0: "SCOPE_UNSPECIFIED", - 1: "PUBLIC", - 2: "LIMITED", - 3: "PRIVATE", - } - ProjectPublicationScope_value = map[string]int32{ - "SCOPE_UNSPECIFIED": 0, - "PUBLIC": 1, - "LIMITED": 2, - "PRIVATE": 3, - } -) - -func (x ProjectPublicationScope) Enum() *ProjectPublicationScope { - p := new(ProjectPublicationScope) - *p = x - return p -} - -func (x ProjectPublicationScope) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ProjectPublicationScope) Descriptor() protoreflect.EnumDescriptor { - return file_proto_v1_internal_api_proto_enumTypes[0].Descriptor() -} - -func (ProjectPublicationScope) Type() protoreflect.EnumType { - return &file_proto_v1_internal_api_proto_enumTypes[0] -} - -func (x ProjectPublicationScope) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ProjectPublicationScope.Descriptor instead. -func (ProjectPublicationScope) EnumDescriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{0} -} - -// Auth messages -type AuthRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AuthRequest) Reset() { - *x = AuthRequest{} - mi := &file_proto_v1_internal_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AuthRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthRequest) ProtoMessage() {} - -func (x *AuthRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead. -func (*AuthRequest) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{0} -} - -func (x *AuthRequest) GetApiKey() string { - if x != nil { - return x.ApiKey - } - return "" -} - -type RefreshTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshTokenRequest) Reset() { - *x = RefreshTokenRequest{} - mi := &file_proto_v1_internal_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshTokenRequest) ProtoMessage() {} - -func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead. -func (*RefreshTokenRequest) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{1} -} - -func (x *RefreshTokenRequest) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -type AuthResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AuthResponse) Reset() { - *x = AuthResponse{} - mi := &file_proto_v1_internal_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AuthResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthResponse) ProtoMessage() {} - -func (x *AuthResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead. -func (*AuthResponse) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{2} -} - -func (x *AuthResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *AuthResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -func (x *AuthResponse) GetExpiresAt() *timestamppb.Timestamp { - if x != nil { - return x.ExpiresAt - } - return nil -} - -// Core messages -type Project struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - WorkspaceId string `protobuf:"bytes,4,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` - Publication *ProjectPublication `protobuf:"bytes,5,opt,name=publication,proto3" json:"publication,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Project) Reset() { - *x = Project{} - mi := &file_proto_v1_internal_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Project) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Project) ProtoMessage() {} - -func (x *Project) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Project.ProtoReflect.Descriptor instead. -func (*Project) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{3} -} - -func (x *Project) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Project) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Project) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Project) GetWorkspaceId() string { - if x != nil { - return x.WorkspaceId - } - return "" -} - -func (x *Project) GetPublication() *ProjectPublication { - if x != nil { - return x.Publication - } - return nil -} - -func (x *Project) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Project) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -type ProjectPublication struct { - state protoimpl.MessageState `protogen:"open.v1"` - Scope ProjectPublicationScope `protobuf:"varint,1,opt,name=scope,proto3,enum=reearth.cms.v1.ProjectPublicationScope" json:"scope,omitempty"` - AssetPublic bool `protobuf:"varint,2,opt,name=asset_public,json=assetPublic,proto3" json:"asset_public,omitempty"` - Token *string `protobuf:"bytes,3,opt,name=token,proto3,oneof" json:"token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProjectPublication) Reset() { - *x = ProjectPublication{} - mi := &file_proto_v1_internal_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProjectPublication) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProjectPublication) ProtoMessage() {} - -func (x *ProjectPublication) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProjectPublication.ProtoReflect.Descriptor instead. -func (*ProjectPublication) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{4} -} - -func (x *ProjectPublication) GetScope() ProjectPublicationScope { - if x != nil { - return x.Scope - } - return ProjectPublicationScope_SCOPE_UNSPECIFIED -} - -func (x *ProjectPublication) GetAssetPublic() bool { - if x != nil { - return x.AssetPublic - } - return false -} - -func (x *ProjectPublication) GetToken() string { - if x != nil && x.Token != nil { - return *x.Token - } - return "" -} - -type Model struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"` - Public bool `protobuf:"varint,6,opt,name=public,proto3" json:"public,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Model) Reset() { - *x = Model{} - mi := &file_proto_v1_internal_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Model) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Model) ProtoMessage() {} - -func (x *Model) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Model.ProtoReflect.Descriptor instead. -func (*Model) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{5} -} - -func (x *Model) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Model) GetProjectId() string { - if x != nil { - return x.ProjectId - } - return "" -} - -func (x *Model) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Model) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Model) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Model) GetPublic() bool { - if x != nil { - return x.Public - } - return false -} - -func (x *Model) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *Model) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -// Request messages -type ListProjectsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListProjectsRequest) Reset() { - *x = ListProjectsRequest{} - mi := &file_proto_v1_internal_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListProjectsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProjectsRequest) ProtoMessage() {} - -func (x *ListProjectsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListProjectsRequest.ProtoReflect.Descriptor instead. -func (*ListProjectsRequest) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{6} -} - -func (x *ListProjectsRequest) GetWorkspaceId() string { - if x != nil { - return x.WorkspaceId - } - return "" -} - -func (x *ListProjectsRequest) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListProjectsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -type ListModelsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListModelsRequest) Reset() { - *x = ListModelsRequest{} - mi := &file_proto_v1_internal_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListModelsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListModelsRequest) ProtoMessage() {} - -func (x *ListModelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListModelsRequest.ProtoReflect.Descriptor instead. -func (*ListModelsRequest) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{7} -} - -func (x *ListModelsRequest) GetProjectId() string { - if x != nil { - return x.ProjectId - } - return "" -} - -func (x *ListModelsRequest) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListModelsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -type ExportRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` - ModelId string `protobuf:"bytes,2,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"` - ExpiresInSeconds int32 `protobuf:"varint,3,opt,name=expires_in_seconds,json=expiresInSeconds,proto3" json:"expires_in_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExportRequest) Reset() { - *x = ExportRequest{} - mi := &file_proto_v1_internal_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExportRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExportRequest) ProtoMessage() {} - -func (x *ExportRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExportRequest.ProtoReflect.Descriptor instead. -func (*ExportRequest) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{8} -} - -func (x *ExportRequest) GetProjectId() string { - if x != nil { - return x.ProjectId - } - return "" -} - -func (x *ExportRequest) GetModelId() string { - if x != nil { - return x.ModelId - } - return "" -} - -func (x *ExportRequest) GetExpiresInSeconds() int32 { - if x != nil { - return x.ExpiresInSeconds - } - return 0 -} - -// Response messages -type ListProjectsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Projects []*Project `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - TotalCount int32 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListProjectsResponse) Reset() { - *x = ListProjectsResponse{} - mi := &file_proto_v1_internal_api_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListProjectsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProjectsResponse) ProtoMessage() {} - -func (x *ListProjectsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListProjectsResponse.ProtoReflect.Descriptor instead. -func (*ListProjectsResponse) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{9} -} - -func (x *ListProjectsResponse) GetProjects() []*Project { - if x != nil { - return x.Projects - } - return nil -} - -func (x *ListProjectsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *ListProjectsResponse) GetTotalCount() int32 { - if x != nil { - return x.TotalCount - } - return 0 -} - -type ListModelsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Models []*Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"` - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - TotalCount int32 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListModelsResponse) Reset() { - *x = ListModelsResponse{} - mi := &file_proto_v1_internal_api_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListModelsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListModelsResponse) ProtoMessage() {} - -func (x *ListModelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListModelsResponse.ProtoReflect.Descriptor instead. -func (*ListModelsResponse) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{10} -} - -func (x *ListModelsResponse) GetModels() []*Model { - if x != nil { - return x.Models - } - return nil -} - -func (x *ListModelsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *ListModelsResponse) GetTotalCount() int32 { - if x != nil { - return x.TotalCount - } - return 0 -} - -type ExportURLResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExportURLResponse) Reset() { - *x = ExportURLResponse{} - mi := &file_proto_v1_internal_api_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExportURLResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExportURLResponse) ProtoMessage() {} - -func (x *ExportURLResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1_internal_api_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExportURLResponse.ProtoReflect.Descriptor instead. -func (*ExportURLResponse) Descriptor() ([]byte, []int) { - return file_proto_v1_internal_api_proto_rawDescGZIP(), []int{11} -} - -func (x *ExportURLResponse) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *ExportURLResponse) GetExpiresAt() *timestamppb.Timestamp { - if x != nil { - return x.ExpiresAt - } - return nil -} - -var File_proto_v1_internal_api_proto protoreflect.FileDescriptor - -var file_proto_v1_internal_api_proto_rawDesc = string([]byte{ - 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x72, - 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, - 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x22, 0x3a, 0x0a, 0x13, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, - 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x91, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, - 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x65, - 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0xae, 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0b, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, - 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, - 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x12, 0x19, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8c, 0x02, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x39, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x22, 0x74, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x77, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x6e, 0x0a, 0x11, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x77, 0x0a, 0x0d, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, - 0x5f, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, 0x6e, 0x53, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x08, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, - 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x12, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x60, 0x0a, 0x11, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x2a, 0x56, 0x0a, 0x17, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, - 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4c, 0x49, 0x4d, - 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, - 0x45, 0x10, 0x03, 0x32, 0xc2, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x45, 0x61, 0x72, 0x74, 0x68, 0x43, - 0x4d, 0x53, 0x12, 0x4b, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x53, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x23, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x72, 0x65, 0x65, 0x61, - 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, - 0x21, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x47, 0x65, 0x6f, 0x4a, 0x53, 0x4f, 0x4e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x55, 0x52, 0x4c, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x72, 0x65, 0x65, 0x61, 0x72, 0x74, 0x68, 0x2e, 0x63, 0x6d, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -}) - -var ( - file_proto_v1_internal_api_proto_rawDescOnce sync.Once - file_proto_v1_internal_api_proto_rawDescData []byte -) - -func file_proto_v1_internal_api_proto_rawDescGZIP() []byte { - file_proto_v1_internal_api_proto_rawDescOnce.Do(func() { - file_proto_v1_internal_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_v1_internal_api_proto_rawDesc), len(file_proto_v1_internal_api_proto_rawDesc))) - }) - return file_proto_v1_internal_api_proto_rawDescData -} - -var file_proto_v1_internal_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_v1_internal_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_proto_v1_internal_api_proto_goTypes = []any{ - (ProjectPublicationScope)(0), // 0: reearth.cms.v1.ProjectPublicationScope - (*AuthRequest)(nil), // 1: reearth.cms.v1.AuthRequest - (*RefreshTokenRequest)(nil), // 2: reearth.cms.v1.RefreshTokenRequest - (*AuthResponse)(nil), // 3: reearth.cms.v1.AuthResponse - (*Project)(nil), // 4: reearth.cms.v1.Project - (*ProjectPublication)(nil), // 5: reearth.cms.v1.ProjectPublication - (*Model)(nil), // 6: reearth.cms.v1.Model - (*ListProjectsRequest)(nil), // 7: reearth.cms.v1.ListProjectsRequest - (*ListModelsRequest)(nil), // 8: reearth.cms.v1.ListModelsRequest - (*ExportRequest)(nil), // 9: reearth.cms.v1.ExportRequest - (*ListProjectsResponse)(nil), // 10: reearth.cms.v1.ListProjectsResponse - (*ListModelsResponse)(nil), // 11: reearth.cms.v1.ListModelsResponse - (*ExportURLResponse)(nil), // 12: reearth.cms.v1.ExportURLResponse - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp -} -var file_proto_v1_internal_api_proto_depIdxs = []int32{ - 13, // 0: reearth.cms.v1.AuthResponse.expires_at:type_name -> google.protobuf.Timestamp - 5, // 1: reearth.cms.v1.Project.publication:type_name -> reearth.cms.v1.ProjectPublication - 13, // 2: reearth.cms.v1.Project.created_at:type_name -> google.protobuf.Timestamp - 13, // 3: reearth.cms.v1.Project.updated_at:type_name -> google.protobuf.Timestamp - 0, // 4: reearth.cms.v1.ProjectPublication.scope:type_name -> reearth.cms.v1.ProjectPublicationScope - 13, // 5: reearth.cms.v1.Model.created_at:type_name -> google.protobuf.Timestamp - 13, // 6: reearth.cms.v1.Model.updated_at:type_name -> google.protobuf.Timestamp - 4, // 7: reearth.cms.v1.ListProjectsResponse.projects:type_name -> reearth.cms.v1.Project - 6, // 8: reearth.cms.v1.ListModelsResponse.models:type_name -> reearth.cms.v1.Model - 13, // 9: reearth.cms.v1.ExportURLResponse.expires_at:type_name -> google.protobuf.Timestamp - 1, // 10: reearth.cms.v1.ReEarthCMS.Authenticate:input_type -> reearth.cms.v1.AuthRequest - 2, // 11: reearth.cms.v1.ReEarthCMS.RefreshToken:input_type -> reearth.cms.v1.RefreshTokenRequest - 7, // 12: reearth.cms.v1.ReEarthCMS.ListProjects:input_type -> reearth.cms.v1.ListProjectsRequest - 8, // 13: reearth.cms.v1.ReEarthCMS.ListModels:input_type -> reearth.cms.v1.ListModelsRequest - 9, // 14: reearth.cms.v1.ReEarthCMS.GetModelGeoJSONExportURL:input_type -> reearth.cms.v1.ExportRequest - 3, // 15: reearth.cms.v1.ReEarthCMS.Authenticate:output_type -> reearth.cms.v1.AuthResponse - 3, // 16: reearth.cms.v1.ReEarthCMS.RefreshToken:output_type -> reearth.cms.v1.AuthResponse - 10, // 17: reearth.cms.v1.ReEarthCMS.ListProjects:output_type -> reearth.cms.v1.ListProjectsResponse - 11, // 18: reearth.cms.v1.ReEarthCMS.ListModels:output_type -> reearth.cms.v1.ListModelsResponse - 12, // 19: reearth.cms.v1.ReEarthCMS.GetModelGeoJSONExportURL:output_type -> reearth.cms.v1.ExportURLResponse - 15, // [15:20] is the sub-list for method output_type - 10, // [10:15] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_proto_v1_internal_api_proto_init() } -func file_proto_v1_internal_api_proto_init() { - if File_proto_v1_internal_api_proto != nil { - return - } - file_proto_v1_internal_api_proto_msgTypes[4].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_v1_internal_api_proto_rawDesc), len(file_proto_v1_internal_api_proto_rawDesc)), - NumEnums: 1, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_v1_internal_api_proto_goTypes, - DependencyIndexes: file_proto_v1_internal_api_proto_depIdxs, - EnumInfos: file_proto_v1_internal_api_proto_enumTypes, - MessageInfos: file_proto_v1_internal_api_proto_msgTypes, - }.Build() - File_proto_v1_internal_api_proto = out.File - file_proto_v1_internal_api_proto_goTypes = nil - file_proto_v1_internal_api_proto_depIdxs = nil -} diff --git a/server/proto/v1/internal_api_grpc.pb.go b/server/proto/v1/internal_api_grpc.pb.go deleted file mode 100644 index 2138467d66..0000000000 --- a/server/proto/v1/internal_api_grpc.pb.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: proto/v1/internal_api.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - ReEarthCMS_Authenticate_FullMethodName = "/reearth.cms.v1.ReEarthCMS/Authenticate" - ReEarthCMS_RefreshToken_FullMethodName = "/reearth.cms.v1.ReEarthCMS/RefreshToken" - ReEarthCMS_ListProjects_FullMethodName = "/reearth.cms.v1.ReEarthCMS/ListProjects" - ReEarthCMS_ListModels_FullMethodName = "/reearth.cms.v1.ReEarthCMS/ListModels" - ReEarthCMS_GetModelGeoJSONExportURL_FullMethodName = "/reearth.cms.v1.ReEarthCMS/GetModelGeoJSONExportURL" -) - -// ReEarthCMSClient is the client API for ReEarthCMS service. -// -// 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 ReEarthCMSClient interface { - // Auth - Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) - RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error) - // Main operations - ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*ListProjectsResponse, error) - ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) - GetModelGeoJSONExportURL(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportURLResponse, error) -} - -type reEarthCMSClient struct { - cc grpc.ClientConnInterface -} - -func NewReEarthCMSClient(cc grpc.ClientConnInterface) ReEarthCMSClient { - return &reEarthCMSClient{cc} -} - -func (c *reEarthCMSClient) Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AuthResponse) - err := c.cc.Invoke(ctx, ReEarthCMS_Authenticate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reEarthCMSClient) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AuthResponse) - err := c.cc.Invoke(ctx, ReEarthCMS_RefreshToken_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reEarthCMSClient) ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*ListProjectsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListProjectsResponse) - err := c.cc.Invoke(ctx, ReEarthCMS_ListProjects_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reEarthCMSClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListModelsResponse) - err := c.cc.Invoke(ctx, ReEarthCMS_ListModels_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reEarthCMSClient) GetModelGeoJSONExportURL(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ExportURLResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ExportURLResponse) - err := c.cc.Invoke(ctx, ReEarthCMS_GetModelGeoJSONExportURL_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ReEarthCMSServer is the server API for ReEarthCMS service. -// All implementations must embed UnimplementedReEarthCMSServer -// for forward compatibility. -type ReEarthCMSServer interface { - // Auth - Authenticate(context.Context, *AuthRequest) (*AuthResponse, error) - RefreshToken(context.Context, *RefreshTokenRequest) (*AuthResponse, error) - // Main operations - ListProjects(context.Context, *ListProjectsRequest) (*ListProjectsResponse, error) - ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) - GetModelGeoJSONExportURL(context.Context, *ExportRequest) (*ExportURLResponse, error) - mustEmbedUnimplementedReEarthCMSServer() -} - -// UnimplementedReEarthCMSServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedReEarthCMSServer struct{} - -func (UnimplementedReEarthCMSServer) Authenticate(context.Context, *AuthRequest) (*AuthResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") -} -func (UnimplementedReEarthCMSServer) RefreshToken(context.Context, *RefreshTokenRequest) (*AuthResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") -} -func (UnimplementedReEarthCMSServer) ListProjects(context.Context, *ListProjectsRequest) (*ListProjectsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListProjects not implemented") -} -func (UnimplementedReEarthCMSServer) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListModels not implemented") -} -func (UnimplementedReEarthCMSServer) GetModelGeoJSONExportURL(context.Context, *ExportRequest) (*ExportURLResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetModelGeoJSONExportURL not implemented") -} -func (UnimplementedReEarthCMSServer) mustEmbedUnimplementedReEarthCMSServer() {} -func (UnimplementedReEarthCMSServer) testEmbeddedByValue() {} - -// UnsafeReEarthCMSServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ReEarthCMSServer will -// result in compilation errors. -type UnsafeReEarthCMSServer interface { - mustEmbedUnimplementedReEarthCMSServer() -} - -func RegisterReEarthCMSServer(s grpc.ServiceRegistrar, srv ReEarthCMSServer) { - // If the following call pancis, it indicates UnimplementedReEarthCMSServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ReEarthCMS_ServiceDesc, srv) -} - -func _ReEarthCMS_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReEarthCMSServer).Authenticate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ReEarthCMS_Authenticate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReEarthCMSServer).Authenticate(ctx, req.(*AuthRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReEarthCMS_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RefreshTokenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReEarthCMSServer).RefreshToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ReEarthCMS_RefreshToken_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReEarthCMSServer).RefreshToken(ctx, req.(*RefreshTokenRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReEarthCMS_ListProjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListProjectsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReEarthCMSServer).ListProjects(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ReEarthCMS_ListProjects_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReEarthCMSServer).ListProjects(ctx, req.(*ListProjectsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReEarthCMS_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListModelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReEarthCMSServer).ListModels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ReEarthCMS_ListModels_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReEarthCMSServer).ListModels(ctx, req.(*ListModelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReEarthCMS_GetModelGeoJSONExportURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExportRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReEarthCMSServer).GetModelGeoJSONExportURL(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ReEarthCMS_GetModelGeoJSONExportURL_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReEarthCMSServer).GetModelGeoJSONExportURL(ctx, req.(*ExportRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ReEarthCMS_ServiceDesc is the grpc.ServiceDesc for ReEarthCMS service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ReEarthCMS_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "reearth.cms.v1.ReEarthCMS", - HandlerType: (*ReEarthCMSServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Authenticate", - Handler: _ReEarthCMS_Authenticate_Handler, - }, - { - MethodName: "RefreshToken", - Handler: _ReEarthCMS_RefreshToken_Handler, - }, - { - MethodName: "ListProjects", - Handler: _ReEarthCMS_ListProjects_Handler, - }, - { - MethodName: "ListModels", - Handler: _ReEarthCMS_ListModels_Handler, - }, - { - MethodName: "GetModelGeoJSONExportURL", - Handler: _ReEarthCMS_GetModelGeoJSONExportURL_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto/v1/internal_api.proto", -} diff --git a/server/proto/v1/internal_api.proto b/server/schemas/internel/v1/schema.proto similarity index 71% rename from server/proto/v1/internal_api.proto rename to server/schemas/internel/v1/schema.proto index df2651dc6c..aa35ebbeaf 100644 --- a/server/proto/v1/internal_api.proto +++ b/server/schemas/internel/v1/schema.proto @@ -7,11 +7,8 @@ import "google/protobuf/timestamp.proto"; option go_package = "proto/v1"; service ReEarthCMS { - // Auth - rpc Authenticate(AuthRequest) returns (AuthResponse) {} - rpc RefreshToken(RefreshTokenRequest) returns (AuthResponse) {} - // Main operations + rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse) {} rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) {} rpc ListModels(ListModelsRequest) returns (ListModelsResponse) {} rpc GetModelGeoJSONExportURL(ExportRequest) returns (ExportURLResponse) {} @@ -19,23 +16,9 @@ service ReEarthCMS { // Implementation note: // Authentication should be implemented using gRPC interceptors -// JWT tokens should be passed in metadata with key "authorization" +// M2M tokens should be passed in metadata with key "authorization" // Format: "Bearer " - -// Auth messages -message AuthRequest { - string api_key = 1; -} - -message RefreshTokenRequest { - string refresh_token = 1; -} - -message AuthResponse { - string access_token = 1; - string refresh_token = 2; - google.protobuf.Timestamp expires_at = 3; -} +// UserId should be passed in metadata with key "user-id" // Core messages message Project { @@ -73,38 +56,42 @@ message Model { } // Request messages +message CreateProjectRequest { + string workspace_id = 1; + string name = 2; + string description = 3; + string alias = 4; + ProjectPublication publication = 5; +} + message ListProjectsRequest { string workspace_id = 1; - int32 page_size = 2; - string page_token = 3; } message ListModelsRequest { string project_id = 1; - int32 page_size = 2; - string page_token = 3; } message ExportRequest { string project_id = 1; string model_id = 2; - int32 expires_in_seconds = 3; } // Response messages +message CreateProjectResponse { + Project project = 1; +} + message ListProjectsResponse { repeated Project projects = 1; - string next_page_token = 2; int32 total_count = 3; } message ListModelsResponse { repeated Model models = 1; - string next_page_token = 2; int32 total_count = 3; } message ExportURLResponse { string url = 1; - google.protobuf.Timestamp expires_at = 2; }