diff --git a/WORKSPACE b/WORKSPACE index bce8d2647c4..d94d341cfa2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -468,7 +468,7 @@ rules_buf_dependencies() rules_buf_toolchains( sha256 = "05dfb45d2330559d258e1230f5a25e154f0a328afda2a434348b5ba4c124ece7", - version = "v1.28.1", + version = "v1.33.0", ) load("@rules_buf//gazelle/buf:repositories.bzl", "gazelle_buf_dependencies") diff --git a/dev/linters/depguard/depguard.go b/dev/linters/depguard/depguard.go index d32ecac9b19..577527fb21e 100644 --- a/dev/linters/depguard/depguard.go +++ b/dev/linters/depguard/depguard.go @@ -31,10 +31,10 @@ func createAnalyzer() *analysis.Analyzer { Deny[fmt.Sprintf("github.com/google/go-github/v%d/github$", i)] = "Use github.com/google/go-github/v55/github instead. To convert between v48 and v55, use the internal/extsvc/github/githubconvert package" } - // We don't provide anything for the Files attribute, which means the "Main" list will apply - // to all files. If we wanted to restrict our Deny list to a subset of files, we would add - // Files: []string{"dev/**"}, which would mean it will only deny the import of some packages - // in code under dev/**, thus ignore the rest of the code base. + // If we wanted to restrict our Deny list to a subset of files, we would add + // a new List with Files: []string{"dev/**"}, which would mean it will only + // deny the import of some packages in code under dev/**, thus ignore the + // rest of the code base. // // You can also create other lists, that apply different deny/allow lists. Ie: // "Test": &depguard.List{ @@ -46,6 +46,12 @@ func createAnalyzer() *analysis.Analyzer { settings := &depguard.LinterSettings{ "Main": &depguard.List{ Deny: Deny, + Files: []string{ + "$all", + + // Don't check generated connectrpc code + "!**/v1/v1connect/**", + }, }, } analyzer, err := depguard.NewAnalyzer(settings) diff --git a/dev/sg/buf/buf.go b/dev/sg/buf/buf.go index 1a150e232f9..35fd2f4a35a 100644 --- a/dev/sg/buf/buf.go +++ b/dev/sg/buf/buf.go @@ -19,7 +19,7 @@ import ( var dependencies = []dependency{ "github.com/bufbuild/buf/cmd/buf@v1.11.0", "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.5.1", - "google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1", + "google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0", } type dependency string diff --git a/lib/buf.yaml b/lib/buf.yaml new file mode 100644 index 00000000000..1a5194568a9 --- /dev/null +++ b/lib/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/lib/enterpriseportal/README.md b/lib/enterpriseportal/README.md new file mode 100644 index 00000000000..ad0f48d5278 --- /dev/null +++ b/lib/enterpriseportal/README.md @@ -0,0 +1,13 @@ +# Enterprise Portal services + +`lib/enterpriseportal` defines the gRPC services implemented by Enterprise Portal. Core functionality are defined in `subscriptions/v1`, with extensions defined as separate services implemented by Enterprise Portal, such as `codyaccess/v1`. + +To regenerate all relevant bindings: + +```sh +sg gen buf \ + lib/enterpriseportal/subscriptions/v1/buf.gen.yaml \ + lib/enterpriseportal/codyaccess/v1/buf.gen.yaml +``` + +> **EVERYTHING HERE IS IN A DRAFT STATE** - see [RFC 885](https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q). diff --git a/lib/enterpriseportal/codyaccess/v1/BUILD.bazel b/lib/enterpriseportal/codyaccess/v1/BUILD.bazel new file mode 100644 index 00000000000..e97bd1bf84f --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/BUILD.bazel @@ -0,0 +1,42 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_buf//buf:defs.bzl", "buf_lint_test") + +# Bazel-generated files are different from what is generated locally by buf and +# causes compilation errors - the next line disables Gazelle-generated Bazel +# configuration that overrides the generated code that gets committed. +# https://github.com/sourcegraph/devx-support/issues/932#issuecomment-2103608521 +# gazelle:proto disable_global + +proto_library( + name = "v1_proto", + srcs = ["codyaccess.proto"], + strip_import_prefix = "/lib", # keep + visibility = ["//visibility:public"], + deps = ["@com_google_protobuf//:duration_proto"], +) + +go_library( + name = "codyaccess", + srcs = [ + "codyaccess.pb.go", + "codyaccess_grpc.pb.go", + ], + importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1", + visibility = ["//visibility:public"], + deps = [ + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_google_protobuf//reflect/protoreflect", + "@org_golang_google_protobuf//runtime/protoimpl", + "@org_golang_google_protobuf//types/known/durationpb", + ], +) + +buf_lint_test( + name = "v1_proto_lint", + timeout = "short", + config = "//internal:buf.yaml", + targets = [":v1_proto"], +) diff --git a/lib/enterpriseportal/codyaccess/v1/buf.gen.yaml b/lib/enterpriseportal/codyaccess/v1/buf.gen.yaml new file mode 100644 index 00000000000..e5707836ced --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/buf.gen.yaml @@ -0,0 +1,17 @@ +# Configuration file for https://buf.build/, which we use for Protobuf code generation. +version: v1 +plugins: + - plugin: buf.build/grpc/go:v1.3.0 + out: . + opt: + - paths=source_relative + - plugin: buf.build/protocolbuffers/go:v1.33.0 + out: . + opt: + - paths=source_relative + + # Generate connectrpc bindings in Go + - plugin: buf.build/connectrpc/go:v1.16.1 + out: . + opt: + - paths=source_relative diff --git a/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go b/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go new file mode 100644 index 00000000000..771261c1335 --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/codyaccess.pb.go @@ -0,0 +1,830 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: codyaccess.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + 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 CodyGatewayRateLimitSource int32 + +const ( + CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED CodyGatewayRateLimitSource = 0 + // Indicates that a custom override for the rate limit has been configured + // and applied. + CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE CodyGatewayRateLimitSource = 1 + // Indicates that the rate limit is inferred by the subscription's active plan. + CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN CodyGatewayRateLimitSource = 2 +) + +// Enum value maps for CodyGatewayRateLimitSource. +var ( + CodyGatewayRateLimitSource_name = map[int32]string{ + 0: "CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED", + 1: "CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE", + 2: "CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN", + } + CodyGatewayRateLimitSource_value = map[string]int32{ + "CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED": 0, + "CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE": 1, + "CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN": 2, + } +) + +func (x CodyGatewayRateLimitSource) Enum() *CodyGatewayRateLimitSource { + p := new(CodyGatewayRateLimitSource) + *p = x + return p +} + +func (x CodyGatewayRateLimitSource) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CodyGatewayRateLimitSource) Descriptor() protoreflect.EnumDescriptor { + return file_codyaccess_proto_enumTypes[0].Descriptor() +} + +func (CodyGatewayRateLimitSource) Type() protoreflect.EnumType { + return &file_codyaccess_proto_enumTypes[0] +} + +func (x CodyGatewayRateLimitSource) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CodyGatewayRateLimitSource.Descriptor instead. +func (CodyGatewayRateLimitSource) EnumDescriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{0} +} + +type GetCodyGatewayAccessRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Query: + // + // *GetCodyGatewayAccessRequest_SubscriptionId + // *GetCodyGatewayAccessRequest_AccessToken + Query isGetCodyGatewayAccessRequest_Query `protobuf_oneof:"query"` +} + +func (x *GetCodyGatewayAccessRequest) Reset() { + *x = GetCodyGatewayAccessRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCodyGatewayAccessRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCodyGatewayAccessRequest) ProtoMessage() {} + +func (x *GetCodyGatewayAccessRequest) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[0] + 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 GetCodyGatewayAccessRequest.ProtoReflect.Descriptor instead. +func (*GetCodyGatewayAccessRequest) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{0} +} + +func (m *GetCodyGatewayAccessRequest) GetQuery() isGetCodyGatewayAccessRequest_Query { + if m != nil { + return m.Query + } + return nil +} + +func (x *GetCodyGatewayAccessRequest) GetSubscriptionId() string { + if x, ok := x.GetQuery().(*GetCodyGatewayAccessRequest_SubscriptionId); ok { + return x.SubscriptionId + } + return "" +} + +func (x *GetCodyGatewayAccessRequest) GetAccessToken() string { + if x, ok := x.GetQuery().(*GetCodyGatewayAccessRequest_AccessToken); ok { + return x.AccessToken + } + return "" +} + +type isGetCodyGatewayAccessRequest_Query interface { + isGetCodyGatewayAccessRequest_Query() +} + +type GetCodyGatewayAccessRequest_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"` +} + +type GetCodyGatewayAccessRequest_AccessToken struct { + // An license-based access token that is valid for an Enterprise subscription's + // Cody Gateway access, e.g. 'slk_...' + AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3,oneof"` +} + +func (*GetCodyGatewayAccessRequest_SubscriptionId) isGetCodyGatewayAccessRequest_Query() {} + +func (*GetCodyGatewayAccessRequest_AccessToken) isGetCodyGatewayAccessRequest_Query() {} + +type GetCodyGatewayAccessResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Access *CodyGatewayAccess `protobuf:"bytes,1,opt,name=access,proto3" json:"access,omitempty"` +} + +func (x *GetCodyGatewayAccessResponse) Reset() { + *x = GetCodyGatewayAccessResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCodyGatewayAccessResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCodyGatewayAccessResponse) ProtoMessage() {} + +func (x *GetCodyGatewayAccessResponse) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[1] + 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 GetCodyGatewayAccessResponse.ProtoReflect.Descriptor instead. +func (*GetCodyGatewayAccessResponse) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{1} +} + +func (x *GetCodyGatewayAccessResponse) GetAccess() *CodyGatewayAccess { + if x != nil { + return x.Access + } + return nil +} + +type CodyGatewayRateLimit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 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"` + // Interval for rate limiting. + IntervalDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=interval_duration,json=intervalDuration,proto3" json:"interval_duration,omitempty"` +} + +func (x *CodyGatewayRateLimit) Reset() { + *x = CodyGatewayRateLimit{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CodyGatewayRateLimit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodyGatewayRateLimit) ProtoMessage() {} + +func (x *CodyGatewayRateLimit) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[2] + 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 CodyGatewayRateLimit.ProtoReflect.Descriptor instead. +func (*CodyGatewayRateLimit) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{2} +} + +func (x *CodyGatewayRateLimit) GetSource() CodyGatewayRateLimitSource { + if x != nil { + return x.Source + } + return CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED +} + +func (x *CodyGatewayRateLimit) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *CodyGatewayRateLimit) GetIntervalDuration() *durationpb.Duration { + if x != nil { + return x.IntervalDuration + } + return nil +} + +type CodyGatewayAccessToken struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Access token for authenticating as the subscription holder with managed + // Sourcegraph services. + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *CodyGatewayAccessToken) Reset() { + *x = CodyGatewayAccessToken{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CodyGatewayAccessToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodyGatewayAccessToken) ProtoMessage() {} + +func (x *CodyGatewayAccessToken) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[3] + 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 CodyGatewayAccessToken.ProtoReflect.Descriptor instead. +func (*CodyGatewayAccessToken) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{3} +} + +func (x *CodyGatewayAccessToken) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type CodyGatewayAccess 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 access description. + SubscriptionId string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` + // Whether or not a subscription has Cody Gateway access enabled. + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` + // Rate limit for chat completions access, or null if not enabled. + ChatCompletionsRateLimit *CodyGatewayRateLimit `protobuf:"bytes,3,opt,name=chat_completions_rate_limit,json=chatCompletionsRateLimit,proto3,oneof" json:"chat_completions_rate_limit,omitempty"` + // Rate limit for code completions access, or null if not enabled. + CodeCompletionsRateLimit *CodyGatewayRateLimit `protobuf:"bytes,4,opt,name=code_completions_rate_limit,json=codeCompletionsRateLimit,proto3,oneof" json:"code_completions_rate_limit,omitempty"` + // Rate limit for embedding text chunks, or null if not enabled. + EmbeddingsRateLimt *CodyGatewayRateLimit `protobuf:"bytes,5,opt,name=embeddings_rate_limt,json=embeddingsRateLimt,proto3,oneof" json:"embeddings_rate_limt,omitempty"` + // Available access tokens for authenticating as the subscription holder with + // Cody Gateway. + AccessTokens []*CodyGatewayAccessToken `protobuf:"bytes,6,rep,name=access_tokens,json=accessTokens,proto3" json:"access_tokens,omitempty"` +} + +func (x *CodyGatewayAccess) Reset() { + *x = CodyGatewayAccess{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CodyGatewayAccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CodyGatewayAccess) ProtoMessage() {} + +func (x *CodyGatewayAccess) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[4] + 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 CodyGatewayAccess.ProtoReflect.Descriptor instead. +func (*CodyGatewayAccess) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{4} +} + +func (x *CodyGatewayAccess) GetSubscriptionId() string { + if x != nil { + return x.SubscriptionId + } + return "" +} + +func (x *CodyGatewayAccess) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *CodyGatewayAccess) GetChatCompletionsRateLimit() *CodyGatewayRateLimit { + if x != nil { + return x.ChatCompletionsRateLimit + } + return nil +} + +func (x *CodyGatewayAccess) GetCodeCompletionsRateLimit() *CodyGatewayRateLimit { + if x != nil { + return x.CodeCompletionsRateLimit + } + return nil +} + +func (x *CodyGatewayAccess) GetEmbeddingsRateLimt() *CodyGatewayRateLimit { + if x != nil { + return x.EmbeddingsRateLimt + } + return nil +} + +func (x *CodyGatewayAccess) GetAccessTokens() []*CodyGatewayAccessToken { + if x != nil { + return x.AccessTokens + } + return nil +} + +type ListCodyGatewayAccessesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Clients use this field to specify the maximum number of results to be + // returned by the server. The server may further constrain the maximum number + // of results returned in a single page. If the page_size is 0, the server + // will decide the number of results to be returned. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // The client uses this field to request a specific page of the list results. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListCodyGatewayAccessesRequest) Reset() { + *x = ListCodyGatewayAccessesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCodyGatewayAccessesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCodyGatewayAccessesRequest) ProtoMessage() {} + +func (x *ListCodyGatewayAccessesRequest) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[5] + 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 ListCodyGatewayAccessesRequest.ProtoReflect.Descriptor instead. +func (*ListCodyGatewayAccessesRequest) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{5} +} + +func (x *ListCodyGatewayAccessesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListCodyGatewayAccessesRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type ListCodyGatewayAccessesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field represents the pagination token to retrieve the next page of + // results. If the value is "", it means no further results for the request. + NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // The list of Cody Gateway access that matched the given query. + Accesses []*CodyGatewayAccess `protobuf:"bytes,2,rep,name=accesses,proto3" json:"accesses,omitempty"` +} + +func (x *ListCodyGatewayAccessesResponse) Reset() { + *x = ListCodyGatewayAccessesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_codyaccess_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCodyGatewayAccessesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCodyGatewayAccessesResponse) ProtoMessage() {} + +func (x *ListCodyGatewayAccessesResponse) ProtoReflect() protoreflect.Message { + mi := &file_codyaccess_proto_msgTypes[6] + 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 ListCodyGatewayAccessesResponse.ProtoReflect.Descriptor instead. +func (*ListCodyGatewayAccessesResponse) Descriptor() ([]byte, []int) { + return file_codyaccess_proto_rawDescGZIP(), []int{6} +} + +func (x *ListCodyGatewayAccessesResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListCodyGatewayAccessesResponse) GetAccesses() []*CodyGatewayAccess { + if x != nil { + return x.Accesses + } + return nil +} + +var File_codyaccess_proto protoreflect.FileDescriptor + +var file_codyaccess_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1e, 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, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0xed, 0x04, 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, 0x6b, 0x0a, + 0x14, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x5f, 0x6c, 0x69, 0x6d, 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, 0x12, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x52, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 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, 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, 0x17, 0x0a, 0x15, 0x5f, 0x65, 0x6d, 0x62, 0x65, + 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 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, 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, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2b, 0x0a, 0x27, 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, 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, 0xce, + 0x02, 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, 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, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 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, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9f, 0x01, + 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x3e, 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, 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, 0x1a, 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, 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, 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 ( + file_codyaccess_proto_rawDescOnce sync.Once + file_codyaccess_proto_rawDescData = file_codyaccess_proto_rawDesc +) + +func file_codyaccess_proto_rawDescGZIP() []byte { + file_codyaccess_proto_rawDescOnce.Do(func() { + file_codyaccess_proto_rawDescData = protoimpl.X.CompressGZIP(file_codyaccess_proto_rawDescData) + }) + return file_codyaccess_proto_rawDescData +} + +var file_codyaccess_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_codyaccess_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_codyaccess_proto_goTypes = []interface{}{ + (CodyGatewayRateLimitSource)(0), // 0: enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource + (*GetCodyGatewayAccessRequest)(nil), // 1: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest + (*GetCodyGatewayAccessResponse)(nil), // 2: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse + (*CodyGatewayRateLimit)(nil), // 3: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit + (*CodyGatewayAccessToken)(nil), // 4: enterpriseportal.codyaccess.v1.CodyGatewayAccessToken + (*CodyGatewayAccess)(nil), // 5: enterpriseportal.codyaccess.v1.CodyGatewayAccess + (*ListCodyGatewayAccessesRequest)(nil), // 6: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesRequest + (*ListCodyGatewayAccessesResponse)(nil), // 7: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse + (*durationpb.Duration)(nil), // 8: google.protobuf.Duration +} +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 + 8, // 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_limt: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 + 1, // 8: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:input_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest + 6, // 9: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:input_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesRequest + 2, // 10: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:output_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse + 7, // 11: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:output_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse + 10, // [10:12] is the sub-list for method output_type + 8, // [8:10] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_codyaccess_proto_init() } +func file_codyaccess_proto_init() { + if File_codyaccess_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_codyaccess_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCodyGatewayAccessRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCodyGatewayAccessResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodyGatewayRateLimit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodyGatewayAccessToken); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodyGatewayAccess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCodyGatewayAccessesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_codyaccess_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCodyGatewayAccessesResponse); 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{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_codyaccess_proto_rawDesc, + NumEnums: 1, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_codyaccess_proto_goTypes, + DependencyIndexes: file_codyaccess_proto_depIdxs, + EnumInfos: file_codyaccess_proto_enumTypes, + MessageInfos: file_codyaccess_proto_msgTypes, + }.Build() + File_codyaccess_proto = out.File + file_codyaccess_proto_rawDesc = nil + file_codyaccess_proto_goTypes = nil + file_codyaccess_proto_depIdxs = nil +} diff --git a/lib/enterpriseportal/codyaccess/v1/codyaccess.proto b/lib/enterpriseportal/codyaccess/v1/codyaccess.proto new file mode 100644 index 00000000000..2130d793c38 --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/codyaccess.proto @@ -0,0 +1,105 @@ +syntax = "proto3"; + +package enterpriseportal.codyaccess.v1; + +import "google/protobuf/duration.proto"; + +option go_package = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1"; + +// CodyAccessService is an extension to Enterprise Portal that serves Cody +// Gateway access management capabilities (e.g. access quotas). It is not the +// Cody Gateway service API itself - it serves capabilities that Cody Gateway +// depends on. +// +// DRAFT STATE - see RFC 885: https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q +service CodyAccessService { + // Retrieve Cody Gateway access granted to an Enterprise subscription. + rpc GetCodyGatewayAccess(GetCodyGatewayAccessRequest) returns (GetCodyGatewayAccessResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + + // List all Cody Gateway accesses granted to any Enterprise subscription. + rpc ListCodyGatewayAccesses(ListCodyGatewayAccessesRequest) returns (ListCodyGatewayAccessesResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } +} + +message GetCodyGatewayAccessRequest { + oneof query { + // The external, prefixed UUID-format identifier of an Enterprise subscription. + string subscription_id = 1; + // An license-based access token that is valid for an Enterprise subscription's + // Cody Gateway access, e.g. 'slk_...' + string access_token = 2; + } +} + +message GetCodyGatewayAccessResponse { + CodyGatewayAccess access = 1; +} + +enum CodyGatewayRateLimitSource { + CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED = 0; + // Indicates that a custom override for the rate limit has been configured + // and applied. + CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE = 1; + // Indicates that the rate limit is inferred by the subscription's active plan. + CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN = 2; +} + +message CodyGatewayRateLimit { + // The source of the rate limit configuration. + CodyGatewayRateLimitSource source = 1; + // Requests per time interval. + int64 limit = 2; + // Interval for rate limiting. + google.protobuf.Duration interval_duration = 3; +} + +message CodyGatewayAccessToken { + // Access token for authenticating as the subscription holder with managed + // Sourcegraph services. + string token = 1; +} + +message CodyGatewayAccess { + // The external, prefixed UUID-format identifier for the Enterprise + // subscription corresponding to this Cody Gateway access description. + string subscription_id = 1; + + // Whether or not a subscription has Cody Gateway access enabled. + bool enabled = 2; + + // Rate limit for chat completions access, or null if not enabled. + optional CodyGatewayRateLimit chat_completions_rate_limit = 3; + // Rate limit for code completions access, or null if not enabled. + optional CodyGatewayRateLimit code_completions_rate_limit = 4; + // Rate limit for embedding text chunks, or null if not enabled. + optional CodyGatewayRateLimit embeddings_rate_limt = 5; + + // Available access tokens for authenticating as the subscription holder with + // Cody Gateway. + repeated CodyGatewayAccessToken access_tokens = 6; +} + +message ListCodyGatewayAccessesRequest { + // Clients use this field to specify the maximum number of results to be + // returned by the server. The server may further constrain the maximum number + // of results returned in a single page. If the page_size is 0, the server + // will decide the number of results to be returned. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + int32 page_size = 1; + // The client uses this field to request a specific page of the list results. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + string page_token = 2; +} + +message ListCodyGatewayAccessesResponse { + // This field represents the pagination token to retrieve the next page of + // results. If the value is "", it means no further results for the request. + string next_page_token = 1; + // The list of Cody Gateway access that matched the given query. + repeated CodyGatewayAccess accesses = 2; +} diff --git a/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go b/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go new file mode 100644 index 00000000000..af2d306398d --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/codyaccess_grpc.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: codyaccess.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + CodyAccessService_GetCodyGatewayAccess_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayAccess" + CodyAccessService_ListCodyGatewayAccesses_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/ListCodyGatewayAccesses" +) + +// CodyAccessServiceClient is the client API for CodyAccessService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CodyAccessServiceClient interface { + // Retrieve Cody Gateway access granted to an Enterprise subscription. + GetCodyGatewayAccess(ctx context.Context, in *GetCodyGatewayAccessRequest, opts ...grpc.CallOption) (*GetCodyGatewayAccessResponse, error) + // List all Cody Gateway accesses granted to any Enterprise subscription. + ListCodyGatewayAccesses(ctx context.Context, in *ListCodyGatewayAccessesRequest, opts ...grpc.CallOption) (*ListCodyGatewayAccessesResponse, error) +} + +type codyAccessServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCodyAccessServiceClient(cc grpc.ClientConnInterface) CodyAccessServiceClient { + return &codyAccessServiceClient{cc} +} + +func (c *codyAccessServiceClient) GetCodyGatewayAccess(ctx context.Context, in *GetCodyGatewayAccessRequest, opts ...grpc.CallOption) (*GetCodyGatewayAccessResponse, error) { + out := new(GetCodyGatewayAccessResponse) + err := c.cc.Invoke(ctx, CodyAccessService_GetCodyGatewayAccess_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *codyAccessServiceClient) ListCodyGatewayAccesses(ctx context.Context, in *ListCodyGatewayAccessesRequest, opts ...grpc.CallOption) (*ListCodyGatewayAccessesResponse, error) { + out := new(ListCodyGatewayAccessesResponse) + err := c.cc.Invoke(ctx, CodyAccessService_ListCodyGatewayAccesses_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 +type CodyAccessServiceServer interface { + // Retrieve Cody Gateway access granted to an Enterprise subscription. + GetCodyGatewayAccess(context.Context, *GetCodyGatewayAccessRequest) (*GetCodyGatewayAccessResponse, error) + // List all Cody Gateway accesses granted to any Enterprise subscription. + ListCodyGatewayAccesses(context.Context, *ListCodyGatewayAccessesRequest) (*ListCodyGatewayAccessesResponse, error) + mustEmbedUnimplementedCodyAccessServiceServer() +} + +// UnimplementedCodyAccessServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCodyAccessServiceServer struct { +} + +func (UnimplementedCodyAccessServiceServer) GetCodyGatewayAccess(context.Context, *GetCodyGatewayAccessRequest) (*GetCodyGatewayAccessResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCodyGatewayAccess not implemented") +} +func (UnimplementedCodyAccessServiceServer) ListCodyGatewayAccesses(context.Context, *ListCodyGatewayAccessesRequest) (*ListCodyGatewayAccessesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCodyGatewayAccesses not implemented") +} +func (UnimplementedCodyAccessServiceServer) mustEmbedUnimplementedCodyAccessServiceServer() {} + +// UnsafeCodyAccessServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CodyAccessServiceServer will +// result in compilation errors. +type UnsafeCodyAccessServiceServer interface { + mustEmbedUnimplementedCodyAccessServiceServer() +} + +func RegisterCodyAccessServiceServer(s grpc.ServiceRegistrar, srv CodyAccessServiceServer) { + s.RegisterService(&CodyAccessService_ServiceDesc, srv) +} + +func _CodyAccessService_GetCodyGatewayAccess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCodyGatewayAccessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CodyAccessServiceServer).GetCodyGatewayAccess(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CodyAccessService_GetCodyGatewayAccess_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CodyAccessServiceServer).GetCodyGatewayAccess(ctx, req.(*GetCodyGatewayAccessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CodyAccessService_ListCodyGatewayAccesses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCodyGatewayAccessesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CodyAccessServiceServer).ListCodyGatewayAccesses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CodyAccessService_ListCodyGatewayAccesses_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CodyAccessServiceServer).ListCodyGatewayAccesses(ctx, req.(*ListCodyGatewayAccessesRequest)) + } + 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) +var CodyAccessService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "enterpriseportal.codyaccess.v1.CodyAccessService", + HandlerType: (*CodyAccessServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetCodyGatewayAccess", + Handler: _CodyAccessService_GetCodyGatewayAccess_Handler, + }, + { + MethodName: "ListCodyGatewayAccesses", + Handler: _CodyAccessService_ListCodyGatewayAccesses_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "codyaccess.proto", +} diff --git a/lib/enterpriseportal/codyaccess/v1/v1connect/BUILD.bazel b/lib/enterpriseportal/codyaccess/v1/v1connect/BUILD.bazel new file mode 100644 index 00000000000..8628326027a --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/v1connect/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "v1connect", + srcs = ["codyaccess.connect.go"], + importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1/v1connect", + visibility = ["//visibility:public"], + deps = [ + "//lib/enterpriseportal/codyaccess/v1:codyaccess", + "@com_connectrpc_connect//:connect", + ], +) diff --git a/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go b/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go new file mode 100644 index 00000000000..b92760c4e24 --- /dev/null +++ b/lib/enterpriseportal/codyaccess/v1/v1connect/codyaccess.connect.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: codyaccess.proto + +package v1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/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 ( + // CodyAccessServiceName is the fully-qualified name of the CodyAccessService service. + CodyAccessServiceName = "enterpriseportal.codyaccess.v1.CodyAccessService" +) + +// 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 ( + // CodyAccessServiceGetCodyGatewayAccessProcedure is the fully-qualified name of the + // CodyAccessService's GetCodyGatewayAccess RPC. + CodyAccessServiceGetCodyGatewayAccessProcedure = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayAccess" + // CodyAccessServiceListCodyGatewayAccessesProcedure is the fully-qualified name of the + // CodyAccessService's ListCodyGatewayAccesses RPC. + CodyAccessServiceListCodyGatewayAccessesProcedure = "/enterpriseportal.codyaccess.v1.CodyAccessService/ListCodyGatewayAccesses" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + codyAccessServiceServiceDescriptor = v1.File_codyaccess_proto.Services().ByName("CodyAccessService") + codyAccessServiceGetCodyGatewayAccessMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("GetCodyGatewayAccess") + codyAccessServiceListCodyGatewayAccessesMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("ListCodyGatewayAccesses") +) + +// CodyAccessServiceClient is a client for the enterpriseportal.codyaccess.v1.CodyAccessService +// service. +type CodyAccessServiceClient interface { + // Retrieve Cody Gateway access granted to an Enterprise subscription. + GetCodyGatewayAccess(context.Context, *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error) + // List all Cody Gateway accesses granted to any Enterprise subscription. + ListCodyGatewayAccesses(context.Context, *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error) +} + +// NewCodyAccessServiceClient constructs a client for the +// enterpriseportal.codyaccess.v1.CodyAccessService 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 NewCodyAccessServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CodyAccessServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &codyAccessServiceClient{ + getCodyGatewayAccess: connect.NewClient[v1.GetCodyGatewayAccessRequest, v1.GetCodyGatewayAccessResponse]( + httpClient, + baseURL+CodyAccessServiceGetCodyGatewayAccessProcedure, + connect.WithSchema(codyAccessServiceGetCodyGatewayAccessMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + listCodyGatewayAccesses: connect.NewClient[v1.ListCodyGatewayAccessesRequest, v1.ListCodyGatewayAccessesResponse]( + httpClient, + baseURL+CodyAccessServiceListCodyGatewayAccessesProcedure, + connect.WithSchema(codyAccessServiceListCodyGatewayAccessesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + } +} + +// codyAccessServiceClient implements CodyAccessServiceClient. +type codyAccessServiceClient struct { + getCodyGatewayAccess *connect.Client[v1.GetCodyGatewayAccessRequest, v1.GetCodyGatewayAccessResponse] + listCodyGatewayAccesses *connect.Client[v1.ListCodyGatewayAccessesRequest, v1.ListCodyGatewayAccessesResponse] +} + +// GetCodyGatewayAccess calls enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess. +func (c *codyAccessServiceClient) GetCodyGatewayAccess(ctx context.Context, req *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error) { + return c.getCodyGatewayAccess.CallUnary(ctx, req) +} + +// ListCodyGatewayAccesses calls +// enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses. +func (c *codyAccessServiceClient) ListCodyGatewayAccesses(ctx context.Context, req *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error) { + return c.listCodyGatewayAccesses.CallUnary(ctx, req) +} + +// CodyAccessServiceHandler is an implementation of the +// enterpriseportal.codyaccess.v1.CodyAccessService service. +type CodyAccessServiceHandler interface { + // Retrieve Cody Gateway access granted to an Enterprise subscription. + GetCodyGatewayAccess(context.Context, *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error) + // List all Cody Gateway accesses granted to any Enterprise subscription. + ListCodyGatewayAccesses(context.Context, *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error) +} + +// NewCodyAccessServiceHandler 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 NewCodyAccessServiceHandler(svc CodyAccessServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + codyAccessServiceGetCodyGatewayAccessHandler := connect.NewUnaryHandler( + CodyAccessServiceGetCodyGatewayAccessProcedure, + svc.GetCodyGatewayAccess, + connect.WithSchema(codyAccessServiceGetCodyGatewayAccessMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + codyAccessServiceListCodyGatewayAccessesHandler := connect.NewUnaryHandler( + CodyAccessServiceListCodyGatewayAccessesProcedure, + svc.ListCodyGatewayAccesses, + connect.WithSchema(codyAccessServiceListCodyGatewayAccessesMethodDescriptor), + 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: + codyAccessServiceGetCodyGatewayAccessHandler.ServeHTTP(w, r) + case CodyAccessServiceListCodyGatewayAccessesProcedure: + codyAccessServiceListCodyGatewayAccessesHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedCodyAccessServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedCodyAccessServiceHandler struct{} + +func (UnimplementedCodyAccessServiceHandler) GetCodyGatewayAccess(context.Context, *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess is not implemented")) +} + +func (UnimplementedCodyAccessServiceHandler) ListCodyGatewayAccesses(context.Context, *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses is not implemented")) +} diff --git a/lib/enterpriseportal/subscriptions/v1/BUILD.bazel b/lib/enterpriseportal/subscriptions/v1/BUILD.bazel new file mode 100644 index 00000000000..4a64c1ff48a --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_proto_grpc//doc:defs.bzl", "doc_template_compile") +load("@rules_buf//buf:defs.bzl", "buf_lint_test") + +# Bazel-generated files are different from what is generated locally by buf and +# causes compilation errors - the next line disables Gazelle-generated Bazel +# configuration that overrides the generated code that gets committed. +# https://github.com/sourcegraph/devx-support/issues/932#issuecomment-2103608521 +# gazelle:proto disable_global + +proto_library( + name = "v1_proto", + srcs = ["subscriptions.proto"], + strip_import_prefix = "/lib", # keep + visibility = ["//visibility:public"], + deps = ["@com_google_protobuf//:timestamp_proto"], +) + +go_library( + name = "subscriptions", + srcs = [ + "subscriptions.pb.go", + "subscriptions_grpc.pb.go", + ], + importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/v1", + visibility = ["//visibility:public"], + deps = [ + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_google_protobuf//reflect/protoreflect", + "@org_golang_google_protobuf//runtime/protoimpl", + "@org_golang_google_protobuf//types/known/timestamppb", + ], +) + +buf_lint_test( + name = "v1_proto_lint", + timeout = "short", + config = "//internal:buf.yaml", + targets = [":v1_proto"], +) diff --git a/lib/enterpriseportal/subscriptions/v1/buf.gen.yaml b/lib/enterpriseportal/subscriptions/v1/buf.gen.yaml new file mode 100644 index 00000000000..e5707836ced --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/buf.gen.yaml @@ -0,0 +1,17 @@ +# Configuration file for https://buf.build/, which we use for Protobuf code generation. +version: v1 +plugins: + - plugin: buf.build/grpc/go:v1.3.0 + out: . + opt: + - paths=source_relative + - plugin: buf.build/protocolbuffers/go:v1.33.0 + out: . + opt: + - paths=source_relative + + # Generate connectrpc bindings in Go + - plugin: buf.build/connectrpc/go:v1.16.1 + out: . + opt: + - paths=source_relative diff --git a/lib/enterpriseportal/subscriptions/v1/subscriptions.pb.go b/lib/enterpriseportal/subscriptions/v1/subscriptions.pb.go new file mode 100644 index 00000000000..33767a6c945 --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/subscriptions.pb.go @@ -0,0 +1,1631 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: subscriptions.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +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) +) + +// EnterpriseSubscriptionLicenseType can be used to denote different types of +// licenses. +type EnterpriseSubscriptionLicenseType int32 + +const ( + EnterpriseSubscriptionLicenseType_ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_UNSPECIFIED EnterpriseSubscriptionLicenseType = 0 + // The 'license key' type is the classic licensing mechanism that Sourcegraph + // has always had. They are signed by a private key and offline-validated by + // a public key that ships with all Sourcegraph builds. + // + // Each Subscription is expected to have at most one active Sourcegraph classic + // license used by a Sourcegraph instance at a time. + EnterpriseSubscriptionLicenseType_ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY EnterpriseSubscriptionLicenseType = 1 +) + +// Enum value maps for EnterpriseSubscriptionLicenseType. +var ( + EnterpriseSubscriptionLicenseType_name = map[int32]string{ + 0: "ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_UNSPECIFIED", + 1: "ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY", + } + EnterpriseSubscriptionLicenseType_value = map[string]int32{ + "ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_UNSPECIFIED": 0, + "ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY": 1, + } +) + +func (x EnterpriseSubscriptionLicenseType) Enum() *EnterpriseSubscriptionLicenseType { + p := new(EnterpriseSubscriptionLicenseType) + *p = x + return p +} + +func (x EnterpriseSubscriptionLicenseType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EnterpriseSubscriptionLicenseType) Descriptor() protoreflect.EnumDescriptor { + return file_subscriptions_proto_enumTypes[0].Descriptor() +} + +func (EnterpriseSubscriptionLicenseType) Type() protoreflect.EnumType { + return &file_subscriptions_proto_enumTypes[0] +} + +func (x EnterpriseSubscriptionLicenseType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EnterpriseSubscriptionLicenseType.Descriptor instead. +func (EnterpriseSubscriptionLicenseType) EnumDescriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{0} +} + +type EnterpriseSubscriptionCondition_Status int32 + +const ( + EnterpriseSubscriptionCondition_STATUS_UNSPECIFIED EnterpriseSubscriptionCondition_Status = 0 + // License creation status. + EnterpriseSubscriptionCondition_STATUS_CREATED EnterpriseSubscriptionCondition_Status = 1 + // License archival status. i.e. 'is_archived' + EnterpriseSubscriptionCondition_STATUS_ARCHIVED EnterpriseSubscriptionCondition_Status = 2 +) + +// Enum value maps for EnterpriseSubscriptionCondition_Status. +var ( + EnterpriseSubscriptionCondition_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_CREATED", + 2: "STATUS_ARCHIVED", + } + EnterpriseSubscriptionCondition_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_CREATED": 1, + "STATUS_ARCHIVED": 2, + } +) + +func (x EnterpriseSubscriptionCondition_Status) Enum() *EnterpriseSubscriptionCondition_Status { + p := new(EnterpriseSubscriptionCondition_Status) + *p = x + return p +} + +func (x EnterpriseSubscriptionCondition_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EnterpriseSubscriptionCondition_Status) Descriptor() protoreflect.EnumDescriptor { + return file_subscriptions_proto_enumTypes[1].Descriptor() +} + +func (EnterpriseSubscriptionCondition_Status) Type() protoreflect.EnumType { + return &file_subscriptions_proto_enumTypes[1] +} + +func (x EnterpriseSubscriptionCondition_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EnterpriseSubscriptionCondition_Status.Descriptor instead. +func (EnterpriseSubscriptionCondition_Status) EnumDescriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{0, 0} +} + +type EnterpriseSubscriptionLicenseCondition_Status int32 + +const ( + EnterpriseSubscriptionLicenseCondition_STATUS_UNSPECIFIED EnterpriseSubscriptionLicenseCondition_Status = 0 + // License creation status. + EnterpriseSubscriptionLicenseCondition_STATUS_CREATED EnterpriseSubscriptionLicenseCondition_Status = 1 + // License archival status. i.e. 'is_archived' + EnterpriseSubscriptionLicenseCondition_STATUS_ARCHIVED EnterpriseSubscriptionLicenseCondition_Status = 2 + // License revocation status, i.e. 'is_revoked' + EnterpriseSubscriptionLicenseCondition_STATUS_REVOKED EnterpriseSubscriptionLicenseCondition_Status = 3 +) + +// Enum value maps for EnterpriseSubscriptionLicenseCondition_Status. +var ( + EnterpriseSubscriptionLicenseCondition_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_CREATED", + 2: "STATUS_ARCHIVED", + 3: "STATUS_REVOKED", + } + EnterpriseSubscriptionLicenseCondition_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_CREATED": 1, + "STATUS_ARCHIVED": 2, + "STATUS_REVOKED": 3, + } +) + +func (x EnterpriseSubscriptionLicenseCondition_Status) Enum() *EnterpriseSubscriptionLicenseCondition_Status { + p := new(EnterpriseSubscriptionLicenseCondition_Status) + *p = x + return p +} + +func (x EnterpriseSubscriptionLicenseCondition_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EnterpriseSubscriptionLicenseCondition_Status) Descriptor() protoreflect.EnumDescriptor { + return file_subscriptions_proto_enumTypes[2].Descriptor() +} + +func (EnterpriseSubscriptionLicenseCondition_Status) Type() protoreflect.EnumType { + return &file_subscriptions_proto_enumTypes[2] +} + +func (x EnterpriseSubscriptionLicenseCondition_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EnterpriseSubscriptionLicenseCondition_Status.Descriptor instead. +func (EnterpriseSubscriptionLicenseCondition_Status) EnumDescriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{3, 0} +} + +type EnterpriseSubscriptionCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The time this subscription transitioned into this status. + LastTransitionTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=last_transition_time,json=lastTransitionTime,proto3" json:"last_transition_time,omitempty"` + // Status is the type of status corresponding to this condition. + Status EnterpriseSubscriptionCondition_Status `protobuf:"varint,2,opt,name=status,proto3,enum=enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition_Status" json:"status,omitempty"` + // Message is a description of the status transition and why it happened. + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *EnterpriseSubscriptionCondition) Reset() { + *x = EnterpriseSubscriptionCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnterpriseSubscriptionCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnterpriseSubscriptionCondition) ProtoMessage() {} + +func (x *EnterpriseSubscriptionCondition) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[0] + 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 EnterpriseSubscriptionCondition.ProtoReflect.Descriptor instead. +func (*EnterpriseSubscriptionCondition) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{0} +} + +func (x *EnterpriseSubscriptionCondition) GetLastTransitionTime() *timestamppb.Timestamp { + if x != nil { + return x.LastTransitionTime + } + return nil +} + +func (x *EnterpriseSubscriptionCondition) GetStatus() EnterpriseSubscriptionCondition_Status { + if x != nil { + return x.Status + } + return EnterpriseSubscriptionCondition_STATUS_UNSPECIFIED +} + +func (x *EnterpriseSubscriptionCondition) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// EnterpriseSubscription represents a Sourcegraph Enterprise subscription. +type EnterpriseSubscription struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID is the external, prefixed UUID-format identifier for this subscription. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Timeline of key events corresponding to this subscription. + Conditions []*EnterpriseSubscriptionCondition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"` + // Display name of this subscription, e.g. "Acme, Inc." + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` +} + +func (x *EnterpriseSubscription) Reset() { + *x = EnterpriseSubscription{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnterpriseSubscription) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnterpriseSubscription) ProtoMessage() {} + +func (x *EnterpriseSubscription) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[1] + 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 EnterpriseSubscription.ProtoReflect.Descriptor instead. +func (*EnterpriseSubscription) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{1} +} + +func (x *EnterpriseSubscription) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EnterpriseSubscription) GetConditions() []*EnterpriseSubscriptionCondition { + if x != nil { + return x.Conditions + } + return nil +} + +func (x *EnterpriseSubscription) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +// EnterpriseSubscriptionLicenseKey is the classic offline Sourcegraph license +// key, and corresponds to ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY. +type EnterpriseSubscriptionLicenseKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Version of this classic license's information schema. It is incremented + // whenever a major change is made to the shape of Info to indicate what + // fields can be expected from the information embedded in the license key. + InfoVersion uint32 `protobuf:"varint,1,opt,name=info_version,json=infoVersion,proto3" json:"info_version,omitempty"` + // Information embedded into the license key. + Info *EnterpriseSubscriptionLicenseKey_Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + // The license key. + LicenseKey string `protobuf:"bytes,3,opt,name=license_key,json=licenseKey,proto3" json:"license_key,omitempty"` + // UUID of the known instance using this license key, self-reported from + // online license checks and pings. Also known as 'site ID'. + InstanceId string `protobuf:"bytes,4,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` +} + +func (x *EnterpriseSubscriptionLicenseKey) Reset() { + *x = EnterpriseSubscriptionLicenseKey{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnterpriseSubscriptionLicenseKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnterpriseSubscriptionLicenseKey) ProtoMessage() {} + +func (x *EnterpriseSubscriptionLicenseKey) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[2] + 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 EnterpriseSubscriptionLicenseKey.ProtoReflect.Descriptor instead. +func (*EnterpriseSubscriptionLicenseKey) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{2} +} + +func (x *EnterpriseSubscriptionLicenseKey) GetInfoVersion() uint32 { + if x != nil { + return x.InfoVersion + } + return 0 +} + +func (x *EnterpriseSubscriptionLicenseKey) GetInfo() *EnterpriseSubscriptionLicenseKey_Info { + if x != nil { + return x.Info + } + return nil +} + +func (x *EnterpriseSubscriptionLicenseKey) GetLicenseKey() string { + if x != nil { + return x.LicenseKey + } + return "" +} + +func (x *EnterpriseSubscriptionLicenseKey) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +type EnterpriseSubscriptionLicenseCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The time this subscription transitioned into this status. + LastTransitionTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=last_transition_time,json=lastTransitionTime,proto3" json:"last_transition_time,omitempty"` + // Status is the type of status corresponding to this condition. + Status EnterpriseSubscriptionLicenseCondition_Status `protobuf:"varint,2,opt,name=status,proto3,enum=enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition_Status" json:"status,omitempty"` + // Message is a description of the status transition and why it happened. + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *EnterpriseSubscriptionLicenseCondition) Reset() { + *x = EnterpriseSubscriptionLicenseCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnterpriseSubscriptionLicenseCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnterpriseSubscriptionLicenseCondition) ProtoMessage() {} + +func (x *EnterpriseSubscriptionLicenseCondition) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[3] + 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 EnterpriseSubscriptionLicenseCondition.ProtoReflect.Descriptor instead. +func (*EnterpriseSubscriptionLicenseCondition) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{3} +} + +func (x *EnterpriseSubscriptionLicenseCondition) GetLastTransitionTime() *timestamppb.Timestamp { + if x != nil { + return x.LastTransitionTime + } + return nil +} + +func (x *EnterpriseSubscriptionLicenseCondition) GetStatus() EnterpriseSubscriptionLicenseCondition_Status { + if x != nil { + return x.Status + } + return EnterpriseSubscriptionLicenseCondition_STATUS_UNSPECIFIED +} + +func (x *EnterpriseSubscriptionLicenseCondition) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// EnterpriseSubscriptionLicense represents a license for a Sourcegraph +// Enterprise product. Multiple licenses are associated with a single +// subscription, typically a series of licenses with the most recent one being +// a subscription's active license. +type EnterpriseSubscriptionLicense struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID is the external, prefixed UUID-format identifier for this license key. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The external, prefixed UUID-format identifier for the subscription that + // owns this license. + SubscriptionId string `protobuf:"bytes,2,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` + // Timeline of key events corresponding to this license. + Conditions []*EnterpriseSubscriptionLicenseCondition `protobuf:"bytes,3,rep,name=conditions,proto3" json:"conditions,omitempty"` + // License data, based on the type of the license. + // + // Types that are assignable to License: + // + // *EnterpriseSubscriptionLicense_Key + License isEnterpriseSubscriptionLicense_License `protobuf_oneof:"license"` +} + +func (x *EnterpriseSubscriptionLicense) Reset() { + *x = EnterpriseSubscriptionLicense{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnterpriseSubscriptionLicense) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnterpriseSubscriptionLicense) ProtoMessage() {} + +func (x *EnterpriseSubscriptionLicense) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[4] + 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 EnterpriseSubscriptionLicense.ProtoReflect.Descriptor instead. +func (*EnterpriseSubscriptionLicense) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{4} +} + +func (x *EnterpriseSubscriptionLicense) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EnterpriseSubscriptionLicense) GetSubscriptionId() string { + if x != nil { + return x.SubscriptionId + } + return "" +} + +func (x *EnterpriseSubscriptionLicense) GetConditions() []*EnterpriseSubscriptionLicenseCondition { + if x != nil { + return x.Conditions + } + return nil +} + +func (m *EnterpriseSubscriptionLicense) GetLicense() isEnterpriseSubscriptionLicense_License { + if m != nil { + return m.License + } + return nil +} + +func (x *EnterpriseSubscriptionLicense) GetKey() *EnterpriseSubscriptionLicenseKey { + if x, ok := x.GetLicense().(*EnterpriseSubscriptionLicense_Key); ok { + return x.Key + } + return nil +} + +type isEnterpriseSubscriptionLicense_License interface { + isEnterpriseSubscriptionLicense_License() +} + +type EnterpriseSubscriptionLicense_Key struct { + Key *EnterpriseSubscriptionLicenseKey `protobuf:"bytes,4,opt,name=key,proto3,oneof"` +} + +func (*EnterpriseSubscriptionLicense_Key) isEnterpriseSubscriptionLicense_License() {} + +type GetEnterpriseSubscriptionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Query specifies the lookup strategy for this get request. + // + // Types that are assignable to Query: + // + // *GetEnterpriseSubscriptionRequest_Id + Query isGetEnterpriseSubscriptionRequest_Query `protobuf_oneof:"query"` +} + +func (x *GetEnterpriseSubscriptionRequest) Reset() { + *x = GetEnterpriseSubscriptionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEnterpriseSubscriptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEnterpriseSubscriptionRequest) ProtoMessage() {} + +func (x *GetEnterpriseSubscriptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[5] + 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 GetEnterpriseSubscriptionRequest.ProtoReflect.Descriptor instead. +func (*GetEnterpriseSubscriptionRequest) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{5} +} + +func (m *GetEnterpriseSubscriptionRequest) GetQuery() isGetEnterpriseSubscriptionRequest_Query { + if m != nil { + return m.Query + } + return nil +} + +func (x *GetEnterpriseSubscriptionRequest) GetId() string { + if x, ok := x.GetQuery().(*GetEnterpriseSubscriptionRequest_Id); ok { + return x.Id + } + return "" +} + +type isGetEnterpriseSubscriptionRequest_Query interface { + isGetEnterpriseSubscriptionRequest_Query() +} + +type GetEnterpriseSubscriptionRequest_Id struct { + // Look up a subscription using its external, prefixed UUID-format identifier. + Id string `protobuf:"bytes,1,opt,name=id,proto3,oneof"` +} + +func (*GetEnterpriseSubscriptionRequest_Id) isGetEnterpriseSubscriptionRequest_Query() {} + +type GetEnterpriseSubscriptionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subscription *EnterpriseSubscription `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"` +} + +func (x *GetEnterpriseSubscriptionResponse) Reset() { + *x = GetEnterpriseSubscriptionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEnterpriseSubscriptionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEnterpriseSubscriptionResponse) ProtoMessage() {} + +func (x *GetEnterpriseSubscriptionResponse) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[6] + 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 GetEnterpriseSubscriptionResponse.ProtoReflect.Descriptor instead. +func (*GetEnterpriseSubscriptionResponse) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{6} +} + +func (x *GetEnterpriseSubscriptionResponse) GetSubscription() *EnterpriseSubscription { + if x != nil { + return x.Subscription + } + return nil +} + +type ListEnterpriseSubscriptionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Clients use this field to specify the maximum number of results to be + // returned by the server. The server may further constrain the maximum number + // of results returned in a single page. If the page_size is 0, the server + // will decide the number of results to be returned. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // The client uses this field to request a specific page of the list results. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListEnterpriseSubscriptionsRequest) Reset() { + *x = ListEnterpriseSubscriptionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnterpriseSubscriptionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnterpriseSubscriptionsRequest) ProtoMessage() {} + +func (x *ListEnterpriseSubscriptionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[7] + 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 ListEnterpriseSubscriptionsRequest.ProtoReflect.Descriptor instead. +func (*ListEnterpriseSubscriptionsRequest) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{7} +} + +func (x *ListEnterpriseSubscriptionsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListEnterpriseSubscriptionsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +type ListEnterpriseSubscriptionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field represents the pagination token to retrieve the next page of + // results. If the value is "", it means no further results for the request. + NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // The list of subscriptions that matched the given query. + Subscriptions []*EnterpriseSubscription `protobuf:"bytes,2,rep,name=subscriptions,proto3" json:"subscriptions,omitempty"` +} + +func (x *ListEnterpriseSubscriptionsResponse) Reset() { + *x = ListEnterpriseSubscriptionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnterpriseSubscriptionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnterpriseSubscriptionsResponse) ProtoMessage() {} + +func (x *ListEnterpriseSubscriptionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_proto_msgTypes[8] + 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 ListEnterpriseSubscriptionsResponse.ProtoReflect.Descriptor instead. +func (*ListEnterpriseSubscriptionsResponse) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{8} +} + +func (x *ListEnterpriseSubscriptionsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListEnterpriseSubscriptionsResponse) GetSubscriptions() []*EnterpriseSubscription { + if x != nil { + return x.Subscriptions + } + return nil +} + +type ListEnterpriseSubscriptionLicensesFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Filter: + // + // *ListEnterpriseSubscriptionLicensesFilter_SubscriptionId + // *ListEnterpriseSubscriptionLicensesFilter_Type + // *ListEnterpriseSubscriptionLicensesFilter_IsArchived + // *ListEnterpriseSubscriptionLicensesFilter_LicenseKeySubstring + Filter isListEnterpriseSubscriptionLicensesFilter_Filter `protobuf_oneof:"filter"` +} + +func (x *ListEnterpriseSubscriptionLicensesFilter) Reset() { + *x = ListEnterpriseSubscriptionLicensesFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnterpriseSubscriptionLicensesFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnterpriseSubscriptionLicensesFilter) ProtoMessage() {} + +func (x *ListEnterpriseSubscriptionLicensesFilter) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_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 ListEnterpriseSubscriptionLicensesFilter.ProtoReflect.Descriptor instead. +func (*ListEnterpriseSubscriptionLicensesFilter) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{9} +} + +func (m *ListEnterpriseSubscriptionLicensesFilter) GetFilter() isListEnterpriseSubscriptionLicensesFilter_Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (x *ListEnterpriseSubscriptionLicensesFilter) GetSubscriptionId() string { + if x, ok := x.GetFilter().(*ListEnterpriseSubscriptionLicensesFilter_SubscriptionId); ok { + return x.SubscriptionId + } + return "" +} + +func (x *ListEnterpriseSubscriptionLicensesFilter) GetType() EnterpriseSubscriptionLicenseType { + if x, ok := x.GetFilter().(*ListEnterpriseSubscriptionLicensesFilter_Type); ok { + return x.Type + } + return EnterpriseSubscriptionLicenseType_ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_UNSPECIFIED +} + +func (x *ListEnterpriseSubscriptionLicensesFilter) GetIsArchived() bool { + if x, ok := x.GetFilter().(*ListEnterpriseSubscriptionLicensesFilter_IsArchived); ok { + return x.IsArchived + } + return false +} + +func (x *ListEnterpriseSubscriptionLicensesFilter) GetLicenseKeySubstring() string { + if x, ok := x.GetFilter().(*ListEnterpriseSubscriptionLicensesFilter_LicenseKeySubstring); ok { + return x.LicenseKeySubstring + } + return "" +} + +type isListEnterpriseSubscriptionLicensesFilter_Filter interface { + isListEnterpriseSubscriptionLicensesFilter_Filter() +} + +type ListEnterpriseSubscriptionLicensesFilter_SubscriptionId struct { + // Return only licenses corresponding to the given subscription ID, with the + // most recently issued licenses first. + SubscriptionId string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3,oneof"` +} + +type ListEnterpriseSubscriptionLicensesFilter_Type struct { + // Return only licenses of the given type. + Type EnterpriseSubscriptionLicenseType `protobuf:"varint,2,opt,name=type,proto3,enum=enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseType,oneof"` +} + +type ListEnterpriseSubscriptionLicensesFilter_IsArchived struct { + // Return only licenses with the given archival status. + IsArchived bool `protobuf:"varint,3,opt,name=is_archived,json=isArchived,proto3,oneof"` +} + +type ListEnterpriseSubscriptionLicensesFilter_LicenseKeySubstring struct { + // Return only product subscriptions whose license key contains this + // substring. + LicenseKeySubstring string `protobuf:"bytes,4,opt,name=license_key_substring,json=licenseKeySubstring,proto3,oneof"` +} + +func (*ListEnterpriseSubscriptionLicensesFilter_SubscriptionId) isListEnterpriseSubscriptionLicensesFilter_Filter() { +} + +func (*ListEnterpriseSubscriptionLicensesFilter_Type) isListEnterpriseSubscriptionLicensesFilter_Filter() { +} + +func (*ListEnterpriseSubscriptionLicensesFilter_IsArchived) isListEnterpriseSubscriptionLicensesFilter_Filter() { +} + +func (*ListEnterpriseSubscriptionLicensesFilter_LicenseKeySubstring) isListEnterpriseSubscriptionLicensesFilter_Filter() { +} + +type ListEnterpriseSubscriptionLicensesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Clients use this field to specify the maximum number of results to be + // returned by the server. The server may further constrain the maximum number + // of results returned in a single page. If the page_size is 0, the server + // will decide the number of results to be returned. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // The client uses this field to request a specific page of the list results. + // A zero value requests the first page. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + // + // TODO: Create an internal pagination token type: https://protobuf.dev/programming-guides/api/#encode-opaque-data-in-strings + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Filters define the lookup strategy for this list request. Multiple filters + // are treated as AND-concatenated. + Filters []*ListEnterpriseSubscriptionLicensesFilter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (x *ListEnterpriseSubscriptionLicensesRequest) Reset() { + *x = ListEnterpriseSubscriptionLicensesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnterpriseSubscriptionLicensesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnterpriseSubscriptionLicensesRequest) ProtoMessage() {} + +func (x *ListEnterpriseSubscriptionLicensesRequest) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_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 ListEnterpriseSubscriptionLicensesRequest.ProtoReflect.Descriptor instead. +func (*ListEnterpriseSubscriptionLicensesRequest) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{10} +} + +func (x *ListEnterpriseSubscriptionLicensesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListEnterpriseSubscriptionLicensesRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListEnterpriseSubscriptionLicensesRequest) GetFilters() []*ListEnterpriseSubscriptionLicensesFilter { + if x != nil { + return x.Filters + } + return nil +} + +type ListEnterpriseSubscriptionLicensesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field represents the pagination token to retrieve the next page of + // results. If the value is "", it means no further results for the request. + NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // The list of licenses that matched the given query. + Licenses []*EnterpriseSubscriptionLicense `protobuf:"bytes,2,rep,name=licenses,proto3" json:"licenses,omitempty"` +} + +func (x *ListEnterpriseSubscriptionLicensesResponse) Reset() { + *x = ListEnterpriseSubscriptionLicensesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnterpriseSubscriptionLicensesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnterpriseSubscriptionLicensesResponse) ProtoMessage() {} + +func (x *ListEnterpriseSubscriptionLicensesResponse) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_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 ListEnterpriseSubscriptionLicensesResponse.ProtoReflect.Descriptor instead. +func (*ListEnterpriseSubscriptionLicensesResponse) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{11} +} + +func (x *ListEnterpriseSubscriptionLicensesResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListEnterpriseSubscriptionLicensesResponse) GetLicenses() []*EnterpriseSubscriptionLicense { + if x != nil { + return x.Licenses + } + return nil +} + +// Information embedded into the license key. +type EnterpriseSubscriptionLicenseKey_Info struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The tags that indicate which features are activated by this license. + Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` + // The number of users for which this product subscription is valid. + UserCount uint64 `protobuf:"varint,2,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"` + // The expiration date of this product license. In license data, this is + // called 'expires_at', expressed as the number of seconds since the epoch. + ExpireTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` + // The Salesforce subscription ID associated with this product license. + SalesforceSubscriptionId string `protobuf:"bytes,4,opt,name=salesforce_subscription_id,json=salesforceSubscriptionId,proto3" json:"salesforce_subscription_id,omitempty"` + // The Salesforce opportunity ID associated with this product license. + SalesforceOpportunityId string `protobuf:"bytes,5,opt,name=salesforce_opportunity_id,json=salesforceOpportunityId,proto3" json:"salesforce_opportunity_id,omitempty"` +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) Reset() { + *x = EnterpriseSubscriptionLicenseKey_Info{} + if protoimpl.UnsafeEnabled { + mi := &file_subscriptions_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnterpriseSubscriptionLicenseKey_Info) ProtoMessage() {} + +func (x *EnterpriseSubscriptionLicenseKey_Info) ProtoReflect() protoreflect.Message { + mi := &file_subscriptions_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 EnterpriseSubscriptionLicenseKey_Info.ProtoReflect.Descriptor instead. +func (*EnterpriseSubscriptionLicenseKey_Info) Descriptor() ([]byte, []int) { + return file_subscriptions_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) GetUserCount() uint64 { + if x != nil { + return x.UserCount + } + return 0 +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) GetExpireTime() *timestamppb.Timestamp { + if x != nil { + return x.ExpireTime + } + return nil +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) GetSalesforceSubscriptionId() string { + if x != nil { + return x.SalesforceSubscriptionId + } + return "" +} + +func (x *EnterpriseSubscriptionLicenseKey_Info) GetSalesforceOpportunityId() string { + if x != nil { + return x.SalesforceOpportunityId + } + return "" +} + +var File_subscriptions_proto protoreflect.FileDescriptor + +var file_subscriptions_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb7, 0x02, 0x0a, 0x1f, 0x45, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, + 0x14, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 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, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x61, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x49, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x49, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, + 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, + 0x44, 0x10, 0x02, 0x22, 0xaf, 0x01, 0x0a, 0x16, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x62, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, + 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xd8, 0x03, 0x0a, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, + 0x66, 0x6f, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x4b, 0x65, 0x79, + 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, + 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, 0xf0, 0x01, + 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x66, + 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x73, 0x61, 0x6c, 0x65, + 0x73, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x19, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x5f, 0x6f, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x73, 0x61, 0x6c, 0x65, 0x73, 0x66, 0x6f, + 0x72, 0x63, 0x65, 0x4f, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x49, 0x64, + 0x22, 0xd9, 0x02, 0x0a, 0x26, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x14, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 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, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x68, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x50, 0x2e, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x5d, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, + 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x52, + 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x52, 0x45, 0x56, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0x03, 0x22, 0xa7, 0x02, 0x0a, + 0x1d, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x27, + 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x69, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x57, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x43, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, + 0x65, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x6c, + 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x82, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0c, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x60, 0x0a, 0x22, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0xae, 0x01, 0x0a, + 0x23, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0x5f, 0x0a, 0x0d, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x94, 0x02, + 0x0a, 0x28, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, + 0x6e, 0x73, 0x65, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 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, 0x5a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x44, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, + 0x63, 0x65, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x15, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x13, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x4b, 0x65, + 0x79, 0x53, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x08, 0x0a, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x22, 0xce, 0x01, 0x0a, 0x29, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 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, 0x12, 0x65, + 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x4b, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, + 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0xb2, 0x01, 0x0a, 0x2a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 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, 0x5c, 0x0a, 0x08, + 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, + 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, + 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, + 0x52, 0x08, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2a, 0x87, 0x01, 0x0a, 0x21, 0x45, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x34, 0x0a, 0x30, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x50, 0x52, 0x49, 0x53, 0x45, 0x5f, 0x53, + 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x49, 0x43, 0x45, + 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, 0x0a, 0x28, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x50, + 0x52, 0x49, 0x53, 0x45, 0x5f, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4b, + 0x45, 0x59, 0x10, 0x01, 0x32, 0xc1, 0x04, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xab, 0x01, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x44, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xb1, 0x01, 0x0a, 0x1b, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x45, 0x2e, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x46, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, + 0xc6, 0x01, 0x0a, 0x22, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, + 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x4c, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x4d, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x4a, 0x5a, 0x48, 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, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_subscriptions_proto_rawDescOnce sync.Once + file_subscriptions_proto_rawDescData = file_subscriptions_proto_rawDesc +) + +func file_subscriptions_proto_rawDescGZIP() []byte { + file_subscriptions_proto_rawDescOnce.Do(func() { + file_subscriptions_proto_rawDescData = protoimpl.X.CompressGZIP(file_subscriptions_proto_rawDescData) + }) + return file_subscriptions_proto_rawDescData +} + +var file_subscriptions_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_subscriptions_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_subscriptions_proto_goTypes = []interface{}{ + (EnterpriseSubscriptionLicenseType)(0), // 0: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseType + (EnterpriseSubscriptionCondition_Status)(0), // 1: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition.Status + (EnterpriseSubscriptionLicenseCondition_Status)(0), // 2: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition.Status + (*EnterpriseSubscriptionCondition)(nil), // 3: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition + (*EnterpriseSubscription)(nil), // 4: enterpriseportal.subscriptions.v1.EnterpriseSubscription + (*EnterpriseSubscriptionLicenseKey)(nil), // 5: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseKey + (*EnterpriseSubscriptionLicenseCondition)(nil), // 6: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition + (*EnterpriseSubscriptionLicense)(nil), // 7: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicense + (*GetEnterpriseSubscriptionRequest)(nil), // 8: enterpriseportal.subscriptions.v1.GetEnterpriseSubscriptionRequest + (*GetEnterpriseSubscriptionResponse)(nil), // 9: enterpriseportal.subscriptions.v1.GetEnterpriseSubscriptionResponse + (*ListEnterpriseSubscriptionsRequest)(nil), // 10: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionsRequest + (*ListEnterpriseSubscriptionsResponse)(nil), // 11: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionsResponse + (*ListEnterpriseSubscriptionLicensesFilter)(nil), // 12: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesFilter + (*ListEnterpriseSubscriptionLicensesRequest)(nil), // 13: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesRequest + (*ListEnterpriseSubscriptionLicensesResponse)(nil), // 14: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesResponse + (*EnterpriseSubscriptionLicenseKey_Info)(nil), // 15: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseKey.Info + (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp +} +var file_subscriptions_proto_depIdxs = []int32{ + 16, // 0: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition.last_transition_time:type_name -> google.protobuf.Timestamp + 1, // 1: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition.status:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition.Status + 3, // 2: enterpriseportal.subscriptions.v1.EnterpriseSubscription.conditions:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionCondition + 15, // 3: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseKey.info:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseKey.Info + 16, // 4: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition.last_transition_time:type_name -> google.protobuf.Timestamp + 2, // 5: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition.status:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition.Status + 6, // 6: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicense.conditions:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseCondition + 5, // 7: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicense.key:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseKey + 4, // 8: enterpriseportal.subscriptions.v1.GetEnterpriseSubscriptionResponse.subscription:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscription + 4, // 9: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionsResponse.subscriptions:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscription + 0, // 10: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesFilter.type:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseType + 12, // 11: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesRequest.filters:type_name -> enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesFilter + 7, // 12: enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesResponse.licenses:type_name -> enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicense + 16, // 13: enterpriseportal.subscriptions.v1.EnterpriseSubscriptionLicenseKey.Info.expire_time:type_name -> google.protobuf.Timestamp + 8, // 14: enterpriseportal.subscriptions.v1.SubscriptionsService.GetEnterpriseSubscription:input_type -> enterpriseportal.subscriptions.v1.GetEnterpriseSubscriptionRequest + 10, // 15: enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptions:input_type -> enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionsRequest + 13, // 16: enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptionLicenses:input_type -> enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesRequest + 9, // 17: enterpriseportal.subscriptions.v1.SubscriptionsService.GetEnterpriseSubscription:output_type -> enterpriseportal.subscriptions.v1.GetEnterpriseSubscriptionResponse + 11, // 18: enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptions:output_type -> enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionsResponse + 14, // 19: enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptionLicenses:output_type -> enterpriseportal.subscriptions.v1.ListEnterpriseSubscriptionLicensesResponse + 17, // [17:20] is the sub-list for method output_type + 14, // [14:17] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_subscriptions_proto_init() } +func file_subscriptions_proto_init() { + if File_subscriptions_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_subscriptions_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseSubscriptionCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseSubscription); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseSubscriptionLicenseKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseSubscriptionLicenseCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseSubscriptionLicense); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEnterpriseSubscriptionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEnterpriseSubscriptionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnterpriseSubscriptionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnterpriseSubscriptionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnterpriseSubscriptionLicensesFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnterpriseSubscriptionLicensesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnterpriseSubscriptionLicensesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_subscriptions_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseSubscriptionLicenseKey_Info); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_subscriptions_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*EnterpriseSubscriptionLicense_Key)(nil), + } + file_subscriptions_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*GetEnterpriseSubscriptionRequest_Id)(nil), + } + file_subscriptions_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*ListEnterpriseSubscriptionLicensesFilter_SubscriptionId)(nil), + (*ListEnterpriseSubscriptionLicensesFilter_Type)(nil), + (*ListEnterpriseSubscriptionLicensesFilter_IsArchived)(nil), + (*ListEnterpriseSubscriptionLicensesFilter_LicenseKeySubstring)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_subscriptions_proto_rawDesc, + NumEnums: 3, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_subscriptions_proto_goTypes, + DependencyIndexes: file_subscriptions_proto_depIdxs, + EnumInfos: file_subscriptions_proto_enumTypes, + MessageInfos: file_subscriptions_proto_msgTypes, + }.Build() + File_subscriptions_proto = out.File + file_subscriptions_proto_rawDesc = nil + file_subscriptions_proto_goTypes = nil + file_subscriptions_proto_depIdxs = nil +} diff --git a/lib/enterpriseportal/subscriptions/v1/subscriptions.proto b/lib/enterpriseportal/subscriptions/v1/subscriptions.proto new file mode 100644 index 00000000000..f855d634388 --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/subscriptions.proto @@ -0,0 +1,224 @@ +syntax = "proto3"; + +package enterpriseportal.subscriptions.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/v1"; + +// SubscriptionsService is the service API specification for Enterprise Portal's +// core Enterprise subscription and Enterprise license management capabilities. +// +// Extensions to support additional Enterprise services are expected to be +// defined as separate gRPC services in 'lib/enterpriseportal' - these are +// generally all be implemented by the Enterprise Portal Service directly for +// now. +// +// DRAFT STATE - see RFC 885: https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q +service SubscriptionsService { + // GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription. + rpc GetEnterpriseSubscription(GetEnterpriseSubscriptionRequest) returns (GetEnterpriseSubscriptionResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + + // ListEnterpriseSubscriptions queries for Enterprise subscriptions. + rpc ListEnterpriseSubscriptions(ListEnterpriseSubscriptionsRequest) returns (ListEnterpriseSubscriptionsResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } + + // ListEnterpriseSubscriptionLicenses queries for licenses associated with + // Enterprise subscription licenses, with the ability to list licenses across + // all subscriptions, or just a specific subscription. + // + // Each subscription owns a collection of licenses, typically a series of + // licenses with the most recent one being a subscription's active license. + rpc ListEnterpriseSubscriptionLicenses(ListEnterpriseSubscriptionLicensesRequest) returns (ListEnterpriseSubscriptionLicensesResponse) { + option idempotency_level = NO_SIDE_EFFECTS; + } +} + +message EnterpriseSubscriptionCondition { + enum Status { + STATUS_UNSPECIFIED = 0; + // License creation status. + STATUS_CREATED = 1; + // License archival status. i.e. 'is_archived' + STATUS_ARCHIVED = 2; + } + + // The time this subscription transitioned into this status. + google.protobuf.Timestamp last_transition_time = 1; + // Status is the type of status corresponding to this condition. + Status status = 2; + // Message is a description of the status transition and why it happened. + string message = 3; +} + +// EnterpriseSubscription represents a Sourcegraph Enterprise subscription. +message EnterpriseSubscription { + // ID is the external, prefixed UUID-format identifier for this subscription. + string id = 1; + // Timeline of key events corresponding to this subscription. + repeated EnterpriseSubscriptionCondition conditions = 2; + // Display name of this subscription, e.g. "Acme, Inc." + string display_name = 3; +} + +// EnterpriseSubscriptionLicenseKey is the classic offline Sourcegraph license +// key, and corresponds to ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY. +message EnterpriseSubscriptionLicenseKey { + // Information embedded into the license key. + message Info { + // The tags that indicate which features are activated by this license. + repeated string tags = 1; + // The number of users for which this product subscription is valid. + uint64 user_count = 2; + // The expiration date of this product license. In license data, this is + // called 'expires_at', expressed as the number of seconds since the epoch. + google.protobuf.Timestamp expire_time = 3; + // The Salesforce subscription ID associated with this product license. + string salesforce_subscription_id = 4; + // The Salesforce opportunity ID associated with this product license. + string salesforce_opportunity_id = 5; + } + + // Version of this classic license's information schema. It is incremented + // whenever a major change is made to the shape of Info to indicate what + // fields can be expected from the information embedded in the license key. + uint32 info_version = 1; + // Information embedded into the license key. + Info info = 2; + // The license key. + string license_key = 3; + // UUID of the known instance using this license key, self-reported from + // online license checks and pings. Also known as 'site ID'. + string instance_id = 4; +} + +message EnterpriseSubscriptionLicenseCondition { + enum Status { + STATUS_UNSPECIFIED = 0; + // License creation status. + STATUS_CREATED = 1; + // License archival status. i.e. 'is_archived' + STATUS_ARCHIVED = 2; + // License revocation status, i.e. 'is_revoked' + STATUS_REVOKED = 3; + } + + // The time this subscription transitioned into this status. + google.protobuf.Timestamp last_transition_time = 1; + // Status is the type of status corresponding to this condition. + Status status = 2; + // Message is a description of the status transition and why it happened. + string message = 3; +} + +// EnterpriseSubscriptionLicense represents a license for a Sourcegraph +// Enterprise product. Multiple licenses are associated with a single +// subscription, typically a series of licenses with the most recent one being +// a subscription's active license. +message EnterpriseSubscriptionLicense { + // ID is the external, prefixed UUID-format identifier for this license key. + string id = 1; + // The external, prefixed UUID-format identifier for the subscription that + // owns this license. + string subscription_id = 2; + // Timeline of key events corresponding to this license. + repeated EnterpriseSubscriptionLicenseCondition conditions = 3; + // License data, based on the type of the license. + oneof license { + EnterpriseSubscriptionLicenseKey key = 4; + } +} + +message GetEnterpriseSubscriptionRequest { + // Query specifies the lookup strategy for this get request. + oneof query { + // Look up a subscription using its external, prefixed UUID-format identifier. + string id = 1; + } +} + +message GetEnterpriseSubscriptionResponse { + EnterpriseSubscription subscription = 1; +} + +// EnterpriseSubscriptionLicenseType can be used to denote different types of +// licenses. +enum EnterpriseSubscriptionLicenseType { + ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_UNSPECIFIED = 0; + // The 'license key' type is the classic licensing mechanism that Sourcegraph + // has always had. They are signed by a private key and offline-validated by + // a public key that ships with all Sourcegraph builds. + // + // Each Subscription is expected to have at most one active Sourcegraph classic + // license used by a Sourcegraph instance at a time. + ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY = 1; +} + +message ListEnterpriseSubscriptionsRequest { + // Clients use this field to specify the maximum number of results to be + // returned by the server. The server may further constrain the maximum number + // of results returned in a single page. If the page_size is 0, the server + // will decide the number of results to be returned. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + int32 page_size = 1; + // The client uses this field to request a specific page of the list results. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + string page_token = 2; +} + +message ListEnterpriseSubscriptionsResponse { + // This field represents the pagination token to retrieve the next page of + // results. If the value is "", it means no further results for the request. + string next_page_token = 1; + // The list of subscriptions that matched the given query. + repeated EnterpriseSubscription subscriptions = 2; +} + +message ListEnterpriseSubscriptionLicensesFilter { + oneof filter { + // Return only licenses corresponding to the given subscription ID, with the + // most recently issued licenses first. + string subscription_id = 1; + // Return only licenses of the given type. + EnterpriseSubscriptionLicenseType type = 2; + // Return only licenses with the given archival status. + bool is_archived = 3; + // Return only product subscriptions whose license key contains this + // substring. + string license_key_substring = 4; + } +} + +message ListEnterpriseSubscriptionLicensesRequest { + // Clients use this field to specify the maximum number of results to be + // returned by the server. The server may further constrain the maximum number + // of results returned in a single page. If the page_size is 0, the server + // will decide the number of results to be returned. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + int32 page_size = 1; + // The client uses this field to request a specific page of the list results. + // A zero value requests the first page. + // + // See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination + // + // TODO: Create an internal pagination token type: https://protobuf.dev/programming-guides/api/#encode-opaque-data-in-strings + string page_token = 2; + + // Filters define the lookup strategy for this list request. Multiple filters + // are treated as AND-concatenated. + repeated ListEnterpriseSubscriptionLicensesFilter filters = 3; +} + +message ListEnterpriseSubscriptionLicensesResponse { + // This field represents the pagination token to retrieve the next page of + // results. If the value is "", it means no further results for the request. + string next_page_token = 1; + // The list of licenses that matched the given query. + repeated EnterpriseSubscriptionLicense licenses = 2; +} diff --git a/lib/enterpriseportal/subscriptions/v1/subscriptions_grpc.pb.go b/lib/enterpriseportal/subscriptions/v1/subscriptions_grpc.pb.go new file mode 100644 index 00000000000..242d94e42c8 --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/subscriptions_grpc.pb.go @@ -0,0 +1,199 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: subscriptions.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + SubscriptionsService_GetEnterpriseSubscription_FullMethodName = "/enterpriseportal.subscriptions.v1.SubscriptionsService/GetEnterpriseSubscription" + SubscriptionsService_ListEnterpriseSubscriptions_FullMethodName = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptions" + SubscriptionsService_ListEnterpriseSubscriptionLicenses_FullMethodName = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptionLicenses" +) + +// SubscriptionsServiceClient is the client API for SubscriptionsService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SubscriptionsServiceClient interface { + // GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription. + GetEnterpriseSubscription(ctx context.Context, in *GetEnterpriseSubscriptionRequest, opts ...grpc.CallOption) (*GetEnterpriseSubscriptionResponse, error) + // ListEnterpriseSubscriptions queries for Enterprise subscriptions. + ListEnterpriseSubscriptions(ctx context.Context, in *ListEnterpriseSubscriptionsRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionsResponse, error) + // ListEnterpriseSubscriptionLicenses queries for licenses associated with + // Enterprise subscription licenses, with the ability to list licenses across + // all subscriptions, or just a specific subscription. + // + // Each subscription owns a collection of licenses, typically a series of + // licenses with the most recent one being a subscription's active license. + ListEnterpriseSubscriptionLicenses(ctx context.Context, in *ListEnterpriseSubscriptionLicensesRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionLicensesResponse, error) +} + +type subscriptionsServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSubscriptionsServiceClient(cc grpc.ClientConnInterface) SubscriptionsServiceClient { + return &subscriptionsServiceClient{cc} +} + +func (c *subscriptionsServiceClient) GetEnterpriseSubscription(ctx context.Context, in *GetEnterpriseSubscriptionRequest, opts ...grpc.CallOption) (*GetEnterpriseSubscriptionResponse, error) { + out := new(GetEnterpriseSubscriptionResponse) + err := c.cc.Invoke(ctx, SubscriptionsService_GetEnterpriseSubscription_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriptionsServiceClient) ListEnterpriseSubscriptions(ctx context.Context, in *ListEnterpriseSubscriptionsRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionsResponse, error) { + out := new(ListEnterpriseSubscriptionsResponse) + err := c.cc.Invoke(ctx, SubscriptionsService_ListEnterpriseSubscriptions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *subscriptionsServiceClient) ListEnterpriseSubscriptionLicenses(ctx context.Context, in *ListEnterpriseSubscriptionLicensesRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionLicensesResponse, error) { + out := new(ListEnterpriseSubscriptionLicensesResponse) + err := c.cc.Invoke(ctx, SubscriptionsService_ListEnterpriseSubscriptionLicenses_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SubscriptionsServiceServer is the server API for SubscriptionsService service. +// All implementations must embed UnimplementedSubscriptionsServiceServer +// for forward compatibility +type SubscriptionsServiceServer interface { + // GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription. + GetEnterpriseSubscription(context.Context, *GetEnterpriseSubscriptionRequest) (*GetEnterpriseSubscriptionResponse, error) + // ListEnterpriseSubscriptions queries for Enterprise subscriptions. + ListEnterpriseSubscriptions(context.Context, *ListEnterpriseSubscriptionsRequest) (*ListEnterpriseSubscriptionsResponse, error) + // ListEnterpriseSubscriptionLicenses queries for licenses associated with + // Enterprise subscription licenses, with the ability to list licenses across + // all subscriptions, or just a specific subscription. + // + // Each subscription owns a collection of licenses, typically a series of + // licenses with the most recent one being a subscription's active license. + ListEnterpriseSubscriptionLicenses(context.Context, *ListEnterpriseSubscriptionLicensesRequest) (*ListEnterpriseSubscriptionLicensesResponse, error) + mustEmbedUnimplementedSubscriptionsServiceServer() +} + +// UnimplementedSubscriptionsServiceServer must be embedded to have forward compatible implementations. +type UnimplementedSubscriptionsServiceServer struct { +} + +func (UnimplementedSubscriptionsServiceServer) GetEnterpriseSubscription(context.Context, *GetEnterpriseSubscriptionRequest) (*GetEnterpriseSubscriptionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEnterpriseSubscription not implemented") +} +func (UnimplementedSubscriptionsServiceServer) ListEnterpriseSubscriptions(context.Context, *ListEnterpriseSubscriptionsRequest) (*ListEnterpriseSubscriptionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnterpriseSubscriptions not implemented") +} +func (UnimplementedSubscriptionsServiceServer) ListEnterpriseSubscriptionLicenses(context.Context, *ListEnterpriseSubscriptionLicensesRequest) (*ListEnterpriseSubscriptionLicensesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnterpriseSubscriptionLicenses not implemented") +} +func (UnimplementedSubscriptionsServiceServer) mustEmbedUnimplementedSubscriptionsServiceServer() {} + +// UnsafeSubscriptionsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SubscriptionsServiceServer will +// result in compilation errors. +type UnsafeSubscriptionsServiceServer interface { + mustEmbedUnimplementedSubscriptionsServiceServer() +} + +func RegisterSubscriptionsServiceServer(s grpc.ServiceRegistrar, srv SubscriptionsServiceServer) { + s.RegisterService(&SubscriptionsService_ServiceDesc, srv) +} + +func _SubscriptionsService_GetEnterpriseSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEnterpriseSubscriptionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriptionsServiceServer).GetEnterpriseSubscription(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SubscriptionsService_GetEnterpriseSubscription_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriptionsServiceServer).GetEnterpriseSubscription(ctx, req.(*GetEnterpriseSubscriptionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SubscriptionsService_ListEnterpriseSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnterpriseSubscriptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SubscriptionsService_ListEnterpriseSubscriptions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptions(ctx, req.(*ListEnterpriseSubscriptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SubscriptionsService_ListEnterpriseSubscriptionLicenses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnterpriseSubscriptionLicensesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptionLicenses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SubscriptionsService_ListEnterpriseSubscriptionLicenses_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptionLicenses(ctx, req.(*ListEnterpriseSubscriptionLicensesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SubscriptionsService_ServiceDesc is the grpc.ServiceDesc for SubscriptionsService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SubscriptionsService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "enterpriseportal.subscriptions.v1.SubscriptionsService", + HandlerType: (*SubscriptionsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetEnterpriseSubscription", + Handler: _SubscriptionsService_GetEnterpriseSubscription_Handler, + }, + { + MethodName: "ListEnterpriseSubscriptions", + Handler: _SubscriptionsService_ListEnterpriseSubscriptions_Handler, + }, + { + MethodName: "ListEnterpriseSubscriptionLicenses", + Handler: _SubscriptionsService_ListEnterpriseSubscriptionLicenses_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "subscriptions.proto", +} diff --git a/lib/enterpriseportal/subscriptions/v1/v1connect/BUILD.bazel b/lib/enterpriseportal/subscriptions/v1/v1connect/BUILD.bazel new file mode 100644 index 00000000000..5d123b3b6c4 --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/v1connect/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "v1connect", + srcs = ["subscriptions.connect.go"], + importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/v1/v1connect", + visibility = ["//visibility:public"], + deps = [ + "//lib/enterpriseportal/subscriptions/v1:subscriptions", + "@com_connectrpc_connect//:connect", + ], +) diff --git a/lib/enterpriseportal/subscriptions/v1/v1connect/subscriptions.connect.go b/lib/enterpriseportal/subscriptions/v1/v1connect/subscriptions.connect.go new file mode 100644 index 00000000000..49cd8a67a1f --- /dev/null +++ b/lib/enterpriseportal/subscriptions/v1/v1connect/subscriptions.connect.go @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: subscriptions.proto + +package v1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/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 ( + // SubscriptionsServiceName is the fully-qualified name of the SubscriptionsService service. + SubscriptionsServiceName = "enterpriseportal.subscriptions.v1.SubscriptionsService" +) + +// 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 ( + // SubscriptionsServiceGetEnterpriseSubscriptionProcedure is the fully-qualified name of the + // SubscriptionsService's GetEnterpriseSubscription RPC. + SubscriptionsServiceGetEnterpriseSubscriptionProcedure = "/enterpriseportal.subscriptions.v1.SubscriptionsService/GetEnterpriseSubscription" + // SubscriptionsServiceListEnterpriseSubscriptionsProcedure is the fully-qualified name of the + // SubscriptionsService's ListEnterpriseSubscriptions RPC. + SubscriptionsServiceListEnterpriseSubscriptionsProcedure = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptions" + // SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure is the fully-qualified name of + // the SubscriptionsService's ListEnterpriseSubscriptionLicenses RPC. + SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptionLicenses" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + subscriptionsServiceServiceDescriptor = v1.File_subscriptions_proto.Services().ByName("SubscriptionsService") + subscriptionsServiceGetEnterpriseSubscriptionMethodDescriptor = subscriptionsServiceServiceDescriptor.Methods().ByName("GetEnterpriseSubscription") + subscriptionsServiceListEnterpriseSubscriptionsMethodDescriptor = subscriptionsServiceServiceDescriptor.Methods().ByName("ListEnterpriseSubscriptions") + subscriptionsServiceListEnterpriseSubscriptionLicensesMethodDescriptor = subscriptionsServiceServiceDescriptor.Methods().ByName("ListEnterpriseSubscriptionLicenses") +) + +// SubscriptionsServiceClient is a client for the +// enterpriseportal.subscriptions.v1.SubscriptionsService service. +type SubscriptionsServiceClient interface { + // GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription. + GetEnterpriseSubscription(context.Context, *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error) + // ListEnterpriseSubscriptions queries for Enterprise subscriptions. + ListEnterpriseSubscriptions(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error) + // ListEnterpriseSubscriptionLicenses queries for licenses associated with + // Enterprise subscription licenses, with the ability to list licenses across + // all subscriptions, or just a specific subscription. + // + // Each subscription owns a collection of licenses, typically a series of + // licenses with the most recent one being a subscription's active license. + ListEnterpriseSubscriptionLicenses(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error) +} + +// NewSubscriptionsServiceClient constructs a client for the +// enterpriseportal.subscriptions.v1.SubscriptionsService 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 NewSubscriptionsServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SubscriptionsServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &subscriptionsServiceClient{ + getEnterpriseSubscription: connect.NewClient[v1.GetEnterpriseSubscriptionRequest, v1.GetEnterpriseSubscriptionResponse]( + httpClient, + baseURL+SubscriptionsServiceGetEnterpriseSubscriptionProcedure, + connect.WithSchema(subscriptionsServiceGetEnterpriseSubscriptionMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + listEnterpriseSubscriptions: connect.NewClient[v1.ListEnterpriseSubscriptionsRequest, v1.ListEnterpriseSubscriptionsResponse]( + httpClient, + baseURL+SubscriptionsServiceListEnterpriseSubscriptionsProcedure, + connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionsMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + listEnterpriseSubscriptionLicenses: connect.NewClient[v1.ListEnterpriseSubscriptionLicensesRequest, v1.ListEnterpriseSubscriptionLicensesResponse]( + httpClient, + baseURL+SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure, + connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionLicensesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithClientOptions(opts...), + ), + } +} + +// subscriptionsServiceClient implements SubscriptionsServiceClient. +type subscriptionsServiceClient struct { + getEnterpriseSubscription *connect.Client[v1.GetEnterpriseSubscriptionRequest, v1.GetEnterpriseSubscriptionResponse] + listEnterpriseSubscriptions *connect.Client[v1.ListEnterpriseSubscriptionsRequest, v1.ListEnterpriseSubscriptionsResponse] + listEnterpriseSubscriptionLicenses *connect.Client[v1.ListEnterpriseSubscriptionLicensesRequest, v1.ListEnterpriseSubscriptionLicensesResponse] +} + +// GetEnterpriseSubscription calls +// enterpriseportal.subscriptions.v1.SubscriptionsService.GetEnterpriseSubscription. +func (c *subscriptionsServiceClient) GetEnterpriseSubscription(ctx context.Context, req *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error) { + return c.getEnterpriseSubscription.CallUnary(ctx, req) +} + +// ListEnterpriseSubscriptions calls +// enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptions. +func (c *subscriptionsServiceClient) ListEnterpriseSubscriptions(ctx context.Context, req *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error) { + return c.listEnterpriseSubscriptions.CallUnary(ctx, req) +} + +// ListEnterpriseSubscriptionLicenses calls +// enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptionLicenses. +func (c *subscriptionsServiceClient) ListEnterpriseSubscriptionLicenses(ctx context.Context, req *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error) { + return c.listEnterpriseSubscriptionLicenses.CallUnary(ctx, req) +} + +// SubscriptionsServiceHandler is an implementation of the +// enterpriseportal.subscriptions.v1.SubscriptionsService service. +type SubscriptionsServiceHandler interface { + // GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription. + GetEnterpriseSubscription(context.Context, *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error) + // ListEnterpriseSubscriptions queries for Enterprise subscriptions. + ListEnterpriseSubscriptions(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error) + // ListEnterpriseSubscriptionLicenses queries for licenses associated with + // Enterprise subscription licenses, with the ability to list licenses across + // all subscriptions, or just a specific subscription. + // + // Each subscription owns a collection of licenses, typically a series of + // licenses with the most recent one being a subscription's active license. + ListEnterpriseSubscriptionLicenses(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error) +} + +// NewSubscriptionsServiceHandler 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 NewSubscriptionsServiceHandler(svc SubscriptionsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + subscriptionsServiceGetEnterpriseSubscriptionHandler := connect.NewUnaryHandler( + SubscriptionsServiceGetEnterpriseSubscriptionProcedure, + svc.GetEnterpriseSubscription, + connect.WithSchema(subscriptionsServiceGetEnterpriseSubscriptionMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + subscriptionsServiceListEnterpriseSubscriptionsHandler := connect.NewUnaryHandler( + SubscriptionsServiceListEnterpriseSubscriptionsProcedure, + svc.ListEnterpriseSubscriptions, + connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionsMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + subscriptionsServiceListEnterpriseSubscriptionLicensesHandler := connect.NewUnaryHandler( + SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure, + svc.ListEnterpriseSubscriptionLicenses, + connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionLicensesMethodDescriptor), + connect.WithIdempotency(connect.IdempotencyNoSideEffects), + connect.WithHandlerOptions(opts...), + ) + return "/enterpriseportal.subscriptions.v1.SubscriptionsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case SubscriptionsServiceGetEnterpriseSubscriptionProcedure: + subscriptionsServiceGetEnterpriseSubscriptionHandler.ServeHTTP(w, r) + case SubscriptionsServiceListEnterpriseSubscriptionsProcedure: + subscriptionsServiceListEnterpriseSubscriptionsHandler.ServeHTTP(w, r) + case SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure: + subscriptionsServiceListEnterpriseSubscriptionLicensesHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedSubscriptionsServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedSubscriptionsServiceHandler struct{} + +func (UnimplementedSubscriptionsServiceHandler) GetEnterpriseSubscription(context.Context, *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.subscriptions.v1.SubscriptionsService.GetEnterpriseSubscription is not implemented")) +} + +func (UnimplementedSubscriptionsServiceHandler) ListEnterpriseSubscriptions(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptions is not implemented")) +} + +func (UnimplementedSubscriptionsServiceHandler) ListEnterpriseSubscriptionLicenses(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptionLicenses is not implemented")) +} diff --git a/lib/go.mod b/lib/go.mod index b1dd22966e1..be26c6b4b85 100644 --- a/lib/go.mod +++ b/lib/go.mod @@ -5,6 +5,7 @@ go 1.22 toolchain go1.22.1 require ( + connectrpc.com/connect v1.16.1 github.com/Masterminds/semver v1.5.0 github.com/charmbracelet/glamour v0.5.0 github.com/cockroachdb/errors v1.11.1 @@ -37,7 +38,7 @@ require ( golang.org/x/sys v0.17.0 golang.org/x/term v0.17.0 google.golang.org/grpc v1.59.0 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/lib/go.sum b/lib/go.sum index ac34cf3d1f3..747cbda50a1 100644 --- a/lib/go.sum +++ b/lib/go.sum @@ -1,4 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +connectrpc.com/connect v1.16.1 h1:rOdrK/RTI/7TVnn3JsVxt3n028MlTRwmK5Q4heSpjis= +connectrpc.com/connect v1.16.1/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -528,8 +530,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/lib/managedservicesplatform/go.mod b/lib/managedservicesplatform/go.mod index 836781214b4..a5dab0c6c57 100644 --- a/lib/managedservicesplatform/go.mod +++ b/lib/managedservicesplatform/go.mod @@ -120,7 +120,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect google.golang.org/grpc v1.61.1 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect mvdan.cc/gofumpt v0.5.0 // indirect ) diff --git a/lib/managedservicesplatform/go.sum b/lib/managedservicesplatform/go.sum index 410306443b7..d3f3f58b168 100644 --- a/lib/managedservicesplatform/go.sum +++ b/lib/managedservicesplatform/go.sum @@ -523,8 +523,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/monitoring/go.mod b/monitoring/go.mod index 1ecfa3dbbe7..54b0e686acb 100644 --- a/monitoring/go.mod +++ b/monitoring/go.mod @@ -83,7 +83,7 @@ require ( golang.org/x/mod v0.15.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect mvdan.cc/gofumpt v0.4.0 // indirect ) diff --git a/monitoring/go.sum b/monitoring/go.sum index 2675148ed04..48cd603cf4d 100644 --- a/monitoring/go.sum +++ b/monitoring/go.sum @@ -692,8 +692,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=