diff --git a/backend/pkg/proto/admin/v1/adminv1connect/deployment.connect.go b/backend/pkg/proto/admin/v1/adminv1connect/deployment.connect.go new file mode 100644 index 00000000..cfb55f7b --- /dev/null +++ b/backend/pkg/proto/admin/v1/adminv1connect/deployment.connect.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: admin/v1/deployment.proto + +package adminv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/ictsc/ictsc-regalia/backend/pkg/proto/admin/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // DeploymentServiceName is the fully-qualified name of the DeploymentService service. + DeploymentServiceName = "admin.v1.DeploymentService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // DeploymentServiceListDeploymentsProcedure is the fully-qualified name of the DeploymentService's + // ListDeployments RPC. + DeploymentServiceListDeploymentsProcedure = "/admin.v1.DeploymentService/ListDeployments" + // DeploymentServiceSyncDeploymentProcedure is the fully-qualified name of the DeploymentService's + // SyncDeployment RPC. + DeploymentServiceSyncDeploymentProcedure = "/admin.v1.DeploymentService/SyncDeployment" + // DeploymentServiceDeployProcedure is the fully-qualified name of the DeploymentService's Deploy + // RPC. + DeploymentServiceDeployProcedure = "/admin.v1.DeploymentService/Deploy" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + deploymentServiceServiceDescriptor = v1.File_admin_v1_deployment_proto.Services().ByName("DeploymentService") + deploymentServiceListDeploymentsMethodDescriptor = deploymentServiceServiceDescriptor.Methods().ByName("ListDeployments") + deploymentServiceSyncDeploymentMethodDescriptor = deploymentServiceServiceDescriptor.Methods().ByName("SyncDeployment") + deploymentServiceDeployMethodDescriptor = deploymentServiceServiceDescriptor.Methods().ByName("Deploy") +) + +// DeploymentServiceClient is a client for the admin.v1.DeploymentService service. +type DeploymentServiceClient interface { + ListDeployments(context.Context, *connect.Request[v1.ListDeploymentsRequest]) (*connect.Response[v1.ListDeploymentsResponse], error) + SyncDeployment(context.Context, *connect.Request[v1.SyncDeploymentRequest]) (*connect.Response[v1.SyncDeploymentResponse], error) + Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) +} + +// NewDeploymentServiceClient constructs a client for the admin.v1.DeploymentService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewDeploymentServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DeploymentServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &deploymentServiceClient{ + listDeployments: connect.NewClient[v1.ListDeploymentsRequest, v1.ListDeploymentsResponse]( + httpClient, + baseURL+DeploymentServiceListDeploymentsProcedure, + connect.WithSchema(deploymentServiceListDeploymentsMethodDescriptor), + connect.WithClientOptions(opts...), + ), + syncDeployment: connect.NewClient[v1.SyncDeploymentRequest, v1.SyncDeploymentResponse]( + httpClient, + baseURL+DeploymentServiceSyncDeploymentProcedure, + connect.WithSchema(deploymentServiceSyncDeploymentMethodDescriptor), + connect.WithClientOptions(opts...), + ), + deploy: connect.NewClient[v1.DeployRequest, v1.DeployResponse]( + httpClient, + baseURL+DeploymentServiceDeployProcedure, + connect.WithSchema(deploymentServiceDeployMethodDescriptor), + connect.WithClientOptions(opts...), + ), + } +} + +// deploymentServiceClient implements DeploymentServiceClient. +type deploymentServiceClient struct { + listDeployments *connect.Client[v1.ListDeploymentsRequest, v1.ListDeploymentsResponse] + syncDeployment *connect.Client[v1.SyncDeploymentRequest, v1.SyncDeploymentResponse] + deploy *connect.Client[v1.DeployRequest, v1.DeployResponse] +} + +// ListDeployments calls admin.v1.DeploymentService.ListDeployments. +func (c *deploymentServiceClient) ListDeployments(ctx context.Context, req *connect.Request[v1.ListDeploymentsRequest]) (*connect.Response[v1.ListDeploymentsResponse], error) { + return c.listDeployments.CallUnary(ctx, req) +} + +// SyncDeployment calls admin.v1.DeploymentService.SyncDeployment. +func (c *deploymentServiceClient) SyncDeployment(ctx context.Context, req *connect.Request[v1.SyncDeploymentRequest]) (*connect.Response[v1.SyncDeploymentResponse], error) { + return c.syncDeployment.CallUnary(ctx, req) +} + +// Deploy calls admin.v1.DeploymentService.Deploy. +func (c *deploymentServiceClient) Deploy(ctx context.Context, req *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) { + return c.deploy.CallUnary(ctx, req) +} + +// DeploymentServiceHandler is an implementation of the admin.v1.DeploymentService service. +type DeploymentServiceHandler interface { + ListDeployments(context.Context, *connect.Request[v1.ListDeploymentsRequest]) (*connect.Response[v1.ListDeploymentsResponse], error) + SyncDeployment(context.Context, *connect.Request[v1.SyncDeploymentRequest]) (*connect.Response[v1.SyncDeploymentResponse], error) + Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) +} + +// NewDeploymentServiceHandler builds an HTTP handler from the service implementation. It returns +// the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewDeploymentServiceHandler(svc DeploymentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + deploymentServiceListDeploymentsHandler := connect.NewUnaryHandler( + DeploymentServiceListDeploymentsProcedure, + svc.ListDeployments, + connect.WithSchema(deploymentServiceListDeploymentsMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + deploymentServiceSyncDeploymentHandler := connect.NewUnaryHandler( + DeploymentServiceSyncDeploymentProcedure, + svc.SyncDeployment, + connect.WithSchema(deploymentServiceSyncDeploymentMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + deploymentServiceDeployHandler := connect.NewUnaryHandler( + DeploymentServiceDeployProcedure, + svc.Deploy, + connect.WithSchema(deploymentServiceDeployMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + return "/admin.v1.DeploymentService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case DeploymentServiceListDeploymentsProcedure: + deploymentServiceListDeploymentsHandler.ServeHTTP(w, r) + case DeploymentServiceSyncDeploymentProcedure: + deploymentServiceSyncDeploymentHandler.ServeHTTP(w, r) + case DeploymentServiceDeployProcedure: + deploymentServiceDeployHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedDeploymentServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedDeploymentServiceHandler struct{} + +func (UnimplementedDeploymentServiceHandler) ListDeployments(context.Context, *connect.Request[v1.ListDeploymentsRequest]) (*connect.Response[v1.ListDeploymentsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("admin.v1.DeploymentService.ListDeployments is not implemented")) +} + +func (UnimplementedDeploymentServiceHandler) SyncDeployment(context.Context, *connect.Request[v1.SyncDeploymentRequest]) (*connect.Response[v1.SyncDeploymentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("admin.v1.DeploymentService.SyncDeployment is not implemented")) +} + +func (UnimplementedDeploymentServiceHandler) Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("admin.v1.DeploymentService.Deploy is not implemented")) +} diff --git a/backend/pkg/proto/admin/v1/deployment.pb.go b/backend/pkg/proto/admin/v1/deployment.pb.go new file mode 100644 index 00000000..8b6d73a2 --- /dev/null +++ b/backend/pkg/proto/admin/v1/deployment.pb.go @@ -0,0 +1,657 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc (unknown) +// source: admin/v1/deployment.proto + +package adminv1 + +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" +) + +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 DeploymentEventType int32 + +const ( + DeploymentEventType_DEPLOYMENT_EVENT_TYPE_UNSPECIFIED DeploymentEventType = 0 + DeploymentEventType_DEPLOYMENT_EVENT_TYPE_QUEUED DeploymentEventType = 1 + DeploymentEventType_DEPLOYMENT_EVENT_TYPE_CREATING DeploymentEventType = 2 + DeploymentEventType_DEPLOYMENT_EVENT_TYPE_FINISHED DeploymentEventType = 3 + DeploymentEventType_DEPLOYMENT_EVENT_TYPE_ERROR DeploymentEventType = 4 +) + +// Enum value maps for DeploymentEventType. +var ( + DeploymentEventType_name = map[int32]string{ + 0: "DEPLOYMENT_EVENT_TYPE_UNSPECIFIED", + 1: "DEPLOYMENT_EVENT_TYPE_QUEUED", + 2: "DEPLOYMENT_EVENT_TYPE_CREATING", + 3: "DEPLOYMENT_EVENT_TYPE_FINISHED", + 4: "DEPLOYMENT_EVENT_TYPE_ERROR", + } + DeploymentEventType_value = map[string]int32{ + "DEPLOYMENT_EVENT_TYPE_UNSPECIFIED": 0, + "DEPLOYMENT_EVENT_TYPE_QUEUED": 1, + "DEPLOYMENT_EVENT_TYPE_CREATING": 2, + "DEPLOYMENT_EVENT_TYPE_FINISHED": 3, + "DEPLOYMENT_EVENT_TYPE_ERROR": 4, + } +) + +func (x DeploymentEventType) Enum() *DeploymentEventType { + p := new(DeploymentEventType) + *p = x + return p +} + +func (x DeploymentEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeploymentEventType) Descriptor() protoreflect.EnumDescriptor { + return file_admin_v1_deployment_proto_enumTypes[0].Descriptor() +} + +func (DeploymentEventType) Type() protoreflect.EnumType { + return &file_admin_v1_deployment_proto_enumTypes[0] +} + +func (x DeploymentEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeploymentEventType.Descriptor instead. +func (DeploymentEventType) EnumDescriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{0} +} + +// 問題の展開状態 +type Deployment struct { + state protoimpl.MessageState `protogen:"open.v1"` + // チームコード + TeamCode int64 `protobuf:"varint,1,opt,name=team_code,json=teamCode,proto3" json:"team_code,omitempty"` + // 問題コード + ProblemCode string `protobuf:"bytes,2,opt,name=problem_code,json=problemCode,proto3" json:"problem_code,omitempty"` + // リビジョン - 0 が初期状態で再展開される度にインクリメントされる + Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` + // 最新のイベント + LatestEvent DeploymentEventType `protobuf:"varint,4,opt,name=latest_event,json=latestEvent,proto3,enum=admin.v1.DeploymentEventType" json:"latest_event,omitempty"` + // イベント + Events []*DeploymentEvent `protobuf:"bytes,5,rep,name=events,proto3" json:"events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Deployment) Reset() { + *x = Deployment{} + mi := &file_admin_v1_deployment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Deployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Deployment) ProtoMessage() {} + +func (x *Deployment) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 Deployment.ProtoReflect.Descriptor instead. +func (*Deployment) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{0} +} + +func (x *Deployment) GetTeamCode() int64 { + if x != nil { + return x.TeamCode + } + return 0 +} + +func (x *Deployment) GetProblemCode() string { + if x != nil { + return x.ProblemCode + } + return "" +} + +func (x *Deployment) GetRevision() int64 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *Deployment) GetLatestEvent() DeploymentEventType { + if x != nil { + return x.LatestEvent + } + return DeploymentEventType_DEPLOYMENT_EVENT_TYPE_UNSPECIFIED +} + +func (x *Deployment) GetEvents() []*DeploymentEvent { + if x != nil { + return x.Events + } + return nil +} + +// 問題展開に関するイベント +type DeploymentEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + OccurredAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"` + Type DeploymentEventType `protobuf:"varint,2,opt,name=type,proto3,enum=admin.v1.DeploymentEventType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeploymentEvent) Reset() { + *x = DeploymentEvent{} + mi := &file_admin_v1_deployment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeploymentEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeploymentEvent) ProtoMessage() {} + +func (x *DeploymentEvent) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 DeploymentEvent.ProtoReflect.Descriptor instead. +func (*DeploymentEvent) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{1} +} + +func (x *DeploymentEvent) GetOccurredAt() *timestamppb.Timestamp { + if x != nil { + return x.OccurredAt + } + return nil +} + +func (x *DeploymentEvent) GetType() DeploymentEventType { + if x != nil { + return x.Type + } + return DeploymentEventType_DEPLOYMENT_EVENT_TYPE_UNSPECIFIED +} + +type ListDeploymentsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TeamCode int64 `protobuf:"varint,1,opt,name=team_code,json=teamCode,proto3" json:"team_code,omitempty"` + ProblemCode string `protobuf:"bytes,2,opt,name=problem_code,json=problemCode,proto3" json:"problem_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDeploymentsRequest) Reset() { + *x = ListDeploymentsRequest{} + mi := &file_admin_v1_deployment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDeploymentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDeploymentsRequest) ProtoMessage() {} + +func (x *ListDeploymentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 ListDeploymentsRequest.ProtoReflect.Descriptor instead. +func (*ListDeploymentsRequest) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{2} +} + +func (x *ListDeploymentsRequest) GetTeamCode() int64 { + if x != nil { + return x.TeamCode + } + return 0 +} + +func (x *ListDeploymentsRequest) GetProblemCode() string { + if x != nil { + return x.ProblemCode + } + return "" +} + +type ListDeploymentsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Deployments []*Deployment `protobuf:"bytes,1,rep,name=deployments,proto3" json:"deployments,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDeploymentsResponse) Reset() { + *x = ListDeploymentsResponse{} + mi := &file_admin_v1_deployment_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDeploymentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDeploymentsResponse) ProtoMessage() {} + +func (x *ListDeploymentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 ListDeploymentsResponse.ProtoReflect.Descriptor instead. +func (*ListDeploymentsResponse) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{3} +} + +func (x *ListDeploymentsResponse) GetDeployments() []*Deployment { + if x != nil { + return x.Deployments + } + return nil +} + +type SyncDeploymentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TeamCode int64 `protobuf:"varint,1,opt,name=team_code,json=teamCode,proto3" json:"team_code,omitempty"` + ProblemCode string `protobuf:"bytes,2,opt,name=problem_code,json=problemCode,proto3" json:"problem_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncDeploymentRequest) Reset() { + *x = SyncDeploymentRequest{} + mi := &file_admin_v1_deployment_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncDeploymentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncDeploymentRequest) ProtoMessage() {} + +func (x *SyncDeploymentRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 SyncDeploymentRequest.ProtoReflect.Descriptor instead. +func (*SyncDeploymentRequest) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{4} +} + +func (x *SyncDeploymentRequest) GetTeamCode() int64 { + if x != nil { + return x.TeamCode + } + return 0 +} + +func (x *SyncDeploymentRequest) GetProblemCode() string { + if x != nil { + return x.ProblemCode + } + return "" +} + +type SyncDeploymentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncDeploymentResponse) Reset() { + *x = SyncDeploymentResponse{} + mi := &file_admin_v1_deployment_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncDeploymentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncDeploymentResponse) ProtoMessage() {} + +func (x *SyncDeploymentResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 SyncDeploymentResponse.ProtoReflect.Descriptor instead. +func (*SyncDeploymentResponse) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{5} +} + +type DeployRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TeamCode int64 `protobuf:"varint,1,opt,name=team_code,json=teamCode,proto3" json:"team_code,omitempty"` + ProblemCode string `protobuf:"bytes,2,opt,name=problem_code,json=problemCode,proto3" json:"problem_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployRequest) Reset() { + *x = DeployRequest{} + mi := &file_admin_v1_deployment_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployRequest) ProtoMessage() {} + +func (x *DeployRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 DeployRequest.ProtoReflect.Descriptor instead. +func (*DeployRequest) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{6} +} + +func (x *DeployRequest) GetTeamCode() int64 { + if x != nil { + return x.TeamCode + } + return 0 +} + +func (x *DeployRequest) GetProblemCode() string { + if x != nil { + return x.ProblemCode + } + return "" +} + +type DeployResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployResponse) Reset() { + *x = DeployResponse{} + mi := &file_admin_v1_deployment_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployResponse) ProtoMessage() {} + +func (x *DeployResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_v1_deployment_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 DeployResponse.ProtoReflect.Descriptor instead. +func (*DeployResponse) Descriptor() ([]byte, []int) { + return file_admin_v1_deployment_proto_rawDescGZIP(), []int{7} +} + +func (x *DeployResponse) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +var File_admin_v1_deployment_proto protoreflect.FileDescriptor + +var file_admin_v1_deployment_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 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, 0xdd, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, + 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x40, 0x0a, 0x0c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x63, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 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, 0x0a, 0x6f, 0x63, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x58, 0x0a, 0x16, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, + 0x43, 0x6f, 0x64, 0x65, 0x22, 0x51, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x36, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x64, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x57, 0x0a, 0x15, 0x53, 0x79, 0x6e, 0x63, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x43, 0x6f, 0x64, 0x65, + 0x22, 0x18, 0x0a, 0x16, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x44, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x65, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x74, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x62, + 0x6c, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x46, 0x0a, 0x0e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x2a, 0xc7, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x21, 0x44, + 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, + 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x55, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, + 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x52, + 0x45, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x45, 0x50, 0x4c, + 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1f, 0x0a, 0x1b, + 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x32, 0xfd, 0x01, + 0x0a, 0x11, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0e, 0x53, + 0x79, 0x6e, 0x63, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x65, + 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3b, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x17, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x43, 0x5a, + 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x63, 0x74, 0x73, + 0x63, 0x2f, 0x69, 0x63, 0x74, 0x73, 0x63, 0x2d, 0x72, 0x65, 0x67, 0x61, 0x6c, 0x69, 0x61, 0x2f, + 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_admin_v1_deployment_proto_rawDescOnce sync.Once + file_admin_v1_deployment_proto_rawDescData = file_admin_v1_deployment_proto_rawDesc +) + +func file_admin_v1_deployment_proto_rawDescGZIP() []byte { + file_admin_v1_deployment_proto_rawDescOnce.Do(func() { + file_admin_v1_deployment_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_v1_deployment_proto_rawDescData) + }) + return file_admin_v1_deployment_proto_rawDescData +} + +var file_admin_v1_deployment_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_admin_v1_deployment_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_admin_v1_deployment_proto_goTypes = []any{ + (DeploymentEventType)(0), // 0: admin.v1.DeploymentEventType + (*Deployment)(nil), // 1: admin.v1.Deployment + (*DeploymentEvent)(nil), // 2: admin.v1.DeploymentEvent + (*ListDeploymentsRequest)(nil), // 3: admin.v1.ListDeploymentsRequest + (*ListDeploymentsResponse)(nil), // 4: admin.v1.ListDeploymentsResponse + (*SyncDeploymentRequest)(nil), // 5: admin.v1.SyncDeploymentRequest + (*SyncDeploymentResponse)(nil), // 6: admin.v1.SyncDeploymentResponse + (*DeployRequest)(nil), // 7: admin.v1.DeployRequest + (*DeployResponse)(nil), // 8: admin.v1.DeployResponse + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp +} +var file_admin_v1_deployment_proto_depIdxs = []int32{ + 0, // 0: admin.v1.Deployment.latest_event:type_name -> admin.v1.DeploymentEventType + 2, // 1: admin.v1.Deployment.events:type_name -> admin.v1.DeploymentEvent + 9, // 2: admin.v1.DeploymentEvent.occurred_at:type_name -> google.protobuf.Timestamp + 0, // 3: admin.v1.DeploymentEvent.type:type_name -> admin.v1.DeploymentEventType + 1, // 4: admin.v1.ListDeploymentsResponse.deployments:type_name -> admin.v1.Deployment + 1, // 5: admin.v1.DeployResponse.deployment:type_name -> admin.v1.Deployment + 3, // 6: admin.v1.DeploymentService.ListDeployments:input_type -> admin.v1.ListDeploymentsRequest + 5, // 7: admin.v1.DeploymentService.SyncDeployment:input_type -> admin.v1.SyncDeploymentRequest + 7, // 8: admin.v1.DeploymentService.Deploy:input_type -> admin.v1.DeployRequest + 4, // 9: admin.v1.DeploymentService.ListDeployments:output_type -> admin.v1.ListDeploymentsResponse + 6, // 10: admin.v1.DeploymentService.SyncDeployment:output_type -> admin.v1.SyncDeploymentResponse + 8, // 11: admin.v1.DeploymentService.Deploy:output_type -> admin.v1.DeployResponse + 9, // [9:12] is the sub-list for method output_type + 6, // [6:9] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_admin_v1_deployment_proto_init() } +func file_admin_v1_deployment_proto_init() { + if File_admin_v1_deployment_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_v1_deployment_proto_rawDesc, + NumEnums: 1, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_v1_deployment_proto_goTypes, + DependencyIndexes: file_admin_v1_deployment_proto_depIdxs, + EnumInfos: file_admin_v1_deployment_proto_enumTypes, + MessageInfos: file_admin_v1_deployment_proto_msgTypes, + }.Build() + File_admin_v1_deployment_proto = out.File + file_admin_v1_deployment_proto_rawDesc = nil + file_admin_v1_deployment_proto_goTypes = nil + file_admin_v1_deployment_proto_depIdxs = nil +} diff --git a/frontend/packages/proto/exports/admin-v1.ts b/frontend/packages/proto/exports/admin-v1.ts index 58ba5a3f..331c7b6f 100644 --- a/frontend/packages/proto/exports/admin-v1.ts +++ b/frontend/packages/proto/exports/admin-v1.ts @@ -1,3 +1,4 @@ // Code generated by scripts/generate-exports.ts; DO NOT EDIT. +export * from "../proto/admin/v1/deployment_pb.ts"; export * from "../proto/admin/v1/problem_pb.ts"; export * from "../proto/admin/v1/team_pb.ts"; diff --git a/frontend/packages/proto/proto/admin/v1/deployment_pb.ts b/frontend/packages/proto/proto/admin/v1/deployment_pb.ts new file mode 100644 index 00000000..3648bf3a --- /dev/null +++ b/frontend/packages/proto/proto/admin/v1/deployment_pb.ts @@ -0,0 +1,269 @@ +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" +// @generated from file admin/v1/deployment.proto (package admin.v1, syntax proto3) +/* eslint-disable */ + +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Timestamp } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file admin/v1/deployment.proto. + */ +export const file_admin_v1_deployment: GenFile = /*@__PURE__*/ + fileDesc("ChlhZG1pbi92MS9kZXBsb3ltZW50LnByb3RvEghhZG1pbi52MSKnAQoKRGVwbG95bWVudBIRCgl0ZWFtX2NvZGUYASABKAMSFAoMcHJvYmxlbV9jb2RlGAIgASgJEhAKCHJldmlzaW9uGAMgASgDEjMKDGxhdGVzdF9ldmVudBgEIAEoDjIdLmFkbWluLnYxLkRlcGxveW1lbnRFdmVudFR5cGUSKQoGZXZlbnRzGAUgAygLMhkuYWRtaW4udjEuRGVwbG95bWVudEV2ZW50Im8KD0RlcGxveW1lbnRFdmVudBIvCgtvY2N1cnJlZF9hdBgBIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASKwoEdHlwZRgCIAEoDjIdLmFkbWluLnYxLkRlcGxveW1lbnRFdmVudFR5cGUiQQoWTGlzdERlcGxveW1lbnRzUmVxdWVzdBIRCgl0ZWFtX2NvZGUYASABKAMSFAoMcHJvYmxlbV9jb2RlGAIgASgJIkQKF0xpc3REZXBsb3ltZW50c1Jlc3BvbnNlEikKC2RlcGxveW1lbnRzGAEgAygLMhQuYWRtaW4udjEuRGVwbG95bWVudCJAChVTeW5jRGVwbG95bWVudFJlcXVlc3QSEQoJdGVhbV9jb2RlGAEgASgDEhQKDHByb2JsZW1fY29kZRgCIAEoCSIYChZTeW5jRGVwbG95bWVudFJlc3BvbnNlIjgKDURlcGxveVJlcXVlc3QSEQoJdGVhbV9jb2RlGAEgASgDEhQKDHByb2JsZW1fY29kZRgCIAEoCSI6Cg5EZXBsb3lSZXNwb25zZRIoCgpkZXBsb3ltZW50GAEgASgLMhQuYWRtaW4udjEuRGVwbG95bWVudCrHAQoTRGVwbG95bWVudEV2ZW50VHlwZRIlCiFERVBMT1lNRU5UX0VWRU5UX1RZUEVfVU5TUEVDSUZJRUQQABIgChxERVBMT1lNRU5UX0VWRU5UX1RZUEVfUVVFVUVEEAESIgoeREVQTE9ZTUVOVF9FVkVOVF9UWVBFX0NSRUFUSU5HEAISIgoeREVQTE9ZTUVOVF9FVkVOVF9UWVBFX0ZJTklTSEVEEAMSHwobREVQTE9ZTUVOVF9FVkVOVF9UWVBFX0VSUk9SEAQy/QEKEURlcGxveW1lbnRTZXJ2aWNlElYKD0xpc3REZXBsb3ltZW50cxIgLmFkbWluLnYxLkxpc3REZXBsb3ltZW50c1JlcXVlc3QaIS5hZG1pbi52MS5MaXN0RGVwbG95bWVudHNSZXNwb25zZRJTCg5TeW5jRGVwbG95bWVudBIfLmFkbWluLnYxLlN5bmNEZXBsb3ltZW50UmVxdWVzdBogLmFkbWluLnYxLlN5bmNEZXBsb3ltZW50UmVzcG9uc2USOwoGRGVwbG95EhcuYWRtaW4udjEuRGVwbG95UmVxdWVzdBoYLmFkbWluLnYxLkRlcGxveVJlc3BvbnNlQqMBCgxjb20uYWRtaW4udjFCD0RlcGxveW1lbnRQcm90b1ABWkFnaXRodWIuY29tL2ljdHNjL2ljdHNjLXJlZ2FsaWEvYmFja2VuZC9wa2cvcHJvdG8vYWRtaW4vdjE7YWRtaW52MaICA0FYWKoCCEFkbWluLlYxygIIQWRtaW5cVjHiAhRBZG1pblxWMVxHUEJNZXRhZGF0YeoCCUFkbWluOjpWMWIGcHJvdG8z", [file_google_protobuf_timestamp]); + +/** + * 問題の展開状態 + * + * @generated from message admin.v1.Deployment + */ +export type Deployment = Message<"admin.v1.Deployment"> & { + /** + * チームコード + * + * @generated from field: int64 team_code = 1; + */ + teamCode: bigint; + + /** + * 問題コード + * + * @generated from field: string problem_code = 2; + */ + problemCode: string; + + /** + * リビジョン - 0 が初期状態で再展開される度にインクリメントされる + * + * @generated from field: int64 revision = 3; + */ + revision: bigint; + + /** + * 最新のイベント + * + * @generated from field: admin.v1.DeploymentEventType latest_event = 4; + */ + latestEvent: DeploymentEventType; + + /** + * イベント + * + * @generated from field: repeated admin.v1.DeploymentEvent events = 5; + */ + events: DeploymentEvent[]; +}; + +/** + * Describes the message admin.v1.Deployment. + * Use `create(DeploymentSchema)` to create a new message. + */ +export const DeploymentSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 0); + +/** + * 問題展開に関するイベント + * + * @generated from message admin.v1.DeploymentEvent + */ +export type DeploymentEvent = Message<"admin.v1.DeploymentEvent"> & { + /** + * @generated from field: google.protobuf.Timestamp occurred_at = 1; + */ + occurredAt?: Timestamp; + + /** + * @generated from field: admin.v1.DeploymentEventType type = 2; + */ + type: DeploymentEventType; +}; + +/** + * Describes the message admin.v1.DeploymentEvent. + * Use `create(DeploymentEventSchema)` to create a new message. + */ +export const DeploymentEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 1); + +/** + * @generated from message admin.v1.ListDeploymentsRequest + */ +export type ListDeploymentsRequest = Message<"admin.v1.ListDeploymentsRequest"> & { + /** + * @generated from field: int64 team_code = 1; + */ + teamCode: bigint; + + /** + * @generated from field: string problem_code = 2; + */ + problemCode: string; +}; + +/** + * Describes the message admin.v1.ListDeploymentsRequest. + * Use `create(ListDeploymentsRequestSchema)` to create a new message. + */ +export const ListDeploymentsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 2); + +/** + * @generated from message admin.v1.ListDeploymentsResponse + */ +export type ListDeploymentsResponse = Message<"admin.v1.ListDeploymentsResponse"> & { + /** + * @generated from field: repeated admin.v1.Deployment deployments = 1; + */ + deployments: Deployment[]; +}; + +/** + * Describes the message admin.v1.ListDeploymentsResponse. + * Use `create(ListDeploymentsResponseSchema)` to create a new message. + */ +export const ListDeploymentsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 3); + +/** + * @generated from message admin.v1.SyncDeploymentRequest + */ +export type SyncDeploymentRequest = Message<"admin.v1.SyncDeploymentRequest"> & { + /** + * @generated from field: int64 team_code = 1; + */ + teamCode: bigint; + + /** + * @generated from field: string problem_code = 2; + */ + problemCode: string; +}; + +/** + * Describes the message admin.v1.SyncDeploymentRequest. + * Use `create(SyncDeploymentRequestSchema)` to create a new message. + */ +export const SyncDeploymentRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 4); + +/** + * @generated from message admin.v1.SyncDeploymentResponse + */ +export type SyncDeploymentResponse = Message<"admin.v1.SyncDeploymentResponse"> & { +}; + +/** + * Describes the message admin.v1.SyncDeploymentResponse. + * Use `create(SyncDeploymentResponseSchema)` to create a new message. + */ +export const SyncDeploymentResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 5); + +/** + * @generated from message admin.v1.DeployRequest + */ +export type DeployRequest = Message<"admin.v1.DeployRequest"> & { + /** + * @generated from field: int64 team_code = 1; + */ + teamCode: bigint; + + /** + * @generated from field: string problem_code = 2; + */ + problemCode: string; +}; + +/** + * Describes the message admin.v1.DeployRequest. + * Use `create(DeployRequestSchema)` to create a new message. + */ +export const DeployRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 6); + +/** + * @generated from message admin.v1.DeployResponse + */ +export type DeployResponse = Message<"admin.v1.DeployResponse"> & { + /** + * @generated from field: admin.v1.Deployment deployment = 1; + */ + deployment?: Deployment; +}; + +/** + * Describes the message admin.v1.DeployResponse. + * Use `create(DeployResponseSchema)` to create a new message. + */ +export const DeployResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_admin_v1_deployment, 7); + +/** + * @generated from enum admin.v1.DeploymentEventType + */ +export enum DeploymentEventType { + /** + * @generated from enum value: DEPLOYMENT_EVENT_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: DEPLOYMENT_EVENT_TYPE_QUEUED = 1; + */ + QUEUED = 1, + + /** + * @generated from enum value: DEPLOYMENT_EVENT_TYPE_CREATING = 2; + */ + CREATING = 2, + + /** + * @generated from enum value: DEPLOYMENT_EVENT_TYPE_FINISHED = 3; + */ + FINISHED = 3, + + /** + * @generated from enum value: DEPLOYMENT_EVENT_TYPE_ERROR = 4; + */ + ERROR = 4, +} + +/** + * Describes the enum admin.v1.DeploymentEventType. + */ +export const DeploymentEventTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_admin_v1_deployment, 0); + +/** + * @generated from service admin.v1.DeploymentService + */ +export const DeploymentService: GenService<{ + /** + * @generated from rpc admin.v1.DeploymentService.ListDeployments + */ + listDeployments: { + methodKind: "unary"; + input: typeof ListDeploymentsRequestSchema; + output: typeof ListDeploymentsResponseSchema; + }, + /** + * @generated from rpc admin.v1.DeploymentService.SyncDeployment + */ + syncDeployment: { + methodKind: "unary"; + input: typeof SyncDeploymentRequestSchema; + output: typeof SyncDeploymentResponseSchema; + }, + /** + * @generated from rpc admin.v1.DeploymentService.Deploy + */ + deploy: { + methodKind: "unary"; + input: typeof DeployRequestSchema; + output: typeof DeployResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_admin_v1_deployment, 0); + diff --git a/proto/admin/v1/deployment.proto b/proto/admin/v1/deployment.proto new file mode 100644 index 00000000..4e2daf86 --- /dev/null +++ b/proto/admin/v1/deployment.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; + +package admin.v1; + +// import "buf/validate/validate.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/ictsc/ictsc-regalia/backend/pkg/proto/admin/v1;adminv1"; + +// 問題の展開状態 +message Deployment { + // チームコード + int64 team_code = 1; + // 問題コード + string problem_code = 2; + // リビジョン - 0 が初期状態で再展開される度にインクリメントされる + int64 revision = 3; + // 最新のイベント + DeploymentEventType latest_event = 4; + // イベント + repeated DeploymentEvent events = 5; +} + +// 問題展開に関するイベント +message DeploymentEvent { + google.protobuf.Timestamp occurred_at = 1; + DeploymentEventType type = 2; +} + +enum DeploymentEventType { + DEPLOYMENT_EVENT_TYPE_UNSPECIFIED = 0; + DEPLOYMENT_EVENT_TYPE_QUEUED = 1; + DEPLOYMENT_EVENT_TYPE_CREATING = 2; + DEPLOYMENT_EVENT_TYPE_FINISHED = 3; + DEPLOYMENT_EVENT_TYPE_ERROR = 4; +} + +message ListDeploymentsRequest { + int64 team_code = 1; + string problem_code = 2; +} +message ListDeploymentsResponse { + repeated Deployment deployments = 1; +} + +message SyncDeploymentRequest { + int64 team_code = 1; + string problem_code = 2; +} +message SyncDeploymentResponse {} + +message DeployRequest { + int64 team_code = 1; + string problem_code = 2; +} +message DeployResponse { + Deployment deployment = 1; +} + +service DeploymentService { + rpc ListDeployments(ListDeploymentsRequest) returns (ListDeploymentsResponse); + rpc SyncDeployment(SyncDeploymentRequest) returns (SyncDeploymentResponse); + rpc Deploy(DeployRequest) returns (DeployResponse); +}