diff --git a/cmd/enterprise-portal/internal/codyaccessservice/adapters.go b/cmd/enterprise-portal/internal/codyaccessservice/adapters.go index ebb474f827c..9d4383e98df 100644 --- a/cmd/enterprise-portal/internal/codyaccessservice/adapters.go +++ b/cmd/enterprise-portal/internal/codyaccessservice/adapters.go @@ -23,17 +23,17 @@ func convertAccessAttrsToProto(attrs *dotcomdb.CodyGatewayAccessAttributes) *cod // Rate limits return nil if not enabled, per API spec ChatCompletionsRateLimit: nilIfNotEnabled(attrs.CodyGatewayEnabled, &codyaccessv1.CodyGatewayRateLimit{ Source: limits.ChatSource, - Limit: limits.Chat.Limit, + Limit: uint64(limits.Chat.Limit), IntervalDuration: durationpb.New(limits.Chat.IntervalDuration()), }), CodeCompletionsRateLimit: nilIfNotEnabled(attrs.CodyGatewayEnabled, &codyaccessv1.CodyGatewayRateLimit{ Source: limits.CodeSource, - Limit: limits.Code.Limit, + Limit: uint64(limits.Code.Limit), IntervalDuration: durationpb.New(limits.Code.IntervalDuration()), }), EmbeddingsRateLimit: nilIfNotEnabled(attrs.CodyGatewayEnabled, &codyaccessv1.CodyGatewayRateLimit{ Source: limits.EmbeddingsSource, - Limit: limits.Embeddings.Limit, + Limit: uint64(limits.Embeddings.Limit), IntervalDuration: durationpb.New(limits.Embeddings.IntervalDuration()), }), // This is always provided, even if access is disabled diff --git a/lib/enterpriseportal/codyaccess/v1/BUILD.bazel b/lib/enterpriseportal/codyaccess/v1/BUILD.bazel index 95fe314062c..069254b0a91 100644 --- a/lib/enterpriseportal/codyaccess/v1/BUILD.bazel +++ b/lib/enterpriseportal/codyaccess/v1/BUILD.bazel @@ -16,6 +16,7 @@ proto_library( deps = [ "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:timestamp_proto", ], ) @@ -35,6 +36,7 @@ go_library( "@org_golang_google_protobuf//runtime/protoimpl", "@org_golang_google_protobuf//types/known/durationpb", "@org_golang_google_protobuf//types/known/fieldmaskpb", + "@org_golang_google_protobuf//types/known/timestamppb", ], ) diff --git a/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go b/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go index ab50bfdb221..1913c76dbd9 100644 --- a/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go +++ b/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -213,7 +214,7 @@ type CodyGatewayRateLimit struct { // The source of the rate limit configuration. Source CodyGatewayRateLimitSource `protobuf:"varint,1,opt,name=source,proto3,enum=enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource" json:"source,omitempty"` // Requests per time interval. - Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` // Interval for rate limiting. IntervalDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=interval_duration,json=intervalDuration,proto3" json:"interval_duration,omitempty"` } @@ -257,7 +258,7 @@ func (x *CodyGatewayRateLimit) GetSource() CodyGatewayRateLimitSource { return CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED } -func (x *CodyGatewayRateLimit) GetLimit() int64 { +func (x *CodyGatewayRateLimit) GetLimit() uint64 { if x != nil { return x.Limit } @@ -668,6 +669,263 @@ func (x *UpdateCodyGatewayAccessResponse) GetAccess() *CodyGatewayAccess { return nil } +type GetCodyGatewayUsageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Query: + // + // *GetCodyGatewayUsageRequest_SubscriptionId + Query isGetCodyGatewayUsageRequest_Query `protobuf_oneof:"query"` +} + +func (x *GetCodyGatewayUsageRequest) Reset() { + *x = GetCodyGatewayUsageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCodyGatewayUsageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCodyGatewayUsageRequest) ProtoMessage() {} + +func (x *GetCodyGatewayUsageRequest) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCodyGatewayUsageRequest.ProtoReflect.Descriptor instead. +func (*GetCodyGatewayUsageRequest) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{9} +} + +func (m *GetCodyGatewayUsageRequest) GetQuery() isGetCodyGatewayUsageRequest_Query { + if m != nil { + return m.Query + } + return nil +} + +func (x *GetCodyGatewayUsageRequest) GetSubscriptionId() string { + if x, ok := x.GetQuery().(*GetCodyGatewayUsageRequest_SubscriptionId); ok { + return x.SubscriptionId + } + return "" +} + +type isGetCodyGatewayUsageRequest_Query interface { + isGetCodyGatewayUsageRequest_Query() +} + +type GetCodyGatewayUsageRequest_SubscriptionId struct { + // The external, prefixed UUID-format identifier of an Enterprise subscription. + SubscriptionId string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3,oneof"` +} + +func (*GetCodyGatewayUsageRequest_SubscriptionId) isGetCodyGatewayUsageRequest_Query() {} + +type CodyGatewayUsage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The external, prefixed UUID-format identifier for the Enterprise + // subscription corresponding to this Cody Gateway usage (e.g. "es_..."). + SubscriptionId string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` + // Usage data for chat completions access, or null if not enabled. + ChatCompletionsUsage []*CodyGatewayUsage_UsageDatapoint `protobuf:"bytes,2,rep,name=chat_completions_usage,json=chatCompletionsUsage,proto3" json:"chat_completions_usage,omitempty"` + // Usage data for code completions access, or null if not enabled. + CodeCompletionsUsage []*CodyGatewayUsage_UsageDatapoint `protobuf:"bytes,3,rep,name=code_completions_usage,json=codeCompletionsUsage,proto3" json:"code_completions_usage,omitempty"` + // Usage data for embedding text chunks, or null if not enabled. + EmbeddingsUsage []*CodyGatewayUsage_UsageDatapoint `protobuf:"bytes,4,rep,name=embeddings_usage,json=embeddingsUsage,proto3" json:"embeddings_usage,omitempty"` +} + +func (x *CodyGatewayUsage) Reset() { + *x = CodyGatewayUsage{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CodyGatewayUsage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodyGatewayUsage) ProtoMessage() {} + +func (x *CodyGatewayUsage) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CodyGatewayUsage.ProtoReflect.Descriptor instead. +func (*CodyGatewayUsage) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{10} +} + +func (x *CodyGatewayUsage) GetSubscriptionId() string { + if x != nil { + return x.SubscriptionId + } + return "" +} + +func (x *CodyGatewayUsage) GetChatCompletionsUsage() []*CodyGatewayUsage_UsageDatapoint { + if x != nil { + return x.ChatCompletionsUsage + } + return nil +} + +func (x *CodyGatewayUsage) GetCodeCompletionsUsage() []*CodyGatewayUsage_UsageDatapoint { + if x != nil { + return x.CodeCompletionsUsage + } + return nil +} + +func (x *CodyGatewayUsage) GetEmbeddingsUsage() []*CodyGatewayUsage_UsageDatapoint { + if x != nil { + return x.EmbeddingsUsage + } + return nil +} + +type GetCodyGatewayUsageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Usage *CodyGatewayUsage `protobuf:"bytes,1,opt,name=usage,proto3" json:"usage,omitempty"` +} + +func (x *GetCodyGatewayUsageResponse) Reset() { + *x = GetCodyGatewayUsageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCodyGatewayUsageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCodyGatewayUsageResponse) ProtoMessage() {} + +func (x *GetCodyGatewayUsageResponse) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCodyGatewayUsageResponse.ProtoReflect.Descriptor instead. +func (*GetCodyGatewayUsageResponse) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{11} +} + +func (x *GetCodyGatewayUsageResponse) GetUsage() *CodyGatewayUsage { + if x != nil { + return x.Usage + } + return nil +} + +type CodyGatewayUsage_UsageDatapoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The time the usage occurred. Currently the time is always the day. + Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` + // The usage for the corresponding time period. + Usage uint64 `protobuf:"varint,2,opt,name=usage,proto3" json:"usage,omitempty"` + // The model that was used. + Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"` +} + +func (x *CodyGatewayUsage_UsageDatapoint) Reset() { + *x = CodyGatewayUsage_UsageDatapoint{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CodyGatewayUsage_UsageDatapoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodyGatewayUsage_UsageDatapoint) ProtoMessage() {} + +func (x *CodyGatewayUsage_UsageDatapoint) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CodyGatewayUsage_UsageDatapoint.ProtoReflect.Descriptor instead. +func (*CodyGatewayUsage_UsageDatapoint) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *CodyGatewayUsage_UsageDatapoint) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *CodyGatewayUsage_UsageDatapoint) GetUsage() uint64 { + if x != nil { + return x.Usage + } + return 0 +} + +func (x *CodyGatewayUsage_UsageDatapoint) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + var File_codyaccess_proto protoreflect.FileDescriptor var file_codyaccess_proto_rawDesc = []byte{ @@ -678,113 +936,159 @@ var file_codyaccess_proto_rawDesc = []byte{ 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x23, - 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x69, 0x0a, 0x1c, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, - 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, - 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x64, 0x79, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x52, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x3a, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x16, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0xac, 0x05, 0x0a, 0x11, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x78, 0x0a, 0x1b, 0x63, - 0x68, 0x61, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, - 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x34, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x18, 0x63, 0x68, 0x61, 0x74, 0x43, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x78, 0x0a, 0x1b, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, - 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, - 0x48, 0x01, 0x52, 0x18, 0x63, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, - 0x6d, 0x0a, 0x15, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, - 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x48, 0x02, 0x52, 0x13, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, - 0x67, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x5b, - 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, - 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, - 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x63, 0x68, 0x61, 0x74, - 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74, - 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x63, 0x6f, 0x64, 0x65, - 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74, - 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x65, 0x6d, 0x62, 0x65, - 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x22, 0x5c, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x01, 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, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x98, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, - 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x4d, 0x0a, 0x08, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, - 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x1e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, + 0x72, 0x6f, 0x74, 0x6f, 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, 0x76, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x23, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x69, 0x0a, + 0x1c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x6c, 0x0a, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, - 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x06, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x2a, 0xa2, 0x01, 0x0a, 0x1a, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, + 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x64, + 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x52, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x3a, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, + 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x16, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0xac, 0x05, 0x0a, 0x11, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x78, 0x0a, 0x1b, + 0x63, 0x68, 0x61, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, + 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x18, 0x63, 0x68, 0x61, 0x74, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x78, 0x0a, 0x1b, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, + 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, + 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x48, 0x01, 0x52, 0x18, 0x63, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x6d, 0x0a, 0x15, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, + 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x48, 0x02, 0x52, 0x13, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x5b, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x19, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x17, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x63, 0x68, 0x61, + 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x65, 0x6d, 0x62, + 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x5c, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x01, 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, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x98, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, + 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x4d, 0x0a, 0x08, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, + 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xa8, 0x01, 0x0a, 0x1e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, + 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, + 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, + 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 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, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x6c, 0x0a, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, + 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x06, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0x50, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x29, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x42, 0x07, 0x0a, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x83, 0x04, 0x0a, 0x10, 0x43, 0x6f, 0x64, 0x79, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x75, 0x0a, 0x16, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x14, 0x63, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x75, 0x0a, 0x16, 0x63, + 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, + 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, + 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x55, 0x73, + 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x14, 0x63, 0x6f, + 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x6a, 0x0a, 0x10, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, + 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x65, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, + 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0f, 0x65, + 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x55, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x6c, + 0x0a, 0x0e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 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, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x65, 0x0a, 0x1b, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x05, 0x75, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x65, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, + 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, + 0x61, 0x67, 0x65, 0x2a, 0xa2, 0x01, 0x0a, 0x1a, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x2a, 0x43, 0x4f, 0x44, 0x59, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x57, 0x41, 0x59, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x5f, 0x53, 0x4f, @@ -794,7 +1098,7 @@ var file_codyaccess_proto_rawDesc = []byte{ 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x4f, 0x44, 0x59, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x57, 0x41, 0x59, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, - 0x45, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x02, 0x32, 0xf0, 0x03, 0x0a, 0x11, 0x43, 0x6f, 0x64, + 0x45, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x02, 0x32, 0x86, 0x05, 0x0a, 0x11, 0x43, 0x6f, 0x64, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x96, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, @@ -825,12 +1129,22 @@ var file_codyaccess_proto_rawDesc = []byte{ 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x47, 0x5a, 0x45, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x2f, 0x6c, 0x69, 0x62, 0x2f, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x93, 0x01, 0x0a, 0x13, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x3a, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x3b, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, + 0x01, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x6c, 0x69, 0x62, 0x2f, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x64, + 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -846,7 +1160,7 @@ func file_codyaccess_proto_rawDescGZIP() []byte { } var file_codyaccess_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_codyaccess_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_codyaccess_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_codyaccess_proto_goTypes = []interface{}{ (CodyGatewayRateLimitSource)(0), // 0: enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource (*GetCodyGatewayAccessRequest)(nil), // 1: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest @@ -858,32 +1172,44 @@ var file_codyaccess_proto_goTypes = []interface{}{ (*ListCodyGatewayAccessesResponse)(nil), // 7: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse (*UpdateCodyGatewayAccessRequest)(nil), // 8: enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessRequest (*UpdateCodyGatewayAccessResponse)(nil), // 9: enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessResponse - (*durationpb.Duration)(nil), // 10: google.protobuf.Duration - (*fieldmaskpb.FieldMask)(nil), // 11: google.protobuf.FieldMask + (*GetCodyGatewayUsageRequest)(nil), // 10: enterpriseportal.codyaccess.v1.GetCodyGatewayUsageRequest + (*CodyGatewayUsage)(nil), // 11: enterpriseportal.codyaccess.v1.CodyGatewayUsage + (*GetCodyGatewayUsageResponse)(nil), // 12: enterpriseportal.codyaccess.v1.GetCodyGatewayUsageResponse + (*CodyGatewayUsage_UsageDatapoint)(nil), // 13: enterpriseportal.codyaccess.v1.CodyGatewayUsage.UsageDatapoint + (*durationpb.Duration)(nil), // 14: google.protobuf.Duration + (*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp } var file_codyaccess_proto_depIdxs = []int32{ 5, // 0: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse.access:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccess 0, // 1: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit.source:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource - 10, // 2: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit.interval_duration:type_name -> google.protobuf.Duration + 14, // 2: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit.interval_duration:type_name -> google.protobuf.Duration 3, // 3: enterpriseportal.codyaccess.v1.CodyGatewayAccess.chat_completions_rate_limit:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimit 3, // 4: enterpriseportal.codyaccess.v1.CodyGatewayAccess.code_completions_rate_limit:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimit 3, // 5: enterpriseportal.codyaccess.v1.CodyGatewayAccess.embeddings_rate_limit:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimit 4, // 6: enterpriseportal.codyaccess.v1.CodyGatewayAccess.access_tokens:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccessToken 5, // 7: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse.accesses:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccess 5, // 8: enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessRequest.access:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccess - 11, // 9: enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessRequest.update_mask:type_name -> google.protobuf.FieldMask + 15, // 9: enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessRequest.update_mask:type_name -> google.protobuf.FieldMask 5, // 10: enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessResponse.access:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccess - 1, // 11: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:input_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest - 6, // 12: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:input_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesRequest - 8, // 13: enterpriseportal.codyaccess.v1.CodyAccessService.UpdateCodyGatewayAccess:input_type -> enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessRequest - 2, // 14: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:output_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse - 7, // 15: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:output_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse - 9, // 16: enterpriseportal.codyaccess.v1.CodyAccessService.UpdateCodyGatewayAccess:output_type -> enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessResponse - 14, // [14:17] is the sub-list for method output_type - 11, // [11:14] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 13, // 11: enterpriseportal.codyaccess.v1.CodyGatewayUsage.chat_completions_usage:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayUsage.UsageDatapoint + 13, // 12: enterpriseportal.codyaccess.v1.CodyGatewayUsage.code_completions_usage:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayUsage.UsageDatapoint + 13, // 13: enterpriseportal.codyaccess.v1.CodyGatewayUsage.embeddings_usage:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayUsage.UsageDatapoint + 11, // 14: enterpriseportal.codyaccess.v1.GetCodyGatewayUsageResponse.usage:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayUsage + 16, // 15: enterpriseportal.codyaccess.v1.CodyGatewayUsage.UsageDatapoint.time:type_name -> google.protobuf.Timestamp + 1, // 16: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:input_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest + 6, // 17: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:input_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesRequest + 8, // 18: enterpriseportal.codyaccess.v1.CodyAccessService.UpdateCodyGatewayAccess:input_type -> enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessRequest + 10, // 19: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayUsage:input_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayUsageRequest + 2, // 20: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:output_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse + 7, // 21: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:output_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse + 9, // 22: enterpriseportal.codyaccess.v1.CodyAccessService.UpdateCodyGatewayAccess:output_type -> enterpriseportal.codyaccess.v1.UpdateCodyGatewayAccessResponse + 12, // 23: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayUsage:output_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayUsageResponse + 20, // [20:24] is the sub-list for method output_type + 16, // [16:20] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_codyaccess_proto_init() } @@ -1000,19 +1326,70 @@ func file_codyaccess_proto_init() { return nil } } + file_codyaccess_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCodyGatewayUsageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodyGatewayUsage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCodyGatewayUsageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodyGatewayUsage_UsageDatapoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_codyaccess_proto_msgTypes[0].OneofWrappers = []interface{}{ (*GetCodyGatewayAccessRequest_SubscriptionId)(nil), (*GetCodyGatewayAccessRequest_AccessToken)(nil), } file_codyaccess_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_codyaccess_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*GetCodyGatewayUsageRequest_SubscriptionId)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_codyaccess_proto_rawDesc, NumEnums: 1, - NumMessages: 9, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/lib/enterpriseportal/codyaccess/v1/codyaccess.proto b/lib/enterpriseportal/codyaccess/v1/codyaccess.proto index 6ba8af530be..145e241a436 100644 --- a/lib/enterpriseportal/codyaccess/v1/codyaccess.proto +++ b/lib/enterpriseportal/codyaccess/v1/codyaccess.proto @@ -4,6 +4,7 @@ package enterpriseportal.codyaccess.v1; import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1"; @@ -27,6 +28,12 @@ service CodyAccessService { rpc UpdateCodyGatewayAccess(UpdateCodyGatewayAccessRequest) returns (UpdateCodyGatewayAccessResponse) { option idempotency_level = IDEMPOTENT; } + + // GetCodyGatewayUsage returns data about a subscription's recent usage of + // Cody Gateway. + rpc GetCodyGatewayUsage(GetCodyGatewayUsageRequest) returns (GetCodyGatewayUsageResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } } message GetCodyGatewayAccessRequest { @@ -56,7 +63,7 @@ message CodyGatewayRateLimit { // The source of the rate limit configuration. CodyGatewayRateLimitSource source = 1; // Requests per time interval. - int64 limit = 2; + uint64 limit = 2; // Interval for rate limiting. google.protobuf.Duration interval_duration = 3; } @@ -139,3 +146,36 @@ message UpdateCodyGatewayAccessResponse { // The updated Cody Gateway access. CodyGatewayAccess access = 1; } + +message GetCodyGatewayUsageRequest { + oneof query { + // The external, prefixed UUID-format identifier of an Enterprise subscription. + string subscription_id = 1; + } +} + +message CodyGatewayUsage { + // The external, prefixed UUID-format identifier for the Enterprise + // subscription corresponding to this Cody Gateway usage (e.g. "es_..."). + string subscription_id = 1; + + message UsageDatapoint { + // The time the usage occurred. Currently the time is always the day. + google.protobuf.Timestamp time = 1; + // The usage for the corresponding time period. + uint64 usage = 2; + // The model that was used. + string model = 3; + } + + // Usage data for chat completions access, or null if not enabled. + repeated UsageDatapoint chat_completions_usage = 2; + // Usage data for code completions access, or null if not enabled. + repeated UsageDatapoint code_completions_usage = 3; + // Usage data for embedding text chunks, or null if not enabled. + repeated UsageDatapoint embeddings_usage = 4; +} + +message GetCodyGatewayUsageResponse { + CodyGatewayUsage usage = 1; +} diff --git a/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go b/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go index 0fbb7bf305d..03afcf43490 100644 --- a/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go +++ b/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go @@ -22,6 +22,7 @@ const ( CodyAccessService_GetCodyGatewayAccess_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayAccess" CodyAccessService_ListCodyGatewayAccesses_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/ListCodyGatewayAccesses" CodyAccessService_UpdateCodyGatewayAccess_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/UpdateCodyGatewayAccess" + CodyAccessService_GetCodyGatewayUsage_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayUsage" ) // CodyAccessServiceClient is the client API for CodyAccessService service. @@ -35,6 +36,9 @@ type CodyAccessServiceClient interface { // UpdateEnterpriseSubscription updates the Cody Gateway access granted to an // Enterprise subscription. UpdateCodyGatewayAccess(ctx context.Context, in *UpdateCodyGatewayAccessRequest, opts ...grpc.CallOption) (*UpdateCodyGatewayAccessResponse, error) + // GetCodyGatewayUsage returns data about a subscription's recent usage of + // Cody Gateway. + GetCodyGatewayUsage(ctx context.Context, in *GetCodyGatewayUsageRequest, opts ...grpc.CallOption) (*GetCodyGatewayUsageResponse, error) } type codyAccessServiceClient struct { @@ -72,6 +76,15 @@ func (c *codyAccessServiceClient) UpdateCodyGatewayAccess(ctx context.Context, i return out, nil } +func (c *codyAccessServiceClient) GetCodyGatewayUsage(ctx context.Context, in *GetCodyGatewayUsageRequest, opts ...grpc.CallOption) (*GetCodyGatewayUsageResponse, error) { + out := new(GetCodyGatewayUsageResponse) + err := c.cc.Invoke(ctx, CodyAccessService_GetCodyGatewayUsage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // CodyAccessServiceServer is the server API for CodyAccessService service. // All implementations must embed UnimplementedCodyAccessServiceServer // for forward compatibility @@ -83,6 +96,9 @@ type CodyAccessServiceServer interface { // UpdateEnterpriseSubscription updates the Cody Gateway access granted to an // Enterprise subscription. UpdateCodyGatewayAccess(context.Context, *UpdateCodyGatewayAccessRequest) (*UpdateCodyGatewayAccessResponse, error) + // GetCodyGatewayUsage returns data about a subscription's recent usage of + // Cody Gateway. + GetCodyGatewayUsage(context.Context, *GetCodyGatewayUsageRequest) (*GetCodyGatewayUsageResponse, error) mustEmbedUnimplementedCodyAccessServiceServer() } @@ -99,6 +115,9 @@ func (UnimplementedCodyAccessServiceServer) ListCodyGatewayAccesses(context.Cont func (UnimplementedCodyAccessServiceServer) UpdateCodyGatewayAccess(context.Context, *UpdateCodyGatewayAccessRequest) (*UpdateCodyGatewayAccessResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateCodyGatewayAccess not implemented") } +func (UnimplementedCodyAccessServiceServer) GetCodyGatewayUsage(context.Context, *GetCodyGatewayUsageRequest) (*GetCodyGatewayUsageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCodyGatewayUsage not implemented") +} func (UnimplementedCodyAccessServiceServer) mustEmbedUnimplementedCodyAccessServiceServer() {} // UnsafeCodyAccessServiceServer may be embedded to opt out of forward compatibility for this service. @@ -166,6 +185,24 @@ func _CodyAccessService_UpdateCodyGatewayAccess_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _CodyAccessService_GetCodyGatewayUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCodyGatewayUsageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CodyAccessServiceServer).GetCodyGatewayUsage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CodyAccessService_GetCodyGatewayUsage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CodyAccessServiceServer).GetCodyGatewayUsage(ctx, req.(*GetCodyGatewayUsageRequest)) + } + return interceptor(ctx, in, info, handler) +} + // CodyAccessService_ServiceDesc is the grpc.ServiceDesc for CodyAccessService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -185,6 +222,10 @@ var CodyAccessService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateCodyGatewayAccess", Handler: _CodyAccessService_UpdateCodyGatewayAccess_Handler, }, + { + MethodName: "GetCodyGatewayUsage", + Handler: _CodyAccessService_GetCodyGatewayUsage_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "codyaccess.proto", diff --git a/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go b/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go index 2963f32c882..c359cf411d4 100644 --- a/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go +++ b/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go @@ -42,6 +42,9 @@ const ( // CodyAccessServiceUpdateCodyGatewayAccessProcedure is the fully-qualified name of the // CodyAccessService's UpdateCodyGatewayAccess RPC. CodyAccessServiceUpdateCodyGatewayAccessProcedure = "/enterpriseportal.codyaccess.v1.CodyAccessService/UpdateCodyGatewayAccess" + // CodyAccessServiceGetCodyGatewayUsageProcedure is the fully-qualified name of the + // CodyAccessService's GetCodyGatewayUsage RPC. + CodyAccessServiceGetCodyGatewayUsageProcedure = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayUsage" ) // These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. @@ -50,6 +53,7 @@ var ( codyAccessServiceGetCodyGatewayAccessMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("GetCodyGatewayAccess") codyAccessServiceListCodyGatewayAccessesMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("ListCodyGatewayAccesses") codyAccessServiceUpdateCodyGatewayAccessMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("UpdateCodyGatewayAccess") + codyAccessServiceGetCodyGatewayUsageMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("GetCodyGatewayUsage") ) // CodyAccessServiceClient is a client for the enterpriseportal.codyaccess.v1.CodyAccessService @@ -62,6 +66,9 @@ type CodyAccessServiceClient interface { // UpdateEnterpriseSubscription updates the Cody Gateway access granted to an // Enterprise subscription. UpdateCodyGatewayAccess(context.Context, *connect.Request[v1.UpdateCodyGatewayAccessRequest]) (*connect.Response[v1.UpdateCodyGatewayAccessResponse], error) + // GetCodyGatewayUsage returns data about a subscription's recent usage of + // Cody Gateway. + GetCodyGatewayUsage(context.Context, *connect.Request[v1.GetCodyGatewayUsageRequest]) (*connect.Response[v1.GetCodyGatewayUsageResponse], error) } // NewCodyAccessServiceClient constructs a client for the @@ -96,6 +103,13 @@ func NewCodyAccessServiceClient(httpClient connect.HTTPClient, baseURL string, o connect.WithIdempotency(connect.IdempotencyIdempotent), connect.WithClientOptions(opts...), ), + getCodyGatewayUsage: connect.NewClient[v1.GetCodyGatewayUsageRequest, v1.GetCodyGatewayUsageResponse]( + httpClient, + baseURL+CodyAccessServiceGetCodyGatewayUsageProcedure, + connect.WithSchema(codyAccessServiceGetCodyGatewayUsageMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), } } @@ -104,6 +118,7 @@ type codyAccessServiceClient struct { getCodyGatewayAccess *connect.Client[v1.GetCodyGatewayAccessRequest, v1.GetCodyGatewayAccessResponse] listCodyGatewayAccesses *connect.Client[v1.ListCodyGatewayAccessesRequest, v1.ListCodyGatewayAccessesResponse] updateCodyGatewayAccess *connect.Client[v1.UpdateCodyGatewayAccessRequest, v1.UpdateCodyGatewayAccessResponse] + getCodyGatewayUsage *connect.Client[v1.GetCodyGatewayUsageRequest, v1.GetCodyGatewayUsageResponse] } // GetCodyGatewayAccess calls enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess. @@ -123,6 +138,11 @@ func (c *codyAccessServiceClient) UpdateCodyGatewayAccess(ctx context.Context, r return c.updateCodyGatewayAccess.CallUnary(ctx, req) } +// GetCodyGatewayUsage calls enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayUsage. +func (c *codyAccessServiceClient) GetCodyGatewayUsage(ctx context.Context, req *connect.Request[v1.GetCodyGatewayUsageRequest]) (*connect.Response[v1.GetCodyGatewayUsageResponse], error) { + return c.getCodyGatewayUsage.CallUnary(ctx, req) +} + // CodyAccessServiceHandler is an implementation of the // enterpriseportal.codyaccess.v1.CodyAccessService service. type CodyAccessServiceHandler interface { @@ -133,6 +153,9 @@ type CodyAccessServiceHandler interface { // UpdateEnterpriseSubscription updates the Cody Gateway access granted to an // Enterprise subscription. UpdateCodyGatewayAccess(context.Context, *connect.Request[v1.UpdateCodyGatewayAccessRequest]) (*connect.Response[v1.UpdateCodyGatewayAccessResponse], error) + // GetCodyGatewayUsage returns data about a subscription's recent usage of + // Cody Gateway. + GetCodyGatewayUsage(context.Context, *connect.Request[v1.GetCodyGatewayUsageRequest]) (*connect.Response[v1.GetCodyGatewayUsageResponse], error) } // NewCodyAccessServiceHandler builds an HTTP handler from the service implementation. It returns @@ -162,6 +185,13 @@ func NewCodyAccessServiceHandler(svc CodyAccessServiceHandler, opts ...connect.H connect.WithIdempotency(connect.IdempotencyIdempotent), connect.WithHandlerOptions(opts...), ) + codyAccessServiceGetCodyGatewayUsageHandler := connect.NewUnaryHandler( + CodyAccessServiceGetCodyGatewayUsageProcedure, + svc.GetCodyGatewayUsage, + connect.WithSchema(codyAccessServiceGetCodyGatewayUsageMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) return "/enterpriseportal.codyaccess.v1.CodyAccessService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case CodyAccessServiceGetCodyGatewayAccessProcedure: @@ -170,6 +200,8 @@ func NewCodyAccessServiceHandler(svc CodyAccessServiceHandler, opts ...connect.H codyAccessServiceListCodyGatewayAccessesHandler.ServeHTTP(w, r) case CodyAccessServiceUpdateCodyGatewayAccessProcedure: codyAccessServiceUpdateCodyGatewayAccessHandler.ServeHTTP(w, r) + case CodyAccessServiceGetCodyGatewayUsageProcedure: + codyAccessServiceGetCodyGatewayUsageHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -190,3 +222,7 @@ func (UnimplementedCodyAccessServiceHandler) ListCodyGatewayAccesses(context.Con func (UnimplementedCodyAccessServiceHandler) UpdateCodyGatewayAccess(context.Context, *connect.Request[v1.UpdateCodyGatewayAccessRequest]) (*connect.Response[v1.UpdateCodyGatewayAccessResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.codyaccess.v1.CodyAccessService.UpdateCodyGatewayAccess is not implemented")) } + +func (UnimplementedCodyAccessServiceHandler) GetCodyGatewayUsage(context.Context, *connect.Request[v1.GetCodyGatewayUsageRequest]) (*connect.Response[v1.GetCodyGatewayUsageResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayUsage is not implemented")) +}