diff --git a/go.mod b/go.mod index e1a6c6aee..80b742c36 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,9 @@ module go.bytebuilders.dev/cli -go 1.25.6 +go 1.26.0 require ( + connectrpc.com/connect v1.21.1 github.com/cert-manager/cert-manager v1.19.4 github.com/envoyproxy/gateway v1.6.3 github.com/fatih/color v1.18.0 @@ -12,16 +13,18 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/xid v1.6.0 github.com/spf13/cobra v1.10.1 + go.bytebuilders.dev/b3/apis v0.0.0-20261108173727-9aab4bbcfac7 go.bytebuilders.dev/catalog v0.0.19 go.bytebuilders.dev/client v0.0.4 go.bytebuilders.dev/license-verifier v0.15.0 - go.bytebuilders.dev/resource-model v0.3.0 gocloud.dev v0.41.0 gomodules.xyz/blobfs v0.2.2 gomodules.xyz/go-sh v0.2.0 gomodules.xyz/logs v0.0.7 gomodules.xyz/pointer v0.1.0 gomodules.xyz/x v0.0.17 + google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 + google.golang.org/protobuf v1.36.12 k8s.io/api v0.34.3 k8s.io/apimachinery v0.34.3 k8s.io/cli-runtime v0.34.3 @@ -41,6 +44,7 @@ require ( ) require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260415201107-50325440f8f2.1 // indirect cel.dev/expr v0.24.0 // indirect cloud.google.com/go v0.120.0 // indirect cloud.google.com/go/auth v0.17.0 // indirect @@ -203,6 +207,7 @@ require ( github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect github.com/zeebo/errs v1.4.0 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect + go.bytebuilders.dev/resource-model v0.3.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect @@ -237,9 +242,7 @@ require ( google.golang.org/api v0.256.0 // indirect google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect google.golang.org/grpc v1.76.0 // indirect - google.golang.org/protobuf v1.36.10 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -278,3 +281,5 @@ replace github.com/Masterminds/sprig/v3 => github.com/gomodules/sprig/v3 v3.2.3- replace sigs.k8s.io/controller-runtime => github.com/kmodules/controller-runtime v0.22.5-0.20251227114913-f011264689cd replace k8s.io/apiserver => github.com/kmodules/apiserver v0.34.4-0.20251227112449-07fa35efc6fc + +replace go.bytebuilders.dev/b3/apis => github.com/appscode-cloud/b3/apis v0.0.0-20261108173727-9aab4bbcfac7 diff --git a/go.sum b/go.sum index 64f80d5b5..8ff0b2ac7 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260415201107-50325440f8f2.1 h1:s6hzCXtND/ICdGPTMGk7C+/BFlr2Jg5GyH0NKf4XGXg= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260415201107-50325440f8f2.1/go.mod h1:tvtbpgaVXZX4g6Pn+AnzFycuRK3MOz5HJfEGeEllXYM= cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -32,6 +34,8 @@ cloud.google.com/go/storage v1.51.0 h1:ZVZ11zCiD7b3k+cH5lQs/qcNaoSz3U9I0jgwVzqDl cloud.google.com/go/storage v1.51.0/go.mod h1:YEJfu/Ki3i5oHC/7jyTgsGZwdQ8P9hqMqvpi5kRKGgc= cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4= cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= +connectrpc.com/connect v1.21.1 h1:h2kacdlzXpZU2OQFSv98xkjYXNUSr/ptxmGVbS/+CRM= +connectrpc.com/connect v1.21.1/go.mod h1:fhMcVJ5w6r/yTYhnkEbW6+sIF7OZ5Ay7KYgmfebh2ek= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -79,6 +83,8 @@ github.com/PuerkitoBio/purell v1.2.1 h1:QsZ4TjvwiMpat6gBCBxEQI0rcS9ehtkKtSpiUnd9 github.com/PuerkitoBio/purell v1.2.1/go.mod h1:ZwHcC/82TOaovDi//J/804umJFFmbOHPngi8iYYv/Eo= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/appscode-cloud/b3/apis v0.0.0-20261108173727-9aab4bbcfac7 h1:DUTRqm1J+kuLpmEbqwQQ7zSF86oKD/U3mFj+C3ysq5U= +github.com/appscode-cloud/b3/apis v0.0.0-20261108173727-9aab4bbcfac7/go.mod h1:mfUKXIT8VqyGjS+ecHykxMSLs/0lEkl/OdHPS4pNplI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -905,8 +911,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= -google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= 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= diff --git a/pkg/akp/client.go b/pkg/akp/client.go new file mode 100644 index 000000000..40c035e82 --- /dev/null +++ b/pkg/akp/client.go @@ -0,0 +1,160 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the AppsCode Community License 1.0.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package akp builds the clients of the AKP v2 API, served under /api/v2. +package akp + +import ( + "context" + "encoding/base64" + "errors" + "fmt" + "net/http" + "os" + "strings" + + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect" + userv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2" + "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect" + + "connectrpc.com/connect" + "github.com/nats-io/nats.go" +) + +const csrfCookie = "_csrf" + +// Credentials are what the CLI signs in to AKP with. +type Credentials struct { + Token string + Username string + Password string + Cookies []http.Cookie +} + +type Clients struct { + // Organization is the account to act on; empty means the caller's own. + Organization string + + Users userv2connect.UserServiceClient + Nats userv2connect.NatsServiceClient + Clusters clusterv2connect.ClusterServiceClient + Lifecycle clusterv2connect.LifecycleServiceClient +} + +func NewClients(endpoint, organization string, cred Credentials) *Clients { + baseURL := strings.TrimSuffix(endpoint, "/") + "/api/v2" + hc := http.DefaultClient + opts := []connect.ClientOption{connect.WithInterceptors(credentialsInterceptor(cred), errorInfoInterceptor(endpoint))} + return &Clients{ + Organization: organization, + Users: userv2connect.NewUserServiceClient(hc, baseURL, opts...), + Nats: userv2connect.NewNatsServiceClient(hc, baseURL, opts...), + Clusters: clusterv2connect.NewClusterServiceClient(hc, baseURL, opts...), + Lifecycle: clusterv2connect.NewLifecycleServiceClient(hc, baseURL, opts...), + } +} + +func credentialsInterceptor(cred Credentials) connect.UnaryInterceptorFunc { + return func(next connect.UnaryFunc) connect.UnaryFunc { + return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { + if req.Spec().IsClient { + setCredentials(req.Header(), cred) + } + return next(ctx, req) + } + } +} + +func setCredentials(h http.Header, cred Credentials) { + if cred.Token != "" { + h.Set("Authorization", "token "+cred.Token) + } + // Basic auth replaces the token, as it did with the AKP v1 API client. + if cred.Username != "" && cred.Password != "" { + h.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(cred.Username+":"+cred.Password))) + } + if len(cred.Cookies) == 0 { + return + } + cookies := make([]string, 0, len(cred.Cookies)) + for _, c := range cred.Cookies { + cookies = append(cookies, (&http.Cookie{Name: c.Name, Value: c.Value}).String()) + if c.Name == csrfCookie { + // AKP checks the CSRF token of a session caller. + h.Set("X-Csrf-Token", c.Value) + } + } + h.Set("Cookie", strings.Join(cookies, "; ")) +} + +// Owner is the account the CLI acts on: the chosen organization, else the caller. +func (c *Clients) Owner(ctx context.Context) (string, error) { + if c.Organization != "" { + return c.Organization, nil + } + resp, err := c.Users.GetAuthenticatedUser(ctx, connect.NewRequest(&userv2.GetAuthenticatedUserRequest{})) + if err != nil { + return "", fmt.Errorf("organization name wasn't provided. Automatic user detection failed with error: %w", err) + } + return resp.Msg.GetUser().GetUsername(), nil +} + +// NatsConnection connects to AKP's NATS with the caller's credentials. +func (c *Clients) NatsConnection(ctx context.Context, name string) (*nats.Conn, error) { + resp, err := c.Nats.GetNatsCredentials(ctx, connect.NewRequest(&userv2.GetNatsCredentialsRequest{})) + if err != nil { + return nil, err + } + if len(resp.Msg.GetEndpoints()) == 0 { + return nil, errors.New("AKP answered no NATS endpoint") + } + + credFile, err := os.CreateTemp("", "nats-*.creds") + if err != nil { + return nil, err + } + defer os.Remove(credFile.Name()) // nolint:errcheck + _, err = credFile.Write(resp.Msg.GetCredentials()) + if cerr := credFile.Close(); err == nil { + err = cerr + } + if err != nil { + return nil, err + } + + return nats.Connect( + resp.Msg.GetEndpoints()[0], + nats.Name(name), + nats.UserCredentials(credFile.Name()), + nats.NoReconnect(), + ) +} + +// ClusterStatus is a cluster with its live status. +func (c *Clients) ClusterStatus(ctx context.Context, owner, name string) (*clusterv2.Cluster, error) { + resp, err := c.Lifecycle.GetClusterStatus(ctx, connect.NewRequest(&clusterv2.GetClusterStatusRequest{ + Cluster: &clusterv2.ClusterRef{Owner: owner, Name: name}, + })) + if err != nil { + return nil, err + } + return resp.Msg.GetCluster(), nil +} + +func IsNotFound(err error) bool { + return connect.CodeOf(err) == connect.CodeNotFound +} diff --git a/pkg/akp/errors.go b/pkg/akp/errors.go new file mode 100644 index 000000000..5169d042b --- /dev/null +++ b/pkg/akp/errors.go @@ -0,0 +1,96 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the AppsCode Community License 1.0.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package akp + +import ( + "context" + "errors" + "fmt" + "strings" + + "connectrpc.com/connect" + "google.golang.org/genproto/googleapis/rpc/errdetails" +) + +// Domain and reasons of the google.rpc.ErrorInfo the AKP v2 API attaches to errors. +const ( + errorDomain = "akp" + reasonAccountInactive = "ACCOUNT_INACTIVE" + reasonLoginProhibited = "LOGIN_PROHIBITED" + reasonOrgSSORequired = "ORG_SSO_REQUIRED" +) + +// errorInfoInterceptor adds to an AKP v2 API error the page where the user can resolve it. +func errorInfoInterceptor(endpoint string) connect.UnaryInterceptorFunc { + return func(next connect.UnaryFunc) connect.UnaryFunc { + return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { + resp, err := next(ctx, req) + if err != nil { + err = withErrorInfo(err, endpoint) + } + return resp, err + } + } +} + +// withErrorInfo wraps err, so connect.CodeOf still sees its code. +func withErrorInfo(err error, endpoint string) error { + info := errorInfo(err) + if info == nil { + return err + } + md := info.GetMetadata() + page := func(key string) string { + if md[key] == "" { + return "" + } + return strings.TrimSuffix(endpoint, "/") + md[key] + } + + switch info.GetReason() { + case reasonAccountInactive: + if url := page("activation_path"); url != "" { + return fmt.Errorf("%w; activate the account at %s", err, url) + } + case reasonLoginProhibited: + if url := page("prohibit_login_path"); url != "" { + return fmt.Errorf("%w; the account may not sign in, see %s", err, url) + } + case reasonOrgSSORequired: + if url := page("oauth_callback_path"); url != "" { + return fmt.Errorf("%w; organization %s requires signing in through its SSO at %s", err, md["organization"], url) + } + } + return err +} + +func errorInfo(err error) *errdetails.ErrorInfo { + var ce *connect.Error + if !errors.As(err, &ce) { + return nil + } + for _, d := range ce.Details() { + v, err := d.Value() + if err != nil { + continue + } + if info, ok := v.(*errdetails.ErrorInfo); ok && info.GetDomain() == errorDomain { + return info + } + } + return nil +} diff --git a/pkg/akp/errors_test.go b/pkg/akp/errors_test.go new file mode 100644 index 000000000..664e8d5df --- /dev/null +++ b/pkg/akp/errors_test.go @@ -0,0 +1,86 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the AppsCode Community License 1.0.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package akp + +import ( + "errors" + "strings" + "testing" + + "connectrpc.com/connect" + "google.golang.org/genproto/googleapis/rpc/errdetails" +) + +func infoError(code connect.Code, reason string, md map[string]string) error { + ce := connect.NewError(code, errors.New("refused")) + d, err := connect.NewErrorDetail(&errdetails.ErrorInfo{Reason: reason, Domain: errorDomain, Metadata: md}) + if err != nil { + panic(err) + } + ce.AddDetail(d) + return ce +} + +func TestWithErrorInfo(t *testing.T) { + const endpoint = "https://akp.example.com/" + tests := []struct { + name string + err error + want string + }{ + { + name: "account inactive", + err: infoError(connect.CodeFailedPrecondition, reasonAccountInactive, map[string]string{"activation_path": "/accounts/user/activate"}), + want: "activate the account at https://akp.example.com/accounts/user/activate", + }, + { + name: "login prohibited", + err: infoError(connect.CodePermissionDenied, reasonLoginProhibited, map[string]string{"prohibit_login_path": "/accounts/user/prohibit_login"}), + want: "see https://akp.example.com/accounts/user/prohibit_login", + }, + { + name: "org sso required", + err: infoError(connect.CodePermissionDenied, reasonOrgSSORequired, map[string]string{ + "organization": "acme", + "oauth_callback_path": "/user/oauth2/org-3", + }), + want: "organization acme requires signing in through its SSO at https://akp.example.com/user/oauth2/org-3", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := withErrorInfo(tt.err, endpoint) + if !strings.Contains(got.Error(), tt.want) { + t.Errorf("got %q, want it to contain %q", got.Error(), tt.want) + } + if connect.CodeOf(got) != connect.CodeOf(tt.err) { + t.Errorf("code %v, want %v", connect.CodeOf(got), connect.CodeOf(tt.err)) + } + }) + } +} + +func TestWithErrorInfoLeavesOtherErrors(t *testing.T) { + plain := connect.NewError(connect.CodeNotFound, errors.New("no cluster")) + if got := withErrorInfo(plain, "https://akp.example.com"); got != error(plain) { + t.Errorf("got %v, want the error unchanged", got) + } + noPath := infoError(connect.CodeFailedPrecondition, reasonAccountInactive, nil) + if got := withErrorInfo(noPath, "https://akp.example.com"); got != noPath { + t.Errorf("got %v, want the error unchanged", got) + } +} diff --git a/pkg/cmds/cluster/check.go b/pkg/cmds/cluster/check.go index dbad90b88..1b2d17066 100644 --- a/pkg/cmds/cluster/check.go +++ b/pkg/cmds/cluster/check.go @@ -20,17 +20,17 @@ import ( "fmt" "os" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" "go.bytebuilders.dev/cli/pkg/config" "go.bytebuilders.dev/cli/pkg/printer" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "go.bytebuilders.dev/resource-model/apis/cluster/v1alpha1" + "connectrpc.com/connect" "github.com/spf13/cobra" rsapi "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" ) func newCmdCheck(f *config.Factory) *cobra.Command { - opts := clustermodel.CheckOptions{} + provider := &clusterv2.ProviderOptions{} var kubeConfigPath string cmd := &cobra.Command{ Use: "check", @@ -42,33 +42,48 @@ func newCmdCheck(f *config.Factory) *cobra.Command { if err != nil { return fmt.Errorf("failed to read Kubeconfig file. Reason: %w", err) } - opts.Provider.KubeConfig = string(data) + provider.Kubeconfig = string(data) } - cluster, err := checkClusterExistence(f, opts) + cluster, err := checkClusterExistence(cmd, f, provider) if err != nil { return fmt.Errorf("failed to check cluster existence. Reason: %w", err) } - if cluster.Status.Phase == rsapi.ClusterPhaseNotImported { + if cluster.GetStatus().GetPhase() == string(rsapi.ClusterPhaseNotImported) { fmt.Println("Cluster hasn't been imported yet.") return nil } return printer.PrintCluster(cluster) }, } - cmd.Flags().StringVar(&opts.Provider.Name, "provider", "", "Name of the cluster provider") - cmd.Flags().StringVar(&opts.Provider.Credential, "credential", "", "Name of the credential with access to the provider APIs") - cmd.Flags().StringVar(&opts.Provider.ClusterID, "id", "", "Provider specific cluster ID") - cmd.Flags().StringVar(&opts.Provider.Project, "project", "", "Project where the cluster belong (use for GKE)") - cmd.Flags().StringVar(&opts.Provider.Region, "region", "", "Region or location of the cluster") - cmd.Flags().StringVar(&opts.Provider.ResourceGroup, "resource-group", "", "Resource group of the cluster (use for AKS)") - cmd.Flags().StringVar(&kubeConfigPath, "kubeconfig", "", "Path of the kubeconfig file") + addProviderFlags(cmd, provider, &kubeConfigPath) return cmd } -func checkClusterExistence(f *config.Factory, opts clustermodel.CheckOptions) (*v1alpha1.ClusterInfo, error) { - c, err := f.Client() +func addProviderFlags(cmd *cobra.Command, provider *clusterv2.ProviderOptions, kubeConfigPath *string) { + cmd.Flags().StringVar(&provider.Name, "provider", "", "Name of the cluster provider") + cmd.Flags().StringVar(&provider.Credential, "credential", "", "Name of the credential with access to the provider APIs") + cmd.Flags().StringVar(&provider.ClusterId, "id", "", "Provider specific cluster ID") + cmd.Flags().StringVar(&provider.Project, "project", "", "Project where the cluster belong (use for GKE)") + cmd.Flags().StringVar(&provider.Region, "region", "", "Region or location of the cluster") + cmd.Flags().StringVar(&provider.ResourceGroup, "resource-group", "", "Resource group of the cluster (use for AKS)") + cmd.Flags().StringVar(kubeConfigPath, "kubeconfig", "", "Path of the kubeconfig file") +} + +func checkClusterExistence(cmd *cobra.Command, f *config.Factory, provider *clusterv2.ProviderOptions) (*clusterv2.Cluster, error) { + c, err := f.Clients() + if err != nil { + return nil, err + } + owner, err := c.Owner(cmd.Context()) + if err != nil { + return nil, err + } + resp, err := c.Lifecycle.CheckCluster(cmd.Context(), connect.NewRequest(&clusterv2.CheckClusterRequest{ + Owner: owner, + Provider: provider, + })) if err != nil { return nil, err } - return c.CheckClusterExistence(opts) + return resp.Msg.GetCluster(), nil } diff --git a/pkg/cmds/cluster/cluster.go b/pkg/cmds/cluster/cluster.go index 072c0fa14..999175204 100644 --- a/pkg/cmds/cluster/cluster.go +++ b/pkg/cmds/cluster/cluster.go @@ -17,9 +17,9 @@ limitations under the License. package cluster import ( + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" "go.bytebuilders.dev/cli/pkg/config" "go.bytebuilders.dev/cli/pkg/printer" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" "github.com/spf13/cobra" ) @@ -42,9 +42,11 @@ func NewCmdCluster(f *config.Factory) *cobra.Command { return cmd } -var defaultFeatureSet = []clustermodel.FeatureSet{ - { - Name: "opscenter-core", - Features: []string{"kube-ui-server"}, - }, +func defaultFeatureSets() []*clusterv2.FeatureSet { + return []*clusterv2.FeatureSet{ + { + Name: "opscenter-core", + Features: []string{"kube-ui-server"}, + }, + } } diff --git a/pkg/cmds/cluster/connect.go b/pkg/cmds/cluster/connect.go index 092c2ceff..f08442f1b 100644 --- a/pkg/cmds/cluster/connect.go +++ b/pkg/cmds/cluster/connect.go @@ -17,20 +17,19 @@ limitations under the License. package cluster import ( - "errors" "fmt" "os" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/cli/pkg/akp" "go.bytebuilders.dev/cli/pkg/config" - ace "go.bytebuilders.dev/client" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "go.bytebuilders.dev/resource-model/apis/cluster/v1alpha1" + "connectrpc.com/connect" "github.com/spf13/cobra" ) func newCmdConnect(f *config.Factory) *cobra.Command { - opts := clustermodel.ConnectOptions{} + req := &clusterv2.ConnectClusterRequest{Cluster: &clusterv2.ClusterRef{}} var kubeConfigPath string cmd := &cobra.Command{ Use: "connect", @@ -42,11 +41,11 @@ func newCmdConnect(f *config.Factory) *cobra.Command { if err != nil { return fmt.Errorf("failed to read Kubeconfig file. Reason: %w", err) } - opts.KubeConfig = string(data) + req.Kubeconfig = string(data) } - _, err := connectCluster(f, opts) + err := connectCluster(cmd, f, req) if err != nil { - if errors.Is(err, ace.ErrNotFound) { + if akp.IsNotFound(err) { fmt.Println("Provided cluster does not exist. Please provide a valid cluster name.") return nil } @@ -56,16 +55,21 @@ func newCmdConnect(f *config.Factory) *cobra.Command { return nil }, } - cmd.Flags().StringVar(&opts.Name, "name", "", "Name of the cluster to get") - cmd.Flags().StringVar(&opts.Credential, "credential", "", "Name of the credential to use to connect with the cluster") + cmd.Flags().StringVar(&req.Cluster.Name, "name", "", "Name of the cluster to get") + cmd.Flags().StringVar(&req.Credential, "credential", "", "Name of the credential to use to connect with the cluster") cmd.Flags().StringVar(&kubeConfigPath, "kubeconfig", "", "Path of the kubeconfig file") return cmd } -func connectCluster(f *config.Factory, opts clustermodel.ConnectOptions) (*v1alpha1.ClusterInfo, error) { - c, err := f.Client() +func connectCluster(cmd *cobra.Command, f *config.Factory, req *clusterv2.ConnectClusterRequest) error { + c, err := f.Clients() if err != nil { - return nil, err + return err } - return c.ConnectCluster(opts) + req.Cluster.Owner, err = c.Owner(cmd.Context()) + if err != nil { + return err + } + _, err = c.Lifecycle.ConnectCluster(cmd.Context(), connect.NewRequest(req)) + return err } diff --git a/pkg/cmds/cluster/get.go b/pkg/cmds/cluster/get.go index 3ed220157..5ec4c09a4 100644 --- a/pkg/cmds/cluster/get.go +++ b/pkg/cmds/cluster/get.go @@ -17,28 +17,26 @@ limitations under the License. package cluster import ( - "errors" "fmt" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/cli/pkg/akp" "go.bytebuilders.dev/cli/pkg/config" "go.bytebuilders.dev/cli/pkg/printer" - ace "go.bytebuilders.dev/client" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "go.bytebuilders.dev/resource-model/apis/cluster/v1alpha1" "github.com/spf13/cobra" ) func newCmdGet(f *config.Factory) *cobra.Command { - opts := clustermodel.GetOptions{} + var name string cmd := &cobra.Command{ Use: "get", Short: "Get a particular cluster information", DisableAutoGenTag: true, RunE: func(cmd *cobra.Command, args []string) error { - cluster, err := getCluster(f, opts) + cluster, err := getCluster(cmd, f, name) if err != nil { - if errors.Is(err, ace.ErrNotFound) { + if akp.IsNotFound(err) { fmt.Println("Cluster does not exist.") return nil } @@ -47,14 +45,18 @@ func newCmdGet(f *config.Factory) *cobra.Command { return printer.PrintCluster(cluster) }, } - cmd.Flags().StringVar(&opts.Name, "name", "", "Name of the cluster to get") + cmd.Flags().StringVar(&name, "name", "", "Name of the cluster to get") return cmd } -func getCluster(f *config.Factory, opts clustermodel.GetOptions) (*v1alpha1.ClusterInfo, error) { - c, err := f.Client() +func getCluster(cmd *cobra.Command, f *config.Factory, name string) (*clusterv2.Cluster, error) { + c, err := f.Clients() if err != nil { return nil, err } - return c.GetCluster(opts) + owner, err := c.Owner(cmd.Context()) + if err != nil { + return nil, err + } + return c.ClusterStatus(cmd.Context(), owner, name) } diff --git a/pkg/cmds/cluster/import.go b/pkg/cmds/cluster/import.go index c6420e834..6464d76b2 100644 --- a/pkg/cmds/cluster/import.go +++ b/pkg/cmds/cluster/import.go @@ -17,21 +17,25 @@ limitations under the License. package cluster import ( + "context" "fmt" "os" "strings" - "sync" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/cli/pkg/akp" "go.bytebuilders.dev/cli/pkg/config" - "go.bytebuilders.dev/cli/pkg/printer" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "github.com/rs/xid" + "connectrpc.com/connect" "github.com/spf13/cobra" ) func newCmdImport(f *config.Factory) *cobra.Command { - opts := clustermodel.ImportOptions{} + req := &clusterv2.ImportClusterRequest{ + Names: &clusterv2.ClusterNames{}, + Provider: &clusterv2.ProviderOptions{}, + Components: &clusterv2.ComponentOptions{}, + } var featureSet map[string]string var kubeConfigPath string cmd := &cobra.Command{ @@ -44,81 +48,49 @@ func newCmdImport(f *config.Factory) *cobra.Command { if err != nil { return fmt.Errorf("failed to read Kubeconfig file. Reason: %w", err) } - opts.Provider.KubeConfig = string(data) + req.Provider.Kubeconfig = string(data) } - opts.Components.FeatureSets = getFeatureSetsInfo(featureSet) + req.Components.FeatureSets = getFeatureSetsInfo(featureSet) - err := importCluster(f, opts) + err := importCluster(cmd, f, req) if err != nil { return fmt.Errorf("failed to import cluster. Reason: %w", err) } return nil }, } - cmd.Flags().StringVar(&opts.Provider.Name, "provider", "", "Name of the cluster provider") - cmd.Flags().StringVar(&opts.Provider.Credential, "credential", "", "Name of the credential with access to the provider APIs") - cmd.Flags().StringVar(&opts.Provider.ClusterID, "id", "", "Provider specific cluster ID") - cmd.Flags().StringVar(&opts.Provider.Project, "project", "", "Project where the cluster belong (use for GKE)") - cmd.Flags().StringVar(&opts.Provider.Region, "region", "", "Region or location of the cluster") - cmd.Flags().StringVar(&opts.Provider.ResourceGroup, "resource-group", "", "Resource group of the cluster (use for AKS)") - cmd.Flags().StringVar(&kubeConfigPath, "kubeconfig", "", "Path of the kubeconfig file") + addProviderFlags(cmd, req.Provider, &kubeConfigPath) - cmd.Flags().StringVar(&opts.BasicInfo.DisplayName, "display-name", "", "Display name of the cluster") - cmd.Flags().StringVar(&opts.BasicInfo.Name, "name", "", "Unique name across all imported clusters of all provider") - cmd.Flags().BoolVar(&opts.Components.FluxCD, "install-fluxcd", true, "Specify whether to install FluxCD or not (default true).") - cmd.Flags().BoolVar(&opts.Components.AllFeatures, "all-features", false, "Install all features") + cmd.Flags().StringVar(&req.Names.DisplayName, "display-name", "", "Display name of the cluster") + cmd.Flags().StringVar(&req.Names.Name, "name", "", "Unique name across all imported clusters of all provider") + cmd.Flags().BoolVar(&req.Components.FluxCd, "install-fluxcd", true, "Specify whether to install FluxCD or not (default true).") + cmd.Flags().BoolVar(&req.Components.AllFeatures, "all-features", false, "Install all features") cmd.Flags().StringToStringVar(&featureSet, "featureset", featureSet, "List of features") return cmd } -func importCluster(f *config.Factory, opts clustermodel.ImportOptions) error { +func importCluster(cmd *cobra.Command, f *config.Factory, req *clusterv2.ImportClusterRequest) error { fmt.Println("Importing cluster......") - c, err := f.Client() - if err != nil { - return err - } - nc, err := c.NewNatsConnection("ace-cli") - if err != nil { + return runOperation(cmd, f, "the import", func(ctx context.Context, c *akp.Clients, owner string, op *clusterv2.OperationOptions) error { + req.Owner = owner + req.Operation = op + _, err := c.Lifecycle.ImportCluster(ctx, connect.NewRequest(req)) return err - } - defer nc.Close() // nolint:errcheck - - responseID := xid.New().String() - wg := sync.WaitGroup{} - wg.Add(1) - done := f.Canceller() - go func() { - err := printer.PrintNATSJobSteps(&wg, nc, responseID, done) - if err != nil { - fmt.Println("Failed to log the import steps. Reason: ", err) - } - }() - - _, err = c.ImportCluster(opts, responseID) - if err != nil { - close(done) - return err - } - wg.Wait() - - return nil + }) } -func getFeatureSetsInfo(featureSets map[string]string) []clustermodel.FeatureSet { - var desiredFeatureSets []clustermodel.FeatureSet +func getFeatureSetsInfo(featureSets map[string]string) []*clusterv2.FeatureSet { if len(featureSets) == 0 { - return defaultFeatureSet + return defaultFeatureSets() } + desiredFeatureSets := make([]*clusterv2.FeatureSet, 0, len(featureSets)) for key, val := range featureSets { - featureSet := clustermodel.FeatureSet{ + desiredFeatureSets = append(desiredFeatureSets, &clusterv2.FeatureSet{ Name: key, Features: strings.Split(val, ","), - } - - desiredFeatureSets = append(desiredFeatureSets, featureSet) + }) } - return desiredFeatureSets } diff --git a/pkg/cmds/cluster/list.go b/pkg/cmds/cluster/list.go index 1ab36a661..9bf0b9e90 100644 --- a/pkg/cmds/cluster/list.go +++ b/pkg/cmds/cluster/list.go @@ -18,55 +18,66 @@ package cluster import ( "fmt" + "strings" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" "go.bytebuilders.dev/cli/pkg/config" "go.bytebuilders.dev/cli/pkg/printer" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "go.bytebuilders.dev/resource-model/apis/cluster/v1alpha1" + "connectrpc.com/connect" "github.com/spf13/cobra" ) func newCmdList(f *config.Factory) *cobra.Command { - listOptions := clustermodel.ListOptions{} + var provider string cmd := &cobra.Command{ Use: "list", Short: "List cluster managed by ACE platform", DisableAutoGenTag: true, RunE: func(cmd *cobra.Command, args []string) error { - clusters, err := listClusters(f, listOptions) + clusters, err := listClusters(cmd, f, provider) if err != nil { return fmt.Errorf("failed to list clusters. Reason: %w", err) } - if len(clusters.Items) == 0 { + if len(clusters) == 0 { fmt.Println("No cluster found.") return nil } - return printer.PrintClusterList(clusters.Items) + return printer.PrintClusterList(clusters) }, } - cmd.Flags().StringVar(&listOptions.Provider, "provider", "", "List cluster only for this provider") + cmd.Flags().StringVar(&provider, "provider", "", "List cluster only for this provider") return cmd } -func listClusters(f *config.Factory, opts clustermodel.ListOptions) (*v1alpha1.ClusterInfoList, error) { - c, err := f.Client() +func listClusters(cmd *cobra.Command, f *config.Factory, provider string) ([]*clusterv2.Cluster, error) { + ctx := cmd.Context() + c, err := f.Clients() if err != nil { return nil, err } - - clusters, err := c.ListClusters(opts) + owner, err := c.Owner(ctx) + if err != nil { + return nil, err + } + resp, err := c.Clusters.ListClusters(ctx, connect.NewRequest(&clusterv2.ListClustersRequest{Owner: owner})) if err != nil { return nil, err } - for i := range clusters.Items { - cluster, err := c.GetCluster(clustermodel.GetOptions{ - Name: clusters.Items[i].Spec.Name, - }) + + var clusters []*clusterv2.Cluster + for _, cluster := range resp.Msg.GetClusters() { + // The API lists every provider's clusters. + if provider != "" && !strings.EqualFold(cluster.GetProvider(), provider) { + continue + } + // The list carries stored records; the live status is asked per cluster. + live, err := c.ClusterStatus(ctx, owner, cluster.GetName()) if err != nil { return nil, err } - clusters.Items[i].Status = cluster.Status + cluster.Status = live.GetStatus() + clusters = append(clusters, cluster) } return clusters, nil } diff --git a/pkg/cmds/cluster/operation.go b/pkg/cmds/cluster/operation.go new file mode 100644 index 000000000..c15b932eb --- /dev/null +++ b/pkg/cmds/cluster/operation.go @@ -0,0 +1,73 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the AppsCode Community License 1.0.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "context" + "fmt" + "sync" + + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/cli/pkg/akp" + "go.bytebuilders.dev/cli/pkg/config" + "go.bytebuilders.dev/cli/pkg/printer" + + "github.com/rs/xid" + "github.com/spf13/cobra" +) + +type operationStarter func(ctx context.Context, c *akp.Clients, owner string, op *clusterv2.OperationOptions) error + +// runOperation starts a cluster operation and prints its steps, which AKP publishes on NATS +// under the operation's response ID, until it ends. +func runOperation(cmd *cobra.Command, f *config.Factory, steps string, start operationStarter) error { + ctx := cmd.Context() + c, err := f.Clients() + if err != nil { + return err + } + owner, err := c.Owner(ctx) + if err != nil { + return err + } + + nc, err := c.NatsConnection(ctx, "ace-cli") + if err != nil { + return err + } + defer nc.Close() // nolint:errcheck + + responseID := xid.New().String() + wg := sync.WaitGroup{} + wg.Add(1) + done := f.Canceller() + go func() { + err := printer.PrintNATSJobSteps(&wg, nc, responseID, done) + if err != nil { + fmt.Printf("Failed to log %s steps. Reason: %v\n", steps, err) + } + }() + + err = start(ctx, c, owner, &clusterv2.OperationOptions{ResponseId: responseID}) + if err != nil { + close(done) + return err + } + wg.Wait() + + return nil +} diff --git a/pkg/cmds/cluster/reconfigure.go b/pkg/cmds/cluster/reconfigure.go index 9482df481..ffe6e992f 100644 --- a/pkg/cmds/cluster/reconfigure.go +++ b/pkg/cmds/cluster/reconfigure.go @@ -17,32 +17,33 @@ limitations under the License. package cluster import ( - "errors" + "context" "fmt" - "sync" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/cli/pkg/akp" "go.bytebuilders.dev/cli/pkg/config" - "go.bytebuilders.dev/cli/pkg/printer" - ace "go.bytebuilders.dev/client" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "github.com/rs/xid" + "connectrpc.com/connect" "github.com/spf13/cobra" ) func newCmdReconfigure(f *config.Factory) *cobra.Command { - opts := clustermodel.ReconfigureOptions{} + req := &clusterv2.ReconfigureClusterRequest{ + Cluster: &clusterv2.ClusterRef{}, + Components: &clusterv2.ComponentOptions{}, + } cmd := &cobra.Command{ Use: "reconfigure", Short: "Re-install cluster components to fix common issues", DisableAutoGenTag: true, RunE: func(cmd *cobra.Command, args []string) error { - if !opts.Components.AllFeatures { - opts.Components.FeatureSets = defaultFeatureSet + if !req.Components.AllFeatures { + req.Components.FeatureSets = defaultFeatureSets() } - err := reconfigureCluster(f, opts) + err := reconfigureCluster(cmd, f, req) if err != nil { - if errors.Is(err, ace.ErrNotFound) { + if akp.IsNotFound(err) { fmt.Println("Provided cluster does not exist. Please provide a valid cluster name.") return nil } @@ -51,42 +52,18 @@ func newCmdReconfigure(f *config.Factory) *cobra.Command { return nil }, } - cmd.Flags().StringVar(&opts.BasicInfo.Name, "name", "", "Name of the cluster to get") - cmd.Flags().BoolVar(&opts.Components.FluxCD, "install-fluxcd", true, "Specify whether to install FluxCD or not (default true).") - cmd.Flags().BoolVar(&opts.Components.AllFeatures, "all-features", false, "Install all features") + cmd.Flags().StringVar(&req.Cluster.Name, "name", "", "Name of the cluster to get") + cmd.Flags().BoolVar(&req.Components.FluxCd, "install-fluxcd", true, "Specify whether to install FluxCD or not (default true).") + cmd.Flags().BoolVar(&req.Components.AllFeatures, "all-features", false, "Install all features") return cmd } -func reconfigureCluster(f *config.Factory, opts clustermodel.ReconfigureOptions) error { +func reconfigureCluster(cmd *cobra.Command, f *config.Factory, req *clusterv2.ReconfigureClusterRequest) error { fmt.Println("Reconfiguring cluster......") - c, err := f.Client() - if err != nil { - return err - } - - nc, err := c.NewNatsConnection("ace-cli") - if err != nil { - return err - } - defer nc.Close() // nolint:errcheck - - responseID := xid.New().String() - wg := sync.WaitGroup{} - wg.Add(1) - done := f.Canceller() - go func() { - err := printer.PrintNATSJobSteps(&wg, nc, responseID, done) - if err != nil { - fmt.Println("Failed to log reconfigure steps. Reason: ", err) - } - }() - - _, err = c.ReconfigureCluster(opts, responseID) - if err != nil { - close(done) + return runOperation(cmd, f, "reconfigure", func(ctx context.Context, c *akp.Clients, owner string, op *clusterv2.OperationOptions) error { + req.Cluster.Owner = owner + req.Operation = op + _, err := c.Lifecycle.ReconfigureCluster(ctx, connect.NewRequest(req)) return err - } - wg.Wait() - - return nil + }) } diff --git a/pkg/cmds/cluster/remove.go b/pkg/cmds/cluster/remove.go index 24827e02e..8110307b3 100644 --- a/pkg/cmds/cluster/remove.go +++ b/pkg/cmds/cluster/remove.go @@ -17,32 +17,33 @@ limitations under the License. package cluster import ( - "errors" + "context" "fmt" - "sync" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "go.bytebuilders.dev/cli/pkg/akp" "go.bytebuilders.dev/cli/pkg/config" - "go.bytebuilders.dev/cli/pkg/printer" - ace "go.bytebuilders.dev/client" - clustermodel "go.bytebuilders.dev/resource-model/apis/cluster" - "github.com/rs/xid" + "connectrpc.com/connect" "github.com/spf13/cobra" ) func newCmdRemove(f *config.Factory) *cobra.Command { - opts := clustermodel.RemovalOptions{} + req := &clusterv2.RemoveClusterRequest{ + Cluster: &clusterv2.ClusterRef{}, + Components: &clusterv2.ComponentOptions{}, + } cmd := &cobra.Command{ Use: "remove", Short: "Remove a cluster from ACE platform", DisableAutoGenTag: true, RunE: func(cmd *cobra.Command, args []string) error { - if !opts.Components.AllFeatures { - opts.Components.FeatureSets = defaultFeatureSet + if !req.Components.AllFeatures { + req.Components.FeatureSets = defaultFeatureSets() } - err := removeCluster(f, opts) + err := removeCluster(cmd, f, req) if err != nil { - if errors.Is(err, ace.ErrNotFound) { + if akp.IsNotFound(err) { fmt.Println("Cluster has been removed already.") return nil } @@ -51,42 +52,18 @@ func newCmdRemove(f *config.Factory) *cobra.Command { return nil }, } - cmd.Flags().StringVar(&opts.Name, "name", "", "Name of the cluster to get") - cmd.Flags().BoolVar(&opts.Components.FluxCD, "remove-fluxcd", true, "Specify whether to remove FluxCD or not (default true).") - cmd.Flags().BoolVar(&opts.Components.AllFeatures, "all-features", false, "Remove all features") + cmd.Flags().StringVar(&req.Cluster.Name, "name", "", "Name of the cluster to get") + cmd.Flags().BoolVar(&req.Components.FluxCd, "remove-fluxcd", true, "Specify whether to remove FluxCD or not (default true).") + cmd.Flags().BoolVar(&req.Components.AllFeatures, "all-features", false, "Remove all features") return cmd } -func removeCluster(f *config.Factory, opts clustermodel.RemovalOptions) error { +func removeCluster(cmd *cobra.Command, f *config.Factory, req *clusterv2.RemoveClusterRequest) error { fmt.Println("Removing cluster......") - c, err := f.Client() - if err != nil { - return err - } - - nc, err := c.NewNatsConnection("ace-cli") - if err != nil { - return err - } - defer nc.Close() // nolint:errcheck - - responseID := xid.New().String() - wg := sync.WaitGroup{} - wg.Add(1) - done := f.Canceller() - go func() { - err := printer.PrintNATSJobSteps(&wg, nc, responseID, done) - if err != nil { - fmt.Println("Failed to log removal steps. Reason: ", err) - } - }() - - err = c.RemoveCluster(opts, responseID) - if err != nil { - close(done) + return runOperation(cmd, f, "removal", func(ctx context.Context, c *akp.Clients, owner string, op *clusterv2.OperationOptions) error { + req.Cluster.Owner = owner + req.Operation = op + _, err := c.Lifecycle.RemoveCluster(ctx, connect.NewRequest(req)) return err - } - wg.Wait() - - return nil + }) } diff --git a/pkg/cmds/root.go b/pkg/cmds/root.go index 540c5ebb7..82385196f 100644 --- a/pkg/cmds/root.go +++ b/pkg/cmds/root.go @@ -21,6 +21,7 @@ import ( "os/signal" "syscall" + "go.bytebuilders.dev/cli/pkg/akp" "go.bytebuilders.dev/cli/pkg/cmds/auth" "go.bytebuilders.dev/cli/pkg/cmds/cloud_swap" "go.bytebuilders.dev/cli/pkg/cmds/cluster" @@ -29,7 +30,6 @@ import ( "go.bytebuilders.dev/cli/pkg/cmds/expose" "go.bytebuilders.dev/cli/pkg/cmds/installer" "go.bytebuilders.dev/cli/pkg/config" - ace "go.bytebuilders.dev/client" "github.com/spf13/cobra" v "gomodules.xyz/x/version" @@ -46,7 +46,7 @@ func NewRootCmd() *cobra.Command { rootCmd.PersistentFlags().StringVar(&config.Organization, "org", "", "Use this organization for instead of auto-detecting current one") f := &config.Factory{ - Client: aceClient, + Clients: akpClients, Canceller: canceller, } rootCmd.AddCommand(cmdconfig.NewCmdConfig()) @@ -65,32 +65,23 @@ func NewRootCmd() *cobra.Command { return rootCmd } -func aceClient() (*ace.Client, error) { +func akpClients() (*akp.Clients, error) { cfg, err := config.GetContext() if err != nil { return nil, err } - client := ace.NewClient(cfg.Endpoint) - if config.Organization != "" { - client = client.WithOrganization(config.Organization) - } - - if cfg.Token != "" { - client = client.WithAccessToken(cfg.Token) - } - - if cred := auth.GetBasicAuthCredFromEnv(); cred != nil { - client = client.WithBasicAuth(cred.Username, cred.Password) + cred := akp.Credentials{ + Token: cfg.Token, + Cookies: cfg.Cookies, } if token := auth.GetAuthTokenFromEnv(); token != "" { - client = client.WithAccessToken(token) + cred.Token = token } - - if cfg.Cookies != nil { - client = client.WithCookies(cfg.Cookies) + if basic := auth.GetBasicAuthCredFromEnv(); basic != nil { + cred.Username = basic.Username + cred.Password = basic.Password } - - return client, err + return akp.NewClients(cfg.Endpoint, config.Organization, cred), nil } func canceller() chan os.Signal { diff --git a/pkg/config/factory.go b/pkg/config/factory.go index 96d3a861f..99515cd1c 100644 --- a/pkg/config/factory.go +++ b/pkg/config/factory.go @@ -19,10 +19,10 @@ package config import ( "os" - ace "go.bytebuilders.dev/client" + "go.bytebuilders.dev/cli/pkg/akp" ) type Factory struct { - Client func() (*ace.Client, error) + Clients func() (*akp.Clients, error) Canceller func() chan os.Signal } diff --git a/pkg/printer/cluster.go b/pkg/printer/cluster.go index ef778ada2..e4cc9675b 100644 --- a/pkg/printer/cluster.go +++ b/pkg/printer/cluster.go @@ -17,21 +17,21 @@ limitations under the License. package printer import ( - "encoding/json" "fmt" "os" "text/tabwriter" - "go.bytebuilders.dev/resource-model/apis/cluster/v1alpha1" + clusterv2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + "google.golang.org/protobuf/encoding/protojson" "sigs.k8s.io/yaml" ) var OutputFormat string type clusterPrinter interface { - printCluster(cluster *v1alpha1.ClusterInfo) error - printClusterList(clusters []v1alpha1.ClusterInfo) error + printCluster(cluster *clusterv2.Cluster) error + printClusterList(clusters []*clusterv2.Cluster) error } func newPrinter() clusterPrinter { @@ -47,38 +47,37 @@ func newPrinter() clusterPrinter { return printer } -func PrintCluster(cluster *v1alpha1.ClusterInfo) error { +func PrintCluster(cluster *clusterv2.Cluster) error { printer := newPrinter() return printer.printCluster(cluster) } -func PrintClusterList(clusters []v1alpha1.ClusterInfo) error { +func PrintClusterList(clusters []*clusterv2.Cluster) error { printer := newPrinter() return printer.printClusterList(clusters) } type tablePrinter struct{} -func (p *tablePrinter) printCluster(cluster *v1alpha1.ClusterInfo) error { - w := tabwriter.NewWriter(os.Stdout, 0, 0, 5, ' ', 0) - _, _ = fmt.Fprintln(w, "NAME\tDISPLAY_NAME\tPROVIDER\tPHASE") - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", cluster.Spec.Name, cluster.Spec.DisplayName, cluster.Spec.Provider, cluster.Status.Phase) - return w.Flush() +func (p *tablePrinter) printCluster(cluster *clusterv2.Cluster) error { + return p.printClusterList([]*clusterv2.Cluster{cluster}) } -func (p *tablePrinter) printClusterList(clusters []v1alpha1.ClusterInfo) error { +func (p *tablePrinter) printClusterList(clusters []*clusterv2.Cluster) error { w := tabwriter.NewWriter(os.Stdout, 0, 0, 5, ' ', 0) _, _ = fmt.Fprintln(w, "NAME\tDISPLAY_NAME\tPROVIDER\tPHASE") - for i := range clusters { - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", clusters[i].Spec.Name, clusters[i].Spec.DisplayName, clusters[i].Spec.Provider, clusters[i].Status.Phase) + for _, c := range clusters { + _, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", c.GetName(), c.GetDisplayName(), c.GetProvider(), c.GetStatus().GetPhase()) } return w.Flush() } +var jsonOptions = protojson.MarshalOptions{Indent: " "} + type jsonPrinter struct{} -func (p *jsonPrinter) printCluster(cluster *v1alpha1.ClusterInfo) error { - data, err := json.MarshalIndent(cluster, "", " ") +func (p *jsonPrinter) printCluster(cluster *clusterv2.Cluster) error { + data, err := jsonOptions.Marshal(cluster) if err != nil { return err } @@ -86,21 +85,23 @@ func (p *jsonPrinter) printCluster(cluster *v1alpha1.ClusterInfo) error { return nil } -func (p *jsonPrinter) printClusterList(clusters []v1alpha1.ClusterInfo) error { - for i := range clusters { - data, err := json.MarshalIndent(clusters[i], "", " ") - if err != nil { +func (p *jsonPrinter) printClusterList(clusters []*clusterv2.Cluster) error { + for _, c := range clusters { + if err := p.printCluster(c); err != nil { return err } - fmt.Println(string(data)) } return nil } type yamlPrinter struct{} -func (p *yamlPrinter) printCluster(cluster *v1alpha1.ClusterInfo) error { - data, err := yaml.Marshal(cluster) +func (p *yamlPrinter) printCluster(cluster *clusterv2.Cluster) error { + data, err := protojson.Marshal(cluster) + if err != nil { + return err + } + data, err = yaml.JSONToYAML(data) if err != nil { return err } @@ -108,13 +109,11 @@ func (p *yamlPrinter) printCluster(cluster *v1alpha1.ClusterInfo) error { return nil } -func (p *yamlPrinter) printClusterList(clusters []v1alpha1.ClusterInfo) error { - for i := range clusters { - data, err := yaml.Marshal(clusters[i]) - if err != nil { +func (p *yamlPrinter) printClusterList(clusters []*clusterv2.Cluster) error { + for _, c := range clusters { + if err := p.printCluster(c); err != nil { return err } - fmt.Println(string(data)) } return nil } diff --git a/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/LICENSE b/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/LICENSE new file mode 100644 index 000000000..347d9fc99 --- /dev/null +++ b/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023-2026 Buf Technologies, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/validate.pb.go b/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/validate.pb.go new file mode 100644 index 000000000..79968111a --- /dev/null +++ b/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/validate.pb.go @@ -0,0 +1,17828 @@ +// Copyright 2023-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: buf/validate/validate.proto + +// [Protovalidate](https://protovalidate.com/) is the semantic validation library for Protobuf. +// It provides standard annotations to validate common rules on messages and fields, as well as the ability to use [CEL](https://cel.dev) to write custom rules. +// It's the next generation of [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate). +// +// This package provides the options, messages, and enums that power Protovalidate. +// Apply its options to messages, fields, and oneofs in your Protobuf schemas to add validation rules: +// +// ```proto +// message User { +// string id = 1 [(buf.validate.field).string.uuid = true]; +// string first_name = 2 [(buf.validate.field).string.max_len = 64]; +// string last_name = 3 [(buf.validate.field).string.max_len = 64]; +// +// option (buf.validate.message).cel = { +// id: "first_name_requires_last_name" +// message: "last_name must be present if first_name is present" +// expression: "!has(this.first_name) || has(this.last_name)" +// }; +// } +// ``` +// +// These rules are enforced at runtime by language-specific libraries. +// See the [developer quickstart](https://protovalidate.com/quickstart/) to get started, or go directly to the runtime library for your language: +// [Go](https://github.com/bufbuild/protovalidate-go), +// [JavaScript/TypeScript](https://github.com/bufbuild/protovalidate-es), +// [Java](https://github.com/bufbuild/protovalidate-java), +// [Python](https://github.com/bufbuild/protovalidate-python), +// or [C++](https://github.com/bufbuild/protovalidate-cc). + +//go:build !protoopaque + +package validate + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and +// whether the field tracks presence. +type Ignore int32 + +const ( + // Ignore rules if the field tracks presence and is unset. This is the default + // behavior. + // + // In proto3, only message fields, members of a Protobuf `oneof`, and fields + // with the `optional` label track presence. Consequently, the following fields + // are always validated, whether a value is set or not: + // + // ```proto + // syntax="proto3"; + // + // message RulesApply { + // string email = 1 [ + // (buf.validate.field).string.email = true + // ]; + // int32 age = 2 [ + // (buf.validate.field).int32.gt = 0 + // ]; + // repeated string labels = 3 [ + // (buf.validate.field).repeated.min_items = 1 + // ]; + // } + // + // ``` + // + // In contrast, the following fields track presence, and are only validated if + // a value is set: + // + // ```proto + // syntax="proto3"; + // + // message RulesApplyIfSet { + // optional string email = 1 [ + // (buf.validate.field).string.email = true + // ]; + // oneof ref { + // string reference = 2 [ + // (buf.validate.field).string.uuid = true + // ]; + // string name = 3 [ + // (buf.validate.field).string.min_len = 4 + // ]; + // } + // SomeMessage msg = 4 [ + // (buf.validate.field).cel = {/* ... */} + // ]; + // } + // + // ``` + // + // To ensure that such a field is set, add the `required` rule. + // + // To learn which fields track presence, see the + // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + Ignore_IGNORE_UNSPECIFIED Ignore = 0 + // Ignore rules if the field is unset, or set to the zero value. + // + // The zero value depends on the field type: + // - For strings, the zero value is the empty string. + // - For bytes, the zero value is empty bytes. + // - For bool, the zero value is false. + // - For numeric types, the zero value is zero. + // - For enums, the zero value is the first defined enum value. + // - For repeated fields, the zero is an empty list. + // - For map fields, the zero is an empty map. + // - For message fields, absence of the message (typically a null-value) is considered zero value. + // + // For fields that track presence (e.g. adding the `optional` label in proto3), + // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`. + Ignore_IGNORE_IF_ZERO_VALUE Ignore = 1 + // Always ignore rules, including the `required` rule. + // + // This is useful for ignoring the rules of a referenced message, or to + // temporarily ignore rules during development. + // + // ```proto + // + // message MyMessage { + // // The field's rules will always be ignored, including any validations + // // on value's fields. + // MyOtherMessage value = 1 [ + // (buf.validate.field).ignore = IGNORE_ALWAYS + // ]; + // } + // + // ``` + Ignore_IGNORE_ALWAYS Ignore = 3 +) + +// Enum value maps for Ignore. +var ( + Ignore_name = map[int32]string{ + 0: "IGNORE_UNSPECIFIED", + 1: "IGNORE_IF_ZERO_VALUE", + 3: "IGNORE_ALWAYS", + } + Ignore_value = map[string]int32{ + "IGNORE_UNSPECIFIED": 0, + "IGNORE_IF_ZERO_VALUE": 1, + "IGNORE_ALWAYS": 3, + } +) + +func (x Ignore) Enum() *Ignore { + p := new(Ignore) + *p = x + return p +} + +func (x Ignore) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Ignore) Descriptor() protoreflect.EnumDescriptor { + return file_buf_validate_validate_proto_enumTypes[0].Descriptor() +} + +func (Ignore) Type() protoreflect.EnumType { + return &file_buf_validate_validate_proto_enumTypes[0] +} + +func (x Ignore) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// KnownRegex contains some well-known patterns. +type KnownRegex int32 + +const ( + KnownRegex_KNOWN_REGEX_UNSPECIFIED KnownRegex = 0 + // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). + KnownRegex_KNOWN_REGEX_HTTP_HEADER_NAME KnownRegex = 1 + // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4). + KnownRegex_KNOWN_REGEX_HTTP_HEADER_VALUE KnownRegex = 2 +) + +// Enum value maps for KnownRegex. +var ( + KnownRegex_name = map[int32]string{ + 0: "KNOWN_REGEX_UNSPECIFIED", + 1: "KNOWN_REGEX_HTTP_HEADER_NAME", + 2: "KNOWN_REGEX_HTTP_HEADER_VALUE", + } + KnownRegex_value = map[string]int32{ + "KNOWN_REGEX_UNSPECIFIED": 0, + "KNOWN_REGEX_HTTP_HEADER_NAME": 1, + "KNOWN_REGEX_HTTP_HEADER_VALUE": 2, + } +) + +func (x KnownRegex) Enum() *KnownRegex { + p := new(KnownRegex) + *p = x + return p +} + +func (x KnownRegex) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KnownRegex) Descriptor() protoreflect.EnumDescriptor { + return file_buf_validate_validate_proto_enumTypes[1].Descriptor() +} + +func (KnownRegex) Type() protoreflect.EnumType { + return &file_buf_validate_validate_proto_enumTypes[1] +} + +func (x KnownRegex) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// `Rule` represents a validation rule written in the Common Expression +// Language (CEL) syntax. Each Rule includes a unique identifier, an +// optional error message, and the CEL expression to evaluate. For more +// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). +// +// ```proto +// +// message Foo { +// option (buf.validate.message).cel = { +// id: "foo.bar" +// message: "bar must be greater than 0" +// expression: "this.bar > 0" +// }; +// int32 bar = 1; +// } +// +// ``` +type Rule struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `id` is a string that serves as a machine-readable name for this Rule. + // It should be unique within its scope, which could be either a message or a field. + Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // `message` is an optional field that provides a human-readable error message + // for this Rule when the CEL expression evaluates to false. If a + // non-empty message is provided, any strings resulting from the CEL + // expression evaluation are ignored. + Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + // `expression` is the actual CEL expression that will be evaluated for + // validation. This string must resolve to either a boolean or a string + // value. If the expression evaluates to false or a non-empty string, the + // validation is considered failed, and the message is rejected. + Expression *string `protobuf:"bytes,3,opt,name=expression" json:"expression,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Rule) Reset() { + *x = Rule{} + mi := &file_buf_validate_validate_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule) ProtoMessage() {} + +func (x *Rule) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Rule) GetId() string { + if x != nil && x.Id != nil { + return *x.Id + } + return "" +} + +func (x *Rule) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message + } + return "" +} + +func (x *Rule) GetExpression() string { + if x != nil && x.Expression != nil { + return *x.Expression + } + return "" +} + +func (x *Rule) SetId(v string) { + x.Id = &v +} + +func (x *Rule) SetMessage(v string) { + x.Message = &v +} + +func (x *Rule) SetExpression(v string) { + x.Expression = &v +} + +func (x *Rule) HasId() bool { + if x == nil { + return false + } + return x.Id != nil +} + +func (x *Rule) HasMessage() bool { + if x == nil { + return false + } + return x.Message != nil +} + +func (x *Rule) HasExpression() bool { + if x == nil { + return false + } + return x.Expression != nil +} + +func (x *Rule) ClearId() { + x.Id = nil +} + +func (x *Rule) ClearMessage() { + x.Message = nil +} + +func (x *Rule) ClearExpression() { + x.Expression = nil +} + +type Rule_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `id` is a string that serves as a machine-readable name for this Rule. + // It should be unique within its scope, which could be either a message or a field. + Id *string + // `message` is an optional field that provides a human-readable error message + // for this Rule when the CEL expression evaluates to false. If a + // non-empty message is provided, any strings resulting from the CEL + // expression evaluation are ignored. + Message *string + // `expression` is the actual CEL expression that will be evaluated for + // validation. This string must resolve to either a boolean or a string + // value. If the expression evaluates to false or a non-empty string, the + // validation is considered failed, and the message is rejected. + Expression *string +} + +func (b0 Rule_builder) Build() *Rule { + m0 := &Rule{} + b, x := &b0, m0 + _, _ = b, x + x.Id = b.Id + x.Message = b.Message + x.Expression = b.Expression + return m0 +} + +// MessageRules represents validation rules that are applied to the entire message. +// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules. +type MessageRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + // + // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + // be same as the `expression`. + // + // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `foo` must be greater than 42. + // option (buf.validate.message).cel_expression = "this.foo > 42"; + // // The field `foo` must be less than 84. + // option (buf.validate.message).cel_expression = "this.foo < 84"; + // optional int32 foo = 1; + // } + // + // ``` + CelExpression []string `protobuf:"bytes,5,rep,name=cel_expression,json=celExpression" json:"cel_expression,omitempty"` + // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message. + // These rules are written in Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `foo` must be greater than 42. + // option (buf.validate.message).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this.foo > 42", + // }; + // optional int32 foo = 1; + // } + // + // ``` + Cel []*Rule `protobuf:"bytes,3,rep,name=cel" json:"cel,omitempty"` + // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields + // of which at most one can be present. If `required` is also specified, then exactly one + // of the specified fields _must_ be present. + // + // This will enforce oneof-like constraints with a few features not provided by + // actual Protobuf oneof declarations: + // 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof, + // only scalar fields are allowed. + // 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member + // fields have explicit presence. This means that, for the purpose of determining + // how many fields are set, explicitly setting such a field to its zero value is + // effectively the same as not setting it at all. + // 3. This will always generate validation errors for a message unmarshalled from + // serialized data that sets more than one field. With a Protobuf oneof, when + // multiple fields are present in the serialized form, earlier values are usually + // silently ignored when unmarshalling, with only the last field being set when + // unmarshalling completes. + // + // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means + // only the field that is set will be validated and the unset fields are not validated according to the field rules. + // This behavior can be overridden by setting `ignore` against a field. + // + // ```proto + // + // message MyMessage { + // // Only one of `field1` or `field2` _can_ be present in this message. + // option (buf.validate.message).oneof = { fields: ["field1", "field2"] }; + // // Exactly one of `field3` or `field4` _must_ be present in this message. + // option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true }; + // string field1 = 1; + // bytes field2 = 2; + // bool field3 = 3; + // int32 field4 = 4; + // } + // + // ``` + Oneof []*MessageOneofRule `protobuf:"bytes,4,rep,name=oneof" json:"oneof,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageRules) Reset() { + *x = MessageRules{} + mi := &file_buf_validate_validate_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageRules) ProtoMessage() {} + +func (x *MessageRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MessageRules) GetCelExpression() []string { + if x != nil { + return x.CelExpression + } + return nil +} + +func (x *MessageRules) GetCel() []*Rule { + if x != nil { + return x.Cel + } + return nil +} + +func (x *MessageRules) GetOneof() []*MessageOneofRule { + if x != nil { + return x.Oneof + } + return nil +} + +func (x *MessageRules) SetCelExpression(v []string) { + x.CelExpression = v +} + +func (x *MessageRules) SetCel(v []*Rule) { + x.Cel = v +} + +func (x *MessageRules) SetOneof(v []*MessageOneofRule) { + x.Oneof = v +} + +type MessageRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + // + // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + // be same as the `expression`. + // + // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `foo` must be greater than 42. + // option (buf.validate.message).cel_expression = "this.foo > 42"; + // // The field `foo` must be less than 84. + // option (buf.validate.message).cel_expression = "this.foo < 84"; + // optional int32 foo = 1; + // } + // + // ``` + CelExpression []string + // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message. + // These rules are written in Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `foo` must be greater than 42. + // option (buf.validate.message).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this.foo > 42", + // }; + // optional int32 foo = 1; + // } + // + // ``` + Cel []*Rule + // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields + // of which at most one can be present. If `required` is also specified, then exactly one + // of the specified fields _must_ be present. + // + // This will enforce oneof-like constraints with a few features not provided by + // actual Protobuf oneof declarations: + // 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof, + // only scalar fields are allowed. + // 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member + // fields have explicit presence. This means that, for the purpose of determining + // how many fields are set, explicitly setting such a field to its zero value is + // effectively the same as not setting it at all. + // 3. This will always generate validation errors for a message unmarshalled from + // serialized data that sets more than one field. With a Protobuf oneof, when + // multiple fields are present in the serialized form, earlier values are usually + // silently ignored when unmarshalling, with only the last field being set when + // unmarshalling completes. + // + // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means + // only the field that is set will be validated and the unset fields are not validated according to the field rules. + // This behavior can be overridden by setting `ignore` against a field. + // + // ```proto + // + // message MyMessage { + // // Only one of `field1` or `field2` _can_ be present in this message. + // option (buf.validate.message).oneof = { fields: ["field1", "field2"] }; + // // Exactly one of `field3` or `field4` _must_ be present in this message. + // option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true }; + // string field1 = 1; + // bytes field2 = 2; + // bool field3 = 3; + // int32 field4 = 4; + // } + // + // ``` + Oneof []*MessageOneofRule +} + +func (b0 MessageRules_builder) Build() *MessageRules { + m0 := &MessageRules{} + b, x := &b0, m0 + _, _ = b, x + x.CelExpression = b.CelExpression + x.Cel = b.Cel + x.Oneof = b.Oneof + return m0 +} + +type MessageOneofRule struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // A list of field names to include in the oneof. All field names must be + // defined in the message. At least one field must be specified, and + // duplicates are not permitted. + Fields []string `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty"` + // If true, one of the fields specified _must_ be set. + Required *bool `protobuf:"varint,2,opt,name=required" json:"required,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageOneofRule) Reset() { + *x = MessageOneofRule{} + mi := &file_buf_validate_validate_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageOneofRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageOneofRule) ProtoMessage() {} + +func (x *MessageOneofRule) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MessageOneofRule) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +func (x *MessageOneofRule) GetRequired() bool { + if x != nil && x.Required != nil { + return *x.Required + } + return false +} + +func (x *MessageOneofRule) SetFields(v []string) { + x.Fields = v +} + +func (x *MessageOneofRule) SetRequired(v bool) { + x.Required = &v +} + +func (x *MessageOneofRule) HasRequired() bool { + if x == nil { + return false + } + return x.Required != nil +} + +func (x *MessageOneofRule) ClearRequired() { + x.Required = nil +} + +type MessageOneofRule_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // A list of field names to include in the oneof. All field names must be + // defined in the message. At least one field must be specified, and + // duplicates are not permitted. + Fields []string + // If true, one of the fields specified _must_ be set. + Required *bool +} + +func (b0 MessageOneofRule_builder) Build() *MessageOneofRule { + m0 := &MessageOneofRule{} + b, x := &b0, m0 + _, _ = b, x + x.Fields = b.Fields + x.Required = b.Required + return m0 +} + +// The `OneofRules` message type enables you to manage rules for +// oneof fields in your protobuf messages. +type OneofRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // If `required` is true, exactly one field of the oneof must be set. A + // validation error is returned if no fields in the oneof are set. Further rules + // should be placed on the fields themselves to ensure they are valid values, + // such as `min_len` or `gt`. + // + // ```proto + // + // message MyMessage { + // oneof value { + // // Either `a` or `b` must be set. If `a` is set, it must also be + // // non-empty; whereas if `b` is set, it can still be an empty string. + // option (buf.validate.oneof).required = true; + // string a = 1 [(buf.validate.field).string.min_len = 1]; + // string b = 2; + // } + // } + // + // ``` + Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OneofRules) Reset() { + *x = OneofRules{} + mi := &file_buf_validate_validate_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OneofRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OneofRules) ProtoMessage() {} + +func (x *OneofRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OneofRules) GetRequired() bool { + if x != nil && x.Required != nil { + return *x.Required + } + return false +} + +func (x *OneofRules) SetRequired(v bool) { + x.Required = &v +} + +func (x *OneofRules) HasRequired() bool { + if x == nil { + return false + } + return x.Required != nil +} + +func (x *OneofRules) ClearRequired() { + x.Required = nil +} + +type OneofRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // If `required` is true, exactly one field of the oneof must be set. A + // validation error is returned if no fields in the oneof are set. Further rules + // should be placed on the fields themselves to ensure they are valid values, + // such as `min_len` or `gt`. + // + // ```proto + // + // message MyMessage { + // oneof value { + // // Either `a` or `b` must be set. If `a` is set, it must also be + // // non-empty; whereas if `b` is set, it can still be an empty string. + // option (buf.validate.oneof).required = true; + // string a = 1 [(buf.validate.field).string.min_len = 1]; + // string b = 2; + // } + // } + // + // ``` + Required *bool +} + +func (b0 OneofRules_builder) Build() *OneofRules { + m0 := &OneofRules{} + b, x := &b0, m0 + _, _ = b, x + x.Required = b.Required + return m0 +} + +// FieldRules encapsulates the rules for each type of field. Depending on +// the field, the correct set should be used to ensure proper validations. +type FieldRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + // + // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + // be same as the `expression`. + // + // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"]; + // } + // + // ``` + CelExpression []string `protobuf:"bytes,29,rep,name=cel_expression,json=celExpression" json:"cel_expression,omitempty"` + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.field).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this > 42", + // }]; + // } + // + // ``` + Cel []*Rule `protobuf:"bytes,23,rep,name=cel" json:"cel,omitempty"` + // If `required` is true, the field must be set. A validation error is returned + // if the field is not set. + // + // ```proto + // syntax="proto3"; + // + // message FieldsWithPresence { + // // Requires any string to be set, including the empty string. + // optional string link = 1 [ + // (buf.validate.field).required = true + // ]; + // // Requires true or false to be set. + // optional bool disabled = 2 [ + // (buf.validate.field).required = true + // ]; + // // Requires a message to be set, including the empty message. + // SomeMessage msg = 4 [ + // (buf.validate.field).required = true + // ]; + // } + // + // ``` + // + // All fields in the example above track presence. By default, Protovalidate + // ignores rules on those fields if no value is set. `required` ensures that + // the fields are set and valid. + // + // Fields that don't track presence are always validated by Protovalidate, + // whether they are set or not. It is not necessary to add `required`. It + // can be added to indicate that the field cannot be the zero value. + // + // ```proto + // syntax="proto3"; + // + // message FieldsWithoutPresence { + // // `string.email` always applies, even to an empty string. + // string link = 1 [ + // (buf.validate.field).string.email = true + // ]; + // // `repeated.min_items` always applies, even to an empty list. + // repeated string labels = 2 [ + // (buf.validate.field).repeated.min_items = 1 + // ]; + // // `required`, for fields that don't track presence, indicates + // // the value of the field can't be the zero value. + // int32 zero_value_not_allowed = 3 [ + // (buf.validate.field).required = true + // ]; + // } + // + // ``` + // + // To learn which fields track presence, see the + // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + // + // Note: While field rules can be applied to repeated items, map keys, and map + // values, the elements are always considered to be set. Consequently, + // specifying `repeated.items.required` is redundant. + Required *bool `protobuf:"varint,25,opt,name=required" json:"required,omitempty"` + // Ignore validation rules on the field if its value matches the specified + // criteria. See the `Ignore` enum for details. + // + // ```proto + // + // message UpdateRequest { + // // The uri rule only applies if the field is not an empty string. + // string url = 1 [ + // (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE, + // (buf.validate.field).string.uri = true + // ]; + // } + // + // ``` + Ignore *Ignore `protobuf:"varint,27,opt,name=ignore,enum=buf.validate.Ignore" json:"ignore,omitempty"` + // Types that are valid to be assigned to Type: + // + // *FieldRules_Float + // *FieldRules_Double + // *FieldRules_Int32 + // *FieldRules_Int64 + // *FieldRules_Uint32 + // *FieldRules_Uint64 + // *FieldRules_Sint32 + // *FieldRules_Sint64 + // *FieldRules_Fixed32 + // *FieldRules_Fixed64 + // *FieldRules_Sfixed32 + // *FieldRules_Sfixed64 + // *FieldRules_Bool + // *FieldRules_String_ + // *FieldRules_Bytes + // *FieldRules_Enum + // *FieldRules_Repeated + // *FieldRules_Map + // *FieldRules_Any + // *FieldRules_Duration + // *FieldRules_FieldMask + // *FieldRules_Timestamp + Type isFieldRules_Type `protobuf_oneof:"type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldRules) Reset() { + *x = FieldRules{} + mi := &file_buf_validate_validate_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldRules) ProtoMessage() {} + +func (x *FieldRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldRules) GetCelExpression() []string { + if x != nil { + return x.CelExpression + } + return nil +} + +func (x *FieldRules) GetCel() []*Rule { + if x != nil { + return x.Cel + } + return nil +} + +func (x *FieldRules) GetRequired() bool { + if x != nil && x.Required != nil { + return *x.Required + } + return false +} + +func (x *FieldRules) GetIgnore() Ignore { + if x != nil && x.Ignore != nil { + return *x.Ignore + } + return Ignore_IGNORE_UNSPECIFIED +} + +func (x *FieldRules) GetType() isFieldRules_Type { + if x != nil { + return x.Type + } + return nil +} + +func (x *FieldRules) GetFloat() *FloatRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Float); ok { + return x.Float + } + } + return nil +} + +func (x *FieldRules) GetDouble() *DoubleRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Double); ok { + return x.Double + } + } + return nil +} + +func (x *FieldRules) GetInt32() *Int32Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Int32); ok { + return x.Int32 + } + } + return nil +} + +func (x *FieldRules) GetInt64() *Int64Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Int64); ok { + return x.Int64 + } + } + return nil +} + +func (x *FieldRules) GetUint32() *UInt32Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Uint32); ok { + return x.Uint32 + } + } + return nil +} + +func (x *FieldRules) GetUint64() *UInt64Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Uint64); ok { + return x.Uint64 + } + } + return nil +} + +func (x *FieldRules) GetSint32() *SInt32Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Sint32); ok { + return x.Sint32 + } + } + return nil +} + +func (x *FieldRules) GetSint64() *SInt64Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Sint64); ok { + return x.Sint64 + } + } + return nil +} + +func (x *FieldRules) GetFixed32() *Fixed32Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Fixed32); ok { + return x.Fixed32 + } + } + return nil +} + +func (x *FieldRules) GetFixed64() *Fixed64Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Fixed64); ok { + return x.Fixed64 + } + } + return nil +} + +func (x *FieldRules) GetSfixed32() *SFixed32Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Sfixed32); ok { + return x.Sfixed32 + } + } + return nil +} + +func (x *FieldRules) GetSfixed64() *SFixed64Rules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Sfixed64); ok { + return x.Sfixed64 + } + } + return nil +} + +func (x *FieldRules) GetBool() *BoolRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Bool); ok { + return x.Bool + } + } + return nil +} + +func (x *FieldRules) GetString() *StringRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_String_); ok { + return x.String_ + } + } + return nil +} + +// Deprecated: Use GetString instead. +func (x *FieldRules) GetString_() *StringRules { + return x.GetString() +} + +func (x *FieldRules) GetBytes() *BytesRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Bytes); ok { + return x.Bytes + } + } + return nil +} + +func (x *FieldRules) GetEnum() *EnumRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Enum); ok { + return x.Enum + } + } + return nil +} + +func (x *FieldRules) GetRepeated() *RepeatedRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Repeated); ok { + return x.Repeated + } + } + return nil +} + +func (x *FieldRules) GetMap() *MapRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Map); ok { + return x.Map + } + } + return nil +} + +func (x *FieldRules) GetAny() *AnyRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Any); ok { + return x.Any + } + } + return nil +} + +func (x *FieldRules) GetDuration() *DurationRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Duration); ok { + return x.Duration + } + } + return nil +} + +func (x *FieldRules) GetFieldMask() *FieldMaskRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_FieldMask); ok { + return x.FieldMask + } + } + return nil +} + +func (x *FieldRules) GetTimestamp() *TimestampRules { + if x != nil { + if x, ok := x.Type.(*FieldRules_Timestamp); ok { + return x.Timestamp + } + } + return nil +} + +func (x *FieldRules) SetCelExpression(v []string) { + x.CelExpression = v +} + +func (x *FieldRules) SetCel(v []*Rule) { + x.Cel = v +} + +func (x *FieldRules) SetRequired(v bool) { + x.Required = &v +} + +func (x *FieldRules) SetIgnore(v Ignore) { + x.Ignore = &v +} + +func (x *FieldRules) SetFloat(v *FloatRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Float{v} +} + +func (x *FieldRules) SetDouble(v *DoubleRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Double{v} +} + +func (x *FieldRules) SetInt32(v *Int32Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Int32{v} +} + +func (x *FieldRules) SetInt64(v *Int64Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Int64{v} +} + +func (x *FieldRules) SetUint32(v *UInt32Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Uint32{v} +} + +func (x *FieldRules) SetUint64(v *UInt64Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Uint64{v} +} + +func (x *FieldRules) SetSint32(v *SInt32Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Sint32{v} +} + +func (x *FieldRules) SetSint64(v *SInt64Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Sint64{v} +} + +func (x *FieldRules) SetFixed32(v *Fixed32Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Fixed32{v} +} + +func (x *FieldRules) SetFixed64(v *Fixed64Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Fixed64{v} +} + +func (x *FieldRules) SetSfixed32(v *SFixed32Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Sfixed32{v} +} + +func (x *FieldRules) SetSfixed64(v *SFixed64Rules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Sfixed64{v} +} + +func (x *FieldRules) SetBool(v *BoolRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Bool{v} +} + +func (x *FieldRules) SetString(v *StringRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_String_{v} +} + +func (x *FieldRules) SetBytes(v *BytesRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Bytes{v} +} + +func (x *FieldRules) SetEnum(v *EnumRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Enum{v} +} + +func (x *FieldRules) SetRepeated(v *RepeatedRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Repeated{v} +} + +func (x *FieldRules) SetMap(v *MapRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Map{v} +} + +func (x *FieldRules) SetAny(v *AnyRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Any{v} +} + +func (x *FieldRules) SetDuration(v *DurationRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Duration{v} +} + +func (x *FieldRules) SetFieldMask(v *FieldMaskRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_FieldMask{v} +} + +func (x *FieldRules) SetTimestamp(v *TimestampRules) { + if v == nil { + x.Type = nil + return + } + x.Type = &FieldRules_Timestamp{v} +} + +func (x *FieldRules) HasRequired() bool { + if x == nil { + return false + } + return x.Required != nil +} + +func (x *FieldRules) HasIgnore() bool { + if x == nil { + return false + } + return x.Ignore != nil +} + +func (x *FieldRules) HasType() bool { + if x == nil { + return false + } + return x.Type != nil +} + +func (x *FieldRules) HasFloat() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Float) + return ok +} + +func (x *FieldRules) HasDouble() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Double) + return ok +} + +func (x *FieldRules) HasInt32() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Int32) + return ok +} + +func (x *FieldRules) HasInt64() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Int64) + return ok +} + +func (x *FieldRules) HasUint32() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Uint32) + return ok +} + +func (x *FieldRules) HasUint64() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Uint64) + return ok +} + +func (x *FieldRules) HasSint32() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Sint32) + return ok +} + +func (x *FieldRules) HasSint64() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Sint64) + return ok +} + +func (x *FieldRules) HasFixed32() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Fixed32) + return ok +} + +func (x *FieldRules) HasFixed64() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Fixed64) + return ok +} + +func (x *FieldRules) HasSfixed32() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Sfixed32) + return ok +} + +func (x *FieldRules) HasSfixed64() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Sfixed64) + return ok +} + +func (x *FieldRules) HasBool() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Bool) + return ok +} + +func (x *FieldRules) HasString() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_String_) + return ok +} + +func (x *FieldRules) HasBytes() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Bytes) + return ok +} + +func (x *FieldRules) HasEnum() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Enum) + return ok +} + +func (x *FieldRules) HasRepeated() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Repeated) + return ok +} + +func (x *FieldRules) HasMap() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Map) + return ok +} + +func (x *FieldRules) HasAny() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Any) + return ok +} + +func (x *FieldRules) HasDuration() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Duration) + return ok +} + +func (x *FieldRules) HasFieldMask() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_FieldMask) + return ok +} + +func (x *FieldRules) HasTimestamp() bool { + if x == nil { + return false + } + _, ok := x.Type.(*FieldRules_Timestamp) + return ok +} + +func (x *FieldRules) ClearRequired() { + x.Required = nil +} + +func (x *FieldRules) ClearIgnore() { + x.Ignore = nil +} + +func (x *FieldRules) ClearType() { + x.Type = nil +} + +func (x *FieldRules) ClearFloat() { + if _, ok := x.Type.(*FieldRules_Float); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearDouble() { + if _, ok := x.Type.(*FieldRules_Double); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearInt32() { + if _, ok := x.Type.(*FieldRules_Int32); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearInt64() { + if _, ok := x.Type.(*FieldRules_Int64); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearUint32() { + if _, ok := x.Type.(*FieldRules_Uint32); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearUint64() { + if _, ok := x.Type.(*FieldRules_Uint64); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearSint32() { + if _, ok := x.Type.(*FieldRules_Sint32); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearSint64() { + if _, ok := x.Type.(*FieldRules_Sint64); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearFixed32() { + if _, ok := x.Type.(*FieldRules_Fixed32); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearFixed64() { + if _, ok := x.Type.(*FieldRules_Fixed64); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearSfixed32() { + if _, ok := x.Type.(*FieldRules_Sfixed32); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearSfixed64() { + if _, ok := x.Type.(*FieldRules_Sfixed64); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearBool() { + if _, ok := x.Type.(*FieldRules_Bool); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearString() { + if _, ok := x.Type.(*FieldRules_String_); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearBytes() { + if _, ok := x.Type.(*FieldRules_Bytes); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearEnum() { + if _, ok := x.Type.(*FieldRules_Enum); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearRepeated() { + if _, ok := x.Type.(*FieldRules_Repeated); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearMap() { + if _, ok := x.Type.(*FieldRules_Map); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearAny() { + if _, ok := x.Type.(*FieldRules_Any); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearDuration() { + if _, ok := x.Type.(*FieldRules_Duration); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearFieldMask() { + if _, ok := x.Type.(*FieldRules_FieldMask); ok { + x.Type = nil + } +} + +func (x *FieldRules) ClearTimestamp() { + if _, ok := x.Type.(*FieldRules_Timestamp); ok { + x.Type = nil + } +} + +const FieldRules_Type_not_set_case case_FieldRules_Type = 0 +const FieldRules_Float_case case_FieldRules_Type = 1 +const FieldRules_Double_case case_FieldRules_Type = 2 +const FieldRules_Int32_case case_FieldRules_Type = 3 +const FieldRules_Int64_case case_FieldRules_Type = 4 +const FieldRules_Uint32_case case_FieldRules_Type = 5 +const FieldRules_Uint64_case case_FieldRules_Type = 6 +const FieldRules_Sint32_case case_FieldRules_Type = 7 +const FieldRules_Sint64_case case_FieldRules_Type = 8 +const FieldRules_Fixed32_case case_FieldRules_Type = 9 +const FieldRules_Fixed64_case case_FieldRules_Type = 10 +const FieldRules_Sfixed32_case case_FieldRules_Type = 11 +const FieldRules_Sfixed64_case case_FieldRules_Type = 12 +const FieldRules_Bool_case case_FieldRules_Type = 13 +const FieldRules_String__case case_FieldRules_Type = 14 +const FieldRules_Bytes_case case_FieldRules_Type = 15 +const FieldRules_Enum_case case_FieldRules_Type = 16 +const FieldRules_Repeated_case case_FieldRules_Type = 18 +const FieldRules_Map_case case_FieldRules_Type = 19 +const FieldRules_Any_case case_FieldRules_Type = 20 +const FieldRules_Duration_case case_FieldRules_Type = 21 +const FieldRules_FieldMask_case case_FieldRules_Type = 28 +const FieldRules_Timestamp_case case_FieldRules_Type = 22 + +func (x *FieldRules) WhichType() case_FieldRules_Type { + if x == nil { + return FieldRules_Type_not_set_case + } + switch x.Type.(type) { + case *FieldRules_Float: + return FieldRules_Float_case + case *FieldRules_Double: + return FieldRules_Double_case + case *FieldRules_Int32: + return FieldRules_Int32_case + case *FieldRules_Int64: + return FieldRules_Int64_case + case *FieldRules_Uint32: + return FieldRules_Uint32_case + case *FieldRules_Uint64: + return FieldRules_Uint64_case + case *FieldRules_Sint32: + return FieldRules_Sint32_case + case *FieldRules_Sint64: + return FieldRules_Sint64_case + case *FieldRules_Fixed32: + return FieldRules_Fixed32_case + case *FieldRules_Fixed64: + return FieldRules_Fixed64_case + case *FieldRules_Sfixed32: + return FieldRules_Sfixed32_case + case *FieldRules_Sfixed64: + return FieldRules_Sfixed64_case + case *FieldRules_Bool: + return FieldRules_Bool_case + case *FieldRules_String_: + return FieldRules_String__case + case *FieldRules_Bytes: + return FieldRules_Bytes_case + case *FieldRules_Enum: + return FieldRules_Enum_case + case *FieldRules_Repeated: + return FieldRules_Repeated_case + case *FieldRules_Map: + return FieldRules_Map_case + case *FieldRules_Any: + return FieldRules_Any_case + case *FieldRules_Duration: + return FieldRules_Duration_case + case *FieldRules_FieldMask: + return FieldRules_FieldMask_case + case *FieldRules_Timestamp: + return FieldRules_Timestamp_case + default: + return FieldRules_Type_not_set_case + } +} + +type FieldRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + // + // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + // be same as the `expression`. + // + // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"]; + // } + // + // ``` + CelExpression []string + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.field).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this > 42", + // }]; + // } + // + // ``` + Cel []*Rule + // If `required` is true, the field must be set. A validation error is returned + // if the field is not set. + // + // ```proto + // syntax="proto3"; + // + // message FieldsWithPresence { + // // Requires any string to be set, including the empty string. + // optional string link = 1 [ + // (buf.validate.field).required = true + // ]; + // // Requires true or false to be set. + // optional bool disabled = 2 [ + // (buf.validate.field).required = true + // ]; + // // Requires a message to be set, including the empty message. + // SomeMessage msg = 4 [ + // (buf.validate.field).required = true + // ]; + // } + // + // ``` + // + // All fields in the example above track presence. By default, Protovalidate + // ignores rules on those fields if no value is set. `required` ensures that + // the fields are set and valid. + // + // Fields that don't track presence are always validated by Protovalidate, + // whether they are set or not. It is not necessary to add `required`. It + // can be added to indicate that the field cannot be the zero value. + // + // ```proto + // syntax="proto3"; + // + // message FieldsWithoutPresence { + // // `string.email` always applies, even to an empty string. + // string link = 1 [ + // (buf.validate.field).string.email = true + // ]; + // // `repeated.min_items` always applies, even to an empty list. + // repeated string labels = 2 [ + // (buf.validate.field).repeated.min_items = 1 + // ]; + // // `required`, for fields that don't track presence, indicates + // // the value of the field can't be the zero value. + // int32 zero_value_not_allowed = 3 [ + // (buf.validate.field).required = true + // ]; + // } + // + // ``` + // + // To learn which fields track presence, see the + // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + // + // Note: While field rules can be applied to repeated items, map keys, and map + // values, the elements are always considered to be set. Consequently, + // specifying `repeated.items.required` is redundant. + Required *bool + // Ignore validation rules on the field if its value matches the specified + // criteria. See the `Ignore` enum for details. + // + // ```proto + // + // message UpdateRequest { + // // The uri rule only applies if the field is not an empty string. + // string url = 1 [ + // (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE, + // (buf.validate.field).string.uri = true + // ]; + // } + // + // ``` + Ignore *Ignore + // Fields of oneof Type: + // Scalar Field Types + Float *FloatRules + Double *DoubleRules + Int32 *Int32Rules + Int64 *Int64Rules + Uint32 *UInt32Rules + Uint64 *UInt64Rules + Sint32 *SInt32Rules + Sint64 *SInt64Rules + Fixed32 *Fixed32Rules + Fixed64 *Fixed64Rules + Sfixed32 *SFixed32Rules + Sfixed64 *SFixed64Rules + Bool *BoolRules + String *StringRules + Bytes *BytesRules + // Complex Field Types + Enum *EnumRules + Repeated *RepeatedRules + Map *MapRules + // Well-Known Field Types + Any *AnyRules + Duration *DurationRules + FieldMask *FieldMaskRules + Timestamp *TimestampRules + // -- end of Type +} + +func (b0 FieldRules_builder) Build() *FieldRules { + m0 := &FieldRules{} + b, x := &b0, m0 + _, _ = b, x + x.CelExpression = b.CelExpression + x.Cel = b.Cel + x.Required = b.Required + x.Ignore = b.Ignore + if b.Float != nil { + x.Type = &FieldRules_Float{b.Float} + } + if b.Double != nil { + x.Type = &FieldRules_Double{b.Double} + } + if b.Int32 != nil { + x.Type = &FieldRules_Int32{b.Int32} + } + if b.Int64 != nil { + x.Type = &FieldRules_Int64{b.Int64} + } + if b.Uint32 != nil { + x.Type = &FieldRules_Uint32{b.Uint32} + } + if b.Uint64 != nil { + x.Type = &FieldRules_Uint64{b.Uint64} + } + if b.Sint32 != nil { + x.Type = &FieldRules_Sint32{b.Sint32} + } + if b.Sint64 != nil { + x.Type = &FieldRules_Sint64{b.Sint64} + } + if b.Fixed32 != nil { + x.Type = &FieldRules_Fixed32{b.Fixed32} + } + if b.Fixed64 != nil { + x.Type = &FieldRules_Fixed64{b.Fixed64} + } + if b.Sfixed32 != nil { + x.Type = &FieldRules_Sfixed32{b.Sfixed32} + } + if b.Sfixed64 != nil { + x.Type = &FieldRules_Sfixed64{b.Sfixed64} + } + if b.Bool != nil { + x.Type = &FieldRules_Bool{b.Bool} + } + if b.String != nil { + x.Type = &FieldRules_String_{b.String} + } + if b.Bytes != nil { + x.Type = &FieldRules_Bytes{b.Bytes} + } + if b.Enum != nil { + x.Type = &FieldRules_Enum{b.Enum} + } + if b.Repeated != nil { + x.Type = &FieldRules_Repeated{b.Repeated} + } + if b.Map != nil { + x.Type = &FieldRules_Map{b.Map} + } + if b.Any != nil { + x.Type = &FieldRules_Any{b.Any} + } + if b.Duration != nil { + x.Type = &FieldRules_Duration{b.Duration} + } + if b.FieldMask != nil { + x.Type = &FieldRules_FieldMask{b.FieldMask} + } + if b.Timestamp != nil { + x.Type = &FieldRules_Timestamp{b.Timestamp} + } + return m0 +} + +type case_FieldRules_Type protoreflect.FieldNumber + +func (x case_FieldRules_Type) String() string { + md := file_buf_validate_validate_proto_msgTypes[4].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFieldRules_Type interface { + isFieldRules_Type() +} + +type FieldRules_Float struct { + // Scalar Field Types + Float *FloatRules `protobuf:"bytes,1,opt,name=float,oneof"` +} + +type FieldRules_Double struct { + Double *DoubleRules `protobuf:"bytes,2,opt,name=double,oneof"` +} + +type FieldRules_Int32 struct { + Int32 *Int32Rules `protobuf:"bytes,3,opt,name=int32,oneof"` +} + +type FieldRules_Int64 struct { + Int64 *Int64Rules `protobuf:"bytes,4,opt,name=int64,oneof"` +} + +type FieldRules_Uint32 struct { + Uint32 *UInt32Rules `protobuf:"bytes,5,opt,name=uint32,oneof"` +} + +type FieldRules_Uint64 struct { + Uint64 *UInt64Rules `protobuf:"bytes,6,opt,name=uint64,oneof"` +} + +type FieldRules_Sint32 struct { + Sint32 *SInt32Rules `protobuf:"bytes,7,opt,name=sint32,oneof"` +} + +type FieldRules_Sint64 struct { + Sint64 *SInt64Rules `protobuf:"bytes,8,opt,name=sint64,oneof"` +} + +type FieldRules_Fixed32 struct { + Fixed32 *Fixed32Rules `protobuf:"bytes,9,opt,name=fixed32,oneof"` +} + +type FieldRules_Fixed64 struct { + Fixed64 *Fixed64Rules `protobuf:"bytes,10,opt,name=fixed64,oneof"` +} + +type FieldRules_Sfixed32 struct { + Sfixed32 *SFixed32Rules `protobuf:"bytes,11,opt,name=sfixed32,oneof"` +} + +type FieldRules_Sfixed64 struct { + Sfixed64 *SFixed64Rules `protobuf:"bytes,12,opt,name=sfixed64,oneof"` +} + +type FieldRules_Bool struct { + Bool *BoolRules `protobuf:"bytes,13,opt,name=bool,oneof"` +} + +type FieldRules_String_ struct { + String_ *StringRules `protobuf:"bytes,14,opt,name=string,oneof"` +} + +type FieldRules_Bytes struct { + Bytes *BytesRules `protobuf:"bytes,15,opt,name=bytes,oneof"` +} + +type FieldRules_Enum struct { + // Complex Field Types + Enum *EnumRules `protobuf:"bytes,16,opt,name=enum,oneof"` +} + +type FieldRules_Repeated struct { + Repeated *RepeatedRules `protobuf:"bytes,18,opt,name=repeated,oneof"` +} + +type FieldRules_Map struct { + Map *MapRules `protobuf:"bytes,19,opt,name=map,oneof"` +} + +type FieldRules_Any struct { + // Well-Known Field Types + Any *AnyRules `protobuf:"bytes,20,opt,name=any,oneof"` +} + +type FieldRules_Duration struct { + Duration *DurationRules `protobuf:"bytes,21,opt,name=duration,oneof"` +} + +type FieldRules_FieldMask struct { + FieldMask *FieldMaskRules `protobuf:"bytes,28,opt,name=field_mask,json=fieldMask,oneof"` +} + +type FieldRules_Timestamp struct { + Timestamp *TimestampRules `protobuf:"bytes,22,opt,name=timestamp,oneof"` +} + +func (*FieldRules_Float) isFieldRules_Type() {} + +func (*FieldRules_Double) isFieldRules_Type() {} + +func (*FieldRules_Int32) isFieldRules_Type() {} + +func (*FieldRules_Int64) isFieldRules_Type() {} + +func (*FieldRules_Uint32) isFieldRules_Type() {} + +func (*FieldRules_Uint64) isFieldRules_Type() {} + +func (*FieldRules_Sint32) isFieldRules_Type() {} + +func (*FieldRules_Sint64) isFieldRules_Type() {} + +func (*FieldRules_Fixed32) isFieldRules_Type() {} + +func (*FieldRules_Fixed64) isFieldRules_Type() {} + +func (*FieldRules_Sfixed32) isFieldRules_Type() {} + +func (*FieldRules_Sfixed64) isFieldRules_Type() {} + +func (*FieldRules_Bool) isFieldRules_Type() {} + +func (*FieldRules_String_) isFieldRules_Type() {} + +func (*FieldRules_Bytes) isFieldRules_Type() {} + +func (*FieldRules_Enum) isFieldRules_Type() {} + +func (*FieldRules_Repeated) isFieldRules_Type() {} + +func (*FieldRules_Map) isFieldRules_Type() {} + +func (*FieldRules_Any) isFieldRules_Type() {} + +func (*FieldRules_Duration) isFieldRules_Type() {} + +func (*FieldRules_FieldMask) isFieldRules_Type() {} + +func (*FieldRules_Timestamp) isFieldRules_Type() {} + +// PredefinedRules are custom rules that can be re-used with +// multiple fields. +type PredefinedRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.predefined).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this > 42", + // }]; + // } + // + // ``` + Cel []*Rule `protobuf:"bytes,1,rep,name=cel" json:"cel,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PredefinedRules) Reset() { + *x = PredefinedRules{} + mi := &file_buf_validate_validate_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PredefinedRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PredefinedRules) ProtoMessage() {} + +func (x *PredefinedRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PredefinedRules) GetCel() []*Rule { + if x != nil { + return x.Cel + } + return nil +} + +func (x *PredefinedRules) SetCel(v []*Rule) { + x.Cel = v +} + +type PredefinedRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.predefined).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this > 42", + // }]; + // } + // + // ``` + Cel []*Rule +} + +func (b0 PredefinedRules_builder) Build() *PredefinedRules { + m0 := &PredefinedRules{} + b, x := &b0, m0 + _, _ = b, x + x.Cel = b.Cel + return m0 +} + +// FloatRules describes the rules applied to `float` values. These +// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type. +type FloatRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // value must equal 42.0 + // float value = 1 [(buf.validate.field).float.const = 42.0]; + // } + // + // ``` + Const *float32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *FloatRules_Lt + // *FloatRules_Lte + LessThan isFloatRules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *FloatRules_Gt + // *FloatRules_Gte + GreaterThan isFloatRules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyFloat { + // // must be in list [1.0, 2.0, 3.0] + // float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + In []float32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFloat { + // // value must not be in list [1.0, 2.0, 3.0] + // float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + NotIn []float32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `finite` requires the field value to be finite. If the field value is + // infinite or NaN, an error message is generated. + Finite *bool `protobuf:"varint,8,opt,name=finite" json:"finite,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFloat { + // float value = 1 [ + // (buf.validate.field).float.example = 1.0, + // (buf.validate.field).float.example = inf + // ]; + // } + // + // ``` + Example []float32 `protobuf:"fixed32,9,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FloatRules) Reset() { + *x = FloatRules{} + mi := &file_buf_validate_validate_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FloatRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FloatRules) ProtoMessage() {} + +func (x *FloatRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FloatRules) GetConst() float32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *FloatRules) GetLessThan() isFloatRules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *FloatRules) GetLt() float32 { + if x != nil { + if x, ok := x.LessThan.(*FloatRules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *FloatRules) GetLte() float32 { + if x != nil { + if x, ok := x.LessThan.(*FloatRules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *FloatRules) GetGreaterThan() isFloatRules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *FloatRules) GetGt() float32 { + if x != nil { + if x, ok := x.GreaterThan.(*FloatRules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *FloatRules) GetGte() float32 { + if x != nil { + if x, ok := x.GreaterThan.(*FloatRules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *FloatRules) GetIn() []float32 { + if x != nil { + return x.In + } + return nil +} + +func (x *FloatRules) GetNotIn() []float32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *FloatRules) GetFinite() bool { + if x != nil && x.Finite != nil { + return *x.Finite + } + return false +} + +func (x *FloatRules) GetExample() []float32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *FloatRules) SetConst(v float32) { + x.Const = &v +} + +func (x *FloatRules) SetLt(v float32) { + x.LessThan = &FloatRules_Lt{v} +} + +func (x *FloatRules) SetLte(v float32) { + x.LessThan = &FloatRules_Lte{v} +} + +func (x *FloatRules) SetGt(v float32) { + x.GreaterThan = &FloatRules_Gt{v} +} + +func (x *FloatRules) SetGte(v float32) { + x.GreaterThan = &FloatRules_Gte{v} +} + +func (x *FloatRules) SetIn(v []float32) { + x.In = v +} + +func (x *FloatRules) SetNotIn(v []float32) { + x.NotIn = v +} + +func (x *FloatRules) SetFinite(v bool) { + x.Finite = &v +} + +func (x *FloatRules) SetExample(v []float32) { + x.Example = v +} + +func (x *FloatRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *FloatRules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *FloatRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*FloatRules_Lt) + return ok +} + +func (x *FloatRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*FloatRules_Lte) + return ok +} + +func (x *FloatRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *FloatRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*FloatRules_Gt) + return ok +} + +func (x *FloatRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*FloatRules_Gte) + return ok +} + +func (x *FloatRules) HasFinite() bool { + if x == nil { + return false + } + return x.Finite != nil +} + +func (x *FloatRules) ClearConst() { + x.Const = nil +} + +func (x *FloatRules) ClearLessThan() { + x.LessThan = nil +} + +func (x *FloatRules) ClearLt() { + if _, ok := x.LessThan.(*FloatRules_Lt); ok { + x.LessThan = nil + } +} + +func (x *FloatRules) ClearLte() { + if _, ok := x.LessThan.(*FloatRules_Lte); ok { + x.LessThan = nil + } +} + +func (x *FloatRules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *FloatRules) ClearGt() { + if _, ok := x.GreaterThan.(*FloatRules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *FloatRules) ClearGte() { + if _, ok := x.GreaterThan.(*FloatRules_Gte); ok { + x.GreaterThan = nil + } +} + +func (x *FloatRules) ClearFinite() { + x.Finite = nil +} + +const FloatRules_LessThan_not_set_case case_FloatRules_LessThan = 0 +const FloatRules_Lt_case case_FloatRules_LessThan = 2 +const FloatRules_Lte_case case_FloatRules_LessThan = 3 + +func (x *FloatRules) WhichLessThan() case_FloatRules_LessThan { + if x == nil { + return FloatRules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *FloatRules_Lt: + return FloatRules_Lt_case + case *FloatRules_Lte: + return FloatRules_Lte_case + default: + return FloatRules_LessThan_not_set_case + } +} + +const FloatRules_GreaterThan_not_set_case case_FloatRules_GreaterThan = 0 +const FloatRules_Gt_case case_FloatRules_GreaterThan = 4 +const FloatRules_Gte_case case_FloatRules_GreaterThan = 5 + +func (x *FloatRules) WhichGreaterThan() case_FloatRules_GreaterThan { + if x == nil { + return FloatRules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *FloatRules_Gt: + return FloatRules_Gt_case + case *FloatRules_Gte: + return FloatRules_Gte_case + default: + return FloatRules_GreaterThan_not_set_case + } +} + +type FloatRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // value must equal 42.0 + // float value = 1 [(buf.validate.field).float.const = 42.0]; + // } + // + // ``` + Const *float32 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than 10.0 + // float value = 1 [(buf.validate.field).float.lt = 10.0]; + // } + // + // ``` + Lt *float32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than or equal to 10.0 + // float value = 1 [(buf.validate.field).float.lte = 10.0]; + // } + // + // ``` + Lte *float32 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than 5.0 [float.gt] + // float value = 1 [(buf.validate.field).float.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [float.gt_lt] + // float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt *float32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than or equal to 5.0 [float.gte] + // float value = 1 [(buf.validate.field).float.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt] + // float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte *float32 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyFloat { + // // must be in list [1.0, 2.0, 3.0] + // float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + In []float32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFloat { + // // value must not be in list [1.0, 2.0, 3.0] + // float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + NotIn []float32 + // `finite` requires the field value to be finite. If the field value is + // infinite or NaN, an error message is generated. + Finite *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFloat { + // float value = 1 [ + // (buf.validate.field).float.example = 1.0, + // (buf.validate.field).float.example = inf + // ]; + // } + // + // ``` + Example []float32 +} + +func (b0 FloatRules_builder) Build() *FloatRules { + m0 := &FloatRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &FloatRules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &FloatRules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &FloatRules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &FloatRules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Finite = b.Finite + x.Example = b.Example + return m0 +} + +type case_FloatRules_LessThan protoreflect.FieldNumber + +func (x case_FloatRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[6].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_FloatRules_GreaterThan protoreflect.FieldNumber + +func (x case_FloatRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[6].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFloatRules_LessThan interface { + isFloatRules_LessThan() +} + +type FloatRules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than 10.0 + // float value = 1 [(buf.validate.field).float.lt = 10.0]; + // } + // + // ``` + Lt float32 `protobuf:"fixed32,2,opt,name=lt,oneof"` +} + +type FloatRules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than or equal to 10.0 + // float value = 1 [(buf.validate.field).float.lte = 10.0]; + // } + // + // ``` + Lte float32 `protobuf:"fixed32,3,opt,name=lte,oneof"` +} + +func (*FloatRules_Lt) isFloatRules_LessThan() {} + +func (*FloatRules_Lte) isFloatRules_LessThan() {} + +type isFloatRules_GreaterThan interface { + isFloatRules_GreaterThan() +} + +type FloatRules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than 5.0 [float.gt] + // float value = 1 [(buf.validate.field).float.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [float.gt_lt] + // float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt float32 `protobuf:"fixed32,4,opt,name=gt,oneof"` +} + +type FloatRules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than or equal to 5.0 [float.gte] + // float value = 1 [(buf.validate.field).float.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt] + // float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte float32 `protobuf:"fixed32,5,opt,name=gte,oneof"` +} + +func (*FloatRules_Gt) isFloatRules_GreaterThan() {} + +func (*FloatRules_Gte) isFloatRules_GreaterThan() {} + +// DoubleRules describes the rules applied to `double` values. These +// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type. +type DoubleRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // value must equal 42.0 + // double value = 1 [(buf.validate.field).double.const = 42.0]; + // } + // + // ``` + Const *float64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *DoubleRules_Lt + // *DoubleRules_Lte + LessThan isDoubleRules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *DoubleRules_Gt + // *DoubleRules_Gte + GreaterThan isDoubleRules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyDouble { + // // must be in list [1.0, 2.0, 3.0] + // double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + In []float64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // value must not be in list [1.0, 2.0, 3.0] + // double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + NotIn []float64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `finite` requires the field value to be finite. If the field value is + // infinite or NaN, an error message is generated. + Finite *bool `protobuf:"varint,8,opt,name=finite" json:"finite,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyDouble { + // double value = 1 [ + // (buf.validate.field).double.example = 1.0, + // (buf.validate.field).double.example = inf + // ]; + // } + // + // ``` + Example []float64 `protobuf:"fixed64,9,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DoubleRules) Reset() { + *x = DoubleRules{} + mi := &file_buf_validate_validate_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DoubleRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleRules) ProtoMessage() {} + +func (x *DoubleRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DoubleRules) GetConst() float64 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *DoubleRules) GetLessThan() isDoubleRules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *DoubleRules) GetLt() float64 { + if x != nil { + if x, ok := x.LessThan.(*DoubleRules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *DoubleRules) GetLte() float64 { + if x != nil { + if x, ok := x.LessThan.(*DoubleRules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *DoubleRules) GetGreaterThan() isDoubleRules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *DoubleRules) GetGt() float64 { + if x != nil { + if x, ok := x.GreaterThan.(*DoubleRules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *DoubleRules) GetGte() float64 { + if x != nil { + if x, ok := x.GreaterThan.(*DoubleRules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *DoubleRules) GetIn() []float64 { + if x != nil { + return x.In + } + return nil +} + +func (x *DoubleRules) GetNotIn() []float64 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *DoubleRules) GetFinite() bool { + if x != nil && x.Finite != nil { + return *x.Finite + } + return false +} + +func (x *DoubleRules) GetExample() []float64 { + if x != nil { + return x.Example + } + return nil +} + +func (x *DoubleRules) SetConst(v float64) { + x.Const = &v +} + +func (x *DoubleRules) SetLt(v float64) { + x.LessThan = &DoubleRules_Lt{v} +} + +func (x *DoubleRules) SetLte(v float64) { + x.LessThan = &DoubleRules_Lte{v} +} + +func (x *DoubleRules) SetGt(v float64) { + x.GreaterThan = &DoubleRules_Gt{v} +} + +func (x *DoubleRules) SetGte(v float64) { + x.GreaterThan = &DoubleRules_Gte{v} +} + +func (x *DoubleRules) SetIn(v []float64) { + x.In = v +} + +func (x *DoubleRules) SetNotIn(v []float64) { + x.NotIn = v +} + +func (x *DoubleRules) SetFinite(v bool) { + x.Finite = &v +} + +func (x *DoubleRules) SetExample(v []float64) { + x.Example = v +} + +func (x *DoubleRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *DoubleRules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *DoubleRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*DoubleRules_Lt) + return ok +} + +func (x *DoubleRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*DoubleRules_Lte) + return ok +} + +func (x *DoubleRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *DoubleRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*DoubleRules_Gt) + return ok +} + +func (x *DoubleRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*DoubleRules_Gte) + return ok +} + +func (x *DoubleRules) HasFinite() bool { + if x == nil { + return false + } + return x.Finite != nil +} + +func (x *DoubleRules) ClearConst() { + x.Const = nil +} + +func (x *DoubleRules) ClearLessThan() { + x.LessThan = nil +} + +func (x *DoubleRules) ClearLt() { + if _, ok := x.LessThan.(*DoubleRules_Lt); ok { + x.LessThan = nil + } +} + +func (x *DoubleRules) ClearLte() { + if _, ok := x.LessThan.(*DoubleRules_Lte); ok { + x.LessThan = nil + } +} + +func (x *DoubleRules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *DoubleRules) ClearGt() { + if _, ok := x.GreaterThan.(*DoubleRules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *DoubleRules) ClearGte() { + if _, ok := x.GreaterThan.(*DoubleRules_Gte); ok { + x.GreaterThan = nil + } +} + +func (x *DoubleRules) ClearFinite() { + x.Finite = nil +} + +const DoubleRules_LessThan_not_set_case case_DoubleRules_LessThan = 0 +const DoubleRules_Lt_case case_DoubleRules_LessThan = 2 +const DoubleRules_Lte_case case_DoubleRules_LessThan = 3 + +func (x *DoubleRules) WhichLessThan() case_DoubleRules_LessThan { + if x == nil { + return DoubleRules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *DoubleRules_Lt: + return DoubleRules_Lt_case + case *DoubleRules_Lte: + return DoubleRules_Lte_case + default: + return DoubleRules_LessThan_not_set_case + } +} + +const DoubleRules_GreaterThan_not_set_case case_DoubleRules_GreaterThan = 0 +const DoubleRules_Gt_case case_DoubleRules_GreaterThan = 4 +const DoubleRules_Gte_case case_DoubleRules_GreaterThan = 5 + +func (x *DoubleRules) WhichGreaterThan() case_DoubleRules_GreaterThan { + if x == nil { + return DoubleRules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *DoubleRules_Gt: + return DoubleRules_Gt_case + case *DoubleRules_Gte: + return DoubleRules_Gte_case + default: + return DoubleRules_GreaterThan_not_set_case + } +} + +type DoubleRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // value must equal 42.0 + // double value = 1 [(buf.validate.field).double.const = 42.0]; + // } + // + // ``` + Const *float64 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than 10.0 + // double value = 1 [(buf.validate.field).double.lt = 10.0]; + // } + // + // ``` + Lt *float64 + // `lte` requires the field value to be less than or equal to the specified value + // (field <= value). If the field value is greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than or equal to 10.0 + // double value = 1 [(buf.validate.field).double.lte = 10.0]; + // } + // + // ``` + Lte *float64 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`, + // the range is reversed, and the field value must be outside the specified + // range. If the field value doesn't meet the required conditions, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than 5.0 [double.gt] + // double value = 1 [(buf.validate.field).double.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [double.gt_lt] + // double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt *float64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than or equal to 5.0 [double.gte] + // double value = 1 [(buf.validate.field).double.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt] + // double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte *float64 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyDouble { + // // must be in list [1.0, 2.0, 3.0] + // double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + In []float64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // value must not be in list [1.0, 2.0, 3.0] + // double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + NotIn []float64 + // `finite` requires the field value to be finite. If the field value is + // infinite or NaN, an error message is generated. + Finite *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyDouble { + // double value = 1 [ + // (buf.validate.field).double.example = 1.0, + // (buf.validate.field).double.example = inf + // ]; + // } + // + // ``` + Example []float64 +} + +func (b0 DoubleRules_builder) Build() *DoubleRules { + m0 := &DoubleRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &DoubleRules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &DoubleRules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &DoubleRules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &DoubleRules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Finite = b.Finite + x.Example = b.Example + return m0 +} + +type case_DoubleRules_LessThan protoreflect.FieldNumber + +func (x case_DoubleRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[7].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_DoubleRules_GreaterThan protoreflect.FieldNumber + +func (x case_DoubleRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[7].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isDoubleRules_LessThan interface { + isDoubleRules_LessThan() +} + +type DoubleRules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than 10.0 + // double value = 1 [(buf.validate.field).double.lt = 10.0]; + // } + // + // ``` + Lt float64 `protobuf:"fixed64,2,opt,name=lt,oneof"` +} + +type DoubleRules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified value + // (field <= value). If the field value is greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than or equal to 10.0 + // double value = 1 [(buf.validate.field).double.lte = 10.0]; + // } + // + // ``` + Lte float64 `protobuf:"fixed64,3,opt,name=lte,oneof"` +} + +func (*DoubleRules_Lt) isDoubleRules_LessThan() {} + +func (*DoubleRules_Lte) isDoubleRules_LessThan() {} + +type isDoubleRules_GreaterThan interface { + isDoubleRules_GreaterThan() +} + +type DoubleRules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`, + // the range is reversed, and the field value must be outside the specified + // range. If the field value doesn't meet the required conditions, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than 5.0 [double.gt] + // double value = 1 [(buf.validate.field).double.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [double.gt_lt] + // double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt float64 `protobuf:"fixed64,4,opt,name=gt,oneof"` +} + +type DoubleRules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than or equal to 5.0 [double.gte] + // double value = 1 [(buf.validate.field).double.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt] + // double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte float64 `protobuf:"fixed64,5,opt,name=gte,oneof"` +} + +func (*DoubleRules_Gt) isDoubleRules_GreaterThan() {} + +func (*DoubleRules_Gte) isDoubleRules_GreaterThan() {} + +// Int32Rules describes the rules applied to `int32` values. These +// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type. +type Int32Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // value must equal 42 + // int32 value = 1 [(buf.validate.field).int32.const = 42]; + // } + // + // ``` + Const *int32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *Int32Rules_Lt + // *Int32Rules_Lte + LessThan isInt32Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *Int32Rules_Gt + // *Int32Rules_Gte + GreaterThan isInt32Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyInt32 { + // // must be in list [1, 2, 3] + // int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyInt32 { + // // value must not be in list [1, 2, 3] + // int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyInt32 { + // int32 value = 1 [ + // (buf.validate.field).int32.example = 1, + // (buf.validate.field).int32.example = -10 + // ]; + // } + // + // ``` + Example []int32 `protobuf:"varint,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Int32Rules) Reset() { + *x = Int32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Int32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int32Rules) ProtoMessage() {} + +func (x *Int32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Int32Rules) GetConst() int32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *Int32Rules) GetLessThan() isInt32Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *Int32Rules) GetLt() int32 { + if x != nil { + if x, ok := x.LessThan.(*Int32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Int32Rules) GetLte() int32 { + if x != nil { + if x, ok := x.LessThan.(*Int32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Int32Rules) GetGreaterThan() isInt32Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *Int32Rules) GetGt() int32 { + if x != nil { + if x, ok := x.GreaterThan.(*Int32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Int32Rules) GetGte() int32 { + if x != nil { + if x, ok := x.GreaterThan.(*Int32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Int32Rules) GetIn() []int32 { + if x != nil { + return x.In + } + return nil +} + +func (x *Int32Rules) GetNotIn() []int32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *Int32Rules) GetExample() []int32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *Int32Rules) SetConst(v int32) { + x.Const = &v +} + +func (x *Int32Rules) SetLt(v int32) { + x.LessThan = &Int32Rules_Lt{v} +} + +func (x *Int32Rules) SetLte(v int32) { + x.LessThan = &Int32Rules_Lte{v} +} + +func (x *Int32Rules) SetGt(v int32) { + x.GreaterThan = &Int32Rules_Gt{v} +} + +func (x *Int32Rules) SetGte(v int32) { + x.GreaterThan = &Int32Rules_Gte{v} +} + +func (x *Int32Rules) SetIn(v []int32) { + x.In = v +} + +func (x *Int32Rules) SetNotIn(v []int32) { + x.NotIn = v +} + +func (x *Int32Rules) SetExample(v []int32) { + x.Example = v +} + +func (x *Int32Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *Int32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *Int32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Int32Rules_Lt) + return ok +} + +func (x *Int32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Int32Rules_Lte) + return ok +} + +func (x *Int32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *Int32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Int32Rules_Gt) + return ok +} + +func (x *Int32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Int32Rules_Gte) + return ok +} + +func (x *Int32Rules) ClearConst() { + x.Const = nil +} + +func (x *Int32Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *Int32Rules) ClearLt() { + if _, ok := x.LessThan.(*Int32Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *Int32Rules) ClearLte() { + if _, ok := x.LessThan.(*Int32Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *Int32Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *Int32Rules) ClearGt() { + if _, ok := x.GreaterThan.(*Int32Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *Int32Rules) ClearGte() { + if _, ok := x.GreaterThan.(*Int32Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const Int32Rules_LessThan_not_set_case case_Int32Rules_LessThan = 0 +const Int32Rules_Lt_case case_Int32Rules_LessThan = 2 +const Int32Rules_Lte_case case_Int32Rules_LessThan = 3 + +func (x *Int32Rules) WhichLessThan() case_Int32Rules_LessThan { + if x == nil { + return Int32Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *Int32Rules_Lt: + return Int32Rules_Lt_case + case *Int32Rules_Lte: + return Int32Rules_Lte_case + default: + return Int32Rules_LessThan_not_set_case + } +} + +const Int32Rules_GreaterThan_not_set_case case_Int32Rules_GreaterThan = 0 +const Int32Rules_Gt_case case_Int32Rules_GreaterThan = 4 +const Int32Rules_Gte_case case_Int32Rules_GreaterThan = 5 + +func (x *Int32Rules) WhichGreaterThan() case_Int32Rules_GreaterThan { + if x == nil { + return Int32Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *Int32Rules_Gt: + return Int32Rules_Gt_case + case *Int32Rules_Gte: + return Int32Rules_Gte_case + default: + return Int32Rules_GreaterThan_not_set_case + } +} + +type Int32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // value must equal 42 + // int32 value = 1 [(buf.validate.field).int32.const = 42]; + // } + // + // ``` + Const *int32 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than 10 + // int32 value = 1 [(buf.validate.field).int32.lt = 10]; + // } + // + // ``` + Lt *int32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than or equal to 10 + // int32 value = 1 [(buf.validate.field).int32.lte = 10]; + // } + // + // ``` + Lte *int32 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than 5 [int32.gt] + // int32 value = 1 [(buf.validate.field).int32.gt = 5]; + // + // // must be greater than 5 and less than 10 [int32.gt_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int32.gt_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int32 + // `gte` requires the field value to be greater than or equal to the specified value + // (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than or equal to 5 [int32.gte] + // int32 value = 1 [(buf.validate.field).int32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int32.gte_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int32 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyInt32 { + // // must be in list [1, 2, 3] + // int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyInt32 { + // // value must not be in list [1, 2, 3] + // int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyInt32 { + // int32 value = 1 [ + // (buf.validate.field).int32.example = 1, + // (buf.validate.field).int32.example = -10 + // ]; + // } + // + // ``` + Example []int32 +} + +func (b0 Int32Rules_builder) Build() *Int32Rules { + m0 := &Int32Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &Int32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &Int32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &Int32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &Int32Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_Int32Rules_LessThan protoreflect.FieldNumber + +func (x case_Int32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[8].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Int32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Int32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[8].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isInt32Rules_LessThan interface { + isInt32Rules_LessThan() +} + +type Int32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than 10 + // int32 value = 1 [(buf.validate.field).int32.lt = 10]; + // } + // + // ``` + Lt int32 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type Int32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than or equal to 10 + // int32 value = 1 [(buf.validate.field).int32.lte = 10]; + // } + // + // ``` + Lte int32 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*Int32Rules_Lt) isInt32Rules_LessThan() {} + +func (*Int32Rules_Lte) isInt32Rules_LessThan() {} + +type isInt32Rules_GreaterThan interface { + isInt32Rules_GreaterThan() +} + +type Int32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than 5 [int32.gt] + // int32 value = 1 [(buf.validate.field).int32.gt = 5]; + // + // // must be greater than 5 and less than 10 [int32.gt_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int32.gt_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int32 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type Int32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified value + // (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than or equal to 5 [int32.gte] + // int32 value = 1 [(buf.validate.field).int32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int32.gte_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int32 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*Int32Rules_Gt) isInt32Rules_GreaterThan() {} + +func (*Int32Rules_Gte) isInt32Rules_GreaterThan() {} + +// Int64Rules describes the rules applied to `int64` values. These +// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type. +type Int64Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // value must equal 42 + // int64 value = 1 [(buf.validate.field).int64.const = 42]; + // } + // + // ``` + Const *int64 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *Int64Rules_Lt + // *Int64Rules_Lte + LessThan isInt64Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *Int64Rules_Gt + // *Int64Rules_Gte + GreaterThan isInt64Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyInt64 { + // // must be in list [1, 2, 3] + // int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyInt64 { + // // value must not be in list [1, 2, 3] + // int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyInt64 { + // int64 value = 1 [ + // (buf.validate.field).int64.example = 1, + // (buf.validate.field).int64.example = -10 + // ]; + // } + // + // ``` + Example []int64 `protobuf:"varint,9,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Int64Rules) Reset() { + *x = Int64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Int64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int64Rules) ProtoMessage() {} + +func (x *Int64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Int64Rules) GetConst() int64 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *Int64Rules) GetLessThan() isInt64Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *Int64Rules) GetLt() int64 { + if x != nil { + if x, ok := x.LessThan.(*Int64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Int64Rules) GetLte() int64 { + if x != nil { + if x, ok := x.LessThan.(*Int64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Int64Rules) GetGreaterThan() isInt64Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *Int64Rules) GetGt() int64 { + if x != nil { + if x, ok := x.GreaterThan.(*Int64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Int64Rules) GetGte() int64 { + if x != nil { + if x, ok := x.GreaterThan.(*Int64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Int64Rules) GetIn() []int64 { + if x != nil { + return x.In + } + return nil +} + +func (x *Int64Rules) GetNotIn() []int64 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *Int64Rules) GetExample() []int64 { + if x != nil { + return x.Example + } + return nil +} + +func (x *Int64Rules) SetConst(v int64) { + x.Const = &v +} + +func (x *Int64Rules) SetLt(v int64) { + x.LessThan = &Int64Rules_Lt{v} +} + +func (x *Int64Rules) SetLte(v int64) { + x.LessThan = &Int64Rules_Lte{v} +} + +func (x *Int64Rules) SetGt(v int64) { + x.GreaterThan = &Int64Rules_Gt{v} +} + +func (x *Int64Rules) SetGte(v int64) { + x.GreaterThan = &Int64Rules_Gte{v} +} + +func (x *Int64Rules) SetIn(v []int64) { + x.In = v +} + +func (x *Int64Rules) SetNotIn(v []int64) { + x.NotIn = v +} + +func (x *Int64Rules) SetExample(v []int64) { + x.Example = v +} + +func (x *Int64Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *Int64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *Int64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Int64Rules_Lt) + return ok +} + +func (x *Int64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Int64Rules_Lte) + return ok +} + +func (x *Int64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *Int64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Int64Rules_Gt) + return ok +} + +func (x *Int64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Int64Rules_Gte) + return ok +} + +func (x *Int64Rules) ClearConst() { + x.Const = nil +} + +func (x *Int64Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *Int64Rules) ClearLt() { + if _, ok := x.LessThan.(*Int64Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *Int64Rules) ClearLte() { + if _, ok := x.LessThan.(*Int64Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *Int64Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *Int64Rules) ClearGt() { + if _, ok := x.GreaterThan.(*Int64Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *Int64Rules) ClearGte() { + if _, ok := x.GreaterThan.(*Int64Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const Int64Rules_LessThan_not_set_case case_Int64Rules_LessThan = 0 +const Int64Rules_Lt_case case_Int64Rules_LessThan = 2 +const Int64Rules_Lte_case case_Int64Rules_LessThan = 3 + +func (x *Int64Rules) WhichLessThan() case_Int64Rules_LessThan { + if x == nil { + return Int64Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *Int64Rules_Lt: + return Int64Rules_Lt_case + case *Int64Rules_Lte: + return Int64Rules_Lte_case + default: + return Int64Rules_LessThan_not_set_case + } +} + +const Int64Rules_GreaterThan_not_set_case case_Int64Rules_GreaterThan = 0 +const Int64Rules_Gt_case case_Int64Rules_GreaterThan = 4 +const Int64Rules_Gte_case case_Int64Rules_GreaterThan = 5 + +func (x *Int64Rules) WhichGreaterThan() case_Int64Rules_GreaterThan { + if x == nil { + return Int64Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *Int64Rules_Gt: + return Int64Rules_Gt_case + case *Int64Rules_Gte: + return Int64Rules_Gte_case + default: + return Int64Rules_GreaterThan_not_set_case + } +} + +type Int64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // value must equal 42 + // int64 value = 1 [(buf.validate.field).int64.const = 42]; + // } + // + // ``` + Const *int64 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than 10 + // int64 value = 1 [(buf.validate.field).int64.lt = 10]; + // } + // + // ``` + Lt *int64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than or equal to 10 + // int64 value = 1 [(buf.validate.field).int64.lte = 10]; + // } + // + // ``` + Lte *int64 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than 5 [int64.gt] + // int64 value = 1 [(buf.validate.field).int64.gt = 5]; + // + // // must be greater than 5 and less than 10 [int64.gt_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int64.gt_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than or equal to 5 [int64.gte] + // int64 value = 1 [(buf.validate.field).int64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int64.gte_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int64 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyInt64 { + // // must be in list [1, 2, 3] + // int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyInt64 { + // // value must not be in list [1, 2, 3] + // int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyInt64 { + // int64 value = 1 [ + // (buf.validate.field).int64.example = 1, + // (buf.validate.field).int64.example = -10 + // ]; + // } + // + // ``` + Example []int64 +} + +func (b0 Int64Rules_builder) Build() *Int64Rules { + m0 := &Int64Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &Int64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &Int64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &Int64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &Int64Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_Int64Rules_LessThan protoreflect.FieldNumber + +func (x case_Int64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[9].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Int64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Int64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[9].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isInt64Rules_LessThan interface { + isInt64Rules_LessThan() +} + +type Int64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than 10 + // int64 value = 1 [(buf.validate.field).int64.lt = 10]; + // } + // + // ``` + Lt int64 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type Int64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than or equal to 10 + // int64 value = 1 [(buf.validate.field).int64.lte = 10]; + // } + // + // ``` + Lte int64 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*Int64Rules_Lt) isInt64Rules_LessThan() {} + +func (*Int64Rules_Lte) isInt64Rules_LessThan() {} + +type isInt64Rules_GreaterThan interface { + isInt64Rules_GreaterThan() +} + +type Int64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than 5 [int64.gt] + // int64 value = 1 [(buf.validate.field).int64.gt = 5]; + // + // // must be greater than 5 and less than 10 [int64.gt_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int64.gt_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int64 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type Int64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than or equal to 5 [int64.gte] + // int64 value = 1 [(buf.validate.field).int64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int64.gte_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int64 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*Int64Rules_Gt) isInt64Rules_GreaterThan() {} + +func (*Int64Rules_Gte) isInt64Rules_GreaterThan() {} + +// UInt32Rules describes the rules applied to `uint32` values. These +// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type. +type UInt32Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // value must equal 42 + // uint32 value = 1 [(buf.validate.field).uint32.const = 42]; + // } + // + // ``` + Const *uint32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *UInt32Rules_Lt + // *UInt32Rules_Lte + LessThan isUInt32Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *UInt32Rules_Gt + // *UInt32Rules_Gte + GreaterThan isUInt32Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyUInt32 { + // // must be in list [1, 2, 3] + // uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint32 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyUInt32 { + // // value must not be in list [1, 2, 3] + // uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint32 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyUInt32 { + // uint32 value = 1 [ + // (buf.validate.field).uint32.example = 1, + // (buf.validate.field).uint32.example = 10 + // ]; + // } + // + // ``` + Example []uint32 `protobuf:"varint,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UInt32Rules) Reset() { + *x = UInt32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UInt32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UInt32Rules) ProtoMessage() {} + +func (x *UInt32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *UInt32Rules) GetConst() uint32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *UInt32Rules) GetLessThan() isUInt32Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *UInt32Rules) GetLt() uint32 { + if x != nil { + if x, ok := x.LessThan.(*UInt32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *UInt32Rules) GetLte() uint32 { + if x != nil { + if x, ok := x.LessThan.(*UInt32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *UInt32Rules) GetGreaterThan() isUInt32Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *UInt32Rules) GetGt() uint32 { + if x != nil { + if x, ok := x.GreaterThan.(*UInt32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *UInt32Rules) GetGte() uint32 { + if x != nil { + if x, ok := x.GreaterThan.(*UInt32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *UInt32Rules) GetIn() []uint32 { + if x != nil { + return x.In + } + return nil +} + +func (x *UInt32Rules) GetNotIn() []uint32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *UInt32Rules) GetExample() []uint32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *UInt32Rules) SetConst(v uint32) { + x.Const = &v +} + +func (x *UInt32Rules) SetLt(v uint32) { + x.LessThan = &UInt32Rules_Lt{v} +} + +func (x *UInt32Rules) SetLte(v uint32) { + x.LessThan = &UInt32Rules_Lte{v} +} + +func (x *UInt32Rules) SetGt(v uint32) { + x.GreaterThan = &UInt32Rules_Gt{v} +} + +func (x *UInt32Rules) SetGte(v uint32) { + x.GreaterThan = &UInt32Rules_Gte{v} +} + +func (x *UInt32Rules) SetIn(v []uint32) { + x.In = v +} + +func (x *UInt32Rules) SetNotIn(v []uint32) { + x.NotIn = v +} + +func (x *UInt32Rules) SetExample(v []uint32) { + x.Example = v +} + +func (x *UInt32Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *UInt32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *UInt32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*UInt32Rules_Lt) + return ok +} + +func (x *UInt32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*UInt32Rules_Lte) + return ok +} + +func (x *UInt32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *UInt32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*UInt32Rules_Gt) + return ok +} + +func (x *UInt32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*UInt32Rules_Gte) + return ok +} + +func (x *UInt32Rules) ClearConst() { + x.Const = nil +} + +func (x *UInt32Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *UInt32Rules) ClearLt() { + if _, ok := x.LessThan.(*UInt32Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *UInt32Rules) ClearLte() { + if _, ok := x.LessThan.(*UInt32Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *UInt32Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *UInt32Rules) ClearGt() { + if _, ok := x.GreaterThan.(*UInt32Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *UInt32Rules) ClearGte() { + if _, ok := x.GreaterThan.(*UInt32Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const UInt32Rules_LessThan_not_set_case case_UInt32Rules_LessThan = 0 +const UInt32Rules_Lt_case case_UInt32Rules_LessThan = 2 +const UInt32Rules_Lte_case case_UInt32Rules_LessThan = 3 + +func (x *UInt32Rules) WhichLessThan() case_UInt32Rules_LessThan { + if x == nil { + return UInt32Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *UInt32Rules_Lt: + return UInt32Rules_Lt_case + case *UInt32Rules_Lte: + return UInt32Rules_Lte_case + default: + return UInt32Rules_LessThan_not_set_case + } +} + +const UInt32Rules_GreaterThan_not_set_case case_UInt32Rules_GreaterThan = 0 +const UInt32Rules_Gt_case case_UInt32Rules_GreaterThan = 4 +const UInt32Rules_Gte_case case_UInt32Rules_GreaterThan = 5 + +func (x *UInt32Rules) WhichGreaterThan() case_UInt32Rules_GreaterThan { + if x == nil { + return UInt32Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *UInt32Rules_Gt: + return UInt32Rules_Gt_case + case *UInt32Rules_Gte: + return UInt32Rules_Gte_case + default: + return UInt32Rules_GreaterThan_not_set_case + } +} + +type UInt32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // value must equal 42 + // uint32 value = 1 [(buf.validate.field).uint32.const = 42]; + // } + // + // ``` + Const *uint32 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than 10 + // uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; + // } + // + // ``` + Lt *uint32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than or equal to 10 + // uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; + // } + // + // ``` + Lte *uint32 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than 5 [uint32.gt] + // uint32 value = 1 [(buf.validate.field).uint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint32.gt_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than or equal to 5 [uint32.gte] + // uint32 value = 1 [(buf.validate.field).uint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint32.gte_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint32 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyUInt32 { + // // must be in list [1, 2, 3] + // uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyUInt32 { + // // value must not be in list [1, 2, 3] + // uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyUInt32 { + // uint32 value = 1 [ + // (buf.validate.field).uint32.example = 1, + // (buf.validate.field).uint32.example = 10 + // ]; + // } + // + // ``` + Example []uint32 +} + +func (b0 UInt32Rules_builder) Build() *UInt32Rules { + m0 := &UInt32Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &UInt32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &UInt32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &UInt32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &UInt32Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_UInt32Rules_LessThan protoreflect.FieldNumber + +func (x case_UInt32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[10].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_UInt32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_UInt32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[10].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isUInt32Rules_LessThan interface { + isUInt32Rules_LessThan() +} + +type UInt32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than 10 + // uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; + // } + // + // ``` + Lt uint32 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type UInt32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than or equal to 10 + // uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; + // } + // + // ``` + Lte uint32 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*UInt32Rules_Lt) isUInt32Rules_LessThan() {} + +func (*UInt32Rules_Lte) isUInt32Rules_LessThan() {} + +type isUInt32Rules_GreaterThan interface { + isUInt32Rules_GreaterThan() +} + +type UInt32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than 5 [uint32.gt] + // uint32 value = 1 [(buf.validate.field).uint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint32.gt_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint32 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type UInt32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than or equal to 5 [uint32.gte] + // uint32 value = 1 [(buf.validate.field).uint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint32.gte_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint32 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*UInt32Rules_Gt) isUInt32Rules_GreaterThan() {} + +func (*UInt32Rules_Gte) isUInt32Rules_GreaterThan() {} + +// UInt64Rules describes the rules applied to `uint64` values. These +// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type. +type UInt64Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // value must equal 42 + // uint64 value = 1 [(buf.validate.field).uint64.const = 42]; + // } + // + // ``` + Const *uint64 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *UInt64Rules_Lt + // *UInt64Rules_Lte + LessThan isUInt64Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *UInt64Rules_Gt + // *UInt64Rules_Gte + GreaterThan isUInt64Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyUInt64 { + // // must be in list [1, 2, 3] + // uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint64 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyUInt64 { + // // value must not be in list [1, 2, 3] + // uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint64 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyUInt64 { + // uint64 value = 1 [ + // (buf.validate.field).uint64.example = 1, + // (buf.validate.field).uint64.example = -10 + // ]; + // } + // + // ``` + Example []uint64 `protobuf:"varint,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UInt64Rules) Reset() { + *x = UInt64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UInt64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UInt64Rules) ProtoMessage() {} + +func (x *UInt64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *UInt64Rules) GetConst() uint64 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *UInt64Rules) GetLessThan() isUInt64Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *UInt64Rules) GetLt() uint64 { + if x != nil { + if x, ok := x.LessThan.(*UInt64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *UInt64Rules) GetLte() uint64 { + if x != nil { + if x, ok := x.LessThan.(*UInt64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *UInt64Rules) GetGreaterThan() isUInt64Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *UInt64Rules) GetGt() uint64 { + if x != nil { + if x, ok := x.GreaterThan.(*UInt64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *UInt64Rules) GetGte() uint64 { + if x != nil { + if x, ok := x.GreaterThan.(*UInt64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *UInt64Rules) GetIn() []uint64 { + if x != nil { + return x.In + } + return nil +} + +func (x *UInt64Rules) GetNotIn() []uint64 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *UInt64Rules) GetExample() []uint64 { + if x != nil { + return x.Example + } + return nil +} + +func (x *UInt64Rules) SetConst(v uint64) { + x.Const = &v +} + +func (x *UInt64Rules) SetLt(v uint64) { + x.LessThan = &UInt64Rules_Lt{v} +} + +func (x *UInt64Rules) SetLte(v uint64) { + x.LessThan = &UInt64Rules_Lte{v} +} + +func (x *UInt64Rules) SetGt(v uint64) { + x.GreaterThan = &UInt64Rules_Gt{v} +} + +func (x *UInt64Rules) SetGte(v uint64) { + x.GreaterThan = &UInt64Rules_Gte{v} +} + +func (x *UInt64Rules) SetIn(v []uint64) { + x.In = v +} + +func (x *UInt64Rules) SetNotIn(v []uint64) { + x.NotIn = v +} + +func (x *UInt64Rules) SetExample(v []uint64) { + x.Example = v +} + +func (x *UInt64Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *UInt64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *UInt64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*UInt64Rules_Lt) + return ok +} + +func (x *UInt64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*UInt64Rules_Lte) + return ok +} + +func (x *UInt64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *UInt64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*UInt64Rules_Gt) + return ok +} + +func (x *UInt64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*UInt64Rules_Gte) + return ok +} + +func (x *UInt64Rules) ClearConst() { + x.Const = nil +} + +func (x *UInt64Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *UInt64Rules) ClearLt() { + if _, ok := x.LessThan.(*UInt64Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *UInt64Rules) ClearLte() { + if _, ok := x.LessThan.(*UInt64Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *UInt64Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *UInt64Rules) ClearGt() { + if _, ok := x.GreaterThan.(*UInt64Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *UInt64Rules) ClearGte() { + if _, ok := x.GreaterThan.(*UInt64Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const UInt64Rules_LessThan_not_set_case case_UInt64Rules_LessThan = 0 +const UInt64Rules_Lt_case case_UInt64Rules_LessThan = 2 +const UInt64Rules_Lte_case case_UInt64Rules_LessThan = 3 + +func (x *UInt64Rules) WhichLessThan() case_UInt64Rules_LessThan { + if x == nil { + return UInt64Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *UInt64Rules_Lt: + return UInt64Rules_Lt_case + case *UInt64Rules_Lte: + return UInt64Rules_Lte_case + default: + return UInt64Rules_LessThan_not_set_case + } +} + +const UInt64Rules_GreaterThan_not_set_case case_UInt64Rules_GreaterThan = 0 +const UInt64Rules_Gt_case case_UInt64Rules_GreaterThan = 4 +const UInt64Rules_Gte_case case_UInt64Rules_GreaterThan = 5 + +func (x *UInt64Rules) WhichGreaterThan() case_UInt64Rules_GreaterThan { + if x == nil { + return UInt64Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *UInt64Rules_Gt: + return UInt64Rules_Gt_case + case *UInt64Rules_Gte: + return UInt64Rules_Gte_case + default: + return UInt64Rules_GreaterThan_not_set_case + } +} + +type UInt64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // value must equal 42 + // uint64 value = 1 [(buf.validate.field).uint64.const = 42]; + // } + // + // ``` + Const *uint64 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than 10 + // uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; + // } + // + // ``` + Lt *uint64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than or equal to 10 + // uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; + // } + // + // ``` + Lte *uint64 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than 5 [uint64.gt] + // uint64 value = 1 [(buf.validate.field).uint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint64.gt_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than or equal to 5 [uint64.gte] + // uint64 value = 1 [(buf.validate.field).uint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint64.gte_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint64 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyUInt64 { + // // must be in list [1, 2, 3] + // uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyUInt64 { + // // value must not be in list [1, 2, 3] + // uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyUInt64 { + // uint64 value = 1 [ + // (buf.validate.field).uint64.example = 1, + // (buf.validate.field).uint64.example = -10 + // ]; + // } + // + // ``` + Example []uint64 +} + +func (b0 UInt64Rules_builder) Build() *UInt64Rules { + m0 := &UInt64Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &UInt64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &UInt64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &UInt64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &UInt64Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_UInt64Rules_LessThan protoreflect.FieldNumber + +func (x case_UInt64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[11].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_UInt64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_UInt64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[11].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isUInt64Rules_LessThan interface { + isUInt64Rules_LessThan() +} + +type UInt64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than 10 + // uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; + // } + // + // ``` + Lt uint64 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type UInt64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than or equal to 10 + // uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; + // } + // + // ``` + Lte uint64 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*UInt64Rules_Lt) isUInt64Rules_LessThan() {} + +func (*UInt64Rules_Lte) isUInt64Rules_LessThan() {} + +type isUInt64Rules_GreaterThan interface { + isUInt64Rules_GreaterThan() +} + +type UInt64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than 5 [uint64.gt] + // uint64 value = 1 [(buf.validate.field).uint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint64.gt_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint64 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type UInt64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than or equal to 5 [uint64.gte] + // uint64 value = 1 [(buf.validate.field).uint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint64.gte_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint64 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*UInt64Rules_Gt) isUInt64Rules_GreaterThan() {} + +func (*UInt64Rules_Gte) isUInt64Rules_GreaterThan() {} + +// SInt32Rules describes the rules applied to `sint32` values. +type SInt32Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // value must equal 42 + // sint32 value = 1 [(buf.validate.field).sint32.const = 42]; + // } + // + // ``` + Const *int32 `protobuf:"zigzag32,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *SInt32Rules_Lt + // *SInt32Rules_Lte + LessThan isSInt32Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *SInt32Rules_Gt + // *SInt32Rules_Gte + GreaterThan isSInt32Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySInt32 { + // // must be in list [1, 2, 3] + // sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 `protobuf:"zigzag32,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySInt32 { + // // value must not be in list [1, 2, 3] + // sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 `protobuf:"zigzag32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySInt32 { + // sint32 value = 1 [ + // (buf.validate.field).sint32.example = 1, + // (buf.validate.field).sint32.example = -10 + // ]; + // } + // + // ``` + Example []int32 `protobuf:"zigzag32,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SInt32Rules) Reset() { + *x = SInt32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SInt32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SInt32Rules) ProtoMessage() {} + +func (x *SInt32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SInt32Rules) GetConst() int32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *SInt32Rules) GetLessThan() isSInt32Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *SInt32Rules) GetLt() int32 { + if x != nil { + if x, ok := x.LessThan.(*SInt32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SInt32Rules) GetLte() int32 { + if x != nil { + if x, ok := x.LessThan.(*SInt32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SInt32Rules) GetGreaterThan() isSInt32Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *SInt32Rules) GetGt() int32 { + if x != nil { + if x, ok := x.GreaterThan.(*SInt32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SInt32Rules) GetGte() int32 { + if x != nil { + if x, ok := x.GreaterThan.(*SInt32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SInt32Rules) GetIn() []int32 { + if x != nil { + return x.In + } + return nil +} + +func (x *SInt32Rules) GetNotIn() []int32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *SInt32Rules) GetExample() []int32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *SInt32Rules) SetConst(v int32) { + x.Const = &v +} + +func (x *SInt32Rules) SetLt(v int32) { + x.LessThan = &SInt32Rules_Lt{v} +} + +func (x *SInt32Rules) SetLte(v int32) { + x.LessThan = &SInt32Rules_Lte{v} +} + +func (x *SInt32Rules) SetGt(v int32) { + x.GreaterThan = &SInt32Rules_Gt{v} +} + +func (x *SInt32Rules) SetGte(v int32) { + x.GreaterThan = &SInt32Rules_Gte{v} +} + +func (x *SInt32Rules) SetIn(v []int32) { + x.In = v +} + +func (x *SInt32Rules) SetNotIn(v []int32) { + x.NotIn = v +} + +func (x *SInt32Rules) SetExample(v []int32) { + x.Example = v +} + +func (x *SInt32Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *SInt32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *SInt32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SInt32Rules_Lt) + return ok +} + +func (x *SInt32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SInt32Rules_Lte) + return ok +} + +func (x *SInt32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *SInt32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SInt32Rules_Gt) + return ok +} + +func (x *SInt32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SInt32Rules_Gte) + return ok +} + +func (x *SInt32Rules) ClearConst() { + x.Const = nil +} + +func (x *SInt32Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *SInt32Rules) ClearLt() { + if _, ok := x.LessThan.(*SInt32Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *SInt32Rules) ClearLte() { + if _, ok := x.LessThan.(*SInt32Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *SInt32Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *SInt32Rules) ClearGt() { + if _, ok := x.GreaterThan.(*SInt32Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *SInt32Rules) ClearGte() { + if _, ok := x.GreaterThan.(*SInt32Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const SInt32Rules_LessThan_not_set_case case_SInt32Rules_LessThan = 0 +const SInt32Rules_Lt_case case_SInt32Rules_LessThan = 2 +const SInt32Rules_Lte_case case_SInt32Rules_LessThan = 3 + +func (x *SInt32Rules) WhichLessThan() case_SInt32Rules_LessThan { + if x == nil { + return SInt32Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *SInt32Rules_Lt: + return SInt32Rules_Lt_case + case *SInt32Rules_Lte: + return SInt32Rules_Lte_case + default: + return SInt32Rules_LessThan_not_set_case + } +} + +const SInt32Rules_GreaterThan_not_set_case case_SInt32Rules_GreaterThan = 0 +const SInt32Rules_Gt_case case_SInt32Rules_GreaterThan = 4 +const SInt32Rules_Gte_case case_SInt32Rules_GreaterThan = 5 + +func (x *SInt32Rules) WhichGreaterThan() case_SInt32Rules_GreaterThan { + if x == nil { + return SInt32Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *SInt32Rules_Gt: + return SInt32Rules_Gt_case + case *SInt32Rules_Gte: + return SInt32Rules_Gte_case + default: + return SInt32Rules_GreaterThan_not_set_case + } +} + +type SInt32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // value must equal 42 + // sint32 value = 1 [(buf.validate.field).sint32.const = 42]; + // } + // + // ``` + Const *int32 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than 10 + // sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; + // } + // + // ``` + Lt *int32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than or equal to 10 + // sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; + // } + // + // ``` + Lte *int32 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than 5 [sint32.gt] + // sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint32.gt_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than or equal to 5 [sint32.gte] + // sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint32.gte_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int32 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySInt32 { + // // must be in list [1, 2, 3] + // sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySInt32 { + // // value must not be in list [1, 2, 3] + // sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySInt32 { + // sint32 value = 1 [ + // (buf.validate.field).sint32.example = 1, + // (buf.validate.field).sint32.example = -10 + // ]; + // } + // + // ``` + Example []int32 +} + +func (b0 SInt32Rules_builder) Build() *SInt32Rules { + m0 := &SInt32Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &SInt32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &SInt32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &SInt32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &SInt32Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_SInt32Rules_LessThan protoreflect.FieldNumber + +func (x case_SInt32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[12].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SInt32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SInt32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[12].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSInt32Rules_LessThan interface { + isSInt32Rules_LessThan() +} + +type SInt32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than 10 + // sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; + // } + // + // ``` + Lt int32 `protobuf:"zigzag32,2,opt,name=lt,oneof"` +} + +type SInt32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than or equal to 10 + // sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; + // } + // + // ``` + Lte int32 `protobuf:"zigzag32,3,opt,name=lte,oneof"` +} + +func (*SInt32Rules_Lt) isSInt32Rules_LessThan() {} + +func (*SInt32Rules_Lte) isSInt32Rules_LessThan() {} + +type isSInt32Rules_GreaterThan interface { + isSInt32Rules_GreaterThan() +} + +type SInt32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than 5 [sint32.gt] + // sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint32.gt_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int32 `protobuf:"zigzag32,4,opt,name=gt,oneof"` +} + +type SInt32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than or equal to 5 [sint32.gte] + // sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint32.gte_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int32 `protobuf:"zigzag32,5,opt,name=gte,oneof"` +} + +func (*SInt32Rules_Gt) isSInt32Rules_GreaterThan() {} + +func (*SInt32Rules_Gte) isSInt32Rules_GreaterThan() {} + +// SInt64Rules describes the rules applied to `sint64` values. +type SInt64Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // value must equal 42 + // sint64 value = 1 [(buf.validate.field).sint64.const = 42]; + // } + // + // ``` + Const *int64 `protobuf:"zigzag64,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *SInt64Rules_Lt + // *SInt64Rules_Lte + LessThan isSInt64Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *SInt64Rules_Gt + // *SInt64Rules_Gte + GreaterThan isSInt64Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MySInt64 { + // // must be in list [1, 2, 3] + // sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 `protobuf:"zigzag64,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySInt64 { + // // value must not be in list [1, 2, 3] + // sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 `protobuf:"zigzag64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySInt64 { + // sint64 value = 1 [ + // (buf.validate.field).sint64.example = 1, + // (buf.validate.field).sint64.example = -10 + // ]; + // } + // + // ``` + Example []int64 `protobuf:"zigzag64,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SInt64Rules) Reset() { + *x = SInt64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SInt64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SInt64Rules) ProtoMessage() {} + +func (x *SInt64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SInt64Rules) GetConst() int64 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *SInt64Rules) GetLessThan() isSInt64Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *SInt64Rules) GetLt() int64 { + if x != nil { + if x, ok := x.LessThan.(*SInt64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SInt64Rules) GetLte() int64 { + if x != nil { + if x, ok := x.LessThan.(*SInt64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SInt64Rules) GetGreaterThan() isSInt64Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *SInt64Rules) GetGt() int64 { + if x != nil { + if x, ok := x.GreaterThan.(*SInt64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SInt64Rules) GetGte() int64 { + if x != nil { + if x, ok := x.GreaterThan.(*SInt64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SInt64Rules) GetIn() []int64 { + if x != nil { + return x.In + } + return nil +} + +func (x *SInt64Rules) GetNotIn() []int64 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *SInt64Rules) GetExample() []int64 { + if x != nil { + return x.Example + } + return nil +} + +func (x *SInt64Rules) SetConst(v int64) { + x.Const = &v +} + +func (x *SInt64Rules) SetLt(v int64) { + x.LessThan = &SInt64Rules_Lt{v} +} + +func (x *SInt64Rules) SetLte(v int64) { + x.LessThan = &SInt64Rules_Lte{v} +} + +func (x *SInt64Rules) SetGt(v int64) { + x.GreaterThan = &SInt64Rules_Gt{v} +} + +func (x *SInt64Rules) SetGte(v int64) { + x.GreaterThan = &SInt64Rules_Gte{v} +} + +func (x *SInt64Rules) SetIn(v []int64) { + x.In = v +} + +func (x *SInt64Rules) SetNotIn(v []int64) { + x.NotIn = v +} + +func (x *SInt64Rules) SetExample(v []int64) { + x.Example = v +} + +func (x *SInt64Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *SInt64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *SInt64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SInt64Rules_Lt) + return ok +} + +func (x *SInt64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SInt64Rules_Lte) + return ok +} + +func (x *SInt64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *SInt64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SInt64Rules_Gt) + return ok +} + +func (x *SInt64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SInt64Rules_Gte) + return ok +} + +func (x *SInt64Rules) ClearConst() { + x.Const = nil +} + +func (x *SInt64Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *SInt64Rules) ClearLt() { + if _, ok := x.LessThan.(*SInt64Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *SInt64Rules) ClearLte() { + if _, ok := x.LessThan.(*SInt64Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *SInt64Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *SInt64Rules) ClearGt() { + if _, ok := x.GreaterThan.(*SInt64Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *SInt64Rules) ClearGte() { + if _, ok := x.GreaterThan.(*SInt64Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const SInt64Rules_LessThan_not_set_case case_SInt64Rules_LessThan = 0 +const SInt64Rules_Lt_case case_SInt64Rules_LessThan = 2 +const SInt64Rules_Lte_case case_SInt64Rules_LessThan = 3 + +func (x *SInt64Rules) WhichLessThan() case_SInt64Rules_LessThan { + if x == nil { + return SInt64Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *SInt64Rules_Lt: + return SInt64Rules_Lt_case + case *SInt64Rules_Lte: + return SInt64Rules_Lte_case + default: + return SInt64Rules_LessThan_not_set_case + } +} + +const SInt64Rules_GreaterThan_not_set_case case_SInt64Rules_GreaterThan = 0 +const SInt64Rules_Gt_case case_SInt64Rules_GreaterThan = 4 +const SInt64Rules_Gte_case case_SInt64Rules_GreaterThan = 5 + +func (x *SInt64Rules) WhichGreaterThan() case_SInt64Rules_GreaterThan { + if x == nil { + return SInt64Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *SInt64Rules_Gt: + return SInt64Rules_Gt_case + case *SInt64Rules_Gte: + return SInt64Rules_Gte_case + default: + return SInt64Rules_GreaterThan_not_set_case + } +} + +type SInt64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // value must equal 42 + // sint64 value = 1 [(buf.validate.field).sint64.const = 42]; + // } + // + // ``` + Const *int64 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than 10 + // sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; + // } + // + // ``` + Lt *int64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than or equal to 10 + // sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; + // } + // + // ``` + Lte *int64 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than 5 [sint64.gt] + // sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint64.gt_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than or equal to 5 [sint64.gte] + // sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int64 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MySInt64 { + // // must be in list [1, 2, 3] + // sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySInt64 { + // // value must not be in list [1, 2, 3] + // sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySInt64 { + // sint64 value = 1 [ + // (buf.validate.field).sint64.example = 1, + // (buf.validate.field).sint64.example = -10 + // ]; + // } + // + // ``` + Example []int64 +} + +func (b0 SInt64Rules_builder) Build() *SInt64Rules { + m0 := &SInt64Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &SInt64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &SInt64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &SInt64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &SInt64Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_SInt64Rules_LessThan protoreflect.FieldNumber + +func (x case_SInt64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[13].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SInt64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SInt64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[13].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSInt64Rules_LessThan interface { + isSInt64Rules_LessThan() +} + +type SInt64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than 10 + // sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; + // } + // + // ``` + Lt int64 `protobuf:"zigzag64,2,opt,name=lt,oneof"` +} + +type SInt64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than or equal to 10 + // sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; + // } + // + // ``` + Lte int64 `protobuf:"zigzag64,3,opt,name=lte,oneof"` +} + +func (*SInt64Rules_Lt) isSInt64Rules_LessThan() {} + +func (*SInt64Rules_Lte) isSInt64Rules_LessThan() {} + +type isSInt64Rules_GreaterThan interface { + isSInt64Rules_GreaterThan() +} + +type SInt64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than 5 [sint64.gt] + // sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint64.gt_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int64 `protobuf:"zigzag64,4,opt,name=gt,oneof"` +} + +type SInt64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than or equal to 5 [sint64.gte] + // sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int64 `protobuf:"zigzag64,5,opt,name=gte,oneof"` +} + +func (*SInt64Rules_Gt) isSInt64Rules_GreaterThan() {} + +func (*SInt64Rules_Gte) isSInt64Rules_GreaterThan() {} + +// Fixed32Rules describes the rules applied to `fixed32` values. +type Fixed32Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // value must equal 42 + // fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; + // } + // + // ``` + Const *uint32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *Fixed32Rules_Lt + // *Fixed32Rules_Lte + LessThan isFixed32Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *Fixed32Rules_Gt + // *Fixed32Rules_Gte + GreaterThan isFixed32Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be in list [1, 2, 3] + // fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFixed32 { + // // value must not be in list [1, 2, 3] + // fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFixed32 { + // fixed32 value = 1 [ + // (buf.validate.field).fixed32.example = 1, + // (buf.validate.field).fixed32.example = 2 + // ]; + // } + // + // ``` + Example []uint32 `protobuf:"fixed32,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Fixed32Rules) Reset() { + *x = Fixed32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Fixed32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Fixed32Rules) ProtoMessage() {} + +func (x *Fixed32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Fixed32Rules) GetConst() uint32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *Fixed32Rules) GetLessThan() isFixed32Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *Fixed32Rules) GetLt() uint32 { + if x != nil { + if x, ok := x.LessThan.(*Fixed32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Fixed32Rules) GetLte() uint32 { + if x != nil { + if x, ok := x.LessThan.(*Fixed32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Fixed32Rules) GetGreaterThan() isFixed32Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *Fixed32Rules) GetGt() uint32 { + if x != nil { + if x, ok := x.GreaterThan.(*Fixed32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Fixed32Rules) GetGte() uint32 { + if x != nil { + if x, ok := x.GreaterThan.(*Fixed32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Fixed32Rules) GetIn() []uint32 { + if x != nil { + return x.In + } + return nil +} + +func (x *Fixed32Rules) GetNotIn() []uint32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *Fixed32Rules) GetExample() []uint32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *Fixed32Rules) SetConst(v uint32) { + x.Const = &v +} + +func (x *Fixed32Rules) SetLt(v uint32) { + x.LessThan = &Fixed32Rules_Lt{v} +} + +func (x *Fixed32Rules) SetLte(v uint32) { + x.LessThan = &Fixed32Rules_Lte{v} +} + +func (x *Fixed32Rules) SetGt(v uint32) { + x.GreaterThan = &Fixed32Rules_Gt{v} +} + +func (x *Fixed32Rules) SetGte(v uint32) { + x.GreaterThan = &Fixed32Rules_Gte{v} +} + +func (x *Fixed32Rules) SetIn(v []uint32) { + x.In = v +} + +func (x *Fixed32Rules) SetNotIn(v []uint32) { + x.NotIn = v +} + +func (x *Fixed32Rules) SetExample(v []uint32) { + x.Example = v +} + +func (x *Fixed32Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *Fixed32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *Fixed32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Fixed32Rules_Lt) + return ok +} + +func (x *Fixed32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Fixed32Rules_Lte) + return ok +} + +func (x *Fixed32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *Fixed32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Fixed32Rules_Gt) + return ok +} + +func (x *Fixed32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Fixed32Rules_Gte) + return ok +} + +func (x *Fixed32Rules) ClearConst() { + x.Const = nil +} + +func (x *Fixed32Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *Fixed32Rules) ClearLt() { + if _, ok := x.LessThan.(*Fixed32Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *Fixed32Rules) ClearLte() { + if _, ok := x.LessThan.(*Fixed32Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *Fixed32Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *Fixed32Rules) ClearGt() { + if _, ok := x.GreaterThan.(*Fixed32Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *Fixed32Rules) ClearGte() { + if _, ok := x.GreaterThan.(*Fixed32Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const Fixed32Rules_LessThan_not_set_case case_Fixed32Rules_LessThan = 0 +const Fixed32Rules_Lt_case case_Fixed32Rules_LessThan = 2 +const Fixed32Rules_Lte_case case_Fixed32Rules_LessThan = 3 + +func (x *Fixed32Rules) WhichLessThan() case_Fixed32Rules_LessThan { + if x == nil { + return Fixed32Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *Fixed32Rules_Lt: + return Fixed32Rules_Lt_case + case *Fixed32Rules_Lte: + return Fixed32Rules_Lte_case + default: + return Fixed32Rules_LessThan_not_set_case + } +} + +const Fixed32Rules_GreaterThan_not_set_case case_Fixed32Rules_GreaterThan = 0 +const Fixed32Rules_Gt_case case_Fixed32Rules_GreaterThan = 4 +const Fixed32Rules_Gte_case case_Fixed32Rules_GreaterThan = 5 + +func (x *Fixed32Rules) WhichGreaterThan() case_Fixed32Rules_GreaterThan { + if x == nil { + return Fixed32Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *Fixed32Rules_Gt: + return Fixed32Rules_Gt_case + case *Fixed32Rules_Gte: + return Fixed32Rules_Gte_case + default: + return Fixed32Rules_GreaterThan_not_set_case + } +} + +type Fixed32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // value must equal 42 + // fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; + // } + // + // ``` + Const *uint32 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; + // } + // + // ``` + Lt *uint32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than or equal to 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; + // } + // + // ``` + Lte *uint32 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than 5 [fixed32.gt] + // fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed32.gt_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than or equal to 5 [fixed32.gte] + // fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint32 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be in list [1, 2, 3] + // fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFixed32 { + // // value must not be in list [1, 2, 3] + // fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFixed32 { + // fixed32 value = 1 [ + // (buf.validate.field).fixed32.example = 1, + // (buf.validate.field).fixed32.example = 2 + // ]; + // } + // + // ``` + Example []uint32 +} + +func (b0 Fixed32Rules_builder) Build() *Fixed32Rules { + m0 := &Fixed32Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &Fixed32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &Fixed32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &Fixed32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &Fixed32Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_Fixed32Rules_LessThan protoreflect.FieldNumber + +func (x case_Fixed32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[14].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Fixed32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Fixed32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[14].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFixed32Rules_LessThan interface { + isFixed32Rules_LessThan() +} + +type Fixed32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; + // } + // + // ``` + Lt uint32 `protobuf:"fixed32,2,opt,name=lt,oneof"` +} + +type Fixed32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than or equal to 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; + // } + // + // ``` + Lte uint32 `protobuf:"fixed32,3,opt,name=lte,oneof"` +} + +func (*Fixed32Rules_Lt) isFixed32Rules_LessThan() {} + +func (*Fixed32Rules_Lte) isFixed32Rules_LessThan() {} + +type isFixed32Rules_GreaterThan interface { + isFixed32Rules_GreaterThan() +} + +type Fixed32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than 5 [fixed32.gt] + // fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed32.gt_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint32 `protobuf:"fixed32,4,opt,name=gt,oneof"` +} + +type Fixed32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than or equal to 5 [fixed32.gte] + // fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint32 `protobuf:"fixed32,5,opt,name=gte,oneof"` +} + +func (*Fixed32Rules_Gt) isFixed32Rules_GreaterThan() {} + +func (*Fixed32Rules_Gte) isFixed32Rules_GreaterThan() {} + +// Fixed64Rules describes the rules applied to `fixed64` values. +type Fixed64Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // value must equal 42 + // fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; + // } + // + // ``` + Const *uint64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *Fixed64Rules_Lt + // *Fixed64Rules_Lte + LessThan isFixed64Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *Fixed64Rules_Gt + // *Fixed64Rules_Gte + GreaterThan isFixed64Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyFixed64 { + // // must be in list [1, 2, 3] + // fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFixed64 { + // // value must not be in list [1, 2, 3] + // fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFixed64 { + // fixed64 value = 1 [ + // (buf.validate.field).fixed64.example = 1, + // (buf.validate.field).fixed64.example = 2 + // ]; + // } + // + // ``` + Example []uint64 `protobuf:"fixed64,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Fixed64Rules) Reset() { + *x = Fixed64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Fixed64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Fixed64Rules) ProtoMessage() {} + +func (x *Fixed64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Fixed64Rules) GetConst() uint64 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *Fixed64Rules) GetLessThan() isFixed64Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *Fixed64Rules) GetLt() uint64 { + if x != nil { + if x, ok := x.LessThan.(*Fixed64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Fixed64Rules) GetLte() uint64 { + if x != nil { + if x, ok := x.LessThan.(*Fixed64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Fixed64Rules) GetGreaterThan() isFixed64Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *Fixed64Rules) GetGt() uint64 { + if x != nil { + if x, ok := x.GreaterThan.(*Fixed64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Fixed64Rules) GetGte() uint64 { + if x != nil { + if x, ok := x.GreaterThan.(*Fixed64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Fixed64Rules) GetIn() []uint64 { + if x != nil { + return x.In + } + return nil +} + +func (x *Fixed64Rules) GetNotIn() []uint64 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *Fixed64Rules) GetExample() []uint64 { + if x != nil { + return x.Example + } + return nil +} + +func (x *Fixed64Rules) SetConst(v uint64) { + x.Const = &v +} + +func (x *Fixed64Rules) SetLt(v uint64) { + x.LessThan = &Fixed64Rules_Lt{v} +} + +func (x *Fixed64Rules) SetLte(v uint64) { + x.LessThan = &Fixed64Rules_Lte{v} +} + +func (x *Fixed64Rules) SetGt(v uint64) { + x.GreaterThan = &Fixed64Rules_Gt{v} +} + +func (x *Fixed64Rules) SetGte(v uint64) { + x.GreaterThan = &Fixed64Rules_Gte{v} +} + +func (x *Fixed64Rules) SetIn(v []uint64) { + x.In = v +} + +func (x *Fixed64Rules) SetNotIn(v []uint64) { + x.NotIn = v +} + +func (x *Fixed64Rules) SetExample(v []uint64) { + x.Example = v +} + +func (x *Fixed64Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *Fixed64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *Fixed64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Fixed64Rules_Lt) + return ok +} + +func (x *Fixed64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*Fixed64Rules_Lte) + return ok +} + +func (x *Fixed64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *Fixed64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Fixed64Rules_Gt) + return ok +} + +func (x *Fixed64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*Fixed64Rules_Gte) + return ok +} + +func (x *Fixed64Rules) ClearConst() { + x.Const = nil +} + +func (x *Fixed64Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *Fixed64Rules) ClearLt() { + if _, ok := x.LessThan.(*Fixed64Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *Fixed64Rules) ClearLte() { + if _, ok := x.LessThan.(*Fixed64Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *Fixed64Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *Fixed64Rules) ClearGt() { + if _, ok := x.GreaterThan.(*Fixed64Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *Fixed64Rules) ClearGte() { + if _, ok := x.GreaterThan.(*Fixed64Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const Fixed64Rules_LessThan_not_set_case case_Fixed64Rules_LessThan = 0 +const Fixed64Rules_Lt_case case_Fixed64Rules_LessThan = 2 +const Fixed64Rules_Lte_case case_Fixed64Rules_LessThan = 3 + +func (x *Fixed64Rules) WhichLessThan() case_Fixed64Rules_LessThan { + if x == nil { + return Fixed64Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *Fixed64Rules_Lt: + return Fixed64Rules_Lt_case + case *Fixed64Rules_Lte: + return Fixed64Rules_Lte_case + default: + return Fixed64Rules_LessThan_not_set_case + } +} + +const Fixed64Rules_GreaterThan_not_set_case case_Fixed64Rules_GreaterThan = 0 +const Fixed64Rules_Gt_case case_Fixed64Rules_GreaterThan = 4 +const Fixed64Rules_Gte_case case_Fixed64Rules_GreaterThan = 5 + +func (x *Fixed64Rules) WhichGreaterThan() case_Fixed64Rules_GreaterThan { + if x == nil { + return Fixed64Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *Fixed64Rules_Gt: + return Fixed64Rules_Gt_case + case *Fixed64Rules_Gte: + return Fixed64Rules_Gte_case + default: + return Fixed64Rules_GreaterThan_not_set_case + } +} + +type Fixed64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // value must equal 42 + // fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; + // } + // + // ``` + Const *uint64 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; + // } + // + // ``` + Lt *uint64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than or equal to 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; + // } + // + // ``` + Lte *uint64 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than 5 [fixed64.gt] + // fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed64.gt_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than or equal to 5 [fixed64.gte] + // fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint64 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyFixed64 { + // // must be in list [1, 2, 3] + // fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFixed64 { + // // value must not be in list [1, 2, 3] + // fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFixed64 { + // fixed64 value = 1 [ + // (buf.validate.field).fixed64.example = 1, + // (buf.validate.field).fixed64.example = 2 + // ]; + // } + // + // ``` + Example []uint64 +} + +func (b0 Fixed64Rules_builder) Build() *Fixed64Rules { + m0 := &Fixed64Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &Fixed64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &Fixed64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &Fixed64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &Fixed64Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_Fixed64Rules_LessThan protoreflect.FieldNumber + +func (x case_Fixed64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Fixed64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Fixed64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFixed64Rules_LessThan interface { + isFixed64Rules_LessThan() +} + +type Fixed64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; + // } + // + // ``` + Lt uint64 `protobuf:"fixed64,2,opt,name=lt,oneof"` +} + +type Fixed64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than or equal to 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; + // } + // + // ``` + Lte uint64 `protobuf:"fixed64,3,opt,name=lte,oneof"` +} + +func (*Fixed64Rules_Lt) isFixed64Rules_LessThan() {} + +func (*Fixed64Rules_Lte) isFixed64Rules_LessThan() {} + +type isFixed64Rules_GreaterThan interface { + isFixed64Rules_GreaterThan() +} + +type Fixed64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than 5 [fixed64.gt] + // fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed64.gt_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint64 `protobuf:"fixed64,4,opt,name=gt,oneof"` +} + +type Fixed64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than or equal to 5 [fixed64.gte] + // fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint64 `protobuf:"fixed64,5,opt,name=gte,oneof"` +} + +func (*Fixed64Rules_Gt) isFixed64Rules_GreaterThan() {} + +func (*Fixed64Rules_Gte) isFixed64Rules_GreaterThan() {} + +// SFixed32Rules describes the rules applied to `fixed32` values. +type SFixed32Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // value must equal 42 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; + // } + // + // ``` + Const *int32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *SFixed32Rules_Lt + // *SFixed32Rules_Lte + LessThan isSFixed32Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *SFixed32Rules_Gt + // *SFixed32Rules_Gte + GreaterThan isSFixed32Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySFixed32 { + // // must be in list [1, 2, 3] + // sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySFixed32 { + // // value must not be in list [1, 2, 3] + // sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySFixed32 { + // sfixed32 value = 1 [ + // (buf.validate.field).sfixed32.example = 1, + // (buf.validate.field).sfixed32.example = 2 + // ]; + // } + // + // ``` + Example []int32 `protobuf:"fixed32,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SFixed32Rules) Reset() { + *x = SFixed32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SFixed32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SFixed32Rules) ProtoMessage() {} + +func (x *SFixed32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SFixed32Rules) GetConst() int32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *SFixed32Rules) GetLessThan() isSFixed32Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *SFixed32Rules) GetLt() int32 { + if x != nil { + if x, ok := x.LessThan.(*SFixed32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SFixed32Rules) GetLte() int32 { + if x != nil { + if x, ok := x.LessThan.(*SFixed32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SFixed32Rules) GetGreaterThan() isSFixed32Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *SFixed32Rules) GetGt() int32 { + if x != nil { + if x, ok := x.GreaterThan.(*SFixed32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SFixed32Rules) GetGte() int32 { + if x != nil { + if x, ok := x.GreaterThan.(*SFixed32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SFixed32Rules) GetIn() []int32 { + if x != nil { + return x.In + } + return nil +} + +func (x *SFixed32Rules) GetNotIn() []int32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *SFixed32Rules) GetExample() []int32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *SFixed32Rules) SetConst(v int32) { + x.Const = &v +} + +func (x *SFixed32Rules) SetLt(v int32) { + x.LessThan = &SFixed32Rules_Lt{v} +} + +func (x *SFixed32Rules) SetLte(v int32) { + x.LessThan = &SFixed32Rules_Lte{v} +} + +func (x *SFixed32Rules) SetGt(v int32) { + x.GreaterThan = &SFixed32Rules_Gt{v} +} + +func (x *SFixed32Rules) SetGte(v int32) { + x.GreaterThan = &SFixed32Rules_Gte{v} +} + +func (x *SFixed32Rules) SetIn(v []int32) { + x.In = v +} + +func (x *SFixed32Rules) SetNotIn(v []int32) { + x.NotIn = v +} + +func (x *SFixed32Rules) SetExample(v []int32) { + x.Example = v +} + +func (x *SFixed32Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *SFixed32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *SFixed32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SFixed32Rules_Lt) + return ok +} + +func (x *SFixed32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SFixed32Rules_Lte) + return ok +} + +func (x *SFixed32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *SFixed32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SFixed32Rules_Gt) + return ok +} + +func (x *SFixed32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SFixed32Rules_Gte) + return ok +} + +func (x *SFixed32Rules) ClearConst() { + x.Const = nil +} + +func (x *SFixed32Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *SFixed32Rules) ClearLt() { + if _, ok := x.LessThan.(*SFixed32Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *SFixed32Rules) ClearLte() { + if _, ok := x.LessThan.(*SFixed32Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *SFixed32Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *SFixed32Rules) ClearGt() { + if _, ok := x.GreaterThan.(*SFixed32Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *SFixed32Rules) ClearGte() { + if _, ok := x.GreaterThan.(*SFixed32Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const SFixed32Rules_LessThan_not_set_case case_SFixed32Rules_LessThan = 0 +const SFixed32Rules_Lt_case case_SFixed32Rules_LessThan = 2 +const SFixed32Rules_Lte_case case_SFixed32Rules_LessThan = 3 + +func (x *SFixed32Rules) WhichLessThan() case_SFixed32Rules_LessThan { + if x == nil { + return SFixed32Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *SFixed32Rules_Lt: + return SFixed32Rules_Lt_case + case *SFixed32Rules_Lte: + return SFixed32Rules_Lte_case + default: + return SFixed32Rules_LessThan_not_set_case + } +} + +const SFixed32Rules_GreaterThan_not_set_case case_SFixed32Rules_GreaterThan = 0 +const SFixed32Rules_Gt_case case_SFixed32Rules_GreaterThan = 4 +const SFixed32Rules_Gte_case case_SFixed32Rules_GreaterThan = 5 + +func (x *SFixed32Rules) WhichGreaterThan() case_SFixed32Rules_GreaterThan { + if x == nil { + return SFixed32Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *SFixed32Rules_Gt: + return SFixed32Rules_Gt_case + case *SFixed32Rules_Gte: + return SFixed32Rules_Gte_case + default: + return SFixed32Rules_GreaterThan_not_set_case + } +} + +type SFixed32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // value must equal 42 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; + // } + // + // ``` + Const *int32 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; + // } + // + // ``` + Lt *int32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than or equal to 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; + // } + // + // ``` + Lte *int32 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than 5 [sfixed32.gt] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed32.gt_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than or equal to 5 [sfixed32.gte] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int32 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySFixed32 { + // // must be in list [1, 2, 3] + // sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySFixed32 { + // // value must not be in list [1, 2, 3] + // sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySFixed32 { + // sfixed32 value = 1 [ + // (buf.validate.field).sfixed32.example = 1, + // (buf.validate.field).sfixed32.example = 2 + // ]; + // } + // + // ``` + Example []int32 +} + +func (b0 SFixed32Rules_builder) Build() *SFixed32Rules { + m0 := &SFixed32Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &SFixed32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &SFixed32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &SFixed32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &SFixed32Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_SFixed32Rules_LessThan protoreflect.FieldNumber + +func (x case_SFixed32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[16].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SFixed32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SFixed32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[16].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSFixed32Rules_LessThan interface { + isSFixed32Rules_LessThan() +} + +type SFixed32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; + // } + // + // ``` + Lt int32 `protobuf:"fixed32,2,opt,name=lt,oneof"` +} + +type SFixed32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than or equal to 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; + // } + // + // ``` + Lte int32 `protobuf:"fixed32,3,opt,name=lte,oneof"` +} + +func (*SFixed32Rules_Lt) isSFixed32Rules_LessThan() {} + +func (*SFixed32Rules_Lte) isSFixed32Rules_LessThan() {} + +type isSFixed32Rules_GreaterThan interface { + isSFixed32Rules_GreaterThan() +} + +type SFixed32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than 5 [sfixed32.gt] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed32.gt_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int32 `protobuf:"fixed32,4,opt,name=gt,oneof"` +} + +type SFixed32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than or equal to 5 [sfixed32.gte] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int32 `protobuf:"fixed32,5,opt,name=gte,oneof"` +} + +func (*SFixed32Rules_Gt) isSFixed32Rules_GreaterThan() {} + +func (*SFixed32Rules_Gte) isSFixed32Rules_GreaterThan() {} + +// SFixed64Rules describes the rules applied to `fixed64` values. +type SFixed64Rules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // value must equal 42 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; + // } + // + // ``` + Const *int64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *SFixed64Rules_Lt + // *SFixed64Rules_Lte + LessThan isSFixed64Rules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *SFixed64Rules_Gt + // *SFixed64Rules_Gte + GreaterThan isSFixed64Rules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySFixed64 { + // // must be in list [1, 2, 3] + // sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySFixed64 { + // // value must not be in list [1, 2, 3] + // sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySFixed64 { + // sfixed64 value = 1 [ + // (buf.validate.field).sfixed64.example = 1, + // (buf.validate.field).sfixed64.example = 2 + // ]; + // } + // + // ``` + Example []int64 `protobuf:"fixed64,8,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SFixed64Rules) Reset() { + *x = SFixed64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SFixed64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SFixed64Rules) ProtoMessage() {} + +func (x *SFixed64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SFixed64Rules) GetConst() int64 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *SFixed64Rules) GetLessThan() isSFixed64Rules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *SFixed64Rules) GetLt() int64 { + if x != nil { + if x, ok := x.LessThan.(*SFixed64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SFixed64Rules) GetLte() int64 { + if x != nil { + if x, ok := x.LessThan.(*SFixed64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SFixed64Rules) GetGreaterThan() isSFixed64Rules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *SFixed64Rules) GetGt() int64 { + if x != nil { + if x, ok := x.GreaterThan.(*SFixed64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SFixed64Rules) GetGte() int64 { + if x != nil { + if x, ok := x.GreaterThan.(*SFixed64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SFixed64Rules) GetIn() []int64 { + if x != nil { + return x.In + } + return nil +} + +func (x *SFixed64Rules) GetNotIn() []int64 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *SFixed64Rules) GetExample() []int64 { + if x != nil { + return x.Example + } + return nil +} + +func (x *SFixed64Rules) SetConst(v int64) { + x.Const = &v +} + +func (x *SFixed64Rules) SetLt(v int64) { + x.LessThan = &SFixed64Rules_Lt{v} +} + +func (x *SFixed64Rules) SetLte(v int64) { + x.LessThan = &SFixed64Rules_Lte{v} +} + +func (x *SFixed64Rules) SetGt(v int64) { + x.GreaterThan = &SFixed64Rules_Gt{v} +} + +func (x *SFixed64Rules) SetGte(v int64) { + x.GreaterThan = &SFixed64Rules_Gte{v} +} + +func (x *SFixed64Rules) SetIn(v []int64) { + x.In = v +} + +func (x *SFixed64Rules) SetNotIn(v []int64) { + x.NotIn = v +} + +func (x *SFixed64Rules) SetExample(v []int64) { + x.Example = v +} + +func (x *SFixed64Rules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *SFixed64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *SFixed64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SFixed64Rules_Lt) + return ok +} + +func (x *SFixed64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*SFixed64Rules_Lte) + return ok +} + +func (x *SFixed64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *SFixed64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SFixed64Rules_Gt) + return ok +} + +func (x *SFixed64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*SFixed64Rules_Gte) + return ok +} + +func (x *SFixed64Rules) ClearConst() { + x.Const = nil +} + +func (x *SFixed64Rules) ClearLessThan() { + x.LessThan = nil +} + +func (x *SFixed64Rules) ClearLt() { + if _, ok := x.LessThan.(*SFixed64Rules_Lt); ok { + x.LessThan = nil + } +} + +func (x *SFixed64Rules) ClearLte() { + if _, ok := x.LessThan.(*SFixed64Rules_Lte); ok { + x.LessThan = nil + } +} + +func (x *SFixed64Rules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *SFixed64Rules) ClearGt() { + if _, ok := x.GreaterThan.(*SFixed64Rules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *SFixed64Rules) ClearGte() { + if _, ok := x.GreaterThan.(*SFixed64Rules_Gte); ok { + x.GreaterThan = nil + } +} + +const SFixed64Rules_LessThan_not_set_case case_SFixed64Rules_LessThan = 0 +const SFixed64Rules_Lt_case case_SFixed64Rules_LessThan = 2 +const SFixed64Rules_Lte_case case_SFixed64Rules_LessThan = 3 + +func (x *SFixed64Rules) WhichLessThan() case_SFixed64Rules_LessThan { + if x == nil { + return SFixed64Rules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *SFixed64Rules_Lt: + return SFixed64Rules_Lt_case + case *SFixed64Rules_Lte: + return SFixed64Rules_Lte_case + default: + return SFixed64Rules_LessThan_not_set_case + } +} + +const SFixed64Rules_GreaterThan_not_set_case case_SFixed64Rules_GreaterThan = 0 +const SFixed64Rules_Gt_case case_SFixed64Rules_GreaterThan = 4 +const SFixed64Rules_Gte_case case_SFixed64Rules_GreaterThan = 5 + +func (x *SFixed64Rules) WhichGreaterThan() case_SFixed64Rules_GreaterThan { + if x == nil { + return SFixed64Rules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *SFixed64Rules_Gt: + return SFixed64Rules_Gt_case + case *SFixed64Rules_Gte: + return SFixed64Rules_Gte_case + default: + return SFixed64Rules_GreaterThan_not_set_case + } +} + +type SFixed64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // value must equal 42 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; + // } + // + // ``` + Const *int64 + // Fields of oneof LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; + // } + // + // ``` + Lt *int64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than or equal to 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; + // } + // + // ``` + Lte *int64 + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than 5 [sfixed64.gt] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed64.gt_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than or equal to 5 [sfixed64.gte] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int64 + // -- end of GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySFixed64 { + // // must be in list [1, 2, 3] + // sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySFixed64 { + // // value must not be in list [1, 2, 3] + // sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySFixed64 { + // sfixed64 value = 1 [ + // (buf.validate.field).sfixed64.example = 1, + // (buf.validate.field).sfixed64.example = 2 + // ]; + // } + // + // ``` + Example []int64 +} + +func (b0 SFixed64Rules_builder) Build() *SFixed64Rules { + m0 := &SFixed64Rules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &SFixed64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.LessThan = &SFixed64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &SFixed64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &SFixed64Rules_Gte{*b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_SFixed64Rules_LessThan protoreflect.FieldNumber + +func (x case_SFixed64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[17].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SFixed64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SFixed64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[17].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSFixed64Rules_LessThan interface { + isSFixed64Rules_LessThan() +} + +type SFixed64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; + // } + // + // ``` + Lt int64 `protobuf:"fixed64,2,opt,name=lt,oneof"` +} + +type SFixed64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than or equal to 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; + // } + // + // ``` + Lte int64 `protobuf:"fixed64,3,opt,name=lte,oneof"` +} + +func (*SFixed64Rules_Lt) isSFixed64Rules_LessThan() {} + +func (*SFixed64Rules_Lte) isSFixed64Rules_LessThan() {} + +type isSFixed64Rules_GreaterThan interface { + isSFixed64Rules_GreaterThan() +} + +type SFixed64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than 5 [sfixed64.gt] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed64.gt_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int64 `protobuf:"fixed64,4,opt,name=gt,oneof"` +} + +type SFixed64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than or equal to 5 [sfixed64.gte] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int64 `protobuf:"fixed64,5,opt,name=gte,oneof"` +} + +func (*SFixed64Rules_Gt) isSFixed64Rules_GreaterThan() {} + +func (*SFixed64Rules_Gte) isSFixed64Rules_GreaterThan() {} + +// BoolRules describes the rules applied to `bool` values. These rules +// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type. +type BoolRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified boolean value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBool { + // // value must equal true + // bool value = 1 [(buf.validate.field).bool.const = true]; + // } + // + // ``` + Const *bool `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyBool { + // bool value = 1 [ + // (buf.validate.field).bool.example = 1, + // (buf.validate.field).bool.example = 2 + // ]; + // } + // + // ``` + Example []bool `protobuf:"varint,2,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BoolRules) Reset() { + *x = BoolRules{} + mi := &file_buf_validate_validate_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BoolRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoolRules) ProtoMessage() {} + +func (x *BoolRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BoolRules) GetConst() bool { + if x != nil && x.Const != nil { + return *x.Const + } + return false +} + +func (x *BoolRules) GetExample() []bool { + if x != nil { + return x.Example + } + return nil +} + +func (x *BoolRules) SetConst(v bool) { + x.Const = &v +} + +func (x *BoolRules) SetExample(v []bool) { + x.Example = v +} + +func (x *BoolRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *BoolRules) ClearConst() { + x.Const = nil +} + +type BoolRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified boolean value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBool { + // // value must equal true + // bool value = 1 [(buf.validate.field).bool.const = true]; + // } + // + // ``` + Const *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyBool { + // bool value = 1 [ + // (buf.validate.field).bool.example = 1, + // (buf.validate.field).bool.example = 2 + // ]; + // } + // + // ``` + Example []bool +} + +func (b0 BoolRules_builder) Build() *BoolRules { + m0 := &BoolRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + x.Example = b.Example + return m0 +} + +// StringRules describes the rules applied to `string` values These +// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type. +type StringRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyString { + // // value must equal `hello` + // string value = 1 [(buf.validate.field).string.const = "hello"]; + // } + // + // ``` + Const *string `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"` + // `len` dictates that the field value must have the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value does not meet the specified + // length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be 5 characters + // string value = 1 [(buf.validate.field).string.len = 5]; + // } + // + // ``` + Len *uint64 `protobuf:"varint,19,opt,name=len" json:"len,omitempty"` + // `min_len` specifies that the field value must have at least the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value contains fewer characters, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at least 3 characters + // string value = 1 [(buf.validate.field).string.min_len = 3]; + // } + // + // ``` + MinLen *uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen" json:"min_len,omitempty"` + // `max_len` specifies that the field value must have no more than the specified + // number of characters (Unicode code points), which may differ from the + // number of bytes in the string. If the field value contains more characters, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at most 10 characters + // string value = 1 [(buf.validate.field).string.max_len = 10]; + // } + // + // ``` + MaxLen *uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen" json:"max_len,omitempty"` + // `len_bytes` dictates that the field value must have the specified number of + // bytes. If the field value does not match the specified length in bytes, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be 6 bytes + // string value = 1 [(buf.validate.field).string.len_bytes = 6]; + // } + // + // ``` + LenBytes *uint64 `protobuf:"varint,20,opt,name=len_bytes,json=lenBytes" json:"len_bytes,omitempty"` + // `min_bytes` specifies that the field value must have at least the specified + // number of bytes. If the field value contains fewer bytes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at least 4 bytes + // string value = 1 [(buf.validate.field).string.min_bytes = 4]; + // } + // + // ``` + MinBytes *uint64 `protobuf:"varint,4,opt,name=min_bytes,json=minBytes" json:"min_bytes,omitempty"` + // `max_bytes` specifies that the field value must have no more than the + // specified number of bytes. If the field value contains more bytes, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at most 8 bytes + // string value = 1 [(buf.validate.field).string.max_bytes = 8]; + // } + // + // ``` + MaxBytes *uint64 `protobuf:"varint,5,opt,name=max_bytes,json=maxBytes" json:"max_bytes,omitempty"` + // `pattern` specifies that the field value must match the specified + // regular expression (RE2 syntax), with the expression provided without any + // delimiters. If the field value doesn't match the regular expression, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not match regex pattern `^[a-zA-Z]//$` + // string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; + // } + // + // ``` + Pattern *string `protobuf:"bytes,6,opt,name=pattern" json:"pattern,omitempty"` + // `prefix` specifies that the field value must have the + // specified substring at the beginning of the string. If the field value + // doesn't start with the specified prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // value does not have prefix `pre` + // string value = 1 [(buf.validate.field).string.prefix = "pre"]; + // } + // + // ``` + Prefix *string `protobuf:"bytes,7,opt,name=prefix" json:"prefix,omitempty"` + // `suffix` specifies that the field value must have the + // specified substring at the end of the string. If the field value doesn't + // end with the specified suffix, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not have suffix `post` + // string value = 1 [(buf.validate.field).string.suffix = "post"]; + // } + // + // ``` + Suffix *string `protobuf:"bytes,8,opt,name=suffix" json:"suffix,omitempty"` + // `contains` specifies that the field value must have the + // specified substring anywhere in the string. If the field value doesn't + // contain the specified substring, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not contain substring `inside`. + // string value = 1 [(buf.validate.field).string.contains = "inside"]; + // } + // + // ``` + Contains *string `protobuf:"bytes,9,opt,name=contains" json:"contains,omitempty"` + // `not_contains` specifies that the field value must not have the + // specified substring anywhere in the string. If the field value contains + // the specified substring, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value contains substring `inside`. + // string value = 1 [(buf.validate.field).string.not_contains = "inside"]; + // } + // + // ``` + NotContains *string `protobuf:"bytes,23,opt,name=not_contains,json=notContains" json:"not_contains,omitempty"` + // `in` specifies that the field value must be equal to one of the specified + // values. If the field value isn't one of the specified values, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be in list ["apple", "banana"] + // string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + // } + // + // ``` + In []string `protobuf:"bytes,10,rep,name=in" json:"in,omitempty"` + // `not_in` specifies that the field value cannot be equal to any + // of the specified values. If the field value is one of the specified values, + // an error message will be generated. + // ```proto + // + // message MyString { + // // value must not be in list ["orange", "grape"] + // string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + // } + // + // ``` + NotIn []string `protobuf:"bytes,11,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `WellKnown` rules provide advanced rules against common string + // patterns. + // + // Types that are valid to be assigned to WellKnown: + // + // *StringRules_Email + // *StringRules_Hostname + // *StringRules_Ip + // *StringRules_Ipv4 + // *StringRules_Ipv6 + // *StringRules_Uri + // *StringRules_UriRef + // *StringRules_Address + // *StringRules_Uuid + // *StringRules_Tuuid + // *StringRules_IpWithPrefixlen + // *StringRules_Ipv4WithPrefixlen + // *StringRules_Ipv6WithPrefixlen + // *StringRules_IpPrefix + // *StringRules_Ipv4Prefix + // *StringRules_Ipv6Prefix + // *StringRules_HostAndPort + // *StringRules_Ulid + // *StringRules_ProtobufFqn + // *StringRules_ProtobufDotFqn + // *StringRules_WellKnownRegex + WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"` + // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + // enable strict header validation. By default, this is true, and HTTP header + // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser + // validations that only disallow `\r\n\0` characters, which can be used to + // bypass header matching rules. + // + // ```proto + // + // message MyString { + // // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. + // string value = 1 [(buf.validate.field).string.strict = false]; + // } + // + // ``` + Strict *bool `protobuf:"varint,25,opt,name=strict" json:"strict,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyString { + // string value = 1 [ + // (buf.validate.field).string.example = "hello", + // (buf.validate.field).string.example = "world" + // ]; + // } + // + // ``` + Example []string `protobuf:"bytes,34,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StringRules) Reset() { + *x = StringRules{} + mi := &file_buf_validate_validate_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StringRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringRules) ProtoMessage() {} + +func (x *StringRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *StringRules) GetConst() string { + if x != nil && x.Const != nil { + return *x.Const + } + return "" +} + +func (x *StringRules) GetLen() uint64 { + if x != nil && x.Len != nil { + return *x.Len + } + return 0 +} + +func (x *StringRules) GetMinLen() uint64 { + if x != nil && x.MinLen != nil { + return *x.MinLen + } + return 0 +} + +func (x *StringRules) GetMaxLen() uint64 { + if x != nil && x.MaxLen != nil { + return *x.MaxLen + } + return 0 +} + +func (x *StringRules) GetLenBytes() uint64 { + if x != nil && x.LenBytes != nil { + return *x.LenBytes + } + return 0 +} + +func (x *StringRules) GetMinBytes() uint64 { + if x != nil && x.MinBytes != nil { + return *x.MinBytes + } + return 0 +} + +func (x *StringRules) GetMaxBytes() uint64 { + if x != nil && x.MaxBytes != nil { + return *x.MaxBytes + } + return 0 +} + +func (x *StringRules) GetPattern() string { + if x != nil && x.Pattern != nil { + return *x.Pattern + } + return "" +} + +func (x *StringRules) GetPrefix() string { + if x != nil && x.Prefix != nil { + return *x.Prefix + } + return "" +} + +func (x *StringRules) GetSuffix() string { + if x != nil && x.Suffix != nil { + return *x.Suffix + } + return "" +} + +func (x *StringRules) GetContains() string { + if x != nil && x.Contains != nil { + return *x.Contains + } + return "" +} + +func (x *StringRules) GetNotContains() string { + if x != nil && x.NotContains != nil { + return *x.NotContains + } + return "" +} + +func (x *StringRules) GetIn() []string { + if x != nil { + return x.In + } + return nil +} + +func (x *StringRules) GetNotIn() []string { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *StringRules) GetWellKnown() isStringRules_WellKnown { + if x != nil { + return x.WellKnown + } + return nil +} + +func (x *StringRules) GetEmail() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Email); ok { + return x.Email + } + } + return false +} + +func (x *StringRules) GetHostname() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Hostname); ok { + return x.Hostname + } + } + return false +} + +func (x *StringRules) GetIp() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ip); ok { + return x.Ip + } + } + return false +} + +func (x *StringRules) GetIpv4() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ipv4); ok { + return x.Ipv4 + } + } + return false +} + +func (x *StringRules) GetIpv6() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ipv6); ok { + return x.Ipv6 + } + } + return false +} + +func (x *StringRules) GetUri() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Uri); ok { + return x.Uri + } + } + return false +} + +func (x *StringRules) GetUriRef() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_UriRef); ok { + return x.UriRef + } + } + return false +} + +func (x *StringRules) GetAddress() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Address); ok { + return x.Address + } + } + return false +} + +func (x *StringRules) GetUuid() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Uuid); ok { + return x.Uuid + } + } + return false +} + +func (x *StringRules) GetTuuid() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Tuuid); ok { + return x.Tuuid + } + } + return false +} + +func (x *StringRules) GetIpWithPrefixlen() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_IpWithPrefixlen); ok { + return x.IpWithPrefixlen + } + } + return false +} + +func (x *StringRules) GetIpv4WithPrefixlen() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ipv4WithPrefixlen); ok { + return x.Ipv4WithPrefixlen + } + } + return false +} + +func (x *StringRules) GetIpv6WithPrefixlen() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ipv6WithPrefixlen); ok { + return x.Ipv6WithPrefixlen + } + } + return false +} + +func (x *StringRules) GetIpPrefix() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_IpPrefix); ok { + return x.IpPrefix + } + } + return false +} + +func (x *StringRules) GetIpv4Prefix() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ipv4Prefix); ok { + return x.Ipv4Prefix + } + } + return false +} + +func (x *StringRules) GetIpv6Prefix() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ipv6Prefix); ok { + return x.Ipv6Prefix + } + } + return false +} + +func (x *StringRules) GetHostAndPort() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_HostAndPort); ok { + return x.HostAndPort + } + } + return false +} + +func (x *StringRules) GetUlid() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_Ulid); ok { + return x.Ulid + } + } + return false +} + +func (x *StringRules) GetProtobufFqn() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_ProtobufFqn); ok { + return x.ProtobufFqn + } + } + return false +} + +func (x *StringRules) GetProtobufDotFqn() bool { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_ProtobufDotFqn); ok { + return x.ProtobufDotFqn + } + } + return false +} + +func (x *StringRules) GetWellKnownRegex() KnownRegex { + if x != nil { + if x, ok := x.WellKnown.(*StringRules_WellKnownRegex); ok { + return x.WellKnownRegex + } + } + return KnownRegex_KNOWN_REGEX_UNSPECIFIED +} + +func (x *StringRules) GetStrict() bool { + if x != nil && x.Strict != nil { + return *x.Strict + } + return false +} + +func (x *StringRules) GetExample() []string { + if x != nil { + return x.Example + } + return nil +} + +func (x *StringRules) SetConst(v string) { + x.Const = &v +} + +func (x *StringRules) SetLen(v uint64) { + x.Len = &v +} + +func (x *StringRules) SetMinLen(v uint64) { + x.MinLen = &v +} + +func (x *StringRules) SetMaxLen(v uint64) { + x.MaxLen = &v +} + +func (x *StringRules) SetLenBytes(v uint64) { + x.LenBytes = &v +} + +func (x *StringRules) SetMinBytes(v uint64) { + x.MinBytes = &v +} + +func (x *StringRules) SetMaxBytes(v uint64) { + x.MaxBytes = &v +} + +func (x *StringRules) SetPattern(v string) { + x.Pattern = &v +} + +func (x *StringRules) SetPrefix(v string) { + x.Prefix = &v +} + +func (x *StringRules) SetSuffix(v string) { + x.Suffix = &v +} + +func (x *StringRules) SetContains(v string) { + x.Contains = &v +} + +func (x *StringRules) SetNotContains(v string) { + x.NotContains = &v +} + +func (x *StringRules) SetIn(v []string) { + x.In = v +} + +func (x *StringRules) SetNotIn(v []string) { + x.NotIn = v +} + +func (x *StringRules) SetEmail(v bool) { + x.WellKnown = &StringRules_Email{v} +} + +func (x *StringRules) SetHostname(v bool) { + x.WellKnown = &StringRules_Hostname{v} +} + +func (x *StringRules) SetIp(v bool) { + x.WellKnown = &StringRules_Ip{v} +} + +func (x *StringRules) SetIpv4(v bool) { + x.WellKnown = &StringRules_Ipv4{v} +} + +func (x *StringRules) SetIpv6(v bool) { + x.WellKnown = &StringRules_Ipv6{v} +} + +func (x *StringRules) SetUri(v bool) { + x.WellKnown = &StringRules_Uri{v} +} + +func (x *StringRules) SetUriRef(v bool) { + x.WellKnown = &StringRules_UriRef{v} +} + +func (x *StringRules) SetAddress(v bool) { + x.WellKnown = &StringRules_Address{v} +} + +func (x *StringRules) SetUuid(v bool) { + x.WellKnown = &StringRules_Uuid{v} +} + +func (x *StringRules) SetTuuid(v bool) { + x.WellKnown = &StringRules_Tuuid{v} +} + +func (x *StringRules) SetIpWithPrefixlen(v bool) { + x.WellKnown = &StringRules_IpWithPrefixlen{v} +} + +func (x *StringRules) SetIpv4WithPrefixlen(v bool) { + x.WellKnown = &StringRules_Ipv4WithPrefixlen{v} +} + +func (x *StringRules) SetIpv6WithPrefixlen(v bool) { + x.WellKnown = &StringRules_Ipv6WithPrefixlen{v} +} + +func (x *StringRules) SetIpPrefix(v bool) { + x.WellKnown = &StringRules_IpPrefix{v} +} + +func (x *StringRules) SetIpv4Prefix(v bool) { + x.WellKnown = &StringRules_Ipv4Prefix{v} +} + +func (x *StringRules) SetIpv6Prefix(v bool) { + x.WellKnown = &StringRules_Ipv6Prefix{v} +} + +func (x *StringRules) SetHostAndPort(v bool) { + x.WellKnown = &StringRules_HostAndPort{v} +} + +func (x *StringRules) SetUlid(v bool) { + x.WellKnown = &StringRules_Ulid{v} +} + +func (x *StringRules) SetProtobufFqn(v bool) { + x.WellKnown = &StringRules_ProtobufFqn{v} +} + +func (x *StringRules) SetProtobufDotFqn(v bool) { + x.WellKnown = &StringRules_ProtobufDotFqn{v} +} + +func (x *StringRules) SetWellKnownRegex(v KnownRegex) { + x.WellKnown = &StringRules_WellKnownRegex{v} +} + +func (x *StringRules) SetStrict(v bool) { + x.Strict = &v +} + +func (x *StringRules) SetExample(v []string) { + x.Example = v +} + +func (x *StringRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *StringRules) HasLen() bool { + if x == nil { + return false + } + return x.Len != nil +} + +func (x *StringRules) HasMinLen() bool { + if x == nil { + return false + } + return x.MinLen != nil +} + +func (x *StringRules) HasMaxLen() bool { + if x == nil { + return false + } + return x.MaxLen != nil +} + +func (x *StringRules) HasLenBytes() bool { + if x == nil { + return false + } + return x.LenBytes != nil +} + +func (x *StringRules) HasMinBytes() bool { + if x == nil { + return false + } + return x.MinBytes != nil +} + +func (x *StringRules) HasMaxBytes() bool { + if x == nil { + return false + } + return x.MaxBytes != nil +} + +func (x *StringRules) HasPattern() bool { + if x == nil { + return false + } + return x.Pattern != nil +} + +func (x *StringRules) HasPrefix() bool { + if x == nil { + return false + } + return x.Prefix != nil +} + +func (x *StringRules) HasSuffix() bool { + if x == nil { + return false + } + return x.Suffix != nil +} + +func (x *StringRules) HasContains() bool { + if x == nil { + return false + } + return x.Contains != nil +} + +func (x *StringRules) HasNotContains() bool { + if x == nil { + return false + } + return x.NotContains != nil +} + +func (x *StringRules) HasWellKnown() bool { + if x == nil { + return false + } + return x.WellKnown != nil +} + +func (x *StringRules) HasEmail() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Email) + return ok +} + +func (x *StringRules) HasHostname() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Hostname) + return ok +} + +func (x *StringRules) HasIp() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ip) + return ok +} + +func (x *StringRules) HasIpv4() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ipv4) + return ok +} + +func (x *StringRules) HasIpv6() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ipv6) + return ok +} + +func (x *StringRules) HasUri() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Uri) + return ok +} + +func (x *StringRules) HasUriRef() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_UriRef) + return ok +} + +func (x *StringRules) HasAddress() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Address) + return ok +} + +func (x *StringRules) HasUuid() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Uuid) + return ok +} + +func (x *StringRules) HasTuuid() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Tuuid) + return ok +} + +func (x *StringRules) HasIpWithPrefixlen() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_IpWithPrefixlen) + return ok +} + +func (x *StringRules) HasIpv4WithPrefixlen() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ipv4WithPrefixlen) + return ok +} + +func (x *StringRules) HasIpv6WithPrefixlen() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ipv6WithPrefixlen) + return ok +} + +func (x *StringRules) HasIpPrefix() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_IpPrefix) + return ok +} + +func (x *StringRules) HasIpv4Prefix() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ipv4Prefix) + return ok +} + +func (x *StringRules) HasIpv6Prefix() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ipv6Prefix) + return ok +} + +func (x *StringRules) HasHostAndPort() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_HostAndPort) + return ok +} + +func (x *StringRules) HasUlid() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_Ulid) + return ok +} + +func (x *StringRules) HasProtobufFqn() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_ProtobufFqn) + return ok +} + +func (x *StringRules) HasProtobufDotFqn() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_ProtobufDotFqn) + return ok +} + +func (x *StringRules) HasWellKnownRegex() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*StringRules_WellKnownRegex) + return ok +} + +func (x *StringRules) HasStrict() bool { + if x == nil { + return false + } + return x.Strict != nil +} + +func (x *StringRules) ClearConst() { + x.Const = nil +} + +func (x *StringRules) ClearLen() { + x.Len = nil +} + +func (x *StringRules) ClearMinLen() { + x.MinLen = nil +} + +func (x *StringRules) ClearMaxLen() { + x.MaxLen = nil +} + +func (x *StringRules) ClearLenBytes() { + x.LenBytes = nil +} + +func (x *StringRules) ClearMinBytes() { + x.MinBytes = nil +} + +func (x *StringRules) ClearMaxBytes() { + x.MaxBytes = nil +} + +func (x *StringRules) ClearPattern() { + x.Pattern = nil +} + +func (x *StringRules) ClearPrefix() { + x.Prefix = nil +} + +func (x *StringRules) ClearSuffix() { + x.Suffix = nil +} + +func (x *StringRules) ClearContains() { + x.Contains = nil +} + +func (x *StringRules) ClearNotContains() { + x.NotContains = nil +} + +func (x *StringRules) ClearWellKnown() { + x.WellKnown = nil +} + +func (x *StringRules) ClearEmail() { + if _, ok := x.WellKnown.(*StringRules_Email); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearHostname() { + if _, ok := x.WellKnown.(*StringRules_Hostname); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIp() { + if _, ok := x.WellKnown.(*StringRules_Ip); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpv4() { + if _, ok := x.WellKnown.(*StringRules_Ipv4); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpv6() { + if _, ok := x.WellKnown.(*StringRules_Ipv6); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearUri() { + if _, ok := x.WellKnown.(*StringRules_Uri); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearUriRef() { + if _, ok := x.WellKnown.(*StringRules_UriRef); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearAddress() { + if _, ok := x.WellKnown.(*StringRules_Address); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearUuid() { + if _, ok := x.WellKnown.(*StringRules_Uuid); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearTuuid() { + if _, ok := x.WellKnown.(*StringRules_Tuuid); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpWithPrefixlen() { + if _, ok := x.WellKnown.(*StringRules_IpWithPrefixlen); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpv4WithPrefixlen() { + if _, ok := x.WellKnown.(*StringRules_Ipv4WithPrefixlen); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpv6WithPrefixlen() { + if _, ok := x.WellKnown.(*StringRules_Ipv6WithPrefixlen); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpPrefix() { + if _, ok := x.WellKnown.(*StringRules_IpPrefix); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpv4Prefix() { + if _, ok := x.WellKnown.(*StringRules_Ipv4Prefix); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearIpv6Prefix() { + if _, ok := x.WellKnown.(*StringRules_Ipv6Prefix); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearHostAndPort() { + if _, ok := x.WellKnown.(*StringRules_HostAndPort); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearUlid() { + if _, ok := x.WellKnown.(*StringRules_Ulid); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearProtobufFqn() { + if _, ok := x.WellKnown.(*StringRules_ProtobufFqn); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearProtobufDotFqn() { + if _, ok := x.WellKnown.(*StringRules_ProtobufDotFqn); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearWellKnownRegex() { + if _, ok := x.WellKnown.(*StringRules_WellKnownRegex); ok { + x.WellKnown = nil + } +} + +func (x *StringRules) ClearStrict() { + x.Strict = nil +} + +const StringRules_WellKnown_not_set_case case_StringRules_WellKnown = 0 +const StringRules_Email_case case_StringRules_WellKnown = 12 +const StringRules_Hostname_case case_StringRules_WellKnown = 13 +const StringRules_Ip_case case_StringRules_WellKnown = 14 +const StringRules_Ipv4_case case_StringRules_WellKnown = 15 +const StringRules_Ipv6_case case_StringRules_WellKnown = 16 +const StringRules_Uri_case case_StringRules_WellKnown = 17 +const StringRules_UriRef_case case_StringRules_WellKnown = 18 +const StringRules_Address_case case_StringRules_WellKnown = 21 +const StringRules_Uuid_case case_StringRules_WellKnown = 22 +const StringRules_Tuuid_case case_StringRules_WellKnown = 33 +const StringRules_IpWithPrefixlen_case case_StringRules_WellKnown = 26 +const StringRules_Ipv4WithPrefixlen_case case_StringRules_WellKnown = 27 +const StringRules_Ipv6WithPrefixlen_case case_StringRules_WellKnown = 28 +const StringRules_IpPrefix_case case_StringRules_WellKnown = 29 +const StringRules_Ipv4Prefix_case case_StringRules_WellKnown = 30 +const StringRules_Ipv6Prefix_case case_StringRules_WellKnown = 31 +const StringRules_HostAndPort_case case_StringRules_WellKnown = 32 +const StringRules_Ulid_case case_StringRules_WellKnown = 35 +const StringRules_ProtobufFqn_case case_StringRules_WellKnown = 37 +const StringRules_ProtobufDotFqn_case case_StringRules_WellKnown = 38 +const StringRules_WellKnownRegex_case case_StringRules_WellKnown = 24 + +func (x *StringRules) WhichWellKnown() case_StringRules_WellKnown { + if x == nil { + return StringRules_WellKnown_not_set_case + } + switch x.WellKnown.(type) { + case *StringRules_Email: + return StringRules_Email_case + case *StringRules_Hostname: + return StringRules_Hostname_case + case *StringRules_Ip: + return StringRules_Ip_case + case *StringRules_Ipv4: + return StringRules_Ipv4_case + case *StringRules_Ipv6: + return StringRules_Ipv6_case + case *StringRules_Uri: + return StringRules_Uri_case + case *StringRules_UriRef: + return StringRules_UriRef_case + case *StringRules_Address: + return StringRules_Address_case + case *StringRules_Uuid: + return StringRules_Uuid_case + case *StringRules_Tuuid: + return StringRules_Tuuid_case + case *StringRules_IpWithPrefixlen: + return StringRules_IpWithPrefixlen_case + case *StringRules_Ipv4WithPrefixlen: + return StringRules_Ipv4WithPrefixlen_case + case *StringRules_Ipv6WithPrefixlen: + return StringRules_Ipv6WithPrefixlen_case + case *StringRules_IpPrefix: + return StringRules_IpPrefix_case + case *StringRules_Ipv4Prefix: + return StringRules_Ipv4Prefix_case + case *StringRules_Ipv6Prefix: + return StringRules_Ipv6Prefix_case + case *StringRules_HostAndPort: + return StringRules_HostAndPort_case + case *StringRules_Ulid: + return StringRules_Ulid_case + case *StringRules_ProtobufFqn: + return StringRules_ProtobufFqn_case + case *StringRules_ProtobufDotFqn: + return StringRules_ProtobufDotFqn_case + case *StringRules_WellKnownRegex: + return StringRules_WellKnownRegex_case + default: + return StringRules_WellKnown_not_set_case + } +} + +type StringRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyString { + // // value must equal `hello` + // string value = 1 [(buf.validate.field).string.const = "hello"]; + // } + // + // ``` + Const *string + // `len` dictates that the field value must have the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value does not meet the specified + // length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be 5 characters + // string value = 1 [(buf.validate.field).string.len = 5]; + // } + // + // ``` + Len *uint64 + // `min_len` specifies that the field value must have at least the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value contains fewer characters, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at least 3 characters + // string value = 1 [(buf.validate.field).string.min_len = 3]; + // } + // + // ``` + MinLen *uint64 + // `max_len` specifies that the field value must have no more than the specified + // number of characters (Unicode code points), which may differ from the + // number of bytes in the string. If the field value contains more characters, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at most 10 characters + // string value = 1 [(buf.validate.field).string.max_len = 10]; + // } + // + // ``` + MaxLen *uint64 + // `len_bytes` dictates that the field value must have the specified number of + // bytes. If the field value does not match the specified length in bytes, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be 6 bytes + // string value = 1 [(buf.validate.field).string.len_bytes = 6]; + // } + // + // ``` + LenBytes *uint64 + // `min_bytes` specifies that the field value must have at least the specified + // number of bytes. If the field value contains fewer bytes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at least 4 bytes + // string value = 1 [(buf.validate.field).string.min_bytes = 4]; + // } + // + // ``` + MinBytes *uint64 + // `max_bytes` specifies that the field value must have no more than the + // specified number of bytes. If the field value contains more bytes, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at most 8 bytes + // string value = 1 [(buf.validate.field).string.max_bytes = 8]; + // } + // + // ``` + MaxBytes *uint64 + // `pattern` specifies that the field value must match the specified + // regular expression (RE2 syntax), with the expression provided without any + // delimiters. If the field value doesn't match the regular expression, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not match regex pattern `^[a-zA-Z]//$` + // string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; + // } + // + // ``` + Pattern *string + // `prefix` specifies that the field value must have the + // specified substring at the beginning of the string. If the field value + // doesn't start with the specified prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // value does not have prefix `pre` + // string value = 1 [(buf.validate.field).string.prefix = "pre"]; + // } + // + // ``` + Prefix *string + // `suffix` specifies that the field value must have the + // specified substring at the end of the string. If the field value doesn't + // end with the specified suffix, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not have suffix `post` + // string value = 1 [(buf.validate.field).string.suffix = "post"]; + // } + // + // ``` + Suffix *string + // `contains` specifies that the field value must have the + // specified substring anywhere in the string. If the field value doesn't + // contain the specified substring, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not contain substring `inside`. + // string value = 1 [(buf.validate.field).string.contains = "inside"]; + // } + // + // ``` + Contains *string + // `not_contains` specifies that the field value must not have the + // specified substring anywhere in the string. If the field value contains + // the specified substring, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value contains substring `inside`. + // string value = 1 [(buf.validate.field).string.not_contains = "inside"]; + // } + // + // ``` + NotContains *string + // `in` specifies that the field value must be equal to one of the specified + // values. If the field value isn't one of the specified values, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be in list ["apple", "banana"] + // string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + // } + // + // ``` + In []string + // `not_in` specifies that the field value cannot be equal to any + // of the specified values. If the field value is one of the specified values, + // an error message will be generated. + // ```proto + // + // message MyString { + // // value must not be in list ["orange", "grape"] + // string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + // } + // + // ``` + NotIn []string + // `WellKnown` rules provide advanced rules against common string + // patterns. + + // Fields of oneof WellKnown: + // `email` specifies that the field value must be a valid email address, for + // example "foo@example.com". + // + // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address). + // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322), + // which allows many unexpected forms of email addresses and will easily match + // a typographical error. + // + // If the field value isn't a valid email address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid email address + // string value = 1 [(buf.validate.field).string.email = true]; + // } + // + // ``` + Email *bool + // `hostname` specifies that the field value must be a valid hostname, for + // example "foo.example.com". + // + // A valid hostname follows the rules below: + // - The name consists of one or more labels, separated by a dot ("."). + // - Each label can be 1 to 63 alphanumeric characters. + // - A label can contain hyphens ("-"), but must not start or end with a hyphen. + // - The right-most label must not be digits only. + // - The name can have a trailing dot—for example, "foo.example.com.". + // - The name can be 253 characters at most, excluding the optional trailing dot. + // + // If the field value isn't a valid hostname, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname + // string value = 1 [(buf.validate.field).string.hostname = true]; + // } + // + // ``` + Hostname *bool + // `ip` specifies that the field value must be a valid IP (v4 or v6) address. + // + // IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21". + // IPv6 addresses are expected in their text representation—for example, "::1", + // or "2001:0DB8:ABCD:0012::0". + // + // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported. + // + // If the field value isn't a valid IP address, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP address + // string value = 1 [(buf.validate.field).string.ip = true]; + // } + // + // ``` + Ip *bool + // `ipv4` specifies that the field value must be a valid IPv4 address—for + // example "192.168.5.21". If the field value isn't a valid IPv4 address, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address + // string value = 1 [(buf.validate.field).string.ipv4 = true]; + // } + // + // ``` + Ipv4 *bool + // `ipv6` specifies that the field value must be a valid IPv6 address—for + // example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field + // value is not a valid IPv6 address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address + // string value = 1 [(buf.validate.field).string.ipv6 = true]; + // } + // + // ``` + Ipv6 *bool + // `uri` specifies that the field value must be a valid URI, for example + // "https://example.com/foo/bar?baz=quux#frag". + // + // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI + // string value = 1 [(buf.validate.field).string.uri = true]; + // } + // + // ``` + Uri *bool + // `uri_ref` specifies that the field value must be a valid URI Reference—either + // a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative + // Reference such as "./foo/bar?query". + // + // URI, URI Reference, and Relative Reference are defined in the internet + // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone + // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI Reference, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI Reference + // string value = 1 [(buf.validate.field).string.uri_ref = true]; + // } + // + // ``` + UriRef *bool + // `address` specifies that the field value must be either a valid hostname + // (for example, "example.com"), or a valid IP (v4 or v6) address (for example, + // "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname, or ip address + // string value = 1 [(buf.validate.field).string.address = true]; + // } + // + // ``` + Address *bool + // `uuid` specifies that the field value must be a valid UUID as defined by + // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid UUID + // string value = 1 [(buf.validate.field).string.uuid = true]; + // } + // + // ``` + Uuid *bool + // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as + // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes + // omitted. If the field value isn't a valid UUID without dashes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid trimmed UUID + // string value = 1 [(buf.validate.field).string.tuuid = true]; + // } + // + // ``` + Tuuid *bool + // `ip_with_prefixlen` specifies that the field value must be a valid IP + // (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or + // "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with + // prefix length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP with prefix length + // string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + // } + // + // ``` + IpWithPrefixlen *bool + // `ipv4_with_prefixlen` specifies that the field value must be a valid + // IPv4 address with prefix length—for example, "192.168.5.21/16". If the + // field value isn't a valid IPv4 address with prefix length, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address with prefix length + // string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + // } + // + // ``` + Ipv4WithPrefixlen *bool + // `ipv6_with_prefixlen` specifies that the field value must be a valid + // IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64". + // If the field value is not a valid IPv6 address with prefix length, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address prefix length + // string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + // } + // + // ``` + Ipv6WithPrefixlen *bool + // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) + // prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value isn't a valid IP prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP prefix + // string value = 1 [(buf.validate.field).string.ip_prefix = true]; + // } + // + // ``` + IpPrefix *bool + // `ipv4_prefix` specifies that the field value must be a valid IPv4 + // prefix, for example "192.168.0.0/16". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "192.168.0.0/16" designates the left-most 16 bits for the prefix, + // and the remaining 16 bits must be zero. + // + // If the field value isn't a valid IPv4 prefix, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 prefix + // string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + // } + // + // ``` + Ipv4Prefix *bool + // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for + // example, "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value is not a valid IPv6 prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 prefix + // string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + // } + // + // ``` + Ipv6Prefix *bool + // `host_and_port` specifies that the field value must be a valid host/port + // pair—for example, "example.com:8080". + // + // The host can be one of: + // - An IPv4 address in dotted decimal format—for example, "192.168.5.21". + // - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]". + // - A hostname—for example, "example.com". + // + // The port is separated by a colon. It must be non-empty, with a decimal number + // in the range of 0-65535, inclusive. + HostAndPort *bool + // `ulid` specifies that the field value must be a valid ULID (Universally Unique + // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec). + // If the field value isn't a valid ULID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid ULID + // string value = 1 [(buf.validate.field).string.ulid = true]; + // } + // + // ``` + Ulid *bool + // `protobuf_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers, + // where each identifier starts with a letter or underscore and is followed by zero or + // more letters, underscores, or digits. + // + // Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage". + // + // Note: historically, fully-qualified Protobuf names were represented with a leading + // dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the + // leading dot, and most fully-qualified names are represented without it. Use + // `protobuf_dot_fqn` if a leading dot is required. + // + // If the field value isn't a valid fully-qualified Protobuf name, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name + // string value = 1 [(buf.validate.field).string.protobuf_fqn = true]; + // } + // + // ``` + ProtobufFqn *bool + // `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name with a leading dot, as defined by the + // [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name with a leading dot is a dot followed by a + // dot-separated list of Protobuf identifiers, where each identifier starts with a + // letter or underscore and is followed by zero or more letters, underscores, or + // digits. + // + // Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage". + // + // Note: this is the historical representation of fully-qualified Protobuf names, + // where a leading dot denotes an absolute reference. Modern Protobuf does not use + // the leading dot, and most fully-qualified names are represented without it. Most + // users will want to use `protobuf_fqn` instead. + // + // If the field value isn't a valid fully-qualified Protobuf name with a leading dot, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name with a leading dot + // string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true]; + // } + // + // ``` + ProtobufDotFqn *bool + // `well_known_regex` specifies a common well-known pattern + // defined as a regex. If the field value doesn't match the well-known + // regex, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid HTTP header value + // string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; + // } + // + // ``` + // + // #### KnownRegex + // + // `well_known_regex` contains some well-known patterns. + // + // | Name | Number | Description | + // |-------------------------------|--------|-------------------------------------------| + // | KNOWN_REGEX_UNSPECIFIED | 0 | | + // | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) | + // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) | + WellKnownRegex *KnownRegex + // -- end of WellKnown + // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + // enable strict header validation. By default, this is true, and HTTP header + // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser + // validations that only disallow `\r\n\0` characters, which can be used to + // bypass header matching rules. + // + // ```proto + // + // message MyString { + // // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. + // string value = 1 [(buf.validate.field).string.strict = false]; + // } + // + // ``` + Strict *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyString { + // string value = 1 [ + // (buf.validate.field).string.example = "hello", + // (buf.validate.field).string.example = "world" + // ]; + // } + // + // ``` + Example []string +} + +func (b0 StringRules_builder) Build() *StringRules { + m0 := &StringRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + x.Len = b.Len + x.MinLen = b.MinLen + x.MaxLen = b.MaxLen + x.LenBytes = b.LenBytes + x.MinBytes = b.MinBytes + x.MaxBytes = b.MaxBytes + x.Pattern = b.Pattern + x.Prefix = b.Prefix + x.Suffix = b.Suffix + x.Contains = b.Contains + x.NotContains = b.NotContains + x.In = b.In + x.NotIn = b.NotIn + if b.Email != nil { + x.WellKnown = &StringRules_Email{*b.Email} + } + if b.Hostname != nil { + x.WellKnown = &StringRules_Hostname{*b.Hostname} + } + if b.Ip != nil { + x.WellKnown = &StringRules_Ip{*b.Ip} + } + if b.Ipv4 != nil { + x.WellKnown = &StringRules_Ipv4{*b.Ipv4} + } + if b.Ipv6 != nil { + x.WellKnown = &StringRules_Ipv6{*b.Ipv6} + } + if b.Uri != nil { + x.WellKnown = &StringRules_Uri{*b.Uri} + } + if b.UriRef != nil { + x.WellKnown = &StringRules_UriRef{*b.UriRef} + } + if b.Address != nil { + x.WellKnown = &StringRules_Address{*b.Address} + } + if b.Uuid != nil { + x.WellKnown = &StringRules_Uuid{*b.Uuid} + } + if b.Tuuid != nil { + x.WellKnown = &StringRules_Tuuid{*b.Tuuid} + } + if b.IpWithPrefixlen != nil { + x.WellKnown = &StringRules_IpWithPrefixlen{*b.IpWithPrefixlen} + } + if b.Ipv4WithPrefixlen != nil { + x.WellKnown = &StringRules_Ipv4WithPrefixlen{*b.Ipv4WithPrefixlen} + } + if b.Ipv6WithPrefixlen != nil { + x.WellKnown = &StringRules_Ipv6WithPrefixlen{*b.Ipv6WithPrefixlen} + } + if b.IpPrefix != nil { + x.WellKnown = &StringRules_IpPrefix{*b.IpPrefix} + } + if b.Ipv4Prefix != nil { + x.WellKnown = &StringRules_Ipv4Prefix{*b.Ipv4Prefix} + } + if b.Ipv6Prefix != nil { + x.WellKnown = &StringRules_Ipv6Prefix{*b.Ipv6Prefix} + } + if b.HostAndPort != nil { + x.WellKnown = &StringRules_HostAndPort{*b.HostAndPort} + } + if b.Ulid != nil { + x.WellKnown = &StringRules_Ulid{*b.Ulid} + } + if b.ProtobufFqn != nil { + x.WellKnown = &StringRules_ProtobufFqn{*b.ProtobufFqn} + } + if b.ProtobufDotFqn != nil { + x.WellKnown = &StringRules_ProtobufDotFqn{*b.ProtobufDotFqn} + } + if b.WellKnownRegex != nil { + x.WellKnown = &StringRules_WellKnownRegex{*b.WellKnownRegex} + } + x.Strict = b.Strict + x.Example = b.Example + return m0 +} + +type case_StringRules_WellKnown protoreflect.FieldNumber + +func (x case_StringRules_WellKnown) String() string { + md := file_buf_validate_validate_proto_msgTypes[19].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isStringRules_WellKnown interface { + isStringRules_WellKnown() +} + +type StringRules_Email struct { + // `email` specifies that the field value must be a valid email address, for + // example "foo@example.com". + // + // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address). + // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322), + // which allows many unexpected forms of email addresses and will easily match + // a typographical error. + // + // If the field value isn't a valid email address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid email address + // string value = 1 [(buf.validate.field).string.email = true]; + // } + // + // ``` + Email bool `protobuf:"varint,12,opt,name=email,oneof"` +} + +type StringRules_Hostname struct { + // `hostname` specifies that the field value must be a valid hostname, for + // example "foo.example.com". + // + // A valid hostname follows the rules below: + // - The name consists of one or more labels, separated by a dot ("."). + // - Each label can be 1 to 63 alphanumeric characters. + // - A label can contain hyphens ("-"), but must not start or end with a hyphen. + // - The right-most label must not be digits only. + // - The name can have a trailing dot—for example, "foo.example.com.". + // - The name can be 253 characters at most, excluding the optional trailing dot. + // + // If the field value isn't a valid hostname, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname + // string value = 1 [(buf.validate.field).string.hostname = true]; + // } + // + // ``` + Hostname bool `protobuf:"varint,13,opt,name=hostname,oneof"` +} + +type StringRules_Ip struct { + // `ip` specifies that the field value must be a valid IP (v4 or v6) address. + // + // IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21". + // IPv6 addresses are expected in their text representation—for example, "::1", + // or "2001:0DB8:ABCD:0012::0". + // + // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported. + // + // If the field value isn't a valid IP address, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP address + // string value = 1 [(buf.validate.field).string.ip = true]; + // } + // + // ``` + Ip bool `protobuf:"varint,14,opt,name=ip,oneof"` +} + +type StringRules_Ipv4 struct { + // `ipv4` specifies that the field value must be a valid IPv4 address—for + // example "192.168.5.21". If the field value isn't a valid IPv4 address, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address + // string value = 1 [(buf.validate.field).string.ipv4 = true]; + // } + // + // ``` + Ipv4 bool `protobuf:"varint,15,opt,name=ipv4,oneof"` +} + +type StringRules_Ipv6 struct { + // `ipv6` specifies that the field value must be a valid IPv6 address—for + // example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field + // value is not a valid IPv6 address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address + // string value = 1 [(buf.validate.field).string.ipv6 = true]; + // } + // + // ``` + Ipv6 bool `protobuf:"varint,16,opt,name=ipv6,oneof"` +} + +type StringRules_Uri struct { + // `uri` specifies that the field value must be a valid URI, for example + // "https://example.com/foo/bar?baz=quux#frag". + // + // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI + // string value = 1 [(buf.validate.field).string.uri = true]; + // } + // + // ``` + Uri bool `protobuf:"varint,17,opt,name=uri,oneof"` +} + +type StringRules_UriRef struct { + // `uri_ref` specifies that the field value must be a valid URI Reference—either + // a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative + // Reference such as "./foo/bar?query". + // + // URI, URI Reference, and Relative Reference are defined in the internet + // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone + // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI Reference, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI Reference + // string value = 1 [(buf.validate.field).string.uri_ref = true]; + // } + // + // ``` + UriRef bool `protobuf:"varint,18,opt,name=uri_ref,json=uriRef,oneof"` +} + +type StringRules_Address struct { + // `address` specifies that the field value must be either a valid hostname + // (for example, "example.com"), or a valid IP (v4 or v6) address (for example, + // "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname, or ip address + // string value = 1 [(buf.validate.field).string.address = true]; + // } + // + // ``` + Address bool `protobuf:"varint,21,opt,name=address,oneof"` +} + +type StringRules_Uuid struct { + // `uuid` specifies that the field value must be a valid UUID as defined by + // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid UUID + // string value = 1 [(buf.validate.field).string.uuid = true]; + // } + // + // ``` + Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"` +} + +type StringRules_Tuuid struct { + // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as + // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes + // omitted. If the field value isn't a valid UUID without dashes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid trimmed UUID + // string value = 1 [(buf.validate.field).string.tuuid = true]; + // } + // + // ``` + Tuuid bool `protobuf:"varint,33,opt,name=tuuid,oneof"` +} + +type StringRules_IpWithPrefixlen struct { + // `ip_with_prefixlen` specifies that the field value must be a valid IP + // (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or + // "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with + // prefix length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP with prefix length + // string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + // } + // + // ``` + IpWithPrefixlen bool `protobuf:"varint,26,opt,name=ip_with_prefixlen,json=ipWithPrefixlen,oneof"` +} + +type StringRules_Ipv4WithPrefixlen struct { + // `ipv4_with_prefixlen` specifies that the field value must be a valid + // IPv4 address with prefix length—for example, "192.168.5.21/16". If the + // field value isn't a valid IPv4 address with prefix length, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address with prefix length + // string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + // } + // + // ``` + Ipv4WithPrefixlen bool `protobuf:"varint,27,opt,name=ipv4_with_prefixlen,json=ipv4WithPrefixlen,oneof"` +} + +type StringRules_Ipv6WithPrefixlen struct { + // `ipv6_with_prefixlen` specifies that the field value must be a valid + // IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64". + // If the field value is not a valid IPv6 address with prefix length, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address prefix length + // string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + // } + // + // ``` + Ipv6WithPrefixlen bool `protobuf:"varint,28,opt,name=ipv6_with_prefixlen,json=ipv6WithPrefixlen,oneof"` +} + +type StringRules_IpPrefix struct { + // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) + // prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value isn't a valid IP prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP prefix + // string value = 1 [(buf.validate.field).string.ip_prefix = true]; + // } + // + // ``` + IpPrefix bool `protobuf:"varint,29,opt,name=ip_prefix,json=ipPrefix,oneof"` +} + +type StringRules_Ipv4Prefix struct { + // `ipv4_prefix` specifies that the field value must be a valid IPv4 + // prefix, for example "192.168.0.0/16". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "192.168.0.0/16" designates the left-most 16 bits for the prefix, + // and the remaining 16 bits must be zero. + // + // If the field value isn't a valid IPv4 prefix, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 prefix + // string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + // } + // + // ``` + Ipv4Prefix bool `protobuf:"varint,30,opt,name=ipv4_prefix,json=ipv4Prefix,oneof"` +} + +type StringRules_Ipv6Prefix struct { + // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for + // example, "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value is not a valid IPv6 prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 prefix + // string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + // } + // + // ``` + Ipv6Prefix bool `protobuf:"varint,31,opt,name=ipv6_prefix,json=ipv6Prefix,oneof"` +} + +type StringRules_HostAndPort struct { + // `host_and_port` specifies that the field value must be a valid host/port + // pair—for example, "example.com:8080". + // + // The host can be one of: + // - An IPv4 address in dotted decimal format—for example, "192.168.5.21". + // - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]". + // - A hostname—for example, "example.com". + // + // The port is separated by a colon. It must be non-empty, with a decimal number + // in the range of 0-65535, inclusive. + HostAndPort bool `protobuf:"varint,32,opt,name=host_and_port,json=hostAndPort,oneof"` +} + +type StringRules_Ulid struct { + // `ulid` specifies that the field value must be a valid ULID (Universally Unique + // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec). + // If the field value isn't a valid ULID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid ULID + // string value = 1 [(buf.validate.field).string.ulid = true]; + // } + // + // ``` + Ulid bool `protobuf:"varint,35,opt,name=ulid,oneof"` +} + +type StringRules_ProtobufFqn struct { + // `protobuf_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers, + // where each identifier starts with a letter or underscore and is followed by zero or + // more letters, underscores, or digits. + // + // Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage". + // + // Note: historically, fully-qualified Protobuf names were represented with a leading + // dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the + // leading dot, and most fully-qualified names are represented without it. Use + // `protobuf_dot_fqn` if a leading dot is required. + // + // If the field value isn't a valid fully-qualified Protobuf name, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name + // string value = 1 [(buf.validate.field).string.protobuf_fqn = true]; + // } + // + // ``` + ProtobufFqn bool `protobuf:"varint,37,opt,name=protobuf_fqn,json=protobufFqn,oneof"` +} + +type StringRules_ProtobufDotFqn struct { + // `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name with a leading dot, as defined by the + // [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name with a leading dot is a dot followed by a + // dot-separated list of Protobuf identifiers, where each identifier starts with a + // letter or underscore and is followed by zero or more letters, underscores, or + // digits. + // + // Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage". + // + // Note: this is the historical representation of fully-qualified Protobuf names, + // where a leading dot denotes an absolute reference. Modern Protobuf does not use + // the leading dot, and most fully-qualified names are represented without it. Most + // users will want to use `protobuf_fqn` instead. + // + // If the field value isn't a valid fully-qualified Protobuf name with a leading dot, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name with a leading dot + // string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true]; + // } + // + // ``` + ProtobufDotFqn bool `protobuf:"varint,38,opt,name=protobuf_dot_fqn,json=protobufDotFqn,oneof"` +} + +type StringRules_WellKnownRegex struct { + // `well_known_regex` specifies a common well-known pattern + // defined as a regex. If the field value doesn't match the well-known + // regex, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid HTTP header value + // string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; + // } + // + // ``` + // + // #### KnownRegex + // + // `well_known_regex` contains some well-known patterns. + // + // | Name | Number | Description | + // |-------------------------------|--------|-------------------------------------------| + // | KNOWN_REGEX_UNSPECIFIED | 0 | | + // | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) | + // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) | + WellKnownRegex KnownRegex `protobuf:"varint,24,opt,name=well_known_regex,json=wellKnownRegex,enum=buf.validate.KnownRegex,oneof"` +} + +func (*StringRules_Email) isStringRules_WellKnown() {} + +func (*StringRules_Hostname) isStringRules_WellKnown() {} + +func (*StringRules_Ip) isStringRules_WellKnown() {} + +func (*StringRules_Ipv4) isStringRules_WellKnown() {} + +func (*StringRules_Ipv6) isStringRules_WellKnown() {} + +func (*StringRules_Uri) isStringRules_WellKnown() {} + +func (*StringRules_UriRef) isStringRules_WellKnown() {} + +func (*StringRules_Address) isStringRules_WellKnown() {} + +func (*StringRules_Uuid) isStringRules_WellKnown() {} + +func (*StringRules_Tuuid) isStringRules_WellKnown() {} + +func (*StringRules_IpWithPrefixlen) isStringRules_WellKnown() {} + +func (*StringRules_Ipv4WithPrefixlen) isStringRules_WellKnown() {} + +func (*StringRules_Ipv6WithPrefixlen) isStringRules_WellKnown() {} + +func (*StringRules_IpPrefix) isStringRules_WellKnown() {} + +func (*StringRules_Ipv4Prefix) isStringRules_WellKnown() {} + +func (*StringRules_Ipv6Prefix) isStringRules_WellKnown() {} + +func (*StringRules_HostAndPort) isStringRules_WellKnown() {} + +func (*StringRules_Ulid) isStringRules_WellKnown() {} + +func (*StringRules_ProtobufFqn) isStringRules_WellKnown() {} + +func (*StringRules_ProtobufDotFqn) isStringRules_WellKnown() {} + +func (*StringRules_WellKnownRegex) isStringRules_WellKnown() {} + +// BytesRules describe the rules applied to `bytes` values. These rules +// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type. +type BytesRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified bytes + // value. If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be "\x01\x02\x03\x04" + // bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; + // } + // + // ``` + Const []byte `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"` + // `len` requires the field value to have the specified length in bytes. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value length must be 4 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + // } + // + // ``` + Len *uint64 `protobuf:"varint,13,opt,name=len" json:"len,omitempty"` + // `min_len` requires the field value to have at least the specified minimum + // length in bytes. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value length must be at least 2 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + // } + // + // ``` + MinLen *uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen" json:"min_len,omitempty"` + // `max_len` requires the field value to have at most the specified maximum + // length in bytes. + // If the field value exceeds the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be at most 6 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + // } + // + // ``` + MaxLen *uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen" json:"max_len,omitempty"` + // `pattern` requires the field value to match the specified regular + // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + // The value of the field must be valid UTF-8 or validation will fail with a + // runtime error. + // If the field value doesn't match the pattern, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value must match regex pattern "^[a-zA-Z0-9]+$". + // optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + // } + // + // ``` + Pattern *string `protobuf:"bytes,4,opt,name=pattern" json:"pattern,omitempty"` + // `prefix` requires the field value to have the specified bytes at the + // beginning of the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not have prefix \x01\x02 + // optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + // } + // + // ``` + Prefix []byte `protobuf:"bytes,5,opt,name=prefix" json:"prefix,omitempty"` + // `suffix` requires the field value to have the specified bytes at the end + // of the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not have suffix \x03\x04 + // optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + // } + // + // ``` + Suffix []byte `protobuf:"bytes,6,opt,name=suffix" json:"suffix,omitempty"` + // `contains` requires the field value to have the specified bytes anywhere in + // the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not contain \x02\x03 + // optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + // } + // + // ``` + Contains []byte `protobuf:"bytes,7,opt,name=contains" json:"contains,omitempty"` + // `in` requires the field value to be equal to one of the specified + // values. If the field value doesn't match any of the specified values, an + // error message is generated. + // + // ```proto + // + // message MyBytes { + // // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // + // ``` + In [][]byte `protobuf:"bytes,8,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to be not equal to any of the specified + // values. + // If the field value matches any of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyBytes { + // // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // + // ``` + NotIn [][]byte `protobuf:"bytes,9,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // WellKnown rules provide advanced rules against common byte + // patterns + // + // Types that are valid to be assigned to WellKnown: + // + // *BytesRules_Ip + // *BytesRules_Ipv4 + // *BytesRules_Ipv6 + // *BytesRules_Uuid + WellKnown isBytesRules_WellKnown `protobuf_oneof:"well_known"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyBytes { + // bytes value = 1 [ + // (buf.validate.field).bytes.example = "\x01\x02", + // (buf.validate.field).bytes.example = "\x02\x03" + // ]; + // } + // + // ``` + Example [][]byte `protobuf:"bytes,14,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BytesRules) Reset() { + *x = BytesRules{} + mi := &file_buf_validate_validate_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BytesRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BytesRules) ProtoMessage() {} + +func (x *BytesRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BytesRules) GetConst() []byte { + if x != nil { + return x.Const + } + return nil +} + +func (x *BytesRules) GetLen() uint64 { + if x != nil && x.Len != nil { + return *x.Len + } + return 0 +} + +func (x *BytesRules) GetMinLen() uint64 { + if x != nil && x.MinLen != nil { + return *x.MinLen + } + return 0 +} + +func (x *BytesRules) GetMaxLen() uint64 { + if x != nil && x.MaxLen != nil { + return *x.MaxLen + } + return 0 +} + +func (x *BytesRules) GetPattern() string { + if x != nil && x.Pattern != nil { + return *x.Pattern + } + return "" +} + +func (x *BytesRules) GetPrefix() []byte { + if x != nil { + return x.Prefix + } + return nil +} + +func (x *BytesRules) GetSuffix() []byte { + if x != nil { + return x.Suffix + } + return nil +} + +func (x *BytesRules) GetContains() []byte { + if x != nil { + return x.Contains + } + return nil +} + +func (x *BytesRules) GetIn() [][]byte { + if x != nil { + return x.In + } + return nil +} + +func (x *BytesRules) GetNotIn() [][]byte { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *BytesRules) GetWellKnown() isBytesRules_WellKnown { + if x != nil { + return x.WellKnown + } + return nil +} + +func (x *BytesRules) GetIp() bool { + if x != nil { + if x, ok := x.WellKnown.(*BytesRules_Ip); ok { + return x.Ip + } + } + return false +} + +func (x *BytesRules) GetIpv4() bool { + if x != nil { + if x, ok := x.WellKnown.(*BytesRules_Ipv4); ok { + return x.Ipv4 + } + } + return false +} + +func (x *BytesRules) GetIpv6() bool { + if x != nil { + if x, ok := x.WellKnown.(*BytesRules_Ipv6); ok { + return x.Ipv6 + } + } + return false +} + +func (x *BytesRules) GetUuid() bool { + if x != nil { + if x, ok := x.WellKnown.(*BytesRules_Uuid); ok { + return x.Uuid + } + } + return false +} + +func (x *BytesRules) GetExample() [][]byte { + if x != nil { + return x.Example + } + return nil +} + +func (x *BytesRules) SetConst(v []byte) { + if v == nil { + v = []byte{} + } + x.Const = v +} + +func (x *BytesRules) SetLen(v uint64) { + x.Len = &v +} + +func (x *BytesRules) SetMinLen(v uint64) { + x.MinLen = &v +} + +func (x *BytesRules) SetMaxLen(v uint64) { + x.MaxLen = &v +} + +func (x *BytesRules) SetPattern(v string) { + x.Pattern = &v +} + +func (x *BytesRules) SetPrefix(v []byte) { + if v == nil { + v = []byte{} + } + x.Prefix = v +} + +func (x *BytesRules) SetSuffix(v []byte) { + if v == nil { + v = []byte{} + } + x.Suffix = v +} + +func (x *BytesRules) SetContains(v []byte) { + if v == nil { + v = []byte{} + } + x.Contains = v +} + +func (x *BytesRules) SetIn(v [][]byte) { + x.In = v +} + +func (x *BytesRules) SetNotIn(v [][]byte) { + x.NotIn = v +} + +func (x *BytesRules) SetIp(v bool) { + x.WellKnown = &BytesRules_Ip{v} +} + +func (x *BytesRules) SetIpv4(v bool) { + x.WellKnown = &BytesRules_Ipv4{v} +} + +func (x *BytesRules) SetIpv6(v bool) { + x.WellKnown = &BytesRules_Ipv6{v} +} + +func (x *BytesRules) SetUuid(v bool) { + x.WellKnown = &BytesRules_Uuid{v} +} + +func (x *BytesRules) SetExample(v [][]byte) { + x.Example = v +} + +func (x *BytesRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *BytesRules) HasLen() bool { + if x == nil { + return false + } + return x.Len != nil +} + +func (x *BytesRules) HasMinLen() bool { + if x == nil { + return false + } + return x.MinLen != nil +} + +func (x *BytesRules) HasMaxLen() bool { + if x == nil { + return false + } + return x.MaxLen != nil +} + +func (x *BytesRules) HasPattern() bool { + if x == nil { + return false + } + return x.Pattern != nil +} + +func (x *BytesRules) HasPrefix() bool { + if x == nil { + return false + } + return x.Prefix != nil +} + +func (x *BytesRules) HasSuffix() bool { + if x == nil { + return false + } + return x.Suffix != nil +} + +func (x *BytesRules) HasContains() bool { + if x == nil { + return false + } + return x.Contains != nil +} + +func (x *BytesRules) HasWellKnown() bool { + if x == nil { + return false + } + return x.WellKnown != nil +} + +func (x *BytesRules) HasIp() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*BytesRules_Ip) + return ok +} + +func (x *BytesRules) HasIpv4() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*BytesRules_Ipv4) + return ok +} + +func (x *BytesRules) HasIpv6() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*BytesRules_Ipv6) + return ok +} + +func (x *BytesRules) HasUuid() bool { + if x == nil { + return false + } + _, ok := x.WellKnown.(*BytesRules_Uuid) + return ok +} + +func (x *BytesRules) ClearConst() { + x.Const = nil +} + +func (x *BytesRules) ClearLen() { + x.Len = nil +} + +func (x *BytesRules) ClearMinLen() { + x.MinLen = nil +} + +func (x *BytesRules) ClearMaxLen() { + x.MaxLen = nil +} + +func (x *BytesRules) ClearPattern() { + x.Pattern = nil +} + +func (x *BytesRules) ClearPrefix() { + x.Prefix = nil +} + +func (x *BytesRules) ClearSuffix() { + x.Suffix = nil +} + +func (x *BytesRules) ClearContains() { + x.Contains = nil +} + +func (x *BytesRules) ClearWellKnown() { + x.WellKnown = nil +} + +func (x *BytesRules) ClearIp() { + if _, ok := x.WellKnown.(*BytesRules_Ip); ok { + x.WellKnown = nil + } +} + +func (x *BytesRules) ClearIpv4() { + if _, ok := x.WellKnown.(*BytesRules_Ipv4); ok { + x.WellKnown = nil + } +} + +func (x *BytesRules) ClearIpv6() { + if _, ok := x.WellKnown.(*BytesRules_Ipv6); ok { + x.WellKnown = nil + } +} + +func (x *BytesRules) ClearUuid() { + if _, ok := x.WellKnown.(*BytesRules_Uuid); ok { + x.WellKnown = nil + } +} + +const BytesRules_WellKnown_not_set_case case_BytesRules_WellKnown = 0 +const BytesRules_Ip_case case_BytesRules_WellKnown = 10 +const BytesRules_Ipv4_case case_BytesRules_WellKnown = 11 +const BytesRules_Ipv6_case case_BytesRules_WellKnown = 12 +const BytesRules_Uuid_case case_BytesRules_WellKnown = 15 + +func (x *BytesRules) WhichWellKnown() case_BytesRules_WellKnown { + if x == nil { + return BytesRules_WellKnown_not_set_case + } + switch x.WellKnown.(type) { + case *BytesRules_Ip: + return BytesRules_Ip_case + case *BytesRules_Ipv4: + return BytesRules_Ipv4_case + case *BytesRules_Ipv6: + return BytesRules_Ipv6_case + case *BytesRules_Uuid: + return BytesRules_Uuid_case + default: + return BytesRules_WellKnown_not_set_case + } +} + +type BytesRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified bytes + // value. If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be "\x01\x02\x03\x04" + // bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; + // } + // + // ``` + Const []byte + // `len` requires the field value to have the specified length in bytes. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value length must be 4 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + // } + // + // ``` + Len *uint64 + // `min_len` requires the field value to have at least the specified minimum + // length in bytes. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value length must be at least 2 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + // } + // + // ``` + MinLen *uint64 + // `max_len` requires the field value to have at most the specified maximum + // length in bytes. + // If the field value exceeds the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be at most 6 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + // } + // + // ``` + MaxLen *uint64 + // `pattern` requires the field value to match the specified regular + // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + // The value of the field must be valid UTF-8 or validation will fail with a + // runtime error. + // If the field value doesn't match the pattern, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value must match regex pattern "^[a-zA-Z0-9]+$". + // optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + // } + // + // ``` + Pattern *string + // `prefix` requires the field value to have the specified bytes at the + // beginning of the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not have prefix \x01\x02 + // optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + // } + // + // ``` + Prefix []byte + // `suffix` requires the field value to have the specified bytes at the end + // of the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not have suffix \x03\x04 + // optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + // } + // + // ``` + Suffix []byte + // `contains` requires the field value to have the specified bytes anywhere in + // the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not contain \x02\x03 + // optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + // } + // + // ``` + Contains []byte + // `in` requires the field value to be equal to one of the specified + // values. If the field value doesn't match any of the specified values, an + // error message is generated. + // + // ```proto + // + // message MyBytes { + // // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // + // ``` + In [][]byte + // `not_in` requires the field value to be not equal to any of the specified + // values. + // If the field value matches any of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyBytes { + // // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // + // ``` + NotIn [][]byte + // WellKnown rules provide advanced rules against common byte + // patterns + + // Fields of oneof WellKnown: + // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IP address + // optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + // } + // + // ``` + Ip *bool + // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IPv4 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + // } + // + // ``` + Ipv4 *bool + // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // ```proto + // + // message MyBytes { + // // must be a valid IPv6 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + // } + // + // ``` + Ipv6 *bool + // `uuid` ensures that the field value encodes 128-bit UUID data as defined + // by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). + // The field must contain exactly 16 bytes representing the UUID. If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid UUID + // optional bytes value = 1 [(buf.validate.field).bytes.uuid = true]; + // } + // + // ``` + Uuid *bool + // -- end of WellKnown + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyBytes { + // bytes value = 1 [ + // (buf.validate.field).bytes.example = "\x01\x02", + // (buf.validate.field).bytes.example = "\x02\x03" + // ]; + // } + // + // ``` + Example [][]byte +} + +func (b0 BytesRules_builder) Build() *BytesRules { + m0 := &BytesRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + x.Len = b.Len + x.MinLen = b.MinLen + x.MaxLen = b.MaxLen + x.Pattern = b.Pattern + x.Prefix = b.Prefix + x.Suffix = b.Suffix + x.Contains = b.Contains + x.In = b.In + x.NotIn = b.NotIn + if b.Ip != nil { + x.WellKnown = &BytesRules_Ip{*b.Ip} + } + if b.Ipv4 != nil { + x.WellKnown = &BytesRules_Ipv4{*b.Ipv4} + } + if b.Ipv6 != nil { + x.WellKnown = &BytesRules_Ipv6{*b.Ipv6} + } + if b.Uuid != nil { + x.WellKnown = &BytesRules_Uuid{*b.Uuid} + } + x.Example = b.Example + return m0 +} + +type case_BytesRules_WellKnown protoreflect.FieldNumber + +func (x case_BytesRules_WellKnown) String() string { + md := file_buf_validate_validate_proto_msgTypes[20].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isBytesRules_WellKnown interface { + isBytesRules_WellKnown() +} + +type BytesRules_Ip struct { + // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IP address + // optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + // } + // + // ``` + Ip bool `protobuf:"varint,10,opt,name=ip,oneof"` +} + +type BytesRules_Ipv4 struct { + // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IPv4 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + // } + // + // ``` + Ipv4 bool `protobuf:"varint,11,opt,name=ipv4,oneof"` +} + +type BytesRules_Ipv6 struct { + // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // ```proto + // + // message MyBytes { + // // must be a valid IPv6 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + // } + // + // ``` + Ipv6 bool `protobuf:"varint,12,opt,name=ipv6,oneof"` +} + +type BytesRules_Uuid struct { + // `uuid` ensures that the field value encodes 128-bit UUID data as defined + // by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). + // The field must contain exactly 16 bytes representing the UUID. If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid UUID + // optional bytes value = 1 [(buf.validate.field).bytes.uuid = true]; + // } + // + // ``` + Uuid bool `protobuf:"varint,15,opt,name=uuid,oneof"` +} + +func (*BytesRules_Ip) isBytesRules_WellKnown() {} + +func (*BytesRules_Ipv4) isBytesRules_WellKnown() {} + +func (*BytesRules_Ipv6) isBytesRules_WellKnown() {} + +func (*BytesRules_Uuid) isBytesRules_WellKnown() {} + +// EnumRules describe the rules applied to `enum` values. +type EnumRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` requires the field value to exactly match the specified enum value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be exactly MY_ENUM_VALUE1. + // MyEnum value = 1 [(buf.validate.field).enum.const = 1]; + // } + // + // ``` + Const *int32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // `defined_only` requires the field value to be one of the defined values for + // this enum, failing on any undefined value. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be a defined value of MyEnum. + // MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; + // } + // + // ``` + DefinedOnly *bool `protobuf:"varint,2,opt,name=defined_only,json=definedOnly" json:"defined_only,omitempty"` + // `in` requires the field value to be equal to one of the + // specified enum values. If the field value doesn't match any of the + // specified values, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be equal to one of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + // } + // + // ``` + In []int32 `protobuf:"varint,3,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to be not equal to any of the + // specified enum values. If the field value matches one of the specified + // values, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must not be equal to any of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + // } + // + // ``` + NotIn []int32 `protobuf:"varint,4,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // (buf.validate.field).enum.example = 1, + // (buf.validate.field).enum.example = 2 + // } + // + // ``` + Example []int32 `protobuf:"varint,5,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnumRules) Reset() { + *x = EnumRules{} + mi := &file_buf_validate_validate_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnumRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnumRules) ProtoMessage() {} + +func (x *EnumRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EnumRules) GetConst() int32 { + if x != nil && x.Const != nil { + return *x.Const + } + return 0 +} + +func (x *EnumRules) GetDefinedOnly() bool { + if x != nil && x.DefinedOnly != nil { + return *x.DefinedOnly + } + return false +} + +func (x *EnumRules) GetIn() []int32 { + if x != nil { + return x.In + } + return nil +} + +func (x *EnumRules) GetNotIn() []int32 { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *EnumRules) GetExample() []int32 { + if x != nil { + return x.Example + } + return nil +} + +func (x *EnumRules) SetConst(v int32) { + x.Const = &v +} + +func (x *EnumRules) SetDefinedOnly(v bool) { + x.DefinedOnly = &v +} + +func (x *EnumRules) SetIn(v []int32) { + x.In = v +} + +func (x *EnumRules) SetNotIn(v []int32) { + x.NotIn = v +} + +func (x *EnumRules) SetExample(v []int32) { + x.Example = v +} + +func (x *EnumRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *EnumRules) HasDefinedOnly() bool { + if x == nil { + return false + } + return x.DefinedOnly != nil +} + +func (x *EnumRules) ClearConst() { + x.Const = nil +} + +func (x *EnumRules) ClearDefinedOnly() { + x.DefinedOnly = nil +} + +type EnumRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified enum value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be exactly MY_ENUM_VALUE1. + // MyEnum value = 1 [(buf.validate.field).enum.const = 1]; + // } + // + // ``` + Const *int32 + // `defined_only` requires the field value to be one of the defined values for + // this enum, failing on any undefined value. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be a defined value of MyEnum. + // MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; + // } + // + // ``` + DefinedOnly *bool + // `in` requires the field value to be equal to one of the + // specified enum values. If the field value doesn't match any of the + // specified values, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be equal to one of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to be not equal to any of the + // specified enum values. If the field value matches one of the specified + // values, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must not be equal to any of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // (buf.validate.field).enum.example = 1, + // (buf.validate.field).enum.example = 2 + // } + // + // ``` + Example []int32 +} + +func (b0 EnumRules_builder) Build() *EnumRules { + m0 := &EnumRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + x.DefinedOnly = b.DefinedOnly + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +// RepeatedRules describe the rules applied to `repeated` values. +type RepeatedRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `min_items` requires that this field must contain at least the specified + // minimum number of items. + // + // Note that `min_items = 1` is equivalent to setting a field as `required`. + // + // ```proto + // + // message MyRepeated { + // // value must contain at least 2 items + // repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + // } + // + // ``` + MinItems *uint64 `protobuf:"varint,1,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + // `max_items` denotes that this field must not exceed a + // certain number of items as the upper limit. If the field contains more + // items than specified, an error message will be generated, requiring the + // field to maintain no more than the specified number of items. + // + // ```proto + // + // message MyRepeated { + // // value must contain no more than 3 item(s) + // repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + // } + // + // ``` + MaxItems *uint64 `protobuf:"varint,2,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + // `unique` indicates that all elements in this field must + // be unique. This rule is strictly applicable to scalar and enum + // types, with message types not being supported. + // + // ```proto + // + // message MyRepeated { + // // repeated value must contain unique items + // repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + // } + // + // ``` + Unique *bool `protobuf:"varint,3,opt,name=unique" json:"unique,omitempty"` + // `items` details the rules to be applied to each item + // in the field. Even for repeated message fields, validation is executed + // against each item unless `ignore` is specified. + // + // ```proto + // + // message MyRepeated { + // // The items in the field `value` must follow the specified rules. + // repeated string value = 1 [(buf.validate.field).repeated.items = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // + // ``` + // + // Note that the `required` rule does not apply. Repeated items + // cannot be unset. + Items *FieldRules `protobuf:"bytes,4,opt,name=items" json:"items,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepeatedRules) Reset() { + *x = RepeatedRules{} + mi := &file_buf_validate_validate_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RepeatedRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepeatedRules) ProtoMessage() {} + +func (x *RepeatedRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RepeatedRules) GetMinItems() uint64 { + if x != nil && x.MinItems != nil { + return *x.MinItems + } + return 0 +} + +func (x *RepeatedRules) GetMaxItems() uint64 { + if x != nil && x.MaxItems != nil { + return *x.MaxItems + } + return 0 +} + +func (x *RepeatedRules) GetUnique() bool { + if x != nil && x.Unique != nil { + return *x.Unique + } + return false +} + +func (x *RepeatedRules) GetItems() *FieldRules { + if x != nil { + return x.Items + } + return nil +} + +func (x *RepeatedRules) SetMinItems(v uint64) { + x.MinItems = &v +} + +func (x *RepeatedRules) SetMaxItems(v uint64) { + x.MaxItems = &v +} + +func (x *RepeatedRules) SetUnique(v bool) { + x.Unique = &v +} + +func (x *RepeatedRules) SetItems(v *FieldRules) { + x.Items = v +} + +func (x *RepeatedRules) HasMinItems() bool { + if x == nil { + return false + } + return x.MinItems != nil +} + +func (x *RepeatedRules) HasMaxItems() bool { + if x == nil { + return false + } + return x.MaxItems != nil +} + +func (x *RepeatedRules) HasUnique() bool { + if x == nil { + return false + } + return x.Unique != nil +} + +func (x *RepeatedRules) HasItems() bool { + if x == nil { + return false + } + return x.Items != nil +} + +func (x *RepeatedRules) ClearMinItems() { + x.MinItems = nil +} + +func (x *RepeatedRules) ClearMaxItems() { + x.MaxItems = nil +} + +func (x *RepeatedRules) ClearUnique() { + x.Unique = nil +} + +func (x *RepeatedRules) ClearItems() { + x.Items = nil +} + +type RepeatedRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `min_items` requires that this field must contain at least the specified + // minimum number of items. + // + // Note that `min_items = 1` is equivalent to setting a field as `required`. + // + // ```proto + // + // message MyRepeated { + // // value must contain at least 2 items + // repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + // } + // + // ``` + MinItems *uint64 + // `max_items` denotes that this field must not exceed a + // certain number of items as the upper limit. If the field contains more + // items than specified, an error message will be generated, requiring the + // field to maintain no more than the specified number of items. + // + // ```proto + // + // message MyRepeated { + // // value must contain no more than 3 item(s) + // repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + // } + // + // ``` + MaxItems *uint64 + // `unique` indicates that all elements in this field must + // be unique. This rule is strictly applicable to scalar and enum + // types, with message types not being supported. + // + // ```proto + // + // message MyRepeated { + // // repeated value must contain unique items + // repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + // } + // + // ``` + Unique *bool + // `items` details the rules to be applied to each item + // in the field. Even for repeated message fields, validation is executed + // against each item unless `ignore` is specified. + // + // ```proto + // + // message MyRepeated { + // // The items in the field `value` must follow the specified rules. + // repeated string value = 1 [(buf.validate.field).repeated.items = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // + // ``` + // + // Note that the `required` rule does not apply. Repeated items + // cannot be unset. + Items *FieldRules +} + +func (b0 RepeatedRules_builder) Build() *RepeatedRules { + m0 := &RepeatedRules{} + b, x := &b0, m0 + _, _ = b, x + x.MinItems = b.MinItems + x.MaxItems = b.MaxItems + x.Unique = b.Unique + x.Items = b.Items + return m0 +} + +// MapRules describe the rules applied to `map` values. +type MapRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // Specifies the minimum number of key-value pairs allowed. If the field has + // fewer key-value pairs than specified, an error message is generated. + // + // ```proto + // + // message MyMap { + // // The field `value` must have at least 2 key-value pairs. + // map value = 1 [(buf.validate.field).map.min_pairs = 2]; + // } + // + // ``` + MinPairs *uint64 `protobuf:"varint,1,opt,name=min_pairs,json=minPairs" json:"min_pairs,omitempty"` + // Specifies the maximum number of key-value pairs allowed. If the field has + // more key-value pairs than specified, an error message is generated. + // + // ```proto + // + // message MyMap { + // // The field `value` must have at most 3 key-value pairs. + // map value = 1 [(buf.validate.field).map.max_pairs = 3]; + // } + // + // ``` + MaxPairs *uint64 `protobuf:"varint,2,opt,name=max_pairs,json=maxPairs" json:"max_pairs,omitempty"` + // Specifies the rules to be applied to each key in the field. + // + // ```proto + // + // message MyMap { + // // The keys in the field `value` must follow the specified rules. + // map value = 1 [(buf.validate.field).map.keys = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // + // ``` + // + // Note that the `required` rule does not apply. Map keys cannot be unset. + Keys *FieldRules `protobuf:"bytes,4,opt,name=keys" json:"keys,omitempty"` + // Specifies the rules to be applied to the value of each key in the + // field. Message values will still have their validations evaluated unless + // `ignore` is specified. + // + // ```proto + // + // message MyMap { + // // The values in the field `value` must follow the specified rules. + // map value = 1 [(buf.validate.field).map.values = { + // string: { + // min_len: 5 + // max_len: 20 + // } + // }]; + // } + // + // ``` + // Note that the `required` rule does not apply. Map values cannot be unset. + Values *FieldRules `protobuf:"bytes,5,opt,name=values" json:"values,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MapRules) Reset() { + *x = MapRules{} + mi := &file_buf_validate_validate_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MapRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MapRules) ProtoMessage() {} + +func (x *MapRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MapRules) GetMinPairs() uint64 { + if x != nil && x.MinPairs != nil { + return *x.MinPairs + } + return 0 +} + +func (x *MapRules) GetMaxPairs() uint64 { + if x != nil && x.MaxPairs != nil { + return *x.MaxPairs + } + return 0 +} + +func (x *MapRules) GetKeys() *FieldRules { + if x != nil { + return x.Keys + } + return nil +} + +func (x *MapRules) GetValues() *FieldRules { + if x != nil { + return x.Values + } + return nil +} + +func (x *MapRules) SetMinPairs(v uint64) { + x.MinPairs = &v +} + +func (x *MapRules) SetMaxPairs(v uint64) { + x.MaxPairs = &v +} + +func (x *MapRules) SetKeys(v *FieldRules) { + x.Keys = v +} + +func (x *MapRules) SetValues(v *FieldRules) { + x.Values = v +} + +func (x *MapRules) HasMinPairs() bool { + if x == nil { + return false + } + return x.MinPairs != nil +} + +func (x *MapRules) HasMaxPairs() bool { + if x == nil { + return false + } + return x.MaxPairs != nil +} + +func (x *MapRules) HasKeys() bool { + if x == nil { + return false + } + return x.Keys != nil +} + +func (x *MapRules) HasValues() bool { + if x == nil { + return false + } + return x.Values != nil +} + +func (x *MapRules) ClearMinPairs() { + x.MinPairs = nil +} + +func (x *MapRules) ClearMaxPairs() { + x.MaxPairs = nil +} + +func (x *MapRules) ClearKeys() { + x.Keys = nil +} + +func (x *MapRules) ClearValues() { + x.Values = nil +} + +type MapRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Specifies the minimum number of key-value pairs allowed. If the field has + // fewer key-value pairs than specified, an error message is generated. + // + // ```proto + // + // message MyMap { + // // The field `value` must have at least 2 key-value pairs. + // map value = 1 [(buf.validate.field).map.min_pairs = 2]; + // } + // + // ``` + MinPairs *uint64 + // Specifies the maximum number of key-value pairs allowed. If the field has + // more key-value pairs than specified, an error message is generated. + // + // ```proto + // + // message MyMap { + // // The field `value` must have at most 3 key-value pairs. + // map value = 1 [(buf.validate.field).map.max_pairs = 3]; + // } + // + // ``` + MaxPairs *uint64 + // Specifies the rules to be applied to each key in the field. + // + // ```proto + // + // message MyMap { + // // The keys in the field `value` must follow the specified rules. + // map value = 1 [(buf.validate.field).map.keys = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // + // ``` + // + // Note that the `required` rule does not apply. Map keys cannot be unset. + Keys *FieldRules + // Specifies the rules to be applied to the value of each key in the + // field. Message values will still have their validations evaluated unless + // `ignore` is specified. + // + // ```proto + // + // message MyMap { + // // The values in the field `value` must follow the specified rules. + // map value = 1 [(buf.validate.field).map.values = { + // string: { + // min_len: 5 + // max_len: 20 + // } + // }]; + // } + // + // ``` + // Note that the `required` rule does not apply. Map values cannot be unset. + Values *FieldRules +} + +func (b0 MapRules_builder) Build() *MapRules { + m0 := &MapRules{} + b, x := &b0, m0 + _, _ = b, x + x.MinPairs = b.MinPairs + x.MaxPairs = b.MaxPairs + x.Keys = b.Keys + x.Values = b.Values + return m0 +} + +// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type. +type AnyRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `in` requires the field's `type_url` to be equal to one of the + // specified values. If it doesn't match any of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyAny { + // // The `value` field must have a `type_url` equal to one of the specified values. + // google.protobuf.Any value = 1 [(buf.validate.field).any = { + // in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"] + // }]; + // } + // + // ``` + In []string `protobuf:"bytes,2,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated. + // + // ```proto + // + // message MyAny { + // // The `value` field must not have a `type_url` equal to any of the specified values. + // google.protobuf.Any value = 1 [(buf.validate.field).any = { + // not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"] + // }]; + // } + // + // ``` + NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AnyRules) Reset() { + *x = AnyRules{} + mi := &file_buf_validate_validate_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AnyRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnyRules) ProtoMessage() {} + +func (x *AnyRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AnyRules) GetIn() []string { + if x != nil { + return x.In + } + return nil +} + +func (x *AnyRules) GetNotIn() []string { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *AnyRules) SetIn(v []string) { + x.In = v +} + +func (x *AnyRules) SetNotIn(v []string) { + x.NotIn = v +} + +type AnyRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `in` requires the field's `type_url` to be equal to one of the + // specified values. If it doesn't match any of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyAny { + // // The `value` field must have a `type_url` equal to one of the specified values. + // google.protobuf.Any value = 1 [(buf.validate.field).any = { + // in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"] + // }]; + // } + // + // ``` + In []string + // `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated. + // + // ```proto + // + // message MyAny { + // // The `value` field must not have a `type_url` equal to any of the specified values. + // google.protobuf.Any value = 1 [(buf.validate.field).any = { + // not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"] + // }]; + // } + // + // ``` + NotIn []string +} + +func (b0 AnyRules_builder) Build() *AnyRules { + m0 := &AnyRules{} + b, x := &b0, m0 + _, _ = b, x + x.In = b.In + x.NotIn = b.NotIn + return m0 +} + +// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type. +type DurationRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. + // + // ```proto + // + // message MyDuration { + // // value must equal 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; + // } + // + // ``` + Const *durationpb.Duration `protobuf:"bytes,2,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *DurationRules_Lt + // *DurationRules_Lte + LessThan isDurationRules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *DurationRules_Gt + // *DurationRules_Gte + GreaterThan isDurationRules_GreaterThan `protobuf_oneof:"greater_than"` + // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + // If the field's value doesn't correspond to any of the specified values, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be in list [1s, 2s, 3s] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; + // } + // + // ``` + In []*durationpb.Duration `protobuf:"bytes,7,rep,name=in" json:"in,omitempty"` + // `not_in` denotes that the field must not be equal to + // any of the specified values of the `google.protobuf.Duration` type. + // If the field's value matches any of these values, an error message will be + // generated. + // + // ```proto + // + // message MyDuration { + // // value must not be in list [1s, 2s, 3s] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; + // } + // + // ``` + NotIn []*durationpb.Duration `protobuf:"bytes,8,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyDuration { + // google.protobuf.Duration value = 1 [ + // (buf.validate.field).duration.example = { seconds: 1 }, + // (buf.validate.field).duration.example = { seconds: 2 }, + // ]; + // } + // + // ``` + Example []*durationpb.Duration `protobuf:"bytes,9,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DurationRules) Reset() { + *x = DurationRules{} + mi := &file_buf_validate_validate_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DurationRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DurationRules) ProtoMessage() {} + +func (x *DurationRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DurationRules) GetConst() *durationpb.Duration { + if x != nil { + return x.Const + } + return nil +} + +func (x *DurationRules) GetLessThan() isDurationRules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *DurationRules) GetLt() *durationpb.Duration { + if x != nil { + if x, ok := x.LessThan.(*DurationRules_Lt); ok { + return x.Lt + } + } + return nil +} + +func (x *DurationRules) GetLte() *durationpb.Duration { + if x != nil { + if x, ok := x.LessThan.(*DurationRules_Lte); ok { + return x.Lte + } + } + return nil +} + +func (x *DurationRules) GetGreaterThan() isDurationRules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *DurationRules) GetGt() *durationpb.Duration { + if x != nil { + if x, ok := x.GreaterThan.(*DurationRules_Gt); ok { + return x.Gt + } + } + return nil +} + +func (x *DurationRules) GetGte() *durationpb.Duration { + if x != nil { + if x, ok := x.GreaterThan.(*DurationRules_Gte); ok { + return x.Gte + } + } + return nil +} + +func (x *DurationRules) GetIn() []*durationpb.Duration { + if x != nil { + return x.In + } + return nil +} + +func (x *DurationRules) GetNotIn() []*durationpb.Duration { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *DurationRules) GetExample() []*durationpb.Duration { + if x != nil { + return x.Example + } + return nil +} + +func (x *DurationRules) SetConst(v *durationpb.Duration) { + x.Const = v +} + +func (x *DurationRules) SetLt(v *durationpb.Duration) { + if v == nil { + x.LessThan = nil + return + } + x.LessThan = &DurationRules_Lt{v} +} + +func (x *DurationRules) SetLte(v *durationpb.Duration) { + if v == nil { + x.LessThan = nil + return + } + x.LessThan = &DurationRules_Lte{v} +} + +func (x *DurationRules) SetGt(v *durationpb.Duration) { + if v == nil { + x.GreaterThan = nil + return + } + x.GreaterThan = &DurationRules_Gt{v} +} + +func (x *DurationRules) SetGte(v *durationpb.Duration) { + if v == nil { + x.GreaterThan = nil + return + } + x.GreaterThan = &DurationRules_Gte{v} +} + +func (x *DurationRules) SetIn(v []*durationpb.Duration) { + x.In = v +} + +func (x *DurationRules) SetNotIn(v []*durationpb.Duration) { + x.NotIn = v +} + +func (x *DurationRules) SetExample(v []*durationpb.Duration) { + x.Example = v +} + +func (x *DurationRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *DurationRules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *DurationRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*DurationRules_Lt) + return ok +} + +func (x *DurationRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*DurationRules_Lte) + return ok +} + +func (x *DurationRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *DurationRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*DurationRules_Gt) + return ok +} + +func (x *DurationRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*DurationRules_Gte) + return ok +} + +func (x *DurationRules) ClearConst() { + x.Const = nil +} + +func (x *DurationRules) ClearLessThan() { + x.LessThan = nil +} + +func (x *DurationRules) ClearLt() { + if _, ok := x.LessThan.(*DurationRules_Lt); ok { + x.LessThan = nil + } +} + +func (x *DurationRules) ClearLte() { + if _, ok := x.LessThan.(*DurationRules_Lte); ok { + x.LessThan = nil + } +} + +func (x *DurationRules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *DurationRules) ClearGt() { + if _, ok := x.GreaterThan.(*DurationRules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *DurationRules) ClearGte() { + if _, ok := x.GreaterThan.(*DurationRules_Gte); ok { + x.GreaterThan = nil + } +} + +const DurationRules_LessThan_not_set_case case_DurationRules_LessThan = 0 +const DurationRules_Lt_case case_DurationRules_LessThan = 3 +const DurationRules_Lte_case case_DurationRules_LessThan = 4 + +func (x *DurationRules) WhichLessThan() case_DurationRules_LessThan { + if x == nil { + return DurationRules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *DurationRules_Lt: + return DurationRules_Lt_case + case *DurationRules_Lte: + return DurationRules_Lte_case + default: + return DurationRules_LessThan_not_set_case + } +} + +const DurationRules_GreaterThan_not_set_case case_DurationRules_GreaterThan = 0 +const DurationRules_Gt_case case_DurationRules_GreaterThan = 5 +const DurationRules_Gte_case case_DurationRules_GreaterThan = 6 + +func (x *DurationRules) WhichGreaterThan() case_DurationRules_GreaterThan { + if x == nil { + return DurationRules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *DurationRules_Gt: + return DurationRules_Gt_case + case *DurationRules_Gte: + return DurationRules_Gte_case + default: + return DurationRules_GreaterThan_not_set_case + } +} + +type DurationRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. + // + // ```proto + // + // message MyDuration { + // // value must equal 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; + // } + // + // ``` + Const *durationpb.Duration + // Fields of oneof LessThan: + // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + // exclusive. If the field's value is greater than or equal to the specified + // value, an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; + // } + // + // ``` + Lt *durationpb.Duration + // `lte` indicates that the field must be less than or equal to the specified + // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than or equal to 10s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; + // } + // + // ``` + Lte *durationpb.Duration + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the duration field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than 5s [duration.gt] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + // + // // duration must be greater than 5s and less than 10s [duration.gt_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gt *durationpb.Duration + // `gte` requires the duration field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value must + // be outside the specified range. If the field value doesn't meet the + // required conditions, an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than or equal to 5s [duration.gte] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; + // + // // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gte *durationpb.Duration + // -- end of GreaterThan + // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + // If the field's value doesn't correspond to any of the specified values, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be in list [1s, 2s, 3s] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; + // } + // + // ``` + In []*durationpb.Duration + // `not_in` denotes that the field must not be equal to + // any of the specified values of the `google.protobuf.Duration` type. + // If the field's value matches any of these values, an error message will be + // generated. + // + // ```proto + // + // message MyDuration { + // // value must not be in list [1s, 2s, 3s] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; + // } + // + // ``` + NotIn []*durationpb.Duration + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyDuration { + // google.protobuf.Duration value = 1 [ + // (buf.validate.field).duration.example = { seconds: 1 }, + // (buf.validate.field).duration.example = { seconds: 2 }, + // ]; + // } + // + // ``` + Example []*durationpb.Duration +} + +func (b0 DurationRules_builder) Build() *DurationRules { + m0 := &DurationRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &DurationRules_Lt{b.Lt} + } + if b.Lte != nil { + x.LessThan = &DurationRules_Lte{b.Lte} + } + if b.Gt != nil { + x.GreaterThan = &DurationRules_Gt{b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &DurationRules_Gte{b.Gte} + } + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +type case_DurationRules_LessThan protoreflect.FieldNumber + +func (x case_DurationRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[25].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_DurationRules_GreaterThan protoreflect.FieldNumber + +func (x case_DurationRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[25].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isDurationRules_LessThan interface { + isDurationRules_LessThan() +} + +type DurationRules_Lt struct { + // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + // exclusive. If the field's value is greater than or equal to the specified + // value, an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; + // } + // + // ``` + Lt *durationpb.Duration `protobuf:"bytes,3,opt,name=lt,oneof"` +} + +type DurationRules_Lte struct { + // `lte` indicates that the field must be less than or equal to the specified + // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than or equal to 10s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; + // } + // + // ``` + Lte *durationpb.Duration `protobuf:"bytes,4,opt,name=lte,oneof"` +} + +func (*DurationRules_Lt) isDurationRules_LessThan() {} + +func (*DurationRules_Lte) isDurationRules_LessThan() {} + +type isDurationRules_GreaterThan interface { + isDurationRules_GreaterThan() +} + +type DurationRules_Gt struct { + // `gt` requires the duration field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than 5s [duration.gt] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + // + // // duration must be greater than 5s and less than 10s [duration.gt_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gt *durationpb.Duration `protobuf:"bytes,5,opt,name=gt,oneof"` +} + +type DurationRules_Gte struct { + // `gte` requires the duration field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value must + // be outside the specified range. If the field value doesn't meet the + // required conditions, an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than or equal to 5s [duration.gte] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; + // + // // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gte *durationpb.Duration `protobuf:"bytes,6,opt,name=gte,oneof"` +} + +func (*DurationRules_Gt) isDurationRules_GreaterThan() {} + +func (*DurationRules_Gte) isDurationRules_GreaterThan() {} + +// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type. +type FieldMaskRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. + // + // ```proto + // + // message MyFieldMask { + // // value must equal ["a"] + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = { + // paths: ["a"] + // }]; + // } + // + // ``` + Const *fieldmaskpb.FieldMask `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"` + // `in` requires the field value to only contain paths matching specified + // values or their subpaths. + // If any of the field value's paths doesn't match the rule, + // an error message is generated. + // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + // + // ```proto + // + // message MyFieldMask { + // // The `value` FieldMask must only contain paths listed in `in`. + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + // in: ["a", "b", "c.a"] + // }]; + // } + // + // ``` + In []string `protobuf:"bytes,2,rep,name=in" json:"in,omitempty"` + // `not_in` requires the field value to not contain paths matching specified + // values or their subpaths. + // If any of the field value's paths matches the rule, + // an error message is generated. + // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + // + // ```proto + // + // message MyFieldMask { + // // The `value` FieldMask shall not contain paths listed in `not_in`. + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + // not_in: ["forbidden", "immutable", "c.a"] + // }]; + // } + // + // ``` + NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFieldMask { + // google.protobuf.FieldMask value = 1 [ + // (buf.validate.field).field_mask.example = { paths: ["a", "b"] }, + // (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }, + // ]; + // } + // + // ``` + Example []*fieldmaskpb.FieldMask `protobuf:"bytes,4,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldMaskRules) Reset() { + *x = FieldMaskRules{} + mi := &file_buf_validate_validate_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldMaskRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldMaskRules) ProtoMessage() {} + +func (x *FieldMaskRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldMaskRules) GetConst() *fieldmaskpb.FieldMask { + if x != nil { + return x.Const + } + return nil +} + +func (x *FieldMaskRules) GetIn() []string { + if x != nil { + return x.In + } + return nil +} + +func (x *FieldMaskRules) GetNotIn() []string { + if x != nil { + return x.NotIn + } + return nil +} + +func (x *FieldMaskRules) GetExample() []*fieldmaskpb.FieldMask { + if x != nil { + return x.Example + } + return nil +} + +func (x *FieldMaskRules) SetConst(v *fieldmaskpb.FieldMask) { + x.Const = v +} + +func (x *FieldMaskRules) SetIn(v []string) { + x.In = v +} + +func (x *FieldMaskRules) SetNotIn(v []string) { + x.NotIn = v +} + +func (x *FieldMaskRules) SetExample(v []*fieldmaskpb.FieldMask) { + x.Example = v +} + +func (x *FieldMaskRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *FieldMaskRules) ClearConst() { + x.Const = nil +} + +type FieldMaskRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. + // + // ```proto + // + // message MyFieldMask { + // // value must equal ["a"] + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = { + // paths: ["a"] + // }]; + // } + // + // ``` + Const *fieldmaskpb.FieldMask + // `in` requires the field value to only contain paths matching specified + // values or their subpaths. + // If any of the field value's paths doesn't match the rule, + // an error message is generated. + // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + // + // ```proto + // + // message MyFieldMask { + // // The `value` FieldMask must only contain paths listed in `in`. + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + // in: ["a", "b", "c.a"] + // }]; + // } + // + // ``` + In []string + // `not_in` requires the field value to not contain paths matching specified + // values or their subpaths. + // If any of the field value's paths matches the rule, + // an error message is generated. + // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + // + // ```proto + // + // message MyFieldMask { + // // The `value` FieldMask shall not contain paths listed in `not_in`. + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + // not_in: ["forbidden", "immutable", "c.a"] + // }]; + // } + // + // ``` + NotIn []string + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFieldMask { + // google.protobuf.FieldMask value = 1 [ + // (buf.validate.field).field_mask.example = { paths: ["a", "b"] }, + // (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }, + // ]; + // } + // + // ``` + Example []*fieldmaskpb.FieldMask +} + +func (b0 FieldMaskRules_builder) Build() *FieldMaskRules { + m0 := &FieldMaskRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + x.In = b.In + x.NotIn = b.NotIn + x.Example = b.Example + return m0 +} + +// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type. +type TimestampRules struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated. + // + // ```proto + // + // message MyTimestamp { + // // value must equal 2023-05-03T10:00:00Z + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; + // } + // + // ``` + Const *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=const" json:"const,omitempty"` + // Types that are valid to be assigned to LessThan: + // + // *TimestampRules_Lt + // *TimestampRules_Lte + // *TimestampRules_LtNow + LessThan isTimestampRules_LessThan `protobuf_oneof:"less_than"` + // Types that are valid to be assigned to GreaterThan: + // + // *TimestampRules_Gt + // *TimestampRules_Gte + // *TimestampRules_GtNow + GreaterThan isTimestampRules_GreaterThan `protobuf_oneof:"greater_than"` + // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // must be within 1 hour of now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; + // } + // + // ``` + Within *durationpb.Duration `protobuf:"bytes,9,opt,name=within" json:"within,omitempty"` + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyTimestamp { + // google.protobuf.Timestamp value = 1 [ + // (buf.validate.field).timestamp.example = { seconds: 1672444800 }, + // (buf.validate.field).timestamp.example = { seconds: 1672531200 }, + // ]; + // } + // + // ``` + Example []*timestamppb.Timestamp `protobuf:"bytes,10,rep,name=example" json:"example,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TimestampRules) Reset() { + *x = TimestampRules{} + mi := &file_buf_validate_validate_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TimestampRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimestampRules) ProtoMessage() {} + +func (x *TimestampRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TimestampRules) GetConst() *timestamppb.Timestamp { + if x != nil { + return x.Const + } + return nil +} + +func (x *TimestampRules) GetLessThan() isTimestampRules_LessThan { + if x != nil { + return x.LessThan + } + return nil +} + +func (x *TimestampRules) GetLt() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.LessThan.(*TimestampRules_Lt); ok { + return x.Lt + } + } + return nil +} + +func (x *TimestampRules) GetLte() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.LessThan.(*TimestampRules_Lte); ok { + return x.Lte + } + } + return nil +} + +func (x *TimestampRules) GetLtNow() bool { + if x != nil { + if x, ok := x.LessThan.(*TimestampRules_LtNow); ok { + return x.LtNow + } + } + return false +} + +func (x *TimestampRules) GetGreaterThan() isTimestampRules_GreaterThan { + if x != nil { + return x.GreaterThan + } + return nil +} + +func (x *TimestampRules) GetGt() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.GreaterThan.(*TimestampRules_Gt); ok { + return x.Gt + } + } + return nil +} + +func (x *TimestampRules) GetGte() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.GreaterThan.(*TimestampRules_Gte); ok { + return x.Gte + } + } + return nil +} + +func (x *TimestampRules) GetGtNow() bool { + if x != nil { + if x, ok := x.GreaterThan.(*TimestampRules_GtNow); ok { + return x.GtNow + } + } + return false +} + +func (x *TimestampRules) GetWithin() *durationpb.Duration { + if x != nil { + return x.Within + } + return nil +} + +func (x *TimestampRules) GetExample() []*timestamppb.Timestamp { + if x != nil { + return x.Example + } + return nil +} + +func (x *TimestampRules) SetConst(v *timestamppb.Timestamp) { + x.Const = v +} + +func (x *TimestampRules) SetLt(v *timestamppb.Timestamp) { + if v == nil { + x.LessThan = nil + return + } + x.LessThan = &TimestampRules_Lt{v} +} + +func (x *TimestampRules) SetLte(v *timestamppb.Timestamp) { + if v == nil { + x.LessThan = nil + return + } + x.LessThan = &TimestampRules_Lte{v} +} + +func (x *TimestampRules) SetLtNow(v bool) { + x.LessThan = &TimestampRules_LtNow{v} +} + +func (x *TimestampRules) SetGt(v *timestamppb.Timestamp) { + if v == nil { + x.GreaterThan = nil + return + } + x.GreaterThan = &TimestampRules_Gt{v} +} + +func (x *TimestampRules) SetGte(v *timestamppb.Timestamp) { + if v == nil { + x.GreaterThan = nil + return + } + x.GreaterThan = &TimestampRules_Gte{v} +} + +func (x *TimestampRules) SetGtNow(v bool) { + x.GreaterThan = &TimestampRules_GtNow{v} +} + +func (x *TimestampRules) SetWithin(v *durationpb.Duration) { + x.Within = v +} + +func (x *TimestampRules) SetExample(v []*timestamppb.Timestamp) { + x.Example = v +} + +func (x *TimestampRules) HasConst() bool { + if x == nil { + return false + } + return x.Const != nil +} + +func (x *TimestampRules) HasLessThan() bool { + if x == nil { + return false + } + return x.LessThan != nil +} + +func (x *TimestampRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*TimestampRules_Lt) + return ok +} + +func (x *TimestampRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*TimestampRules_Lte) + return ok +} + +func (x *TimestampRules) HasLtNow() bool { + if x == nil { + return false + } + _, ok := x.LessThan.(*TimestampRules_LtNow) + return ok +} + +func (x *TimestampRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.GreaterThan != nil +} + +func (x *TimestampRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*TimestampRules_Gt) + return ok +} + +func (x *TimestampRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*TimestampRules_Gte) + return ok +} + +func (x *TimestampRules) HasGtNow() bool { + if x == nil { + return false + } + _, ok := x.GreaterThan.(*TimestampRules_GtNow) + return ok +} + +func (x *TimestampRules) HasWithin() bool { + if x == nil { + return false + } + return x.Within != nil +} + +func (x *TimestampRules) ClearConst() { + x.Const = nil +} + +func (x *TimestampRules) ClearLessThan() { + x.LessThan = nil +} + +func (x *TimestampRules) ClearLt() { + if _, ok := x.LessThan.(*TimestampRules_Lt); ok { + x.LessThan = nil + } +} + +func (x *TimestampRules) ClearLte() { + if _, ok := x.LessThan.(*TimestampRules_Lte); ok { + x.LessThan = nil + } +} + +func (x *TimestampRules) ClearLtNow() { + if _, ok := x.LessThan.(*TimestampRules_LtNow); ok { + x.LessThan = nil + } +} + +func (x *TimestampRules) ClearGreaterThan() { + x.GreaterThan = nil +} + +func (x *TimestampRules) ClearGt() { + if _, ok := x.GreaterThan.(*TimestampRules_Gt); ok { + x.GreaterThan = nil + } +} + +func (x *TimestampRules) ClearGte() { + if _, ok := x.GreaterThan.(*TimestampRules_Gte); ok { + x.GreaterThan = nil + } +} + +func (x *TimestampRules) ClearGtNow() { + if _, ok := x.GreaterThan.(*TimestampRules_GtNow); ok { + x.GreaterThan = nil + } +} + +func (x *TimestampRules) ClearWithin() { + x.Within = nil +} + +const TimestampRules_LessThan_not_set_case case_TimestampRules_LessThan = 0 +const TimestampRules_Lt_case case_TimestampRules_LessThan = 3 +const TimestampRules_Lte_case case_TimestampRules_LessThan = 4 +const TimestampRules_LtNow_case case_TimestampRules_LessThan = 7 + +func (x *TimestampRules) WhichLessThan() case_TimestampRules_LessThan { + if x == nil { + return TimestampRules_LessThan_not_set_case + } + switch x.LessThan.(type) { + case *TimestampRules_Lt: + return TimestampRules_Lt_case + case *TimestampRules_Lte: + return TimestampRules_Lte_case + case *TimestampRules_LtNow: + return TimestampRules_LtNow_case + default: + return TimestampRules_LessThan_not_set_case + } +} + +const TimestampRules_GreaterThan_not_set_case case_TimestampRules_GreaterThan = 0 +const TimestampRules_Gt_case case_TimestampRules_GreaterThan = 5 +const TimestampRules_Gte_case case_TimestampRules_GreaterThan = 6 +const TimestampRules_GtNow_case case_TimestampRules_GreaterThan = 8 + +func (x *TimestampRules) WhichGreaterThan() case_TimestampRules_GreaterThan { + if x == nil { + return TimestampRules_GreaterThan_not_set_case + } + switch x.GreaterThan.(type) { + case *TimestampRules_Gt: + return TimestampRules_Gt_case + case *TimestampRules_Gte: + return TimestampRules_Gte_case + case *TimestampRules_GtNow: + return TimestampRules_GtNow_case + default: + return TimestampRules_GreaterThan_not_set_case + } +} + +type TimestampRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated. + // + // ```proto + // + // message MyTimestamp { + // // value must equal 2023-05-03T10:00:00Z + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; + // } + // + // ``` + Const *timestamppb.Timestamp + // Fields of oneof LessThan: + // `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }]; + // } + // + // ``` + Lt *timestamppb.Timestamp + // `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }]; + // } + // + // ``` + Lte *timestamppb.Timestamp + // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be less than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; + // } + // + // ``` + LtNow *bool + // -- end of LessThan + // Fields of oneof GreaterThan: + // `gt` requires the timestamp field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + // + // // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gt *timestamppb.Timestamp + // `gte` requires the timestamp field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value + // must be outside the specified range. If the field value doesn't meet + // the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + // + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gte *timestamppb.Timestamp + // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be greater than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; + // } + // + // ``` + GtNow *bool + // -- end of GreaterThan + // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // must be within 1 hour of now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; + // } + // + // ``` + Within *durationpb.Duration + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyTimestamp { + // google.protobuf.Timestamp value = 1 [ + // (buf.validate.field).timestamp.example = { seconds: 1672444800 }, + // (buf.validate.field).timestamp.example = { seconds: 1672531200 }, + // ]; + // } + // + // ``` + Example []*timestamppb.Timestamp +} + +func (b0 TimestampRules_builder) Build() *TimestampRules { + m0 := &TimestampRules{} + b, x := &b0, m0 + _, _ = b, x + x.Const = b.Const + if b.Lt != nil { + x.LessThan = &TimestampRules_Lt{b.Lt} + } + if b.Lte != nil { + x.LessThan = &TimestampRules_Lte{b.Lte} + } + if b.LtNow != nil { + x.LessThan = &TimestampRules_LtNow{*b.LtNow} + } + if b.Gt != nil { + x.GreaterThan = &TimestampRules_Gt{b.Gt} + } + if b.Gte != nil { + x.GreaterThan = &TimestampRules_Gte{b.Gte} + } + if b.GtNow != nil { + x.GreaterThan = &TimestampRules_GtNow{*b.GtNow} + } + x.Within = b.Within + x.Example = b.Example + return m0 +} + +type case_TimestampRules_LessThan protoreflect.FieldNumber + +func (x case_TimestampRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[27].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_TimestampRules_GreaterThan protoreflect.FieldNumber + +func (x case_TimestampRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[27].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isTimestampRules_LessThan interface { + isTimestampRules_LessThan() +} + +type TimestampRules_Lt struct { + // `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }]; + // } + // + // ``` + Lt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lt,oneof"` +} + +type TimestampRules_Lte struct { + // `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }]; + // } + // + // ``` + Lte *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=lte,oneof"` +} + +type TimestampRules_LtNow struct { + // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be less than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; + // } + // + // ``` + LtNow bool `protobuf:"varint,7,opt,name=lt_now,json=ltNow,oneof"` +} + +func (*TimestampRules_Lt) isTimestampRules_LessThan() {} + +func (*TimestampRules_Lte) isTimestampRules_LessThan() {} + +func (*TimestampRules_LtNow) isTimestampRules_LessThan() {} + +type isTimestampRules_GreaterThan interface { + isTimestampRules_GreaterThan() +} + +type TimestampRules_Gt struct { + // `gt` requires the timestamp field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + // + // // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=gt,oneof"` +} + +type TimestampRules_Gte struct { + // `gte` requires the timestamp field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value + // must be outside the specified range. If the field value doesn't meet + // the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + // + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gte *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=gte,oneof"` +} + +type TimestampRules_GtNow struct { + // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be greater than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; + // } + // + // ``` + GtNow bool `protobuf:"varint,8,opt,name=gt_now,json=gtNow,oneof"` +} + +func (*TimestampRules_Gt) isTimestampRules_GreaterThan() {} + +func (*TimestampRules_Gte) isTimestampRules_GreaterThan() {} + +func (*TimestampRules_GtNow) isTimestampRules_GreaterThan() {} + +// `Violations` is a collection of `Violation` messages. This message type is returned by +// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules. +// Each individual violation is represented by a `Violation` message. +type Violations struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. + Violations []*Violation `protobuf:"bytes,1,rep,name=violations" json:"violations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Violations) Reset() { + *x = Violations{} + mi := &file_buf_validate_validate_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Violations) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Violations) ProtoMessage() {} + +func (x *Violations) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Violations) GetViolations() []*Violation { + if x != nil { + return x.Violations + } + return nil +} + +func (x *Violations) SetViolations(v []*Violation) { + x.Violations = v +} + +type Violations_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. + Violations []*Violation +} + +func (b0 Violations_builder) Build() *Violations { + m0 := &Violations{} + b, x := &b0, m0 + _, _ = b, x + x.Violations = b.Violations + return m0 +} + +// `Violation` represents a single instance where a validation rule, expressed +// as a `Rule`, was not met. It provides information about the field that +// caused the violation, the specific rule that wasn't fulfilled, and a +// human-readable error message. +// +// For example, consider the following message: +// +// ```proto +// +// message User { +// int32 age = 1 [(buf.validate.field).cel = { +// id: "user.age", +// expression: "this < 18 ? 'User must be at least 18 years old' : ''", +// }]; +// } +// +// ``` +// +// It could produce the following violation: +// +// ```json +// +// { +// "ruleId": "user.age", +// "message": "User must be at least 18 years old", +// "field": { +// "elements": [ +// { +// "fieldNumber": 1, +// "fieldName": "age", +// "fieldType": "TYPE_INT32" +// } +// ] +// }, +// "rule": { +// "elements": [ +// { +// "fieldNumber": 23, +// "fieldName": "cel", +// "fieldType": "TYPE_MESSAGE", +// "index": "0" +// } +// ] +// } +// } +// +// ``` +type Violation struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `field` is a machine-readable path to the field that failed validation. + // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. + // + // For example, consider the following message: + // + // ```proto + // + // message Message { + // bool a = 1 [(buf.validate.field).required = true]; + // } + // + // ``` + // + // It could produce the following violation: + // + // ```textproto + // + // violation { + // field { element { field_number: 1, field_name: "a", field_type: 8 } } + // ... + // } + // + // ``` + Field *FieldPath `protobuf:"bytes,5,opt,name=field" json:"field,omitempty"` + // `rule` is a machine-readable path that points to the specific rule that failed validation. + // This will be a nested field starting from the FieldRules of the field that failed validation. + // For custom rules, this will provide the path of the rule, e.g. `cel[0]`. + // + // For example, consider the following message: + // + // ```proto + // + // message Message { + // bool a = 1 [(buf.validate.field).required = true]; + // bool b = 2 [(buf.validate.field).cel = { + // id: "custom_rule", + // expression: "!this ? 'b must be true': ''" + // }] + // } + // + // ``` + // + // It could produce the following violations: + // + // ```textproto + // + // violation { + // rule { element { field_number: 25, field_name: "required", field_type: 8 } } + // ... + // } + // + // violation { + // rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } } + // ... + // } + // + // ``` + Rule *FieldPath `protobuf:"bytes,6,opt,name=rule" json:"rule,omitempty"` + // `rule_id` is the unique identifier of the `Rule` that was not fulfilled. + // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated. + RuleId *string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId" json:"rule_id,omitempty"` + // `message` is a human-readable error message that describes the nature of the violation. + // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation. + Message *string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` + // `for_key` indicates whether the violation was caused by a map key, rather than a value. + ForKey *bool `protobuf:"varint,4,opt,name=for_key,json=forKey" json:"for_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Violation) Reset() { + *x = Violation{} + mi := &file_buf_validate_validate_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Violation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Violation) ProtoMessage() {} + +func (x *Violation) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Violation) GetField() *FieldPath { + if x != nil { + return x.Field + } + return nil +} + +func (x *Violation) GetRule() *FieldPath { + if x != nil { + return x.Rule + } + return nil +} + +func (x *Violation) GetRuleId() string { + if x != nil && x.RuleId != nil { + return *x.RuleId + } + return "" +} + +func (x *Violation) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message + } + return "" +} + +func (x *Violation) GetForKey() bool { + if x != nil && x.ForKey != nil { + return *x.ForKey + } + return false +} + +func (x *Violation) SetField(v *FieldPath) { + x.Field = v +} + +func (x *Violation) SetRule(v *FieldPath) { + x.Rule = v +} + +func (x *Violation) SetRuleId(v string) { + x.RuleId = &v +} + +func (x *Violation) SetMessage(v string) { + x.Message = &v +} + +func (x *Violation) SetForKey(v bool) { + x.ForKey = &v +} + +func (x *Violation) HasField() bool { + if x == nil { + return false + } + return x.Field != nil +} + +func (x *Violation) HasRule() bool { + if x == nil { + return false + } + return x.Rule != nil +} + +func (x *Violation) HasRuleId() bool { + if x == nil { + return false + } + return x.RuleId != nil +} + +func (x *Violation) HasMessage() bool { + if x == nil { + return false + } + return x.Message != nil +} + +func (x *Violation) HasForKey() bool { + if x == nil { + return false + } + return x.ForKey != nil +} + +func (x *Violation) ClearField() { + x.Field = nil +} + +func (x *Violation) ClearRule() { + x.Rule = nil +} + +func (x *Violation) ClearRuleId() { + x.RuleId = nil +} + +func (x *Violation) ClearMessage() { + x.Message = nil +} + +func (x *Violation) ClearForKey() { + x.ForKey = nil +} + +type Violation_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `field` is a machine-readable path to the field that failed validation. + // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. + // + // For example, consider the following message: + // + // ```proto + // + // message Message { + // bool a = 1 [(buf.validate.field).required = true]; + // } + // + // ``` + // + // It could produce the following violation: + // + // ```textproto + // + // violation { + // field { element { field_number: 1, field_name: "a", field_type: 8 } } + // ... + // } + // + // ``` + Field *FieldPath + // `rule` is a machine-readable path that points to the specific rule that failed validation. + // This will be a nested field starting from the FieldRules of the field that failed validation. + // For custom rules, this will provide the path of the rule, e.g. `cel[0]`. + // + // For example, consider the following message: + // + // ```proto + // + // message Message { + // bool a = 1 [(buf.validate.field).required = true]; + // bool b = 2 [(buf.validate.field).cel = { + // id: "custom_rule", + // expression: "!this ? 'b must be true': ''" + // }] + // } + // + // ``` + // + // It could produce the following violations: + // + // ```textproto + // + // violation { + // rule { element { field_number: 25, field_name: "required", field_type: 8 } } + // ... + // } + // + // violation { + // rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } } + // ... + // } + // + // ``` + Rule *FieldPath + // `rule_id` is the unique identifier of the `Rule` that was not fulfilled. + // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated. + RuleId *string + // `message` is a human-readable error message that describes the nature of the violation. + // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation. + Message *string + // `for_key` indicates whether the violation was caused by a map key, rather than a value. + ForKey *bool +} + +func (b0 Violation_builder) Build() *Violation { + m0 := &Violation{} + b, x := &b0, m0 + _, _ = b, x + x.Field = b.Field + x.Rule = b.Rule + x.RuleId = b.RuleId + x.Message = b.Message + x.ForKey = b.ForKey + return m0 +} + +// `FieldPath` provides a path to a nested protobuf field. +// +// This message provides enough information to render a dotted field path even without protobuf descriptors. +// It also provides enough information to resolve a nested field through unknown wire data. +type FieldPath struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `elements` contains each element of the path, starting from the root and recursing downward. + Elements []*FieldPathElement `protobuf:"bytes,1,rep,name=elements" json:"elements,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldPath) Reset() { + *x = FieldPath{} + mi := &file_buf_validate_validate_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldPath) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldPath) ProtoMessage() {} + +func (x *FieldPath) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldPath) GetElements() []*FieldPathElement { + if x != nil { + return x.Elements + } + return nil +} + +func (x *FieldPath) SetElements(v []*FieldPathElement) { + x.Elements = v +} + +type FieldPath_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `elements` contains each element of the path, starting from the root and recursing downward. + Elements []*FieldPathElement +} + +func (b0 FieldPath_builder) Build() *FieldPath { + m0 := &FieldPath{} + b, x := &b0, m0 + _, _ = b, x + x.Elements = b.Elements + return m0 +} + +// `FieldPathElement` provides enough information to nest through a single protobuf field. +// +// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it. +// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value. +// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available. +type FieldPathElement struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + // `field_number` is the field number this path element refers to. + FieldNumber *int32 `protobuf:"varint,1,opt,name=field_number,json=fieldNumber" json:"field_number,omitempty"` + // `field_name` contains the field name this path element refers to. + // This can be used to display a human-readable path even if the field number is unknown. + FieldName *string `protobuf:"bytes,2,opt,name=field_name,json=fieldName" json:"field_name,omitempty"` + // `field_type` specifies the type of this field. When using reflection, this value is not needed. + // + // This value is provided to make it possible to traverse unknown fields through wire data. + // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes. + // + // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and + // can be explicitly used in Protocol Buffers 2023 Edition. + // + // [1]: https://protobuf.dev/programming-guides/encoding/#packed + // [2]: https://protobuf.dev/programming-guides/encoding/#groups + FieldType *descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,3,opt,name=field_type,json=fieldType,enum=google.protobuf.FieldDescriptorProto_Type" json:"field_type,omitempty"` + // `key_type` specifies the map key type of this field. This value is useful when traversing + // unknown fields through wire data: specifically, it allows handling the differences between + // different integer encodings. + KeyType *descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,4,opt,name=key_type,json=keyType,enum=google.protobuf.FieldDescriptorProto_Type" json:"key_type,omitempty"` + // `value_type` specifies map value type of this field. This is useful if you want to display a + // value inside unknown fields through wire data. + ValueType *descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=value_type,json=valueType,enum=google.protobuf.FieldDescriptorProto_Type" json:"value_type,omitempty"` + // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field. + // + // Types that are valid to be assigned to Subscript: + // + // *FieldPathElement_Index + // *FieldPathElement_BoolKey + // *FieldPathElement_IntKey + // *FieldPathElement_UintKey + // *FieldPathElement_StringKey + Subscript isFieldPathElement_Subscript `protobuf_oneof:"subscript"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldPathElement) Reset() { + *x = FieldPathElement{} + mi := &file_buf_validate_validate_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldPathElement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldPathElement) ProtoMessage() {} + +func (x *FieldPathElement) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldPathElement) GetFieldNumber() int32 { + if x != nil && x.FieldNumber != nil { + return *x.FieldNumber + } + return 0 +} + +func (x *FieldPathElement) GetFieldName() string { + if x != nil && x.FieldName != nil { + return *x.FieldName + } + return "" +} + +func (x *FieldPathElement) GetFieldType() descriptorpb.FieldDescriptorProto_Type { + if x != nil && x.FieldType != nil { + return *x.FieldType + } + return descriptorpb.FieldDescriptorProto_Type(1) +} + +func (x *FieldPathElement) GetKeyType() descriptorpb.FieldDescriptorProto_Type { + if x != nil && x.KeyType != nil { + return *x.KeyType + } + return descriptorpb.FieldDescriptorProto_Type(1) +} + +func (x *FieldPathElement) GetValueType() descriptorpb.FieldDescriptorProto_Type { + if x != nil && x.ValueType != nil { + return *x.ValueType + } + return descriptorpb.FieldDescriptorProto_Type(1) +} + +func (x *FieldPathElement) GetSubscript() isFieldPathElement_Subscript { + if x != nil { + return x.Subscript + } + return nil +} + +func (x *FieldPathElement) GetIndex() uint64 { + if x != nil { + if x, ok := x.Subscript.(*FieldPathElement_Index); ok { + return x.Index + } + } + return 0 +} + +func (x *FieldPathElement) GetBoolKey() bool { + if x != nil { + if x, ok := x.Subscript.(*FieldPathElement_BoolKey); ok { + return x.BoolKey + } + } + return false +} + +func (x *FieldPathElement) GetIntKey() int64 { + if x != nil { + if x, ok := x.Subscript.(*FieldPathElement_IntKey); ok { + return x.IntKey + } + } + return 0 +} + +func (x *FieldPathElement) GetUintKey() uint64 { + if x != nil { + if x, ok := x.Subscript.(*FieldPathElement_UintKey); ok { + return x.UintKey + } + } + return 0 +} + +func (x *FieldPathElement) GetStringKey() string { + if x != nil { + if x, ok := x.Subscript.(*FieldPathElement_StringKey); ok { + return x.StringKey + } + } + return "" +} + +func (x *FieldPathElement) SetFieldNumber(v int32) { + x.FieldNumber = &v +} + +func (x *FieldPathElement) SetFieldName(v string) { + x.FieldName = &v +} + +func (x *FieldPathElement) SetFieldType(v descriptorpb.FieldDescriptorProto_Type) { + x.FieldType = &v +} + +func (x *FieldPathElement) SetKeyType(v descriptorpb.FieldDescriptorProto_Type) { + x.KeyType = &v +} + +func (x *FieldPathElement) SetValueType(v descriptorpb.FieldDescriptorProto_Type) { + x.ValueType = &v +} + +func (x *FieldPathElement) SetIndex(v uint64) { + x.Subscript = &FieldPathElement_Index{v} +} + +func (x *FieldPathElement) SetBoolKey(v bool) { + x.Subscript = &FieldPathElement_BoolKey{v} +} + +func (x *FieldPathElement) SetIntKey(v int64) { + x.Subscript = &FieldPathElement_IntKey{v} +} + +func (x *FieldPathElement) SetUintKey(v uint64) { + x.Subscript = &FieldPathElement_UintKey{v} +} + +func (x *FieldPathElement) SetStringKey(v string) { + x.Subscript = &FieldPathElement_StringKey{v} +} + +func (x *FieldPathElement) HasFieldNumber() bool { + if x == nil { + return false + } + return x.FieldNumber != nil +} + +func (x *FieldPathElement) HasFieldName() bool { + if x == nil { + return false + } + return x.FieldName != nil +} + +func (x *FieldPathElement) HasFieldType() bool { + if x == nil { + return false + } + return x.FieldType != nil +} + +func (x *FieldPathElement) HasKeyType() bool { + if x == nil { + return false + } + return x.KeyType != nil +} + +func (x *FieldPathElement) HasValueType() bool { + if x == nil { + return false + } + return x.ValueType != nil +} + +func (x *FieldPathElement) HasSubscript() bool { + if x == nil { + return false + } + return x.Subscript != nil +} + +func (x *FieldPathElement) HasIndex() bool { + if x == nil { + return false + } + _, ok := x.Subscript.(*FieldPathElement_Index) + return ok +} + +func (x *FieldPathElement) HasBoolKey() bool { + if x == nil { + return false + } + _, ok := x.Subscript.(*FieldPathElement_BoolKey) + return ok +} + +func (x *FieldPathElement) HasIntKey() bool { + if x == nil { + return false + } + _, ok := x.Subscript.(*FieldPathElement_IntKey) + return ok +} + +func (x *FieldPathElement) HasUintKey() bool { + if x == nil { + return false + } + _, ok := x.Subscript.(*FieldPathElement_UintKey) + return ok +} + +func (x *FieldPathElement) HasStringKey() bool { + if x == nil { + return false + } + _, ok := x.Subscript.(*FieldPathElement_StringKey) + return ok +} + +func (x *FieldPathElement) ClearFieldNumber() { + x.FieldNumber = nil +} + +func (x *FieldPathElement) ClearFieldName() { + x.FieldName = nil +} + +func (x *FieldPathElement) ClearFieldType() { + x.FieldType = nil +} + +func (x *FieldPathElement) ClearKeyType() { + x.KeyType = nil +} + +func (x *FieldPathElement) ClearValueType() { + x.ValueType = nil +} + +func (x *FieldPathElement) ClearSubscript() { + x.Subscript = nil +} + +func (x *FieldPathElement) ClearIndex() { + if _, ok := x.Subscript.(*FieldPathElement_Index); ok { + x.Subscript = nil + } +} + +func (x *FieldPathElement) ClearBoolKey() { + if _, ok := x.Subscript.(*FieldPathElement_BoolKey); ok { + x.Subscript = nil + } +} + +func (x *FieldPathElement) ClearIntKey() { + if _, ok := x.Subscript.(*FieldPathElement_IntKey); ok { + x.Subscript = nil + } +} + +func (x *FieldPathElement) ClearUintKey() { + if _, ok := x.Subscript.(*FieldPathElement_UintKey); ok { + x.Subscript = nil + } +} + +func (x *FieldPathElement) ClearStringKey() { + if _, ok := x.Subscript.(*FieldPathElement_StringKey); ok { + x.Subscript = nil + } +} + +const FieldPathElement_Subscript_not_set_case case_FieldPathElement_Subscript = 0 +const FieldPathElement_Index_case case_FieldPathElement_Subscript = 6 +const FieldPathElement_BoolKey_case case_FieldPathElement_Subscript = 7 +const FieldPathElement_IntKey_case case_FieldPathElement_Subscript = 8 +const FieldPathElement_UintKey_case case_FieldPathElement_Subscript = 9 +const FieldPathElement_StringKey_case case_FieldPathElement_Subscript = 10 + +func (x *FieldPathElement) WhichSubscript() case_FieldPathElement_Subscript { + if x == nil { + return FieldPathElement_Subscript_not_set_case + } + switch x.Subscript.(type) { + case *FieldPathElement_Index: + return FieldPathElement_Index_case + case *FieldPathElement_BoolKey: + return FieldPathElement_BoolKey_case + case *FieldPathElement_IntKey: + return FieldPathElement_IntKey_case + case *FieldPathElement_UintKey: + return FieldPathElement_UintKey_case + case *FieldPathElement_StringKey: + return FieldPathElement_StringKey_case + default: + return FieldPathElement_Subscript_not_set_case + } +} + +type FieldPathElement_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `field_number` is the field number this path element refers to. + FieldNumber *int32 + // `field_name` contains the field name this path element refers to. + // This can be used to display a human-readable path even if the field number is unknown. + FieldName *string + // `field_type` specifies the type of this field. When using reflection, this value is not needed. + // + // This value is provided to make it possible to traverse unknown fields through wire data. + // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes. + // + // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and + // can be explicitly used in Protocol Buffers 2023 Edition. + // + // [1]: https://protobuf.dev/programming-guides/encoding/#packed + // [2]: https://protobuf.dev/programming-guides/encoding/#groups + FieldType *descriptorpb.FieldDescriptorProto_Type + // `key_type` specifies the map key type of this field. This value is useful when traversing + // unknown fields through wire data: specifically, it allows handling the differences between + // different integer encodings. + KeyType *descriptorpb.FieldDescriptorProto_Type + // `value_type` specifies map value type of this field. This is useful if you want to display a + // value inside unknown fields through wire data. + ValueType *descriptorpb.FieldDescriptorProto_Type + // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field. + + // Fields of oneof Subscript: + // `index` specifies a 0-based index into a repeated field. + Index *uint64 + // `bool_key` specifies a map key of type bool. + BoolKey *bool + // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64. + IntKey *int64 + // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64. + UintKey *uint64 + // `string_key` specifies a map key of type string. + StringKey *string + // -- end of Subscript +} + +func (b0 FieldPathElement_builder) Build() *FieldPathElement { + m0 := &FieldPathElement{} + b, x := &b0, m0 + _, _ = b, x + x.FieldNumber = b.FieldNumber + x.FieldName = b.FieldName + x.FieldType = b.FieldType + x.KeyType = b.KeyType + x.ValueType = b.ValueType + if b.Index != nil { + x.Subscript = &FieldPathElement_Index{*b.Index} + } + if b.BoolKey != nil { + x.Subscript = &FieldPathElement_BoolKey{*b.BoolKey} + } + if b.IntKey != nil { + x.Subscript = &FieldPathElement_IntKey{*b.IntKey} + } + if b.UintKey != nil { + x.Subscript = &FieldPathElement_UintKey{*b.UintKey} + } + if b.StringKey != nil { + x.Subscript = &FieldPathElement_StringKey{*b.StringKey} + } + return m0 +} + +type case_FieldPathElement_Subscript protoreflect.FieldNumber + +func (x case_FieldPathElement_Subscript) String() string { + md := file_buf_validate_validate_proto_msgTypes[31].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFieldPathElement_Subscript interface { + isFieldPathElement_Subscript() +} + +type FieldPathElement_Index struct { + // `index` specifies a 0-based index into a repeated field. + Index uint64 `protobuf:"varint,6,opt,name=index,oneof"` +} + +type FieldPathElement_BoolKey struct { + // `bool_key` specifies a map key of type bool. + BoolKey bool `protobuf:"varint,7,opt,name=bool_key,json=boolKey,oneof"` +} + +type FieldPathElement_IntKey struct { + // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64. + IntKey int64 `protobuf:"varint,8,opt,name=int_key,json=intKey,oneof"` +} + +type FieldPathElement_UintKey struct { + // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64. + UintKey uint64 `protobuf:"varint,9,opt,name=uint_key,json=uintKey,oneof"` +} + +type FieldPathElement_StringKey struct { + // `string_key` specifies a map key of type string. + StringKey string `protobuf:"bytes,10,opt,name=string_key,json=stringKey,oneof"` +} + +func (*FieldPathElement_Index) isFieldPathElement_Subscript() {} + +func (*FieldPathElement_BoolKey) isFieldPathElement_Subscript() {} + +func (*FieldPathElement_IntKey) isFieldPathElement_Subscript() {} + +func (*FieldPathElement_UintKey) isFieldPathElement_Subscript() {} + +func (*FieldPathElement_StringKey) isFieldPathElement_Subscript() {} + +var file_buf_validate_validate_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*MessageRules)(nil), + Field: 1159, + Name: "buf.validate.message", + Tag: "bytes,1159,opt,name=message", + Filename: "buf/validate/validate.proto", + }, + { + ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtensionType: (*OneofRules)(nil), + Field: 1159, + Name: "buf.validate.oneof", + Tag: "bytes,1159,opt,name=oneof", + Filename: "buf/validate/validate.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*FieldRules)(nil), + Field: 1159, + Name: "buf.validate.field", + Tag: "bytes,1159,opt,name=field", + Filename: "buf/validate/validate.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*PredefinedRules)(nil), + Field: 1160, + Name: "buf.validate.predefined", + Tag: "bytes,1160,opt,name=predefined", + Filename: "buf/validate/validate.proto", + }, +} + +// Extension fields to descriptorpb.MessageOptions. +var ( + // Rules specify the validations to be performed on this message. By default, + // no validation is performed against a message. + // + // optional buf.validate.MessageRules message = 1159; + E_Message = &file_buf_validate_validate_proto_extTypes[0] +) + +// Extension fields to descriptorpb.OneofOptions. +var ( + // Rules specify the validations to be performed on this oneof. By default, + // no validation is performed against a oneof. + // + // optional buf.validate.OneofRules oneof = 1159; + E_Oneof = &file_buf_validate_validate_proto_extTypes[1] +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // Rules specify the validations to be performed on this field. By default, + // no validation is performed against a field. + // + // optional buf.validate.FieldRules field = 1159; + E_Field = &file_buf_validate_validate_proto_extTypes[2] + // Specifies predefined rules. When extending a standard rule message, + // this adds additional CEL expressions that apply when the extension is used. + // + // ```proto + // + // extend buf.validate.Int32Rules { + // bool is_zero [(buf.validate.predefined).cel = { + // id: "int32.is_zero", + // message: "must be zero", + // expression: "!rule || this == 0", + // }]; + // } + // + // message Foo { + // int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true]; + // } + // + // ``` + // + // optional buf.validate.PredefinedRules predefined = 1160; + E_Predefined = &file_buf_validate_validate_proto_extTypes[3] +) + +var File_buf_validate_validate_proto protoreflect.FileDescriptor + +const file_buf_validate_validate_proto_rawDesc = "" + + "\n" + + "\x1bbuf/validate/validate.proto\x12\fbuf.validate\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"P\n" + + "\x04Rule\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x1e\n" + + "\n" + + "expression\x18\x03 \x01(\tR\n" + + "expression\"\xa1\x01\n" + + "\fMessageRules\x12%\n" + + "\x0ecel_expression\x18\x05 \x03(\tR\rcelExpression\x12$\n" + + "\x03cel\x18\x03 \x03(\v2\x12.buf.validate.RuleR\x03cel\x124\n" + + "\x05oneof\x18\x04 \x03(\v2\x1e.buf.validate.MessageOneofRuleR\x05oneofJ\x04\b\x01\x10\x02R\bdisabled\"F\n" + + "\x10MessageOneofRule\x12\x16\n" + + "\x06fields\x18\x01 \x03(\tR\x06fields\x12\x1a\n" + + "\brequired\x18\x02 \x01(\bR\brequired\"(\n" + + "\n" + + "OneofRules\x12\x1a\n" + + "\brequired\x18\x01 \x01(\bR\brequired\"\xe3\n" + + "\n" + + "\n" + + "FieldRules\x12%\n" + + "\x0ecel_expression\x18\x1d \x03(\tR\rcelExpression\x12$\n" + + "\x03cel\x18\x17 \x03(\v2\x12.buf.validate.RuleR\x03cel\x12\x1a\n" + + "\brequired\x18\x19 \x01(\bR\brequired\x12,\n" + + "\x06ignore\x18\x1b \x01(\x0e2\x14.buf.validate.IgnoreR\x06ignore\x120\n" + + "\x05float\x18\x01 \x01(\v2\x18.buf.validate.FloatRulesH\x00R\x05float\x123\n" + + "\x06double\x18\x02 \x01(\v2\x19.buf.validate.DoubleRulesH\x00R\x06double\x120\n" + + "\x05int32\x18\x03 \x01(\v2\x18.buf.validate.Int32RulesH\x00R\x05int32\x120\n" + + "\x05int64\x18\x04 \x01(\v2\x18.buf.validate.Int64RulesH\x00R\x05int64\x123\n" + + "\x06uint32\x18\x05 \x01(\v2\x19.buf.validate.UInt32RulesH\x00R\x06uint32\x123\n" + + "\x06uint64\x18\x06 \x01(\v2\x19.buf.validate.UInt64RulesH\x00R\x06uint64\x123\n" + + "\x06sint32\x18\a \x01(\v2\x19.buf.validate.SInt32RulesH\x00R\x06sint32\x123\n" + + "\x06sint64\x18\b \x01(\v2\x19.buf.validate.SInt64RulesH\x00R\x06sint64\x126\n" + + "\afixed32\x18\t \x01(\v2\x1a.buf.validate.Fixed32RulesH\x00R\afixed32\x126\n" + + "\afixed64\x18\n" + + " \x01(\v2\x1a.buf.validate.Fixed64RulesH\x00R\afixed64\x129\n" + + "\bsfixed32\x18\v \x01(\v2\x1b.buf.validate.SFixed32RulesH\x00R\bsfixed32\x129\n" + + "\bsfixed64\x18\f \x01(\v2\x1b.buf.validate.SFixed64RulesH\x00R\bsfixed64\x12-\n" + + "\x04bool\x18\r \x01(\v2\x17.buf.validate.BoolRulesH\x00R\x04bool\x123\n" + + "\x06string\x18\x0e \x01(\v2\x19.buf.validate.StringRulesH\x00R\x06string\x120\n" + + "\x05bytes\x18\x0f \x01(\v2\x18.buf.validate.BytesRulesH\x00R\x05bytes\x12-\n" + + "\x04enum\x18\x10 \x01(\v2\x17.buf.validate.EnumRulesH\x00R\x04enum\x129\n" + + "\brepeated\x18\x12 \x01(\v2\x1b.buf.validate.RepeatedRulesH\x00R\brepeated\x12*\n" + + "\x03map\x18\x13 \x01(\v2\x16.buf.validate.MapRulesH\x00R\x03map\x12*\n" + + "\x03any\x18\x14 \x01(\v2\x16.buf.validate.AnyRulesH\x00R\x03any\x129\n" + + "\bduration\x18\x15 \x01(\v2\x1b.buf.validate.DurationRulesH\x00R\bduration\x12=\n" + + "\n" + + "field_mask\x18\x1c \x01(\v2\x1c.buf.validate.FieldMaskRulesH\x00R\tfieldMask\x12<\n" + + "\ttimestamp\x18\x16 \x01(\v2\x1c.buf.validate.TimestampRulesH\x00R\ttimestampB\x06\n" + + "\x04typeJ\x04\b\x18\x10\x19J\x04\b\x1a\x10\x1bR\askippedR\fignore_empty\"Z\n" + + "\x0fPredefinedRules\x12$\n" + + "\x03cel\x18\x01 \x03(\v2\x12.buf.validate.RuleR\x03celJ\x04\b\x18\x10\x19J\x04\b\x1a\x10\x1bR\askippedR\fignore_empty\"\xae\x17\n" + + "\n" + + "FloatRules\x12\x84\x01\n" + + "\x05const\x18\x01 \x01(\x02Bn\xc2Hk\n" + + "i\n" + + "\vfloat.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x9d\x01\n" + + "\x02lt\x18\x02 \x01(\x02B\x8a\x01\xc2H\x86\x01\n" + + "\x83\x01\n" + + "\bfloat.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xae\x01\n" + + "\x03lte\x18\x03 \x01(\x02B\x99\x01\xc2H\x95\x01\n" + + "\x92\x01\n" + + "\tfloat.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xd4\a\n" + + "\x02gt\x18\x04 \x01(\x02B\xc1\a\xc2H\xbd\a\n" + + "\x86\x01\n" + + "\bfloat.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xbd\x01\n" + + "\vfloat.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x15float.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\ffloat.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x16float.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xa1\b\n" + + "\x03gte\x18\x05 \x01(\x02B\x8c\b\xc2H\x88\b\n" + + "\x95\x01\n" + + "\tfloat.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xcc\x01\n" + + "\ffloat.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xd6\x01\n" + + "\x16float.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xdc\x01\n" + + "\rfloat.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xe6\x01\n" + + "\x17float.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12}\n" + + "\x02in\x18\x06 \x03(\x02Bm\xc2Hj\n" + + "h\n" + + "\bfloat.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\a \x03(\x02B`\xc2H]\n" + + "[\n" + + "\ffloat.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12w\n" + + "\x06finite\x18\b \x01(\bB_\xc2H\\\n" + + "Z\n" + + "\ffloat.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? 'must be finite' : '') : ''R\x06finite\x124\n" + + "\aexample\x18\t \x03(\x02B\x1a\xc2H\x17\n" + + "\x15\n" + + "\rfloat.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xc0\x17\n" + + "\vDoubleRules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x01Bo\xc2Hl\n" + + "j\n" + + "\fdouble.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x9e\x01\n" + + "\x02lt\x18\x02 \x01(\x01B\x8b\x01\xc2H\x87\x01\n" + + "\x84\x01\n" + + "\tdouble.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xaf\x01\n" + + "\x03lte\x18\x03 \x01(\x01B\x9a\x01\xc2H\x96\x01\n" + + "\x93\x01\n" + + "\n" + + "double.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xd9\a\n" + + "\x02gt\x18\x04 \x01(\x01B\xc6\a\xc2H\xc2\a\n" + + "\x87\x01\n" + + "\tdouble.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xbe\x01\n" + + "\fdouble.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc8\x01\n" + + "\x16double.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xce\x01\n" + + "\rdouble.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xd8\x01\n" + + "\x17double.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xa6\b\n" + + "\x03gte\x18\x05 \x01(\x01B\x91\b\xc2H\x8d\b\n" + + "\x96\x01\n" + + "\n" + + "double.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xcd\x01\n" + + "\rdouble.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xd7\x01\n" + + "\x17double.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xdd\x01\n" + + "\x0edouble.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xe7\x01\n" + + "\x18double.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x01Bn\xc2Hk\n" + + "i\n" + + "\tdouble.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x01Ba\xc2H^\n" + + "\\\n" + + "\rdouble.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12x\n" + + "\x06finite\x18\b \x01(\bB`\xc2H]\n" + + "[\n" + + "\rdouble.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? 'must be finite' : '') : ''R\x06finite\x125\n" + + "\aexample\x18\t \x03(\x01B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0edouble.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xde\x14\n" + + "\n" + + "Int32Rules\x12\x84\x01\n" + + "\x05const\x18\x01 \x01(\x05Bn\xc2Hk\n" + + "i\n" + + "\vint32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x88\x01\n" + + "\x02lt\x18\x02 \x01(\x05Bv\xc2Hs\n" + + "q\n" + + "\bint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9a\x01\n" + + "\x03lte\x18\x03 \x01(\x05B\x85\x01\xc2H\x81\x01\n" + + "\x7f\n" + + "\tint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xfd\x06\n" + + "\x02gt\x18\x04 \x01(\x05B\xea\x06\xc2H\xe6\x06\n" + + "t\n" + + "\bint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xad\x01\n" + + "\vint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb5\x01\n" + + "\x15int32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbd\x01\n" + + "\fint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc5\x01\n" + + "\x16int32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xca\a\n" + + "\x03gte\x18\x05 \x01(\x05B\xb5\a\xc2H\xb1\a\n" + + "\x82\x01\n" + + "\tint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbc\x01\n" + + "\fint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc4\x01\n" + + "\x16int32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcc\x01\n" + + "\rint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd4\x01\n" + + "\x17int32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12}\n" + + "\x02in\x18\x06 \x03(\x05Bm\xc2Hj\n" + + "h\n" + + "\bint32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\a \x03(\x05B`\xc2H]\n" + + "[\n" + + "\fint32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x124\n" + + "\aexample\x18\b \x03(\x05B\x1a\xc2H\x17\n" + + "\x15\n" + + "\rint32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xde\x14\n" + + "\n" + + "Int64Rules\x12\x84\x01\n" + + "\x05const\x18\x01 \x01(\x03Bn\xc2Hk\n" + + "i\n" + + "\vint64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x88\x01\n" + + "\x02lt\x18\x02 \x01(\x03Bv\xc2Hs\n" + + "q\n" + + "\bint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9a\x01\n" + + "\x03lte\x18\x03 \x01(\x03B\x85\x01\xc2H\x81\x01\n" + + "\x7f\n" + + "\tint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xfd\x06\n" + + "\x02gt\x18\x04 \x01(\x03B\xea\x06\xc2H\xe6\x06\n" + + "t\n" + + "\bint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xad\x01\n" + + "\vint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb5\x01\n" + + "\x15int64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbd\x01\n" + + "\fint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc5\x01\n" + + "\x16int64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xca\a\n" + + "\x03gte\x18\x05 \x01(\x03B\xb5\a\xc2H\xb1\a\n" + + "\x82\x01\n" + + "\tint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbc\x01\n" + + "\fint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc4\x01\n" + + "\x16int64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcc\x01\n" + + "\rint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd4\x01\n" + + "\x17int64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12}\n" + + "\x02in\x18\x06 \x03(\x03Bm\xc2Hj\n" + + "h\n" + + "\bint64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\a \x03(\x03B`\xc2H]\n" + + "[\n" + + "\fint64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x124\n" + + "\aexample\x18\t \x03(\x03B\x1a\xc2H\x17\n" + + "\x15\n" + + "\rint64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vUInt32Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\rBo\xc2Hl\n" + + "j\n" + + "\fuint32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\rBw\xc2Ht\n" + + "r\n" + + "\tuint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\rB\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "uint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\rB\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tuint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fuint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16uint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\ruint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17uint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\rB\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "uint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\ruint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17uint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0euint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18uint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\rBn\xc2Hk\n" + + "i\n" + + "\tuint32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\rBa\xc2H^\n" + + "\\\n" + + "\ruint32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\rB\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0euint32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vUInt64Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x04Bo\xc2Hl\n" + + "j\n" + + "\fuint64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\x04Bw\xc2Ht\n" + + "r\n" + + "\tuint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\x04B\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "uint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\x04B\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tuint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fuint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16uint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\ruint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17uint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\x04B\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "uint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\ruint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17uint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0euint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18uint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x04Bn\xc2Hk\n" + + "i\n" + + "\tuint64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x04Ba\xc2H^\n" + + "\\\n" + + "\ruint64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\x04B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0euint64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vSInt32Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x11Bo\xc2Hl\n" + + "j\n" + + "\fsint32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\x11Bw\xc2Ht\n" + + "r\n" + + "\tsint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\x11B\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "sint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\x11B\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tsint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fsint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16sint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\rsint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17sint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\x11B\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "sint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\rsint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17sint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0esint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18sint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x11Bn\xc2Hk\n" + + "i\n" + + "\tsint32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x11Ba\xc2H^\n" + + "\\\n" + + "\rsint32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\x11B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0esint32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vSInt64Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x12Bo\xc2Hl\n" + + "j\n" + + "\fsint64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\x12Bw\xc2Ht\n" + + "r\n" + + "\tsint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\x12B\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "sint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\x12B\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tsint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fsint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16sint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\rsint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17sint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\x12B\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "sint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\rsint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17sint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0esint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18sint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x12Bn\xc2Hk\n" + + "i\n" + + "\tsint64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x12Ba\xc2H^\n" + + "\\\n" + + "\rsint64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\x12B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0esint64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x81\x15\n" + + "\fFixed32Rules\x12\x86\x01\n" + + "\x05const\x18\x01 \x01(\aBp\xc2Hm\n" + + "k\n" + + "\rfixed32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8a\x01\n" + + "\x02lt\x18\x02 \x01(\aBx\xc2Hu\n" + + "s\n" + + "\n" + + "fixed32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9d\x01\n" + + "\x03lte\x18\x03 \x01(\aB\x88\x01\xc2H\x84\x01\n" + + "\x81\x01\n" + + "\vfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x87\a\n" + + "\x02gt\x18\x04 \x01(\aB\xf4\x06\xc2H\xf0\x06\n" + + "v\n" + + "\n" + + "fixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xaf\x01\n" + + "\rfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb7\x01\n" + + "\x17fixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbf\x01\n" + + "\x0efixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc7\x01\n" + + "\x18fixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd4\a\n" + + "\x03gte\x18\x05 \x01(\aB\xbf\a\xc2H\xbb\a\n" + + "\x84\x01\n" + + "\vfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbe\x01\n" + + "\x0efixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc6\x01\n" + + "\x18fixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xce\x01\n" + + "\x0ffixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd6\x01\n" + + "\x19fixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x7f\n" + + "\x02in\x18\x06 \x03(\aBo\xc2Hl\n" + + "j\n" + + "\n" + + "fixed32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12y\n" + + "\x06not_in\x18\a \x03(\aBb\xc2H_\n" + + "]\n" + + "\x0efixed32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x126\n" + + "\aexample\x18\b \x03(\aB\x1c\xc2H\x19\n" + + "\x17\n" + + "\x0ffixed32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x81\x15\n" + + "\fFixed64Rules\x12\x86\x01\n" + + "\x05const\x18\x01 \x01(\x06Bp\xc2Hm\n" + + "k\n" + + "\rfixed64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8a\x01\n" + + "\x02lt\x18\x02 \x01(\x06Bx\xc2Hu\n" + + "s\n" + + "\n" + + "fixed64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9d\x01\n" + + "\x03lte\x18\x03 \x01(\x06B\x88\x01\xc2H\x84\x01\n" + + "\x81\x01\n" + + "\vfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x87\a\n" + + "\x02gt\x18\x04 \x01(\x06B\xf4\x06\xc2H\xf0\x06\n" + + "v\n" + + "\n" + + "fixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xaf\x01\n" + + "\rfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb7\x01\n" + + "\x17fixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbf\x01\n" + + "\x0efixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc7\x01\n" + + "\x18fixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd4\a\n" + + "\x03gte\x18\x05 \x01(\x06B\xbf\a\xc2H\xbb\a\n" + + "\x84\x01\n" + + "\vfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbe\x01\n" + + "\x0efixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc6\x01\n" + + "\x18fixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xce\x01\n" + + "\x0ffixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd6\x01\n" + + "\x19fixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x7f\n" + + "\x02in\x18\x06 \x03(\x06Bo\xc2Hl\n" + + "j\n" + + "\n" + + "fixed64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12y\n" + + "\x06not_in\x18\a \x03(\x06Bb\xc2H_\n" + + "]\n" + + "\x0efixed64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x126\n" + + "\aexample\x18\b \x03(\x06B\x1c\xc2H\x19\n" + + "\x17\n" + + "\x0ffixed64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x93\x15\n" + + "\rSFixed32Rules\x12\x87\x01\n" + + "\x05const\x18\x01 \x01(\x0fBq\xc2Hn\n" + + "l\n" + + "\x0esfixed32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8b\x01\n" + + "\x02lt\x18\x02 \x01(\x0fBy\xc2Hv\n" + + "t\n" + + "\vsfixed32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9e\x01\n" + + "\x03lte\x18\x03 \x01(\x0fB\x89\x01\xc2H\x85\x01\n" + + "\x82\x01\n" + + "\fsfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x8c\a\n" + + "\x02gt\x18\x04 \x01(\x0fB\xf9\x06\xc2H\xf5\x06\n" + + "w\n" + + "\vsfixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb0\x01\n" + + "\x0esfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb8\x01\n" + + "\x18sfixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc0\x01\n" + + "\x0fsfixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc8\x01\n" + + "\x19sfixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd9\a\n" + + "\x03gte\x18\x05 \x01(\x0fB\xc4\a\xc2H\xc0\a\n" + + "\x85\x01\n" + + "\fsfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbf\x01\n" + + "\x0fsfixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x19sfixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcf\x01\n" + + "\x10sfixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x1asfixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x80\x01\n" + + "\x02in\x18\x06 \x03(\x0fBp\xc2Hm\n" + + "k\n" + + "\vsfixed32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12z\n" + + "\x06not_in\x18\a \x03(\x0fBc\xc2H`\n" + + "^\n" + + "\x0fsfixed32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x127\n" + + "\aexample\x18\b \x03(\x0fB\x1d\xc2H\x1a\n" + + "\x18\n" + + "\x10sfixed32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x93\x15\n" + + "\rSFixed64Rules\x12\x87\x01\n" + + "\x05const\x18\x01 \x01(\x10Bq\xc2Hn\n" + + "l\n" + + "\x0esfixed64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8b\x01\n" + + "\x02lt\x18\x02 \x01(\x10By\xc2Hv\n" + + "t\n" + + "\vsfixed64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9e\x01\n" + + "\x03lte\x18\x03 \x01(\x10B\x89\x01\xc2H\x85\x01\n" + + "\x82\x01\n" + + "\fsfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x8c\a\n" + + "\x02gt\x18\x04 \x01(\x10B\xf9\x06\xc2H\xf5\x06\n" + + "w\n" + + "\vsfixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb0\x01\n" + + "\x0esfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb8\x01\n" + + "\x18sfixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc0\x01\n" + + "\x0fsfixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc8\x01\n" + + "\x19sfixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd9\a\n" + + "\x03gte\x18\x05 \x01(\x10B\xc4\a\xc2H\xc0\a\n" + + "\x85\x01\n" + + "\fsfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbf\x01\n" + + "\x0fsfixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x19sfixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcf\x01\n" + + "\x10sfixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x1asfixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x80\x01\n" + + "\x02in\x18\x06 \x03(\x10Bp\xc2Hm\n" + + "k\n" + + "\vsfixed64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12z\n" + + "\x06not_in\x18\a \x03(\x10Bc\xc2H`\n" + + "^\n" + + "\x0fsfixed64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x127\n" + + "\aexample\x18\b \x03(\x10B\x1d\xc2H\x1a\n" + + "\x18\n" + + "\x10sfixed64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xd1\x01\n" + + "\tBoolRules\x12\x83\x01\n" + + "\x05const\x18\x01 \x01(\bBm\xc2Hj\n" + + "h\n" + + "\n" + + "bool.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x123\n" + + "\aexample\x18\x02 \x03(\bB\x19\xc2H\x16\n" + + "\x14\n" + + "\fbool.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xcf?\n" + + "\vStringRules\x12\x87\x01\n" + + "\x05const\x18\x01 \x01(\tBq\xc2Hn\n" + + "l\n" + + "\fstring.const\x1a\\this != getField(rules, 'const') ? 'must equal `%s`'.format([getField(rules, 'const')]) : ''R\x05const\x12v\n" + + "\x03len\x18\x13 \x01(\x04Bd\xc2Ha\n" + + "_\n" + + "\n" + + "string.len\x1aQuint(this.size()) != rules.len ? 'must be %s characters'.format([rules.len]) : ''R\x03len\x12\x91\x01\n" + + "\amin_len\x18\x02 \x01(\x04Bx\xc2Hu\n" + + "s\n" + + "\x0estring.min_len\x1aauint(this.size()) < rules.min_len ? 'must be at least %s characters'.format([rules.min_len]) : ''R\x06minLen\x12\x90\x01\n" + + "\amax_len\x18\x03 \x01(\x04Bw\xc2Ht\n" + + "r\n" + + "\x0estring.max_len\x1a`uint(this.size()) > rules.max_len ? 'must be at most %s characters'.format([rules.max_len]) : ''R\x06maxLen\x12\x95\x01\n" + + "\tlen_bytes\x18\x14 \x01(\x04Bx\xc2Hu\n" + + "s\n" + + "\x10string.len_bytes\x1a_uint(bytes(this).size()) != rules.len_bytes ? 'must be %s bytes'.format([rules.len_bytes]) : ''R\blenBytes\x12\x9e\x01\n" + + "\tmin_bytes\x18\x04 \x01(\x04B\x80\x01\xc2H}\n" + + "{\n" + + "\x10string.min_bytes\x1aguint(bytes(this).size()) < rules.min_bytes ? 'must be at least %s bytes'.format([rules.min_bytes]) : ''R\bminBytes\x12\x9c\x01\n" + + "\tmax_bytes\x18\x05 \x01(\x04B\x7f\xc2H|\n" + + "z\n" + + "\x10string.max_bytes\x1afuint(bytes(this).size()) > rules.max_bytes ? 'must be at most %s bytes'.format([rules.max_bytes]) : ''R\bmaxBytes\x12\x90\x01\n" + + "\apattern\x18\x06 \x01(\tBv\xc2Hs\n" + + "q\n" + + "\x0estring.pattern\x1a_!this.matches(rules.pattern) ? 'does not match regex pattern `%s`'.format([rules.pattern]) : ''R\apattern\x12\x86\x01\n" + + "\x06prefix\x18\a \x01(\tBn\xc2Hk\n" + + "i\n" + + "\rstring.prefix\x1aX!this.startsWith(rules.prefix) ? 'does not have prefix `%s`'.format([rules.prefix]) : ''R\x06prefix\x12\x84\x01\n" + + "\x06suffix\x18\b \x01(\tBl\xc2Hi\n" + + "g\n" + + "\rstring.suffix\x1aV!this.endsWith(rules.suffix) ? 'does not have suffix `%s`'.format([rules.suffix]) : ''R\x06suffix\x12\x94\x01\n" + + "\bcontains\x18\t \x01(\tBx\xc2Hu\n" + + "s\n" + + "\x0fstring.contains\x1a`!this.contains(rules.contains) ? 'does not contain substring `%s`'.format([rules.contains]) : ''R\bcontains\x12\x9e\x01\n" + + "\fnot_contains\x18\x17 \x01(\tB{\xc2Hx\n" + + "v\n" + + "\x13string.not_contains\x1a_this.contains(rules.not_contains) ? 'contains substring `%s`'.format([rules.not_contains]) : ''R\vnotContains\x12~\n" + + "\x02in\x18\n" + + " \x03(\tBn\xc2Hk\n" + + "i\n" + + "\tstring.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\v \x03(\tBa\xc2H^\n" + + "\\\n" + + "\rstring.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12\xe0\x01\n" + + "\x05email\x18\f \x01(\bB\xc7\x01\xc2H\xc3\x01\n" + + "[\n" + + "\fstring.email\x12\x1dmust be a valid email address\x1a,!rules.email || this == '' || this.isEmail()\n" + + "d\n" + + "\x12string.email_empty\x122value is empty, which is not a valid email address\x1a\x1a!rules.email || this != ''H\x00R\x05email\x12\xeb\x01\n" + + "\bhostname\x18\r \x01(\bB\xcc\x01\xc2H\xc8\x01\n" + + "_\n" + + "\x0fstring.hostname\x12\x18must be a valid hostname\x1a2!rules.hostname || this == '' || this.isHostname()\n" + + "e\n" + + "\x15string.hostname_empty\x12-value is empty, which is not a valid hostname\x1a\x1d!rules.hostname || this != ''H\x00R\bhostname\x12\xc5\x01\n" + + "\x02ip\x18\x0e \x01(\bB\xb2\x01\xc2H\xae\x01\n" + + "O\n" + + "\tstring.ip\x12\x1amust be a valid IP address\x1a&!rules.ip || this == '' || this.isIp()\n" + + "[\n" + + "\x0fstring.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x17!rules.ip || this != ''H\x00R\x02ip\x12\xd6\x01\n" + + "\x04ipv4\x18\x0f \x01(\bB\xbf\x01\xc2H\xbb\x01\n" + + "V\n" + + "\vstring.ipv4\x12\x1cmust be a valid IPv4 address\x1a)!rules.ipv4 || this == '' || this.isIp(4)\n" + + "a\n" + + "\x11string.ipv4_empty\x121value is empty, which is not a valid IPv4 address\x1a\x19!rules.ipv4 || this != ''H\x00R\x04ipv4\x12\xd6\x01\n" + + "\x04ipv6\x18\x10 \x01(\bB\xbf\x01\xc2H\xbb\x01\n" + + "V\n" + + "\vstring.ipv6\x12\x1cmust be a valid IPv6 address\x1a)!rules.ipv6 || this == '' || this.isIp(6)\n" + + "a\n" + + "\x11string.ipv6_empty\x121value is empty, which is not a valid IPv6 address\x1a\x19!rules.ipv6 || this != ''H\x00R\x04ipv6\x12\xbe\x01\n" + + "\x03uri\x18\x11 \x01(\bB\xa9\x01\xc2H\xa5\x01\n" + + "K\n" + + "\n" + + "string.uri\x12\x13must be a valid URI\x1a(!rules.uri || this == '' || this.isUri()\n" + + "V\n" + + "\x10string.uri_empty\x12(value is empty, which is not a valid URI\x1a\x18!rules.uri || this != ''H\x00R\x03uri\x12r\n" + + "\auri_ref\x18\x12 \x01(\bBW\xc2HT\n" + + "R\n" + + "\x0estring.uri_ref\x12\x1dmust be a valid URI Reference\x1a!!rules.uri_ref || this.isUriRef()H\x00R\x06uriRef\x12\x92\x02\n" + + "\aaddress\x18\x15 \x01(\bB\xf5\x01\xc2H\xf1\x01\n" + + "{\n" + + "\x0estring.address\x12'must be a valid hostname, or ip address\x1a@!rules.address || this == '' || this.isHostname() || this.isIp()\n" + + "r\n" + + "\x14string.address_empty\x12!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\n" + + "\x92\x01\n" + + " string.ipv4_with_prefixlen_empty\x12Dvalue is empty, which is not a valid IPv4 address with prefix length\x1a(!rules.ipv4_with_prefixlen || this != ''H\x00R\x11ipv4WithPrefixlen\x12\xdc\x02\n" + + "\x13ipv6_with_prefixlen\x18\x1c \x01(\bB\xa9\x02\xc2H\xa5\x02\n" + + "\x8d\x01\n" + + "\x1astring.ipv6_with_prefixlen\x12/must be a valid IPv6 address with prefix length\x1a>!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\n" + + "\x92\x01\n" + + " string.ipv6_with_prefixlen_empty\x12Dvalue is empty, which is not a valid IPv6 address with prefix length\x1a(!rules.ipv6_with_prefixlen || this != ''H\x00R\x11ipv6WithPrefixlen\x12\xf6\x01\n" + + "\tip_prefix\x18\x1d \x01(\bB\xd6\x01\xc2H\xd2\x01\n" + + "f\n" + + "\x10string.ip_prefix\x12\x19must be a valid IP prefix\x1a7!rules.ip_prefix || this == '' || this.isIpPrefix(true)\n" + + "h\n" + + "\x16string.ip_prefix_empty\x12.value is empty, which is not a valid IP prefix\x1a\x1e!rules.ip_prefix || this != ''H\x00R\bipPrefix\x12\x89\x02\n" + + "\vipv4_prefix\x18\x1e \x01(\bB\xe5\x01\xc2H\xe1\x01\n" + + "o\n" + + "\x12string.ipv4_prefix\x12\x1bmust be a valid IPv4 prefix\x1a!rules.host_and_port || this == '' || this.isHostAndPort(true)\n" + + "y\n" + + "\x1astring.host_and_port_empty\x127value is empty, which is not a valid host and port pair\x1a\"!rules.host_and_port || this != ''H\x00R\vhostAndPort\x12\xf4\x01\n" + + "\x04ulid\x18# \x01(\bB\xdd\x01\xc2H\xd9\x01\n" + + "|\n" + + "\vstring.ulid\x12\x14must be a valid ULID\x1aW!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\n" + + "Y\n" + + "\x11string.ulid_empty\x12)value is empty, which is not a valid ULID\x1a\x19!rules.ulid || this != ''H\x00R\x04ulid\x12\xe1\x02\n" + + "\fprotobuf_fqn\x18% \x01(\bB\xbb\x02\xc2H\xb7\x02\n" + + "\xaf\x01\n" + + "\x13string.protobuf_fqn\x12-must be a valid fully-qualified Protobuf name\x1ai!rules.protobuf_fqn || this == '' || this.matches('^[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$')\n" + + "\x82\x01\n" + + "\x19string.protobuf_fqn_empty\x12Bvalue is empty, which is not a valid fully-qualified Protobuf name\x1a!!rules.protobuf_fqn || this != ''H\x00R\vprotobufFqn\x12\xa1\x03\n" + + "\x10protobuf_dot_fqn\x18& \x01(\bB\xf4\x02\xc2H\xf0\x02\n" + + "\xcd\x01\n" + + "\x17string.protobuf_dot_fqn\x12@must be a valid fully-qualified Protobuf name with a leading dot\x1ap!rules.protobuf_dot_fqn || this == '' || this.matches('^\\\\.[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$')\n" + + "\x9d\x01\n" + + "\x1dstring.protobuf_dot_fqn_empty\x12Uvalue is empty, which is not a valid fully-qualified Protobuf name with a leading dot\x1a%!rules.protobuf_dot_fqn || this != ''H\x00R\x0eprotobufDotFqn\x12\xac\x05\n" + + "\x10well_known_regex\x18\x18 \x01(\x0e2\x18.buf.validate.KnownRegexB\xe5\x04\xc2H\xe1\x04\n" + + "\xea\x01\n" + + "#string.well_known_regex.header_name\x12 must be a valid HTTP header name\x1a\xa0\x01rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?'^:?[0-9a-zA-Z!#$%&\\'*+-.^_|~\\x60]+$' :'^[^\\u0000\\u000A\\u000D]+$')\n" + + "\x8d\x01\n" + + ")string.well_known_regex.header_name_empty\x125value is empty, which is not a valid HTTP header name\x1a)rules.well_known_regex != 1 || this != ''\n" + + "\xe1\x01\n" + + "$string.well_known_regex.header_value\x12!must be a valid HTTP header value\x1a\x95\x01rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$' :'^[^\\u0000\\u000A\\u000D]*$')H\x00R\x0ewellKnownRegex\x12\x16\n" + + "\x06strict\x18\x19 \x01(\bR\x06strict\x125\n" + + "\aexample\x18\" \x03(\tB\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0estring.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\f\n" + + "\n" + + "well_known\"\xca\x12\n" + + "\n" + + "BytesRules\x12\x81\x01\n" + + "\x05const\x18\x01 \x01(\fBk\xc2Hh\n" + + "f\n" + + "\vbytes.const\x1aWthis != getField(rules, 'const') ? 'must be %x'.format([getField(rules, 'const')]) : ''R\x05const\x12p\n" + + "\x03len\x18\r \x01(\x04B^\xc2H[\n" + + "Y\n" + + "\tbytes.len\x1aLuint(this.size()) != rules.len ? 'must be %s bytes'.format([rules.len]) : ''R\x03len\x12\x8b\x01\n" + + "\amin_len\x18\x02 \x01(\x04Br\xc2Ho\n" + + "m\n" + + "\rbytes.min_len\x1a\\uint(this.size()) < rules.min_len ? 'must be at least %s bytes'.format([rules.min_len]) : ''R\x06minLen\x12\x8a\x01\n" + + "\amax_len\x18\x03 \x01(\x04Bq\xc2Hn\n" + + "l\n" + + "\rbytes.max_len\x1a[uint(this.size()) > rules.max_len ? 'must be at most %s bytes'.format([rules.max_len]) : ''R\x06maxLen\x12\x93\x01\n" + + "\apattern\x18\x04 \x01(\tBy\xc2Hv\n" + + "t\n" + + "\rbytes.pattern\x1ac!string(this).matches(rules.pattern) ? 'must match regex pattern `%s`'.format([rules.pattern]) : ''R\apattern\x12\x83\x01\n" + + "\x06prefix\x18\x05 \x01(\fBk\xc2Hh\n" + + "f\n" + + "\fbytes.prefix\x1aV!this.startsWith(rules.prefix) ? 'does not have prefix %x'.format([rules.prefix]) : ''R\x06prefix\x12\x81\x01\n" + + "\x06suffix\x18\x06 \x01(\fBi\xc2Hf\n" + + "d\n" + + "\fbytes.suffix\x1aT!this.endsWith(rules.suffix) ? 'does not have suffix %x'.format([rules.suffix]) : ''R\x06suffix\x12\x87\x01\n" + + "\bcontains\x18\a \x01(\fBk\xc2Hh\n" + + "f\n" + + "\x0ebytes.contains\x1aT!this.contains(rules.contains) ? 'does not contain %x'.format([rules.contains]) : ''R\bcontains\x12\xa5\x01\n" + + "\x02in\x18\b \x03(\fB\x94\x01\xc2H\x90\x01\n" + + "\x8d\x01\n" + + "\bbytes.in\x1a\x80\x01getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\t \x03(\fB`\xc2H]\n" + + "[\n" + + "\fbytes.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12\xe9\x01\n" + + "\x02ip\x18\n" + + " \x01(\bB\xd6\x01\xc2H\xd2\x01\n" + + "n\n" + + "\bbytes.ip\x12\x1amust be a valid IP address\x1aF!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n" + + "`\n" + + "\x0ebytes.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x1d!rules.ip || this.size() != 0H\x00R\x02ip\x12\xe4\x01\n" + + "\x04ipv4\x18\v \x01(\bB\xcd\x01\xc2H\xc9\x01\n" + + "_\n" + + "\n" + + "bytes.ipv4\x12\x1cmust be a valid IPv4 address\x1a3!rules.ipv4 || this.size() == 0 || this.size() == 4\n" + + "f\n" + + "\x10bytes.ipv4_empty\x121value is empty, which is not a valid IPv4 address\x1a\x1f!rules.ipv4 || this.size() != 0H\x00R\x04ipv4\x12\xe5\x01\n" + + "\x04ipv6\x18\f \x01(\bB\xce\x01\xc2H\xca\x01\n" + + "`\n" + + "\n" + + "bytes.ipv6\x12\x1cmust be a valid IPv6 address\x1a4!rules.ipv6 || this.size() == 0 || this.size() == 16\n" + + "f\n" + + "\x10bytes.ipv6_empty\x121value is empty, which is not a valid IPv6 address\x1a\x1f!rules.ipv6 || this.size() != 0H\x00R\x04ipv6\x12\xd5\x01\n" + + "\x04uuid\x18\x0f \x01(\bB\xbe\x01\xc2H\xba\x01\n" + + "X\n" + + "\n" + + "bytes.uuid\x12\x14must be a valid UUID\x1a4!rules.uuid || this.size() == 0 || this.size() == 16\n" + + "^\n" + + "\x10bytes.uuid_empty\x12)value is empty, which is not a valid UUID\x1a\x1f!rules.uuid || this.size() != 0H\x00R\x04uuid\x124\n" + + "\aexample\x18\x0e \x03(\fB\x1a\xc2H\x17\n" + + "\x15\n" + + "\rbytes.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\f\n" + + "\n" + + "well_known\"\xea\x03\n" + + "\tEnumRules\x12\x83\x01\n" + + "\x05const\x18\x01 \x01(\x05Bm\xc2Hj\n" + + "h\n" + + "\n" + + "enum.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12!\n" + + "\fdefined_only\x18\x02 \x01(\bR\vdefinedOnly\x12|\n" + + "\x02in\x18\x03 \x03(\x05Bl\xc2Hi\n" + + "g\n" + + "\aenum.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12v\n" + + "\x06not_in\x18\x04 \x03(\x05B_\xc2H\\\n" + + "Z\n" + + "\venum.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x123\n" + + "\aexample\x18\x05 \x03(\x05B\x19\xc2H\x16\n" + + "\x14\n" + + "\fenum.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x90\x04\n" + + "\rRepeatedRules\x12\xa0\x01\n" + + "\tmin_items\x18\x01 \x01(\x04B\x82\x01\xc2H\x7f\n" + + "}\n" + + "\x12repeated.min_items\x1aguint(this.size()) < rules.min_items ? 'must contain at least %d item(s)'.format([rules.min_items]) : ''R\bminItems\x12\xa6\x01\n" + + "\tmax_items\x18\x02 \x01(\x04B\x88\x01\xc2H\x84\x01\n" + + "\x81\x01\n" + + "\x12repeated.max_items\x1akuint(this.size()) > rules.max_items ? 'must contain no more than %s item(s)'.format([rules.max_items]) : ''R\bmaxItems\x12x\n" + + "\x06unique\x18\x03 \x01(\bB`\xc2H]\n" + + "[\n" + + "\x0frepeated.unique\x12(repeated value must contain unique items\x1a\x1e!rules.unique || this.unique()R\x06unique\x12.\n" + + "\x05items\x18\x04 \x01(\v2\x18.buf.validate.FieldRulesR\x05items*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xac\x03\n" + + "\bMapRules\x12\x99\x01\n" + + "\tmin_pairs\x18\x01 \x01(\x04B|\xc2Hy\n" + + "w\n" + + "\rmap.min_pairs\x1afuint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''R\bminPairs\x12\x98\x01\n" + + "\tmax_pairs\x18\x02 \x01(\x04B{\xc2Hx\n" + + "v\n" + + "\rmap.max_pairs\x1aeuint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''R\bmaxPairs\x12,\n" + + "\x04keys\x18\x04 \x01(\v2\x18.buf.validate.FieldRulesR\x04keys\x120\n" + + "\x06values\x18\x05 \x01(\v2\x18.buf.validate.FieldRulesR\x06values*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"1\n" + + "\bAnyRules\x12\x0e\n" + + "\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n" + + "\x06not_in\x18\x03 \x03(\tR\x05notIn\"\xec\x16\n" + + "\rDurationRules\x12\xa2\x01\n" + + "\x05const\x18\x02 \x01(\v2\x19.google.protobuf.DurationBq\xc2Hn\n" + + "l\n" + + "\x0eduration.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\xa6\x01\n" + + "\x02lt\x18\x03 \x01(\v2\x19.google.protobuf.DurationBy\xc2Hv\n" + + "t\n" + + "\vduration.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xb9\x01\n" + + "\x03lte\x18\x04 \x01(\v2\x19.google.protobuf.DurationB\x89\x01\xc2H\x85\x01\n" + + "\x82\x01\n" + + "\fduration.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xa7\a\n" + + "\x02gt\x18\x05 \x01(\v2\x19.google.protobuf.DurationB\xf9\x06\xc2H\xf5\x06\n" + + "w\n" + + "\vduration.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb0\x01\n" + + "\x0eduration.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb8\x01\n" + + "\x18duration.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc0\x01\n" + + "\x0fduration.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc8\x01\n" + + "\x19duration.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xf4\a\n" + + "\x03gte\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\xc4\a\xc2H\xc0\a\n" + + "\x85\x01\n" + + "\fduration.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbf\x01\n" + + "\x0fduration.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x19duration.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcf\x01\n" + + "\x10duration.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x1aduration.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x9b\x01\n" + + "\x02in\x18\a \x03(\v2\x19.google.protobuf.DurationBp\xc2Hm\n" + + "k\n" + + "\vduration.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12\x95\x01\n" + + "\x06not_in\x18\b \x03(\v2\x19.google.protobuf.DurationBc\xc2H`\n" + + "^\n" + + "\x0fduration.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12R\n" + + "\aexample\x18\t \x03(\v2\x19.google.protobuf.DurationB\x1d\xc2H\x1a\n" + + "\x18\n" + + "\x10duration.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x86\x06\n" + + "\x0eFieldMaskRules\x12\xc0\x01\n" + + "\x05const\x18\x01 \x01(\v2\x1a.google.protobuf.FieldMaskB\x8d\x01\xc2H\x89\x01\n" + + "\x86\x01\n" + + "\x10field_mask.const\x1arthis.paths != getField(rules, 'const').paths ? 'must equal paths %s'.format([getField(rules, 'const').paths]) : ''R\x05const\x12\xd7\x01\n" + + "\x02in\x18\x02 \x03(\tB\xc6\x01\xc2H\xc2\x01\n" + + "\xbf\x01\n" + + "\rfield_mask.in\x1a\xad\x01!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'must only contain paths in %s'.format([getField(rules, 'in')]) : ''R\x02in\x12\xf4\x01\n" + + "\x06not_in\x18\x03 \x03(\tB\xdc\x01\xc2H\xd8\x01\n" + + "\xd5\x01\n" + + "\x11field_mask.not_in\x1a\xbf\x01!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''R\x05notIn\x12U\n" + + "\aexample\x18\x04 \x03(\v2\x1a.google.protobuf.FieldMaskB\x1f\xc2H\x1c\n" + + "\x1a\n" + + "\x12field_mask.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xe8\x17\n" + + "\x0eTimestampRules\x12\xa4\x01\n" + + "\x05const\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampBr\xc2Ho\n" + + "m\n" + + "\x0ftimestamp.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\xa8\x01\n" + + "\x02lt\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampBz\xc2Hw\n" + + "u\n" + + "\ftimestamp.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xbb\x01\n" + + "\x03lte\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB\x8a\x01\xc2H\x86\x01\n" + + "\x83\x01\n" + + "\rtimestamp.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12m\n" + + "\x06lt_now\x18\a \x01(\bBT\xc2HQ\n" + + "O\n" + + "\x10timestamp.lt_now\x1a;(rules.lt_now && this > now) ? 'must be less than now' : ''H\x00R\x05ltNow\x12\xad\a\n" + + "\x02gt\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\xfe\x06\xc2H\xfa\x06\n" + + "x\n" + + "\ftimestamp.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb1\x01\n" + + "\x0ftimestamp.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb9\x01\n" + + "\x19timestamp.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc1\x01\n" + + "\x10timestamp.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc9\x01\n" + + "\x1atimestamp.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xfa\a\n" + + "\x03gte\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\xc9\a\xc2H\xc5\a\n" + + "\x86\x01\n" + + "\rtimestamp.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xc0\x01\n" + + "\x10timestamp.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc8\x01\n" + + "\x1atimestamp.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xd0\x01\n" + + "\x11timestamp.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd8\x01\n" + + "\x1btimestamp.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12p\n" + + "\x06gt_now\x18\b \x01(\bBW\xc2HT\n" + + "R\n" + + "\x10timestamp.gt_now\x1a>(rules.gt_now && this < now) ? 'must be greater than now' : ''H\x01R\x05gtNow\x12\xb9\x01\n" + + "\x06within\x18\t \x01(\v2\x19.google.protobuf.DurationB\x85\x01\xc2H\x81\x01\n" + + "\x7f\n" + + "\x10timestamp.within\x1akthis < now-rules.within || this > now+rules.within ? 'must be within %s of now'.format([rules.within]) : ''R\x06within\x12T\n" + + "\aexample\x18\n" + + " \x03(\v2\x1a.google.protobuf.TimestampB\x1e\xc2H\x1b\n" + + "\x19\n" + + "\x11timestamp.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"E\n" + + "\n" + + "Violations\x127\n" + + "\n" + + "violations\x18\x01 \x03(\v2\x17.buf.validate.ViolationR\n" + + "violations\"\xc5\x01\n" + + "\tViolation\x12-\n" + + "\x05field\x18\x05 \x01(\v2\x17.buf.validate.FieldPathR\x05field\x12+\n" + + "\x04rule\x18\x06 \x01(\v2\x17.buf.validate.FieldPathR\x04rule\x12\x17\n" + + "\arule_id\x18\x02 \x01(\tR\x06ruleId\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\x12\x17\n" + + "\afor_key\x18\x04 \x01(\bR\x06forKeyJ\x04\b\x01\x10\x02R\n" + + "field_path\"G\n" + + "\tFieldPath\x12:\n" + + "\belements\x18\x01 \x03(\v2\x1e.buf.validate.FieldPathElementR\belements\"\xcc\x03\n" + + "\x10FieldPathElement\x12!\n" + + "\ffield_number\x18\x01 \x01(\x05R\vfieldNumber\x12\x1d\n" + + "\n" + + "field_name\x18\x02 \x01(\tR\tfieldName\x12I\n" + + "\n" + + "field_type\x18\x03 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\tfieldType\x12E\n" + + "\bkey_type\x18\x04 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\akeyType\x12I\n" + + "\n" + + "value_type\x18\x05 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\tvalueType\x12\x16\n" + + "\x05index\x18\x06 \x01(\x04H\x00R\x05index\x12\x1b\n" + + "\bbool_key\x18\a \x01(\bH\x00R\aboolKey\x12\x19\n" + + "\aint_key\x18\b \x01(\x03H\x00R\x06intKey\x12\x1b\n" + + "\buint_key\x18\t \x01(\x04H\x00R\auintKey\x12\x1f\n" + + "\n" + + "string_key\x18\n" + + " \x01(\tH\x00R\tstringKeyB\v\n" + + "\tsubscript*\xa1\x01\n" + + "\x06Ignore\x12\x16\n" + + "\x12IGNORE_UNSPECIFIED\x10\x00\x12\x18\n" + + "\x14IGNORE_IF_ZERO_VALUE\x10\x01\x12\x11\n" + + "\rIGNORE_ALWAYS\x10\x03\"\x04\b\x02\x10\x02*\fIGNORE_EMPTY*\x0eIGNORE_DEFAULT*\x17IGNORE_IF_DEFAULT_VALUE*\x15IGNORE_IF_UNPOPULATED*n\n" + + "\n" + + "KnownRegex\x12\x1b\n" + + "\x17KNOWN_REGEX_UNSPECIFIED\x10\x00\x12 \n" + + "\x1cKNOWN_REGEX_HTTP_HEADER_NAME\x10\x01\x12!\n" + + "\x1dKNOWN_REGEX_HTTP_HEADER_VALUE\x10\x02:V\n" + + "\amessage\x12\x1f.google.protobuf.MessageOptions\x18\x87\t \x01(\v2\x1a.buf.validate.MessageRulesR\amessage:N\n" + + "\x05oneof\x12\x1d.google.protobuf.OneofOptions\x18\x87\t \x01(\v2\x18.buf.validate.OneofRulesR\x05oneof:N\n" + + "\x05field\x12\x1d.google.protobuf.FieldOptions\x18\x87\t \x01(\v2\x18.buf.validate.FieldRulesR\x05field:]\n" + + "\n" + + "predefined\x12\x1d.google.protobuf.FieldOptions\x18\x88\t \x01(\v2\x1d.buf.validate.PredefinedRulesR\n" + + "predefinedBn\n" + + "\x12build.buf.validateB\rValidateProtoP\x01ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + +var file_buf_validate_validate_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_buf_validate_validate_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_buf_validate_validate_proto_goTypes = []any{ + (Ignore)(0), // 0: buf.validate.Ignore + (KnownRegex)(0), // 1: buf.validate.KnownRegex + (*Rule)(nil), // 2: buf.validate.Rule + (*MessageRules)(nil), // 3: buf.validate.MessageRules + (*MessageOneofRule)(nil), // 4: buf.validate.MessageOneofRule + (*OneofRules)(nil), // 5: buf.validate.OneofRules + (*FieldRules)(nil), // 6: buf.validate.FieldRules + (*PredefinedRules)(nil), // 7: buf.validate.PredefinedRules + (*FloatRules)(nil), // 8: buf.validate.FloatRules + (*DoubleRules)(nil), // 9: buf.validate.DoubleRules + (*Int32Rules)(nil), // 10: buf.validate.Int32Rules + (*Int64Rules)(nil), // 11: buf.validate.Int64Rules + (*UInt32Rules)(nil), // 12: buf.validate.UInt32Rules + (*UInt64Rules)(nil), // 13: buf.validate.UInt64Rules + (*SInt32Rules)(nil), // 14: buf.validate.SInt32Rules + (*SInt64Rules)(nil), // 15: buf.validate.SInt64Rules + (*Fixed32Rules)(nil), // 16: buf.validate.Fixed32Rules + (*Fixed64Rules)(nil), // 17: buf.validate.Fixed64Rules + (*SFixed32Rules)(nil), // 18: buf.validate.SFixed32Rules + (*SFixed64Rules)(nil), // 19: buf.validate.SFixed64Rules + (*BoolRules)(nil), // 20: buf.validate.BoolRules + (*StringRules)(nil), // 21: buf.validate.StringRules + (*BytesRules)(nil), // 22: buf.validate.BytesRules + (*EnumRules)(nil), // 23: buf.validate.EnumRules + (*RepeatedRules)(nil), // 24: buf.validate.RepeatedRules + (*MapRules)(nil), // 25: buf.validate.MapRules + (*AnyRules)(nil), // 26: buf.validate.AnyRules + (*DurationRules)(nil), // 27: buf.validate.DurationRules + (*FieldMaskRules)(nil), // 28: buf.validate.FieldMaskRules + (*TimestampRules)(nil), // 29: buf.validate.TimestampRules + (*Violations)(nil), // 30: buf.validate.Violations + (*Violation)(nil), // 31: buf.validate.Violation + (*FieldPath)(nil), // 32: buf.validate.FieldPath + (*FieldPathElement)(nil), // 33: buf.validate.FieldPathElement + (*durationpb.Duration)(nil), // 34: google.protobuf.Duration + (*fieldmaskpb.FieldMask)(nil), // 35: google.protobuf.FieldMask + (*timestamppb.Timestamp)(nil), // 36: google.protobuf.Timestamp + (descriptorpb.FieldDescriptorProto_Type)(0), // 37: google.protobuf.FieldDescriptorProto.Type + (*descriptorpb.MessageOptions)(nil), // 38: google.protobuf.MessageOptions + (*descriptorpb.OneofOptions)(nil), // 39: google.protobuf.OneofOptions + (*descriptorpb.FieldOptions)(nil), // 40: google.protobuf.FieldOptions +} +var file_buf_validate_validate_proto_depIdxs = []int32{ + 2, // 0: buf.validate.MessageRules.cel:type_name -> buf.validate.Rule + 4, // 1: buf.validate.MessageRules.oneof:type_name -> buf.validate.MessageOneofRule + 2, // 2: buf.validate.FieldRules.cel:type_name -> buf.validate.Rule + 0, // 3: buf.validate.FieldRules.ignore:type_name -> buf.validate.Ignore + 8, // 4: buf.validate.FieldRules.float:type_name -> buf.validate.FloatRules + 9, // 5: buf.validate.FieldRules.double:type_name -> buf.validate.DoubleRules + 10, // 6: buf.validate.FieldRules.int32:type_name -> buf.validate.Int32Rules + 11, // 7: buf.validate.FieldRules.int64:type_name -> buf.validate.Int64Rules + 12, // 8: buf.validate.FieldRules.uint32:type_name -> buf.validate.UInt32Rules + 13, // 9: buf.validate.FieldRules.uint64:type_name -> buf.validate.UInt64Rules + 14, // 10: buf.validate.FieldRules.sint32:type_name -> buf.validate.SInt32Rules + 15, // 11: buf.validate.FieldRules.sint64:type_name -> buf.validate.SInt64Rules + 16, // 12: buf.validate.FieldRules.fixed32:type_name -> buf.validate.Fixed32Rules + 17, // 13: buf.validate.FieldRules.fixed64:type_name -> buf.validate.Fixed64Rules + 18, // 14: buf.validate.FieldRules.sfixed32:type_name -> buf.validate.SFixed32Rules + 19, // 15: buf.validate.FieldRules.sfixed64:type_name -> buf.validate.SFixed64Rules + 20, // 16: buf.validate.FieldRules.bool:type_name -> buf.validate.BoolRules + 21, // 17: buf.validate.FieldRules.string:type_name -> buf.validate.StringRules + 22, // 18: buf.validate.FieldRules.bytes:type_name -> buf.validate.BytesRules + 23, // 19: buf.validate.FieldRules.enum:type_name -> buf.validate.EnumRules + 24, // 20: buf.validate.FieldRules.repeated:type_name -> buf.validate.RepeatedRules + 25, // 21: buf.validate.FieldRules.map:type_name -> buf.validate.MapRules + 26, // 22: buf.validate.FieldRules.any:type_name -> buf.validate.AnyRules + 27, // 23: buf.validate.FieldRules.duration:type_name -> buf.validate.DurationRules + 28, // 24: buf.validate.FieldRules.field_mask:type_name -> buf.validate.FieldMaskRules + 29, // 25: buf.validate.FieldRules.timestamp:type_name -> buf.validate.TimestampRules + 2, // 26: buf.validate.PredefinedRules.cel:type_name -> buf.validate.Rule + 1, // 27: buf.validate.StringRules.well_known_regex:type_name -> buf.validate.KnownRegex + 6, // 28: buf.validate.RepeatedRules.items:type_name -> buf.validate.FieldRules + 6, // 29: buf.validate.MapRules.keys:type_name -> buf.validate.FieldRules + 6, // 30: buf.validate.MapRules.values:type_name -> buf.validate.FieldRules + 34, // 31: buf.validate.DurationRules.const:type_name -> google.protobuf.Duration + 34, // 32: buf.validate.DurationRules.lt:type_name -> google.protobuf.Duration + 34, // 33: buf.validate.DurationRules.lte:type_name -> google.protobuf.Duration + 34, // 34: buf.validate.DurationRules.gt:type_name -> google.protobuf.Duration + 34, // 35: buf.validate.DurationRules.gte:type_name -> google.protobuf.Duration + 34, // 36: buf.validate.DurationRules.in:type_name -> google.protobuf.Duration + 34, // 37: buf.validate.DurationRules.not_in:type_name -> google.protobuf.Duration + 34, // 38: buf.validate.DurationRules.example:type_name -> google.protobuf.Duration + 35, // 39: buf.validate.FieldMaskRules.const:type_name -> google.protobuf.FieldMask + 35, // 40: buf.validate.FieldMaskRules.example:type_name -> google.protobuf.FieldMask + 36, // 41: buf.validate.TimestampRules.const:type_name -> google.protobuf.Timestamp + 36, // 42: buf.validate.TimestampRules.lt:type_name -> google.protobuf.Timestamp + 36, // 43: buf.validate.TimestampRules.lte:type_name -> google.protobuf.Timestamp + 36, // 44: buf.validate.TimestampRules.gt:type_name -> google.protobuf.Timestamp + 36, // 45: buf.validate.TimestampRules.gte:type_name -> google.protobuf.Timestamp + 34, // 46: buf.validate.TimestampRules.within:type_name -> google.protobuf.Duration + 36, // 47: buf.validate.TimestampRules.example:type_name -> google.protobuf.Timestamp + 31, // 48: buf.validate.Violations.violations:type_name -> buf.validate.Violation + 32, // 49: buf.validate.Violation.field:type_name -> buf.validate.FieldPath + 32, // 50: buf.validate.Violation.rule:type_name -> buf.validate.FieldPath + 33, // 51: buf.validate.FieldPath.elements:type_name -> buf.validate.FieldPathElement + 37, // 52: buf.validate.FieldPathElement.field_type:type_name -> google.protobuf.FieldDescriptorProto.Type + 37, // 53: buf.validate.FieldPathElement.key_type:type_name -> google.protobuf.FieldDescriptorProto.Type + 37, // 54: buf.validate.FieldPathElement.value_type:type_name -> google.protobuf.FieldDescriptorProto.Type + 38, // 55: buf.validate.message:extendee -> google.protobuf.MessageOptions + 39, // 56: buf.validate.oneof:extendee -> google.protobuf.OneofOptions + 40, // 57: buf.validate.field:extendee -> google.protobuf.FieldOptions + 40, // 58: buf.validate.predefined:extendee -> google.protobuf.FieldOptions + 3, // 59: buf.validate.message:type_name -> buf.validate.MessageRules + 5, // 60: buf.validate.oneof:type_name -> buf.validate.OneofRules + 6, // 61: buf.validate.field:type_name -> buf.validate.FieldRules + 7, // 62: buf.validate.predefined:type_name -> buf.validate.PredefinedRules + 63, // [63:63] is the sub-list for method output_type + 63, // [63:63] is the sub-list for method input_type + 59, // [59:63] is the sub-list for extension type_name + 55, // [55:59] is the sub-list for extension extendee + 0, // [0:55] is the sub-list for field type_name +} + +func init() { file_buf_validate_validate_proto_init() } +func file_buf_validate_validate_proto_init() { + if File_buf_validate_validate_proto != nil { + return + } + file_buf_validate_validate_proto_msgTypes[4].OneofWrappers = []any{ + (*FieldRules_Float)(nil), + (*FieldRules_Double)(nil), + (*FieldRules_Int32)(nil), + (*FieldRules_Int64)(nil), + (*FieldRules_Uint32)(nil), + (*FieldRules_Uint64)(nil), + (*FieldRules_Sint32)(nil), + (*FieldRules_Sint64)(nil), + (*FieldRules_Fixed32)(nil), + (*FieldRules_Fixed64)(nil), + (*FieldRules_Sfixed32)(nil), + (*FieldRules_Sfixed64)(nil), + (*FieldRules_Bool)(nil), + (*FieldRules_String_)(nil), + (*FieldRules_Bytes)(nil), + (*FieldRules_Enum)(nil), + (*FieldRules_Repeated)(nil), + (*FieldRules_Map)(nil), + (*FieldRules_Any)(nil), + (*FieldRules_Duration)(nil), + (*FieldRules_FieldMask)(nil), + (*FieldRules_Timestamp)(nil), + } + file_buf_validate_validate_proto_msgTypes[6].OneofWrappers = []any{ + (*FloatRules_Lt)(nil), + (*FloatRules_Lte)(nil), + (*FloatRules_Gt)(nil), + (*FloatRules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[7].OneofWrappers = []any{ + (*DoubleRules_Lt)(nil), + (*DoubleRules_Lte)(nil), + (*DoubleRules_Gt)(nil), + (*DoubleRules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[8].OneofWrappers = []any{ + (*Int32Rules_Lt)(nil), + (*Int32Rules_Lte)(nil), + (*Int32Rules_Gt)(nil), + (*Int32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[9].OneofWrappers = []any{ + (*Int64Rules_Lt)(nil), + (*Int64Rules_Lte)(nil), + (*Int64Rules_Gt)(nil), + (*Int64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[10].OneofWrappers = []any{ + (*UInt32Rules_Lt)(nil), + (*UInt32Rules_Lte)(nil), + (*UInt32Rules_Gt)(nil), + (*UInt32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[11].OneofWrappers = []any{ + (*UInt64Rules_Lt)(nil), + (*UInt64Rules_Lte)(nil), + (*UInt64Rules_Gt)(nil), + (*UInt64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[12].OneofWrappers = []any{ + (*SInt32Rules_Lt)(nil), + (*SInt32Rules_Lte)(nil), + (*SInt32Rules_Gt)(nil), + (*SInt32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[13].OneofWrappers = []any{ + (*SInt64Rules_Lt)(nil), + (*SInt64Rules_Lte)(nil), + (*SInt64Rules_Gt)(nil), + (*SInt64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[14].OneofWrappers = []any{ + (*Fixed32Rules_Lt)(nil), + (*Fixed32Rules_Lte)(nil), + (*Fixed32Rules_Gt)(nil), + (*Fixed32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[15].OneofWrappers = []any{ + (*Fixed64Rules_Lt)(nil), + (*Fixed64Rules_Lte)(nil), + (*Fixed64Rules_Gt)(nil), + (*Fixed64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[16].OneofWrappers = []any{ + (*SFixed32Rules_Lt)(nil), + (*SFixed32Rules_Lte)(nil), + (*SFixed32Rules_Gt)(nil), + (*SFixed32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[17].OneofWrappers = []any{ + (*SFixed64Rules_Lt)(nil), + (*SFixed64Rules_Lte)(nil), + (*SFixed64Rules_Gt)(nil), + (*SFixed64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[19].OneofWrappers = []any{ + (*StringRules_Email)(nil), + (*StringRules_Hostname)(nil), + (*StringRules_Ip)(nil), + (*StringRules_Ipv4)(nil), + (*StringRules_Ipv6)(nil), + (*StringRules_Uri)(nil), + (*StringRules_UriRef)(nil), + (*StringRules_Address)(nil), + (*StringRules_Uuid)(nil), + (*StringRules_Tuuid)(nil), + (*StringRules_IpWithPrefixlen)(nil), + (*StringRules_Ipv4WithPrefixlen)(nil), + (*StringRules_Ipv6WithPrefixlen)(nil), + (*StringRules_IpPrefix)(nil), + (*StringRules_Ipv4Prefix)(nil), + (*StringRules_Ipv6Prefix)(nil), + (*StringRules_HostAndPort)(nil), + (*StringRules_Ulid)(nil), + (*StringRules_ProtobufFqn)(nil), + (*StringRules_ProtobufDotFqn)(nil), + (*StringRules_WellKnownRegex)(nil), + } + file_buf_validate_validate_proto_msgTypes[20].OneofWrappers = []any{ + (*BytesRules_Ip)(nil), + (*BytesRules_Ipv4)(nil), + (*BytesRules_Ipv6)(nil), + (*BytesRules_Uuid)(nil), + } + file_buf_validate_validate_proto_msgTypes[25].OneofWrappers = []any{ + (*DurationRules_Lt)(nil), + (*DurationRules_Lte)(nil), + (*DurationRules_Gt)(nil), + (*DurationRules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[27].OneofWrappers = []any{ + (*TimestampRules_Lt)(nil), + (*TimestampRules_Lte)(nil), + (*TimestampRules_LtNow)(nil), + (*TimestampRules_Gt)(nil), + (*TimestampRules_Gte)(nil), + (*TimestampRules_GtNow)(nil), + } + file_buf_validate_validate_proto_msgTypes[31].OneofWrappers = []any{ + (*FieldPathElement_Index)(nil), + (*FieldPathElement_BoolKey)(nil), + (*FieldPathElement_IntKey)(nil), + (*FieldPathElement_UintKey)(nil), + (*FieldPathElement_StringKey)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_buf_validate_validate_proto_rawDesc), len(file_buf_validate_validate_proto_rawDesc)), + NumEnums: 2, + NumMessages: 32, + NumExtensions: 4, + NumServices: 0, + }, + GoTypes: file_buf_validate_validate_proto_goTypes, + DependencyIndexes: file_buf_validate_validate_proto_depIdxs, + EnumInfos: file_buf_validate_validate_proto_enumTypes, + MessageInfos: file_buf_validate_validate_proto_msgTypes, + ExtensionInfos: file_buf_validate_validate_proto_extTypes, + }.Build() + File_buf_validate_validate_proto = out.File + file_buf_validate_validate_proto_goTypes = nil + file_buf_validate_validate_proto_depIdxs = nil +} diff --git a/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/validate_protoopaque.pb.go b/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/validate_protoopaque.pb.go new file mode 100644 index 000000000..67c7db3f0 --- /dev/null +++ b/vendor/buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/validate_protoopaque.pb.go @@ -0,0 +1,16192 @@ +// Copyright 2023-2026 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: buf/validate/validate.proto + +// [Protovalidate](https://protovalidate.com/) is the semantic validation library for Protobuf. +// It provides standard annotations to validate common rules on messages and fields, as well as the ability to use [CEL](https://cel.dev) to write custom rules. +// It's the next generation of [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate). +// +// This package provides the options, messages, and enums that power Protovalidate. +// Apply its options to messages, fields, and oneofs in your Protobuf schemas to add validation rules: +// +// ```proto +// message User { +// string id = 1 [(buf.validate.field).string.uuid = true]; +// string first_name = 2 [(buf.validate.field).string.max_len = 64]; +// string last_name = 3 [(buf.validate.field).string.max_len = 64]; +// +// option (buf.validate.message).cel = { +// id: "first_name_requires_last_name" +// message: "last_name must be present if first_name is present" +// expression: "!has(this.first_name) || has(this.last_name)" +// }; +// } +// ``` +// +// These rules are enforced at runtime by language-specific libraries. +// See the [developer quickstart](https://protovalidate.com/quickstart/) to get started, or go directly to the runtime library for your language: +// [Go](https://github.com/bufbuild/protovalidate-go), +// [JavaScript/TypeScript](https://github.com/bufbuild/protovalidate-es), +// [Java](https://github.com/bufbuild/protovalidate-java), +// [Python](https://github.com/bufbuild/protovalidate-python), +// or [C++](https://github.com/bufbuild/protovalidate-cc). + +//go:build protoopaque + +package validate + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and +// whether the field tracks presence. +type Ignore int32 + +const ( + // Ignore rules if the field tracks presence and is unset. This is the default + // behavior. + // + // In proto3, only message fields, members of a Protobuf `oneof`, and fields + // with the `optional` label track presence. Consequently, the following fields + // are always validated, whether a value is set or not: + // + // ```proto + // syntax="proto3"; + // + // message RulesApply { + // string email = 1 [ + // (buf.validate.field).string.email = true + // ]; + // int32 age = 2 [ + // (buf.validate.field).int32.gt = 0 + // ]; + // repeated string labels = 3 [ + // (buf.validate.field).repeated.min_items = 1 + // ]; + // } + // + // ``` + // + // In contrast, the following fields track presence, and are only validated if + // a value is set: + // + // ```proto + // syntax="proto3"; + // + // message RulesApplyIfSet { + // optional string email = 1 [ + // (buf.validate.field).string.email = true + // ]; + // oneof ref { + // string reference = 2 [ + // (buf.validate.field).string.uuid = true + // ]; + // string name = 3 [ + // (buf.validate.field).string.min_len = 4 + // ]; + // } + // SomeMessage msg = 4 [ + // (buf.validate.field).cel = {/* ... */} + // ]; + // } + // + // ``` + // + // To ensure that such a field is set, add the `required` rule. + // + // To learn which fields track presence, see the + // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + Ignore_IGNORE_UNSPECIFIED Ignore = 0 + // Ignore rules if the field is unset, or set to the zero value. + // + // The zero value depends on the field type: + // - For strings, the zero value is the empty string. + // - For bytes, the zero value is empty bytes. + // - For bool, the zero value is false. + // - For numeric types, the zero value is zero. + // - For enums, the zero value is the first defined enum value. + // - For repeated fields, the zero is an empty list. + // - For map fields, the zero is an empty map. + // - For message fields, absence of the message (typically a null-value) is considered zero value. + // + // For fields that track presence (e.g. adding the `optional` label in proto3), + // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`. + Ignore_IGNORE_IF_ZERO_VALUE Ignore = 1 + // Always ignore rules, including the `required` rule. + // + // This is useful for ignoring the rules of a referenced message, or to + // temporarily ignore rules during development. + // + // ```proto + // + // message MyMessage { + // // The field's rules will always be ignored, including any validations + // // on value's fields. + // MyOtherMessage value = 1 [ + // (buf.validate.field).ignore = IGNORE_ALWAYS + // ]; + // } + // + // ``` + Ignore_IGNORE_ALWAYS Ignore = 3 +) + +// Enum value maps for Ignore. +var ( + Ignore_name = map[int32]string{ + 0: "IGNORE_UNSPECIFIED", + 1: "IGNORE_IF_ZERO_VALUE", + 3: "IGNORE_ALWAYS", + } + Ignore_value = map[string]int32{ + "IGNORE_UNSPECIFIED": 0, + "IGNORE_IF_ZERO_VALUE": 1, + "IGNORE_ALWAYS": 3, + } +) + +func (x Ignore) Enum() *Ignore { + p := new(Ignore) + *p = x + return p +} + +func (x Ignore) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Ignore) Descriptor() protoreflect.EnumDescriptor { + return file_buf_validate_validate_proto_enumTypes[0].Descriptor() +} + +func (Ignore) Type() protoreflect.EnumType { + return &file_buf_validate_validate_proto_enumTypes[0] +} + +func (x Ignore) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// KnownRegex contains some well-known patterns. +type KnownRegex int32 + +const ( + KnownRegex_KNOWN_REGEX_UNSPECIFIED KnownRegex = 0 + // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). + KnownRegex_KNOWN_REGEX_HTTP_HEADER_NAME KnownRegex = 1 + // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4). + KnownRegex_KNOWN_REGEX_HTTP_HEADER_VALUE KnownRegex = 2 +) + +// Enum value maps for KnownRegex. +var ( + KnownRegex_name = map[int32]string{ + 0: "KNOWN_REGEX_UNSPECIFIED", + 1: "KNOWN_REGEX_HTTP_HEADER_NAME", + 2: "KNOWN_REGEX_HTTP_HEADER_VALUE", + } + KnownRegex_value = map[string]int32{ + "KNOWN_REGEX_UNSPECIFIED": 0, + "KNOWN_REGEX_HTTP_HEADER_NAME": 1, + "KNOWN_REGEX_HTTP_HEADER_VALUE": 2, + } +) + +func (x KnownRegex) Enum() *KnownRegex { + p := new(KnownRegex) + *p = x + return p +} + +func (x KnownRegex) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KnownRegex) Descriptor() protoreflect.EnumDescriptor { + return file_buf_validate_validate_proto_enumTypes[1].Descriptor() +} + +func (KnownRegex) Type() protoreflect.EnumType { + return &file_buf_validate_validate_proto_enumTypes[1] +} + +func (x KnownRegex) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// `Rule` represents a validation rule written in the Common Expression +// Language (CEL) syntax. Each Rule includes a unique identifier, an +// optional error message, and the CEL expression to evaluate. For more +// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). +// +// ```proto +// +// message Foo { +// option (buf.validate.message).cel = { +// id: "foo.bar" +// message: "bar must be greater than 0" +// expression: "this.bar > 0" +// }; +// int32 bar = 1; +// } +// +// ``` +type Rule struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Id *string `protobuf:"bytes,1,opt,name=id"` + xxx_hidden_Message *string `protobuf:"bytes,2,opt,name=message"` + xxx_hidden_Expression *string `protobuf:"bytes,3,opt,name=expression"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Rule) Reset() { + *x = Rule{} + mi := &file_buf_validate_validate_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule) ProtoMessage() {} + +func (x *Rule) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Rule) GetId() string { + if x != nil { + if x.xxx_hidden_Id != nil { + return *x.xxx_hidden_Id + } + return "" + } + return "" +} + +func (x *Rule) GetMessage() string { + if x != nil { + if x.xxx_hidden_Message != nil { + return *x.xxx_hidden_Message + } + return "" + } + return "" +} + +func (x *Rule) GetExpression() string { + if x != nil { + if x.xxx_hidden_Expression != nil { + return *x.xxx_hidden_Expression + } + return "" + } + return "" +} + +func (x *Rule) SetId(v string) { + x.xxx_hidden_Id = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3) +} + +func (x *Rule) SetMessage(v string) { + x.xxx_hidden_Message = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3) +} + +func (x *Rule) SetExpression(v string) { + x.xxx_hidden_Expression = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3) +} + +func (x *Rule) HasId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Rule) HasMessage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *Rule) HasExpression() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Rule) ClearId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Id = nil +} + +func (x *Rule) ClearMessage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Message = nil +} + +func (x *Rule) ClearExpression() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Expression = nil +} + +type Rule_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `id` is a string that serves as a machine-readable name for this Rule. + // It should be unique within its scope, which could be either a message or a field. + Id *string + // `message` is an optional field that provides a human-readable error message + // for this Rule when the CEL expression evaluates to false. If a + // non-empty message is provided, any strings resulting from the CEL + // expression evaluation are ignored. + Message *string + // `expression` is the actual CEL expression that will be evaluated for + // validation. This string must resolve to either a boolean or a string + // value. If the expression evaluates to false or a non-empty string, the + // validation is considered failed, and the message is rejected. + Expression *string +} + +func (b0 Rule_builder) Build() *Rule { + m0 := &Rule{} + b, x := &b0, m0 + _, _ = b, x + if b.Id != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3) + x.xxx_hidden_Id = b.Id + } + if b.Message != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3) + x.xxx_hidden_Message = b.Message + } + if b.Expression != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3) + x.xxx_hidden_Expression = b.Expression + } + return m0 +} + +// MessageRules represents validation rules that are applied to the entire message. +// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules. +type MessageRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CelExpression []string `protobuf:"bytes,5,rep,name=cel_expression,json=celExpression"` + xxx_hidden_Cel *[]*Rule `protobuf:"bytes,3,rep,name=cel"` + xxx_hidden_Oneof *[]*MessageOneofRule `protobuf:"bytes,4,rep,name=oneof"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageRules) Reset() { + *x = MessageRules{} + mi := &file_buf_validate_validate_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageRules) ProtoMessage() {} + +func (x *MessageRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MessageRules) GetCelExpression() []string { + if x != nil { + return x.xxx_hidden_CelExpression + } + return nil +} + +func (x *MessageRules) GetCel() []*Rule { + if x != nil { + if x.xxx_hidden_Cel != nil { + return *x.xxx_hidden_Cel + } + } + return nil +} + +func (x *MessageRules) GetOneof() []*MessageOneofRule { + if x != nil { + if x.xxx_hidden_Oneof != nil { + return *x.xxx_hidden_Oneof + } + } + return nil +} + +func (x *MessageRules) SetCelExpression(v []string) { + x.xxx_hidden_CelExpression = v +} + +func (x *MessageRules) SetCel(v []*Rule) { + x.xxx_hidden_Cel = &v +} + +func (x *MessageRules) SetOneof(v []*MessageOneofRule) { + x.xxx_hidden_Oneof = &v +} + +type MessageRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + // + // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + // be same as the `expression`. + // + // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `foo` must be greater than 42. + // option (buf.validate.message).cel_expression = "this.foo > 42"; + // // The field `foo` must be less than 84. + // option (buf.validate.message).cel_expression = "this.foo < 84"; + // optional int32 foo = 1; + // } + // + // ``` + CelExpression []string + // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message. + // These rules are written in Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `foo` must be greater than 42. + // option (buf.validate.message).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this.foo > 42", + // }; + // optional int32 foo = 1; + // } + // + // ``` + Cel []*Rule + // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields + // of which at most one can be present. If `required` is also specified, then exactly one + // of the specified fields _must_ be present. + // + // This will enforce oneof-like constraints with a few features not provided by + // actual Protobuf oneof declarations: + // 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof, + // only scalar fields are allowed. + // 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member + // fields have explicit presence. This means that, for the purpose of determining + // how many fields are set, explicitly setting such a field to its zero value is + // effectively the same as not setting it at all. + // 3. This will always generate validation errors for a message unmarshalled from + // serialized data that sets more than one field. With a Protobuf oneof, when + // multiple fields are present in the serialized form, earlier values are usually + // silently ignored when unmarshalling, with only the last field being set when + // unmarshalling completes. + // + // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means + // only the field that is set will be validated and the unset fields are not validated according to the field rules. + // This behavior can be overridden by setting `ignore` against a field. + // + // ```proto + // + // message MyMessage { + // // Only one of `field1` or `field2` _can_ be present in this message. + // option (buf.validate.message).oneof = { fields: ["field1", "field2"] }; + // // Exactly one of `field3` or `field4` _must_ be present in this message. + // option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true }; + // string field1 = 1; + // bytes field2 = 2; + // bool field3 = 3; + // int32 field4 = 4; + // } + // + // ``` + Oneof []*MessageOneofRule +} + +func (b0 MessageRules_builder) Build() *MessageRules { + m0 := &MessageRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_CelExpression = b.CelExpression + x.xxx_hidden_Cel = &b.Cel + x.xxx_hidden_Oneof = &b.Oneof + return m0 +} + +type MessageOneofRule struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Fields []string `protobuf:"bytes,1,rep,name=fields"` + xxx_hidden_Required bool `protobuf:"varint,2,opt,name=required"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MessageOneofRule) Reset() { + *x = MessageOneofRule{} + mi := &file_buf_validate_validate_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MessageOneofRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageOneofRule) ProtoMessage() {} + +func (x *MessageOneofRule) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MessageOneofRule) GetFields() []string { + if x != nil { + return x.xxx_hidden_Fields + } + return nil +} + +func (x *MessageOneofRule) GetRequired() bool { + if x != nil { + return x.xxx_hidden_Required + } + return false +} + +func (x *MessageOneofRule) SetFields(v []string) { + x.xxx_hidden_Fields = v +} + +func (x *MessageOneofRule) SetRequired(v bool) { + x.xxx_hidden_Required = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2) +} + +func (x *MessageOneofRule) HasRequired() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *MessageOneofRule) ClearRequired() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Required = false +} + +type MessageOneofRule_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // A list of field names to include in the oneof. All field names must be + // defined in the message. At least one field must be specified, and + // duplicates are not permitted. + Fields []string + // If true, one of the fields specified _must_ be set. + Required *bool +} + +func (b0 MessageOneofRule_builder) Build() *MessageOneofRule { + m0 := &MessageOneofRule{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Fields = b.Fields + if b.Required != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2) + x.xxx_hidden_Required = *b.Required + } + return m0 +} + +// The `OneofRules` message type enables you to manage rules for +// oneof fields in your protobuf messages. +type OneofRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Required bool `protobuf:"varint,1,opt,name=required"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OneofRules) Reset() { + *x = OneofRules{} + mi := &file_buf_validate_validate_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OneofRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OneofRules) ProtoMessage() {} + +func (x *OneofRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *OneofRules) GetRequired() bool { + if x != nil { + return x.xxx_hidden_Required + } + return false +} + +func (x *OneofRules) SetRequired(v bool) { + x.xxx_hidden_Required = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 1) +} + +func (x *OneofRules) HasRequired() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *OneofRules) ClearRequired() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Required = false +} + +type OneofRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // If `required` is true, exactly one field of the oneof must be set. A + // validation error is returned if no fields in the oneof are set. Further rules + // should be placed on the fields themselves to ensure they are valid values, + // such as `min_len` or `gt`. + // + // ```proto + // + // message MyMessage { + // oneof value { + // // Either `a` or `b` must be set. If `a` is set, it must also be + // // non-empty; whereas if `b` is set, it can still be an empty string. + // option (buf.validate.oneof).required = true; + // string a = 1 [(buf.validate.field).string.min_len = 1]; + // string b = 2; + // } + // } + // + // ``` + Required *bool +} + +func (b0 OneofRules_builder) Build() *OneofRules { + m0 := &OneofRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Required != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 1) + x.xxx_hidden_Required = *b.Required + } + return m0 +} + +// FieldRules encapsulates the rules for each type of field. Depending on +// the field, the correct set should be used to ensure proper validations. +type FieldRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_CelExpression []string `protobuf:"bytes,29,rep,name=cel_expression,json=celExpression"` + xxx_hidden_Cel *[]*Rule `protobuf:"bytes,23,rep,name=cel"` + xxx_hidden_Required bool `protobuf:"varint,25,opt,name=required"` + xxx_hidden_Ignore Ignore `protobuf:"varint,27,opt,name=ignore,enum=buf.validate.Ignore"` + xxx_hidden_Type isFieldRules_Type `protobuf_oneof:"type"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldRules) Reset() { + *x = FieldRules{} + mi := &file_buf_validate_validate_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldRules) ProtoMessage() {} + +func (x *FieldRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldRules) GetCelExpression() []string { + if x != nil { + return x.xxx_hidden_CelExpression + } + return nil +} + +func (x *FieldRules) GetCel() []*Rule { + if x != nil { + if x.xxx_hidden_Cel != nil { + return *x.xxx_hidden_Cel + } + } + return nil +} + +func (x *FieldRules) GetRequired() bool { + if x != nil { + return x.xxx_hidden_Required + } + return false +} + +func (x *FieldRules) GetIgnore() Ignore { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 3) { + return x.xxx_hidden_Ignore + } + } + return Ignore_IGNORE_UNSPECIFIED +} + +func (x *FieldRules) GetFloat() *FloatRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Float); ok { + return x.Float + } + } + return nil +} + +func (x *FieldRules) GetDouble() *DoubleRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Double); ok { + return x.Double + } + } + return nil +} + +func (x *FieldRules) GetInt32() *Int32Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Int32); ok { + return x.Int32 + } + } + return nil +} + +func (x *FieldRules) GetInt64() *Int64Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Int64); ok { + return x.Int64 + } + } + return nil +} + +func (x *FieldRules) GetUint32() *UInt32Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Uint32); ok { + return x.Uint32 + } + } + return nil +} + +func (x *FieldRules) GetUint64() *UInt64Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Uint64); ok { + return x.Uint64 + } + } + return nil +} + +func (x *FieldRules) GetSint32() *SInt32Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Sint32); ok { + return x.Sint32 + } + } + return nil +} + +func (x *FieldRules) GetSint64() *SInt64Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Sint64); ok { + return x.Sint64 + } + } + return nil +} + +func (x *FieldRules) GetFixed32() *Fixed32Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Fixed32); ok { + return x.Fixed32 + } + } + return nil +} + +func (x *FieldRules) GetFixed64() *Fixed64Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Fixed64); ok { + return x.Fixed64 + } + } + return nil +} + +func (x *FieldRules) GetSfixed32() *SFixed32Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Sfixed32); ok { + return x.Sfixed32 + } + } + return nil +} + +func (x *FieldRules) GetSfixed64() *SFixed64Rules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Sfixed64); ok { + return x.Sfixed64 + } + } + return nil +} + +func (x *FieldRules) GetBool() *BoolRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Bool); ok { + return x.Bool + } + } + return nil +} + +func (x *FieldRules) GetString() *StringRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_String_); ok { + return x.String_ + } + } + return nil +} + +func (x *FieldRules) GetBytes() *BytesRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Bytes); ok { + return x.Bytes + } + } + return nil +} + +func (x *FieldRules) GetEnum() *EnumRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Enum); ok { + return x.Enum + } + } + return nil +} + +func (x *FieldRules) GetRepeated() *RepeatedRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Repeated); ok { + return x.Repeated + } + } + return nil +} + +func (x *FieldRules) GetMap() *MapRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Map); ok { + return x.Map + } + } + return nil +} + +func (x *FieldRules) GetAny() *AnyRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Any); ok { + return x.Any + } + } + return nil +} + +func (x *FieldRules) GetDuration() *DurationRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Duration); ok { + return x.Duration + } + } + return nil +} + +func (x *FieldRules) GetFieldMask() *FieldMaskRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_FieldMask); ok { + return x.FieldMask + } + } + return nil +} + +func (x *FieldRules) GetTimestamp() *TimestampRules { + if x != nil { + if x, ok := x.xxx_hidden_Type.(*fieldRules_Timestamp); ok { + return x.Timestamp + } + } + return nil +} + +func (x *FieldRules) SetCelExpression(v []string) { + x.xxx_hidden_CelExpression = v +} + +func (x *FieldRules) SetCel(v []*Rule) { + x.xxx_hidden_Cel = &v +} + +func (x *FieldRules) SetRequired(v bool) { + x.xxx_hidden_Required = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *FieldRules) SetIgnore(v Ignore) { + x.xxx_hidden_Ignore = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *FieldRules) SetFloat(v *FloatRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Float{v} +} + +func (x *FieldRules) SetDouble(v *DoubleRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Double{v} +} + +func (x *FieldRules) SetInt32(v *Int32Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Int32{v} +} + +func (x *FieldRules) SetInt64(v *Int64Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Int64{v} +} + +func (x *FieldRules) SetUint32(v *UInt32Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Uint32{v} +} + +func (x *FieldRules) SetUint64(v *UInt64Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Uint64{v} +} + +func (x *FieldRules) SetSint32(v *SInt32Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Sint32{v} +} + +func (x *FieldRules) SetSint64(v *SInt64Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Sint64{v} +} + +func (x *FieldRules) SetFixed32(v *Fixed32Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Fixed32{v} +} + +func (x *FieldRules) SetFixed64(v *Fixed64Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Fixed64{v} +} + +func (x *FieldRules) SetSfixed32(v *SFixed32Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Sfixed32{v} +} + +func (x *FieldRules) SetSfixed64(v *SFixed64Rules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Sfixed64{v} +} + +func (x *FieldRules) SetBool(v *BoolRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Bool{v} +} + +func (x *FieldRules) SetString(v *StringRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_String_{v} +} + +func (x *FieldRules) SetBytes(v *BytesRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Bytes{v} +} + +func (x *FieldRules) SetEnum(v *EnumRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Enum{v} +} + +func (x *FieldRules) SetRepeated(v *RepeatedRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Repeated{v} +} + +func (x *FieldRules) SetMap(v *MapRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Map{v} +} + +func (x *FieldRules) SetAny(v *AnyRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Any{v} +} + +func (x *FieldRules) SetDuration(v *DurationRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Duration{v} +} + +func (x *FieldRules) SetFieldMask(v *FieldMaskRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_FieldMask{v} +} + +func (x *FieldRules) SetTimestamp(v *TimestampRules) { + if v == nil { + x.xxx_hidden_Type = nil + return + } + x.xxx_hidden_Type = &fieldRules_Timestamp{v} +} + +func (x *FieldRules) HasRequired() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *FieldRules) HasIgnore() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *FieldRules) HasType() bool { + if x == nil { + return false + } + return x.xxx_hidden_Type != nil +} + +func (x *FieldRules) HasFloat() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Float) + return ok +} + +func (x *FieldRules) HasDouble() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Double) + return ok +} + +func (x *FieldRules) HasInt32() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Int32) + return ok +} + +func (x *FieldRules) HasInt64() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Int64) + return ok +} + +func (x *FieldRules) HasUint32() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Uint32) + return ok +} + +func (x *FieldRules) HasUint64() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Uint64) + return ok +} + +func (x *FieldRules) HasSint32() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Sint32) + return ok +} + +func (x *FieldRules) HasSint64() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Sint64) + return ok +} + +func (x *FieldRules) HasFixed32() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Fixed32) + return ok +} + +func (x *FieldRules) HasFixed64() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Fixed64) + return ok +} + +func (x *FieldRules) HasSfixed32() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Sfixed32) + return ok +} + +func (x *FieldRules) HasSfixed64() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Sfixed64) + return ok +} + +func (x *FieldRules) HasBool() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Bool) + return ok +} + +func (x *FieldRules) HasString() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_String_) + return ok +} + +func (x *FieldRules) HasBytes() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Bytes) + return ok +} + +func (x *FieldRules) HasEnum() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Enum) + return ok +} + +func (x *FieldRules) HasRepeated() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Repeated) + return ok +} + +func (x *FieldRules) HasMap() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Map) + return ok +} + +func (x *FieldRules) HasAny() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Any) + return ok +} + +func (x *FieldRules) HasDuration() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Duration) + return ok +} + +func (x *FieldRules) HasFieldMask() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_FieldMask) + return ok +} + +func (x *FieldRules) HasTimestamp() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Type.(*fieldRules_Timestamp) + return ok +} + +func (x *FieldRules) ClearRequired() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Required = false +} + +func (x *FieldRules) ClearIgnore() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Ignore = Ignore_IGNORE_UNSPECIFIED +} + +func (x *FieldRules) ClearType() { + x.xxx_hidden_Type = nil +} + +func (x *FieldRules) ClearFloat() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Float); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearDouble() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Double); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearInt32() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Int32); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearInt64() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Int64); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearUint32() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Uint32); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearUint64() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Uint64); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearSint32() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Sint32); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearSint64() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Sint64); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearFixed32() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Fixed32); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearFixed64() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Fixed64); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearSfixed32() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Sfixed32); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearSfixed64() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Sfixed64); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearBool() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Bool); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearString() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_String_); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearBytes() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Bytes); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearEnum() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Enum); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearRepeated() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Repeated); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearMap() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Map); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearAny() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Any); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearDuration() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Duration); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearFieldMask() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_FieldMask); ok { + x.xxx_hidden_Type = nil + } +} + +func (x *FieldRules) ClearTimestamp() { + if _, ok := x.xxx_hidden_Type.(*fieldRules_Timestamp); ok { + x.xxx_hidden_Type = nil + } +} + +const FieldRules_Type_not_set_case case_FieldRules_Type = 0 +const FieldRules_Float_case case_FieldRules_Type = 1 +const FieldRules_Double_case case_FieldRules_Type = 2 +const FieldRules_Int32_case case_FieldRules_Type = 3 +const FieldRules_Int64_case case_FieldRules_Type = 4 +const FieldRules_Uint32_case case_FieldRules_Type = 5 +const FieldRules_Uint64_case case_FieldRules_Type = 6 +const FieldRules_Sint32_case case_FieldRules_Type = 7 +const FieldRules_Sint64_case case_FieldRules_Type = 8 +const FieldRules_Fixed32_case case_FieldRules_Type = 9 +const FieldRules_Fixed64_case case_FieldRules_Type = 10 +const FieldRules_Sfixed32_case case_FieldRules_Type = 11 +const FieldRules_Sfixed64_case case_FieldRules_Type = 12 +const FieldRules_Bool_case case_FieldRules_Type = 13 +const FieldRules_String__case case_FieldRules_Type = 14 +const FieldRules_Bytes_case case_FieldRules_Type = 15 +const FieldRules_Enum_case case_FieldRules_Type = 16 +const FieldRules_Repeated_case case_FieldRules_Type = 18 +const FieldRules_Map_case case_FieldRules_Type = 19 +const FieldRules_Any_case case_FieldRules_Type = 20 +const FieldRules_Duration_case case_FieldRules_Type = 21 +const FieldRules_FieldMask_case case_FieldRules_Type = 28 +const FieldRules_Timestamp_case case_FieldRules_Type = 22 + +func (x *FieldRules) WhichType() case_FieldRules_Type { + if x == nil { + return FieldRules_Type_not_set_case + } + switch x.xxx_hidden_Type.(type) { + case *fieldRules_Float: + return FieldRules_Float_case + case *fieldRules_Double: + return FieldRules_Double_case + case *fieldRules_Int32: + return FieldRules_Int32_case + case *fieldRules_Int64: + return FieldRules_Int64_case + case *fieldRules_Uint32: + return FieldRules_Uint32_case + case *fieldRules_Uint64: + return FieldRules_Uint64_case + case *fieldRules_Sint32: + return FieldRules_Sint32_case + case *fieldRules_Sint64: + return FieldRules_Sint64_case + case *fieldRules_Fixed32: + return FieldRules_Fixed32_case + case *fieldRules_Fixed64: + return FieldRules_Fixed64_case + case *fieldRules_Sfixed32: + return FieldRules_Sfixed32_case + case *fieldRules_Sfixed64: + return FieldRules_Sfixed64_case + case *fieldRules_Bool: + return FieldRules_Bool_case + case *fieldRules_String_: + return FieldRules_String__case + case *fieldRules_Bytes: + return FieldRules_Bytes_case + case *fieldRules_Enum: + return FieldRules_Enum_case + case *fieldRules_Repeated: + return FieldRules_Repeated_case + case *fieldRules_Map: + return FieldRules_Map_case + case *fieldRules_Any: + return FieldRules_Any_case + case *fieldRules_Duration: + return FieldRules_Duration_case + case *fieldRules_FieldMask: + return FieldRules_FieldMask_case + case *fieldRules_Timestamp: + return FieldRules_Timestamp_case + default: + return FieldRules_Type_not_set_case + } +} + +type FieldRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + // + // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + // be same as the `expression`. + // + // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"]; + // } + // + // ``` + CelExpression []string + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.field).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this > 42", + // }]; + // } + // + // ``` + Cel []*Rule + // If `required` is true, the field must be set. A validation error is returned + // if the field is not set. + // + // ```proto + // syntax="proto3"; + // + // message FieldsWithPresence { + // // Requires any string to be set, including the empty string. + // optional string link = 1 [ + // (buf.validate.field).required = true + // ]; + // // Requires true or false to be set. + // optional bool disabled = 2 [ + // (buf.validate.field).required = true + // ]; + // // Requires a message to be set, including the empty message. + // SomeMessage msg = 4 [ + // (buf.validate.field).required = true + // ]; + // } + // + // ``` + // + // All fields in the example above track presence. By default, Protovalidate + // ignores rules on those fields if no value is set. `required` ensures that + // the fields are set and valid. + // + // Fields that don't track presence are always validated by Protovalidate, + // whether they are set or not. It is not necessary to add `required`. It + // can be added to indicate that the field cannot be the zero value. + // + // ```proto + // syntax="proto3"; + // + // message FieldsWithoutPresence { + // // `string.email` always applies, even to an empty string. + // string link = 1 [ + // (buf.validate.field).string.email = true + // ]; + // // `repeated.min_items` always applies, even to an empty list. + // repeated string labels = 2 [ + // (buf.validate.field).repeated.min_items = 1 + // ]; + // // `required`, for fields that don't track presence, indicates + // // the value of the field can't be the zero value. + // int32 zero_value_not_allowed = 3 [ + // (buf.validate.field).required = true + // ]; + // } + // + // ``` + // + // To learn which fields track presence, see the + // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + // + // Note: While field rules can be applied to repeated items, map keys, and map + // values, the elements are always considered to be set. Consequently, + // specifying `repeated.items.required` is redundant. + Required *bool + // Ignore validation rules on the field if its value matches the specified + // criteria. See the `Ignore` enum for details. + // + // ```proto + // + // message UpdateRequest { + // // The uri rule only applies if the field is not an empty string. + // string url = 1 [ + // (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE, + // (buf.validate.field).string.uri = true + // ]; + // } + // + // ``` + Ignore *Ignore + // Fields of oneof xxx_hidden_Type: + // Scalar Field Types + Float *FloatRules + Double *DoubleRules + Int32 *Int32Rules + Int64 *Int64Rules + Uint32 *UInt32Rules + Uint64 *UInt64Rules + Sint32 *SInt32Rules + Sint64 *SInt64Rules + Fixed32 *Fixed32Rules + Fixed64 *Fixed64Rules + Sfixed32 *SFixed32Rules + Sfixed64 *SFixed64Rules + Bool *BoolRules + String *StringRules + Bytes *BytesRules + // Complex Field Types + Enum *EnumRules + Repeated *RepeatedRules + Map *MapRules + // Well-Known Field Types + Any *AnyRules + Duration *DurationRules + FieldMask *FieldMaskRules + Timestamp *TimestampRules + // -- end of xxx_hidden_Type +} + +func (b0 FieldRules_builder) Build() *FieldRules { + m0 := &FieldRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_CelExpression = b.CelExpression + x.xxx_hidden_Cel = &b.Cel + if b.Required != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_Required = *b.Required + } + if b.Ignore != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_Ignore = *b.Ignore + } + if b.Float != nil { + x.xxx_hidden_Type = &fieldRules_Float{b.Float} + } + if b.Double != nil { + x.xxx_hidden_Type = &fieldRules_Double{b.Double} + } + if b.Int32 != nil { + x.xxx_hidden_Type = &fieldRules_Int32{b.Int32} + } + if b.Int64 != nil { + x.xxx_hidden_Type = &fieldRules_Int64{b.Int64} + } + if b.Uint32 != nil { + x.xxx_hidden_Type = &fieldRules_Uint32{b.Uint32} + } + if b.Uint64 != nil { + x.xxx_hidden_Type = &fieldRules_Uint64{b.Uint64} + } + if b.Sint32 != nil { + x.xxx_hidden_Type = &fieldRules_Sint32{b.Sint32} + } + if b.Sint64 != nil { + x.xxx_hidden_Type = &fieldRules_Sint64{b.Sint64} + } + if b.Fixed32 != nil { + x.xxx_hidden_Type = &fieldRules_Fixed32{b.Fixed32} + } + if b.Fixed64 != nil { + x.xxx_hidden_Type = &fieldRules_Fixed64{b.Fixed64} + } + if b.Sfixed32 != nil { + x.xxx_hidden_Type = &fieldRules_Sfixed32{b.Sfixed32} + } + if b.Sfixed64 != nil { + x.xxx_hidden_Type = &fieldRules_Sfixed64{b.Sfixed64} + } + if b.Bool != nil { + x.xxx_hidden_Type = &fieldRules_Bool{b.Bool} + } + if b.String != nil { + x.xxx_hidden_Type = &fieldRules_String_{b.String} + } + if b.Bytes != nil { + x.xxx_hidden_Type = &fieldRules_Bytes{b.Bytes} + } + if b.Enum != nil { + x.xxx_hidden_Type = &fieldRules_Enum{b.Enum} + } + if b.Repeated != nil { + x.xxx_hidden_Type = &fieldRules_Repeated{b.Repeated} + } + if b.Map != nil { + x.xxx_hidden_Type = &fieldRules_Map{b.Map} + } + if b.Any != nil { + x.xxx_hidden_Type = &fieldRules_Any{b.Any} + } + if b.Duration != nil { + x.xxx_hidden_Type = &fieldRules_Duration{b.Duration} + } + if b.FieldMask != nil { + x.xxx_hidden_Type = &fieldRules_FieldMask{b.FieldMask} + } + if b.Timestamp != nil { + x.xxx_hidden_Type = &fieldRules_Timestamp{b.Timestamp} + } + return m0 +} + +type case_FieldRules_Type protoreflect.FieldNumber + +func (x case_FieldRules_Type) String() string { + md := file_buf_validate_validate_proto_msgTypes[4].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFieldRules_Type interface { + isFieldRules_Type() +} + +type fieldRules_Float struct { + // Scalar Field Types + Float *FloatRules `protobuf:"bytes,1,opt,name=float,oneof"` +} + +type fieldRules_Double struct { + Double *DoubleRules `protobuf:"bytes,2,opt,name=double,oneof"` +} + +type fieldRules_Int32 struct { + Int32 *Int32Rules `protobuf:"bytes,3,opt,name=int32,oneof"` +} + +type fieldRules_Int64 struct { + Int64 *Int64Rules `protobuf:"bytes,4,opt,name=int64,oneof"` +} + +type fieldRules_Uint32 struct { + Uint32 *UInt32Rules `protobuf:"bytes,5,opt,name=uint32,oneof"` +} + +type fieldRules_Uint64 struct { + Uint64 *UInt64Rules `protobuf:"bytes,6,opt,name=uint64,oneof"` +} + +type fieldRules_Sint32 struct { + Sint32 *SInt32Rules `protobuf:"bytes,7,opt,name=sint32,oneof"` +} + +type fieldRules_Sint64 struct { + Sint64 *SInt64Rules `protobuf:"bytes,8,opt,name=sint64,oneof"` +} + +type fieldRules_Fixed32 struct { + Fixed32 *Fixed32Rules `protobuf:"bytes,9,opt,name=fixed32,oneof"` +} + +type fieldRules_Fixed64 struct { + Fixed64 *Fixed64Rules `protobuf:"bytes,10,opt,name=fixed64,oneof"` +} + +type fieldRules_Sfixed32 struct { + Sfixed32 *SFixed32Rules `protobuf:"bytes,11,opt,name=sfixed32,oneof"` +} + +type fieldRules_Sfixed64 struct { + Sfixed64 *SFixed64Rules `protobuf:"bytes,12,opt,name=sfixed64,oneof"` +} + +type fieldRules_Bool struct { + Bool *BoolRules `protobuf:"bytes,13,opt,name=bool,oneof"` +} + +type fieldRules_String_ struct { + String_ *StringRules `protobuf:"bytes,14,opt,name=string,oneof"` +} + +type fieldRules_Bytes struct { + Bytes *BytesRules `protobuf:"bytes,15,opt,name=bytes,oneof"` +} + +type fieldRules_Enum struct { + // Complex Field Types + Enum *EnumRules `protobuf:"bytes,16,opt,name=enum,oneof"` +} + +type fieldRules_Repeated struct { + Repeated *RepeatedRules `protobuf:"bytes,18,opt,name=repeated,oneof"` +} + +type fieldRules_Map struct { + Map *MapRules `protobuf:"bytes,19,opt,name=map,oneof"` +} + +type fieldRules_Any struct { + // Well-Known Field Types + Any *AnyRules `protobuf:"bytes,20,opt,name=any,oneof"` +} + +type fieldRules_Duration struct { + Duration *DurationRules `protobuf:"bytes,21,opt,name=duration,oneof"` +} + +type fieldRules_FieldMask struct { + FieldMask *FieldMaskRules `protobuf:"bytes,28,opt,name=field_mask,json=fieldMask,oneof"` +} + +type fieldRules_Timestamp struct { + Timestamp *TimestampRules `protobuf:"bytes,22,opt,name=timestamp,oneof"` +} + +func (*fieldRules_Float) isFieldRules_Type() {} + +func (*fieldRules_Double) isFieldRules_Type() {} + +func (*fieldRules_Int32) isFieldRules_Type() {} + +func (*fieldRules_Int64) isFieldRules_Type() {} + +func (*fieldRules_Uint32) isFieldRules_Type() {} + +func (*fieldRules_Uint64) isFieldRules_Type() {} + +func (*fieldRules_Sint32) isFieldRules_Type() {} + +func (*fieldRules_Sint64) isFieldRules_Type() {} + +func (*fieldRules_Fixed32) isFieldRules_Type() {} + +func (*fieldRules_Fixed64) isFieldRules_Type() {} + +func (*fieldRules_Sfixed32) isFieldRules_Type() {} + +func (*fieldRules_Sfixed64) isFieldRules_Type() {} + +func (*fieldRules_Bool) isFieldRules_Type() {} + +func (*fieldRules_String_) isFieldRules_Type() {} + +func (*fieldRules_Bytes) isFieldRules_Type() {} + +func (*fieldRules_Enum) isFieldRules_Type() {} + +func (*fieldRules_Repeated) isFieldRules_Type() {} + +func (*fieldRules_Map) isFieldRules_Type() {} + +func (*fieldRules_Any) isFieldRules_Type() {} + +func (*fieldRules_Duration) isFieldRules_Type() {} + +func (*fieldRules_FieldMask) isFieldRules_Type() {} + +func (*fieldRules_Timestamp) isFieldRules_Type() {} + +// PredefinedRules are custom rules that can be re-used with +// multiple fields. +type PredefinedRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Cel *[]*Rule `protobuf:"bytes,1,rep,name=cel"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PredefinedRules) Reset() { + *x = PredefinedRules{} + mi := &file_buf_validate_validate_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PredefinedRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PredefinedRules) ProtoMessage() {} + +func (x *PredefinedRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PredefinedRules) GetCel() []*Rule { + if x != nil { + if x.xxx_hidden_Cel != nil { + return *x.xxx_hidden_Cel + } + } + return nil +} + +func (x *PredefinedRules) SetCel(v []*Rule) { + x.xxx_hidden_Cel = &v +} + +type PredefinedRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `cel` is a repeated field used to represent a textual expression + // in the Common Expression Language (CEL) syntax. For more information, + // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/). + // + // ```proto + // + // message MyMessage { + // // The field `value` must be greater than 42. + // optional int32 value = 1 [(buf.validate.predefined).cel = { + // id: "my_message.value", + // message: "must be greater than 42", + // expression: "this > 42", + // }]; + // } + // + // ``` + Cel []*Rule +} + +func (b0 PredefinedRules_builder) Build() *PredefinedRules { + m0 := &PredefinedRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Cel = &b.Cel + return m0 +} + +// FloatRules describes the rules applied to `float` values. These +// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type. +type FloatRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const float32 `protobuf:"fixed32,1,opt,name=const"` + xxx_hidden_LessThan isFloatRules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isFloatRules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []float32 `protobuf:"fixed32,6,rep,name=in"` + xxx_hidden_NotIn []float32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn"` + xxx_hidden_Finite bool `protobuf:"varint,8,opt,name=finite"` + xxx_hidden_Example []float32 `protobuf:"fixed32,9,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FloatRules) Reset() { + *x = FloatRules{} + mi := &file_buf_validate_validate_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FloatRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FloatRules) ProtoMessage() {} + +func (x *FloatRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FloatRules) GetConst() float32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *FloatRules) GetLt() float32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*floatRules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *FloatRules) GetLte() float32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*floatRules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *FloatRules) GetGt() float32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*floatRules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *FloatRules) GetGte() float32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*floatRules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *FloatRules) GetIn() []float32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *FloatRules) GetNotIn() []float32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *FloatRules) GetFinite() bool { + if x != nil { + return x.xxx_hidden_Finite + } + return false +} + +func (x *FloatRules) GetExample() []float32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *FloatRules) SetConst(v float32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 7) +} + +func (x *FloatRules) SetLt(v float32) { + x.xxx_hidden_LessThan = &floatRules_Lt{v} +} + +func (x *FloatRules) SetLte(v float32) { + x.xxx_hidden_LessThan = &floatRules_Lte{v} +} + +func (x *FloatRules) SetGt(v float32) { + x.xxx_hidden_GreaterThan = &floatRules_Gt{v} +} + +func (x *FloatRules) SetGte(v float32) { + x.xxx_hidden_GreaterThan = &floatRules_Gte{v} +} + +func (x *FloatRules) SetIn(v []float32) { + x.xxx_hidden_In = v +} + +func (x *FloatRules) SetNotIn(v []float32) { + x.xxx_hidden_NotIn = v +} + +func (x *FloatRules) SetFinite(v bool) { + x.xxx_hidden_Finite = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 7) +} + +func (x *FloatRules) SetExample(v []float32) { + x.xxx_hidden_Example = v +} + +func (x *FloatRules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *FloatRules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *FloatRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*floatRules_Lt) + return ok +} + +func (x *FloatRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*floatRules_Lte) + return ok +} + +func (x *FloatRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *FloatRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*floatRules_Gt) + return ok +} + +func (x *FloatRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*floatRules_Gte) + return ok +} + +func (x *FloatRules) HasFinite() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *FloatRules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *FloatRules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *FloatRules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*floatRules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *FloatRules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*floatRules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *FloatRules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *FloatRules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*floatRules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *FloatRules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*floatRules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *FloatRules) ClearFinite() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_Finite = false +} + +const FloatRules_LessThan_not_set_case case_FloatRules_LessThan = 0 +const FloatRules_Lt_case case_FloatRules_LessThan = 2 +const FloatRules_Lte_case case_FloatRules_LessThan = 3 + +func (x *FloatRules) WhichLessThan() case_FloatRules_LessThan { + if x == nil { + return FloatRules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *floatRules_Lt: + return FloatRules_Lt_case + case *floatRules_Lte: + return FloatRules_Lte_case + default: + return FloatRules_LessThan_not_set_case + } +} + +const FloatRules_GreaterThan_not_set_case case_FloatRules_GreaterThan = 0 +const FloatRules_Gt_case case_FloatRules_GreaterThan = 4 +const FloatRules_Gte_case case_FloatRules_GreaterThan = 5 + +func (x *FloatRules) WhichGreaterThan() case_FloatRules_GreaterThan { + if x == nil { + return FloatRules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *floatRules_Gt: + return FloatRules_Gt_case + case *floatRules_Gte: + return FloatRules_Gte_case + default: + return FloatRules_GreaterThan_not_set_case + } +} + +type FloatRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // value must equal 42.0 + // float value = 1 [(buf.validate.field).float.const = 42.0]; + // } + // + // ``` + Const *float32 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than 10.0 + // float value = 1 [(buf.validate.field).float.lt = 10.0]; + // } + // + // ``` + Lt *float32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than or equal to 10.0 + // float value = 1 [(buf.validate.field).float.lte = 10.0]; + // } + // + // ``` + Lte *float32 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than 5.0 [float.gt] + // float value = 1 [(buf.validate.field).float.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [float.gt_lt] + // float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt *float32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than or equal to 5.0 [float.gte] + // float value = 1 [(buf.validate.field).float.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt] + // float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte *float32 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyFloat { + // // must be in list [1.0, 2.0, 3.0] + // float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + In []float32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFloat { + // // value must not be in list [1.0, 2.0, 3.0] + // float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + NotIn []float32 + // `finite` requires the field value to be finite. If the field value is + // infinite or NaN, an error message is generated. + Finite *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFloat { + // float value = 1 [ + // (buf.validate.field).float.example = 1.0, + // (buf.validate.field).float.example = inf + // ]; + // } + // + // ``` + Example []float32 +} + +func (b0 FloatRules_builder) Build() *FloatRules { + m0 := &FloatRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 7) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &floatRules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &floatRules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &floatRules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &floatRules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + if b.Finite != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 7) + x.xxx_hidden_Finite = *b.Finite + } + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_FloatRules_LessThan protoreflect.FieldNumber + +func (x case_FloatRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[6].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_FloatRules_GreaterThan protoreflect.FieldNumber + +func (x case_FloatRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[6].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFloatRules_LessThan interface { + isFloatRules_LessThan() +} + +type floatRules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than 10.0 + // float value = 1 [(buf.validate.field).float.lt = 10.0]; + // } + // + // ``` + Lt float32 `protobuf:"fixed32,2,opt,name=lt,oneof"` +} + +type floatRules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be less than or equal to 10.0 + // float value = 1 [(buf.validate.field).float.lte = 10.0]; + // } + // + // ``` + Lte float32 `protobuf:"fixed32,3,opt,name=lte,oneof"` +} + +func (*floatRules_Lt) isFloatRules_LessThan() {} + +func (*floatRules_Lte) isFloatRules_LessThan() {} + +type isFloatRules_GreaterThan interface { + isFloatRules_GreaterThan() +} + +type floatRules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than 5.0 [float.gt] + // float value = 1 [(buf.validate.field).float.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [float.gt_lt] + // float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt float32 `protobuf:"fixed32,4,opt,name=gt,oneof"` +} + +type floatRules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFloat { + // // must be greater than or equal to 5.0 [float.gte] + // float value = 1 [(buf.validate.field).float.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt] + // float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive] + // float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte float32 `protobuf:"fixed32,5,opt,name=gte,oneof"` +} + +func (*floatRules_Gt) isFloatRules_GreaterThan() {} + +func (*floatRules_Gte) isFloatRules_GreaterThan() {} + +// DoubleRules describes the rules applied to `double` values. These +// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type. +type DoubleRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const float64 `protobuf:"fixed64,1,opt,name=const"` + xxx_hidden_LessThan isDoubleRules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isDoubleRules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []float64 `protobuf:"fixed64,6,rep,name=in"` + xxx_hidden_NotIn []float64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn"` + xxx_hidden_Finite bool `protobuf:"varint,8,opt,name=finite"` + xxx_hidden_Example []float64 `protobuf:"fixed64,9,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DoubleRules) Reset() { + *x = DoubleRules{} + mi := &file_buf_validate_validate_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DoubleRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleRules) ProtoMessage() {} + +func (x *DoubleRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DoubleRules) GetConst() float64 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *DoubleRules) GetLt() float64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*doubleRules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *DoubleRules) GetLte() float64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*doubleRules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *DoubleRules) GetGt() float64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*doubleRules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *DoubleRules) GetGte() float64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*doubleRules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *DoubleRules) GetIn() []float64 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *DoubleRules) GetNotIn() []float64 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *DoubleRules) GetFinite() bool { + if x != nil { + return x.xxx_hidden_Finite + } + return false +} + +func (x *DoubleRules) GetExample() []float64 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *DoubleRules) SetConst(v float64) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 7) +} + +func (x *DoubleRules) SetLt(v float64) { + x.xxx_hidden_LessThan = &doubleRules_Lt{v} +} + +func (x *DoubleRules) SetLte(v float64) { + x.xxx_hidden_LessThan = &doubleRules_Lte{v} +} + +func (x *DoubleRules) SetGt(v float64) { + x.xxx_hidden_GreaterThan = &doubleRules_Gt{v} +} + +func (x *DoubleRules) SetGte(v float64) { + x.xxx_hidden_GreaterThan = &doubleRules_Gte{v} +} + +func (x *DoubleRules) SetIn(v []float64) { + x.xxx_hidden_In = v +} + +func (x *DoubleRules) SetNotIn(v []float64) { + x.xxx_hidden_NotIn = v +} + +func (x *DoubleRules) SetFinite(v bool) { + x.xxx_hidden_Finite = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 7) +} + +func (x *DoubleRules) SetExample(v []float64) { + x.xxx_hidden_Example = v +} + +func (x *DoubleRules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *DoubleRules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *DoubleRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*doubleRules_Lt) + return ok +} + +func (x *DoubleRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*doubleRules_Lte) + return ok +} + +func (x *DoubleRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *DoubleRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*doubleRules_Gt) + return ok +} + +func (x *DoubleRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*doubleRules_Gte) + return ok +} + +func (x *DoubleRules) HasFinite() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *DoubleRules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *DoubleRules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *DoubleRules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*doubleRules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *DoubleRules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*doubleRules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *DoubleRules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *DoubleRules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*doubleRules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *DoubleRules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*doubleRules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *DoubleRules) ClearFinite() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_Finite = false +} + +const DoubleRules_LessThan_not_set_case case_DoubleRules_LessThan = 0 +const DoubleRules_Lt_case case_DoubleRules_LessThan = 2 +const DoubleRules_Lte_case case_DoubleRules_LessThan = 3 + +func (x *DoubleRules) WhichLessThan() case_DoubleRules_LessThan { + if x == nil { + return DoubleRules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *doubleRules_Lt: + return DoubleRules_Lt_case + case *doubleRules_Lte: + return DoubleRules_Lte_case + default: + return DoubleRules_LessThan_not_set_case + } +} + +const DoubleRules_GreaterThan_not_set_case case_DoubleRules_GreaterThan = 0 +const DoubleRules_Gt_case case_DoubleRules_GreaterThan = 4 +const DoubleRules_Gte_case case_DoubleRules_GreaterThan = 5 + +func (x *DoubleRules) WhichGreaterThan() case_DoubleRules_GreaterThan { + if x == nil { + return DoubleRules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *doubleRules_Gt: + return DoubleRules_Gt_case + case *doubleRules_Gte: + return DoubleRules_Gte_case + default: + return DoubleRules_GreaterThan_not_set_case + } +} + +type DoubleRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // value must equal 42.0 + // double value = 1 [(buf.validate.field).double.const = 42.0]; + // } + // + // ``` + Const *float64 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than 10.0 + // double value = 1 [(buf.validate.field).double.lt = 10.0]; + // } + // + // ``` + Lt *float64 + // `lte` requires the field value to be less than or equal to the specified value + // (field <= value). If the field value is greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than or equal to 10.0 + // double value = 1 [(buf.validate.field).double.lte = 10.0]; + // } + // + // ``` + Lte *float64 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`, + // the range is reversed, and the field value must be outside the specified + // range. If the field value doesn't meet the required conditions, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than 5.0 [double.gt] + // double value = 1 [(buf.validate.field).double.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [double.gt_lt] + // double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt *float64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than or equal to 5.0 [double.gte] + // double value = 1 [(buf.validate.field).double.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt] + // double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte *float64 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyDouble { + // // must be in list [1.0, 2.0, 3.0] + // double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + In []float64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // value must not be in list [1.0, 2.0, 3.0] + // double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }]; + // } + // + // ``` + NotIn []float64 + // `finite` requires the field value to be finite. If the field value is + // infinite or NaN, an error message is generated. + Finite *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyDouble { + // double value = 1 [ + // (buf.validate.field).double.example = 1.0, + // (buf.validate.field).double.example = inf + // ]; + // } + // + // ``` + Example []float64 +} + +func (b0 DoubleRules_builder) Build() *DoubleRules { + m0 := &DoubleRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 7) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &doubleRules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &doubleRules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &doubleRules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &doubleRules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + if b.Finite != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 7) + x.xxx_hidden_Finite = *b.Finite + } + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_DoubleRules_LessThan protoreflect.FieldNumber + +func (x case_DoubleRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[7].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_DoubleRules_GreaterThan protoreflect.FieldNumber + +func (x case_DoubleRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[7].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isDoubleRules_LessThan interface { + isDoubleRules_LessThan() +} + +type doubleRules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than 10.0 + // double value = 1 [(buf.validate.field).double.lt = 10.0]; + // } + // + // ``` + Lt float64 `protobuf:"fixed64,2,opt,name=lt,oneof"` +} + +type doubleRules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified value + // (field <= value). If the field value is greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be less than or equal to 10.0 + // double value = 1 [(buf.validate.field).double.lte = 10.0]; + // } + // + // ``` + Lte float64 `protobuf:"fixed64,3,opt,name=lte,oneof"` +} + +func (*doubleRules_Lt) isDoubleRules_LessThan() {} + +func (*doubleRules_Lte) isDoubleRules_LessThan() {} + +type isDoubleRules_GreaterThan interface { + isDoubleRules_GreaterThan() +} + +type doubleRules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`, + // the range is reversed, and the field value must be outside the specified + // range. If the field value doesn't meet the required conditions, an error + // message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than 5.0 [double.gt] + // double value = 1 [(buf.validate.field).double.gt = 5.0]; + // + // // must be greater than 5 and less than 10.0 [double.gt_lt] + // double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }]; + // + // // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gt float64 `protobuf:"fixed64,4,opt,name=gt,oneof"` +} + +type doubleRules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDouble { + // // must be greater than or equal to 5.0 [double.gte] + // double value = 1 [(buf.validate.field).double.gte = 5.0]; + // + // // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt] + // double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }]; + // + // // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive] + // double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }]; + // } + // + // ``` + Gte float64 `protobuf:"fixed64,5,opt,name=gte,oneof"` +} + +func (*doubleRules_Gt) isDoubleRules_GreaterThan() {} + +func (*doubleRules_Gte) isDoubleRules_GreaterThan() {} + +// Int32Rules describes the rules applied to `int32` values. These +// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type. +type Int32Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int32 `protobuf:"varint,1,opt,name=const"` + xxx_hidden_LessThan isInt32Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isInt32Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []int32 `protobuf:"varint,6,rep,name=in"` + xxx_hidden_NotIn []int32 `protobuf:"varint,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int32 `protobuf:"varint,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Int32Rules) Reset() { + *x = Int32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Int32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int32Rules) ProtoMessage() {} + +func (x *Int32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Int32Rules) GetConst() int32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *Int32Rules) GetLt() int32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*int32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Int32Rules) GetLte() int32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*int32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Int32Rules) GetGt() int32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*int32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Int32Rules) GetGte() int32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*int32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Int32Rules) GetIn() []int32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *Int32Rules) GetNotIn() []int32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *Int32Rules) GetExample() []int32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *Int32Rules) SetConst(v int32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *Int32Rules) SetLt(v int32) { + x.xxx_hidden_LessThan = &int32Rules_Lt{v} +} + +func (x *Int32Rules) SetLte(v int32) { + x.xxx_hidden_LessThan = &int32Rules_Lte{v} +} + +func (x *Int32Rules) SetGt(v int32) { + x.xxx_hidden_GreaterThan = &int32Rules_Gt{v} +} + +func (x *Int32Rules) SetGte(v int32) { + x.xxx_hidden_GreaterThan = &int32Rules_Gte{v} +} + +func (x *Int32Rules) SetIn(v []int32) { + x.xxx_hidden_In = v +} + +func (x *Int32Rules) SetNotIn(v []int32) { + x.xxx_hidden_NotIn = v +} + +func (x *Int32Rules) SetExample(v []int32) { + x.xxx_hidden_Example = v +} + +func (x *Int32Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Int32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *Int32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*int32Rules_Lt) + return ok +} + +func (x *Int32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*int32Rules_Lte) + return ok +} + +func (x *Int32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *Int32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*int32Rules_Gt) + return ok +} + +func (x *Int32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*int32Rules_Gte) + return ok +} + +func (x *Int32Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *Int32Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *Int32Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*int32Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Int32Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*int32Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Int32Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *Int32Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*int32Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *Int32Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*int32Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const Int32Rules_LessThan_not_set_case case_Int32Rules_LessThan = 0 +const Int32Rules_Lt_case case_Int32Rules_LessThan = 2 +const Int32Rules_Lte_case case_Int32Rules_LessThan = 3 + +func (x *Int32Rules) WhichLessThan() case_Int32Rules_LessThan { + if x == nil { + return Int32Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *int32Rules_Lt: + return Int32Rules_Lt_case + case *int32Rules_Lte: + return Int32Rules_Lte_case + default: + return Int32Rules_LessThan_not_set_case + } +} + +const Int32Rules_GreaterThan_not_set_case case_Int32Rules_GreaterThan = 0 +const Int32Rules_Gt_case case_Int32Rules_GreaterThan = 4 +const Int32Rules_Gte_case case_Int32Rules_GreaterThan = 5 + +func (x *Int32Rules) WhichGreaterThan() case_Int32Rules_GreaterThan { + if x == nil { + return Int32Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *int32Rules_Gt: + return Int32Rules_Gt_case + case *int32Rules_Gte: + return Int32Rules_Gte_case + default: + return Int32Rules_GreaterThan_not_set_case + } +} + +type Int32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // value must equal 42 + // int32 value = 1 [(buf.validate.field).int32.const = 42]; + // } + // + // ``` + Const *int32 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than 10 + // int32 value = 1 [(buf.validate.field).int32.lt = 10]; + // } + // + // ``` + Lt *int32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than or equal to 10 + // int32 value = 1 [(buf.validate.field).int32.lte = 10]; + // } + // + // ``` + Lte *int32 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than 5 [int32.gt] + // int32 value = 1 [(buf.validate.field).int32.gt = 5]; + // + // // must be greater than 5 and less than 10 [int32.gt_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int32.gt_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int32 + // `gte` requires the field value to be greater than or equal to the specified value + // (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than or equal to 5 [int32.gte] + // int32 value = 1 [(buf.validate.field).int32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int32.gte_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int32 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyInt32 { + // // must be in list [1, 2, 3] + // int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyInt32 { + // // value must not be in list [1, 2, 3] + // int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyInt32 { + // int32 value = 1 [ + // (buf.validate.field).int32.example = 1, + // (buf.validate.field).int32.example = -10 + // ]; + // } + // + // ``` + Example []int32 +} + +func (b0 Int32Rules_builder) Build() *Int32Rules { + m0 := &Int32Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &int32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &int32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &int32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &int32Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_Int32Rules_LessThan protoreflect.FieldNumber + +func (x case_Int32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[8].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Int32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Int32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[8].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isInt32Rules_LessThan interface { + isInt32Rules_LessThan() +} + +type int32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than 10 + // int32 value = 1 [(buf.validate.field).int32.lt = 10]; + // } + // + // ``` + Lt int32 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type int32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be less than or equal to 10 + // int32 value = 1 [(buf.validate.field).int32.lte = 10]; + // } + // + // ``` + Lte int32 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*int32Rules_Lt) isInt32Rules_LessThan() {} + +func (*int32Rules_Lte) isInt32Rules_LessThan() {} + +type isInt32Rules_GreaterThan interface { + isInt32Rules_GreaterThan() +} + +type int32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than 5 [int32.gt] + // int32 value = 1 [(buf.validate.field).int32.gt = 5]; + // + // // must be greater than 5 and less than 10 [int32.gt_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int32.gt_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int32 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type int32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified value + // (exclusive). If the value of `gte` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt32 { + // // must be greater than or equal to 5 [int32.gte] + // int32 value = 1 [(buf.validate.field).int32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int32.gte_lt] + // int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive] + // int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int32 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*int32Rules_Gt) isInt32Rules_GreaterThan() {} + +func (*int32Rules_Gte) isInt32Rules_GreaterThan() {} + +// Int64Rules describes the rules applied to `int64` values. These +// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type. +type Int64Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int64 `protobuf:"varint,1,opt,name=const"` + xxx_hidden_LessThan isInt64Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isInt64Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []int64 `protobuf:"varint,6,rep,name=in"` + xxx_hidden_NotIn []int64 `protobuf:"varint,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int64 `protobuf:"varint,9,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Int64Rules) Reset() { + *x = Int64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Int64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int64Rules) ProtoMessage() {} + +func (x *Int64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Int64Rules) GetConst() int64 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *Int64Rules) GetLt() int64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*int64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Int64Rules) GetLte() int64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*int64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Int64Rules) GetGt() int64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*int64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Int64Rules) GetGte() int64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*int64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Int64Rules) GetIn() []int64 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *Int64Rules) GetNotIn() []int64 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *Int64Rules) GetExample() []int64 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *Int64Rules) SetConst(v int64) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *Int64Rules) SetLt(v int64) { + x.xxx_hidden_LessThan = &int64Rules_Lt{v} +} + +func (x *Int64Rules) SetLte(v int64) { + x.xxx_hidden_LessThan = &int64Rules_Lte{v} +} + +func (x *Int64Rules) SetGt(v int64) { + x.xxx_hidden_GreaterThan = &int64Rules_Gt{v} +} + +func (x *Int64Rules) SetGte(v int64) { + x.xxx_hidden_GreaterThan = &int64Rules_Gte{v} +} + +func (x *Int64Rules) SetIn(v []int64) { + x.xxx_hidden_In = v +} + +func (x *Int64Rules) SetNotIn(v []int64) { + x.xxx_hidden_NotIn = v +} + +func (x *Int64Rules) SetExample(v []int64) { + x.xxx_hidden_Example = v +} + +func (x *Int64Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Int64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *Int64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*int64Rules_Lt) + return ok +} + +func (x *Int64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*int64Rules_Lte) + return ok +} + +func (x *Int64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *Int64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*int64Rules_Gt) + return ok +} + +func (x *Int64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*int64Rules_Gte) + return ok +} + +func (x *Int64Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *Int64Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *Int64Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*int64Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Int64Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*int64Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Int64Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *Int64Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*int64Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *Int64Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*int64Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const Int64Rules_LessThan_not_set_case case_Int64Rules_LessThan = 0 +const Int64Rules_Lt_case case_Int64Rules_LessThan = 2 +const Int64Rules_Lte_case case_Int64Rules_LessThan = 3 + +func (x *Int64Rules) WhichLessThan() case_Int64Rules_LessThan { + if x == nil { + return Int64Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *int64Rules_Lt: + return Int64Rules_Lt_case + case *int64Rules_Lte: + return Int64Rules_Lte_case + default: + return Int64Rules_LessThan_not_set_case + } +} + +const Int64Rules_GreaterThan_not_set_case case_Int64Rules_GreaterThan = 0 +const Int64Rules_Gt_case case_Int64Rules_GreaterThan = 4 +const Int64Rules_Gte_case case_Int64Rules_GreaterThan = 5 + +func (x *Int64Rules) WhichGreaterThan() case_Int64Rules_GreaterThan { + if x == nil { + return Int64Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *int64Rules_Gt: + return Int64Rules_Gt_case + case *int64Rules_Gte: + return Int64Rules_Gte_case + default: + return Int64Rules_GreaterThan_not_set_case + } +} + +type Int64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // value must equal 42 + // int64 value = 1 [(buf.validate.field).int64.const = 42]; + // } + // + // ``` + Const *int64 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than 10 + // int64 value = 1 [(buf.validate.field).int64.lt = 10]; + // } + // + // ``` + Lt *int64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than or equal to 10 + // int64 value = 1 [(buf.validate.field).int64.lte = 10]; + // } + // + // ``` + Lte *int64 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than 5 [int64.gt] + // int64 value = 1 [(buf.validate.field).int64.gt = 5]; + // + // // must be greater than 5 and less than 10 [int64.gt_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int64.gt_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than or equal to 5 [int64.gte] + // int64 value = 1 [(buf.validate.field).int64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int64.gte_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int64 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyInt64 { + // // must be in list [1, 2, 3] + // int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyInt64 { + // // value must not be in list [1, 2, 3] + // int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyInt64 { + // int64 value = 1 [ + // (buf.validate.field).int64.example = 1, + // (buf.validate.field).int64.example = -10 + // ]; + // } + // + // ``` + Example []int64 +} + +func (b0 Int64Rules_builder) Build() *Int64Rules { + m0 := &Int64Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &int64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &int64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &int64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &int64Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_Int64Rules_LessThan protoreflect.FieldNumber + +func (x case_Int64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[9].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Int64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Int64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[9].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isInt64Rules_LessThan interface { + isInt64Rules_LessThan() +} + +type int64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than 10 + // int64 value = 1 [(buf.validate.field).int64.lt = 10]; + // } + // + // ``` + Lt int64 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type int64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be less than or equal to 10 + // int64 value = 1 [(buf.validate.field).int64.lte = 10]; + // } + // + // ``` + Lte int64 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*int64Rules_Lt) isInt64Rules_LessThan() {} + +func (*int64Rules_Lte) isInt64Rules_LessThan() {} + +type isInt64Rules_GreaterThan interface { + isInt64Rules_GreaterThan() +} + +type int64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than 5 [int64.gt] + // int64 value = 1 [(buf.validate.field).int64.gt = 5]; + // + // // must be greater than 5 and less than 10 [int64.gt_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [int64.gt_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int64 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type int64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyInt64 { + // // must be greater than or equal to 5 [int64.gte] + // int64 value = 1 [(buf.validate.field).int64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [int64.gte_lt] + // int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive] + // int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int64 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*int64Rules_Gt) isInt64Rules_GreaterThan() {} + +func (*int64Rules_Gte) isInt64Rules_GreaterThan() {} + +// UInt32Rules describes the rules applied to `uint32` values. These +// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type. +type UInt32Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const uint32 `protobuf:"varint,1,opt,name=const"` + xxx_hidden_LessThan isUInt32Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isUInt32Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []uint32 `protobuf:"varint,6,rep,name=in"` + xxx_hidden_NotIn []uint32 `protobuf:"varint,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []uint32 `protobuf:"varint,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UInt32Rules) Reset() { + *x = UInt32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UInt32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UInt32Rules) ProtoMessage() {} + +func (x *UInt32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *UInt32Rules) GetConst() uint32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *UInt32Rules) GetLt() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*uInt32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *UInt32Rules) GetLte() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*uInt32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *UInt32Rules) GetGt() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*uInt32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *UInt32Rules) GetGte() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*uInt32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *UInt32Rules) GetIn() []uint32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *UInt32Rules) GetNotIn() []uint32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *UInt32Rules) GetExample() []uint32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *UInt32Rules) SetConst(v uint32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *UInt32Rules) SetLt(v uint32) { + x.xxx_hidden_LessThan = &uInt32Rules_Lt{v} +} + +func (x *UInt32Rules) SetLte(v uint32) { + x.xxx_hidden_LessThan = &uInt32Rules_Lte{v} +} + +func (x *UInt32Rules) SetGt(v uint32) { + x.xxx_hidden_GreaterThan = &uInt32Rules_Gt{v} +} + +func (x *UInt32Rules) SetGte(v uint32) { + x.xxx_hidden_GreaterThan = &uInt32Rules_Gte{v} +} + +func (x *UInt32Rules) SetIn(v []uint32) { + x.xxx_hidden_In = v +} + +func (x *UInt32Rules) SetNotIn(v []uint32) { + x.xxx_hidden_NotIn = v +} + +func (x *UInt32Rules) SetExample(v []uint32) { + x.xxx_hidden_Example = v +} + +func (x *UInt32Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *UInt32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *UInt32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*uInt32Rules_Lt) + return ok +} + +func (x *UInt32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*uInt32Rules_Lte) + return ok +} + +func (x *UInt32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *UInt32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*uInt32Rules_Gt) + return ok +} + +func (x *UInt32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*uInt32Rules_Gte) + return ok +} + +func (x *UInt32Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *UInt32Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *UInt32Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*uInt32Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *UInt32Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*uInt32Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *UInt32Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *UInt32Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*uInt32Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *UInt32Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*uInt32Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const UInt32Rules_LessThan_not_set_case case_UInt32Rules_LessThan = 0 +const UInt32Rules_Lt_case case_UInt32Rules_LessThan = 2 +const UInt32Rules_Lte_case case_UInt32Rules_LessThan = 3 + +func (x *UInt32Rules) WhichLessThan() case_UInt32Rules_LessThan { + if x == nil { + return UInt32Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *uInt32Rules_Lt: + return UInt32Rules_Lt_case + case *uInt32Rules_Lte: + return UInt32Rules_Lte_case + default: + return UInt32Rules_LessThan_not_set_case + } +} + +const UInt32Rules_GreaterThan_not_set_case case_UInt32Rules_GreaterThan = 0 +const UInt32Rules_Gt_case case_UInt32Rules_GreaterThan = 4 +const UInt32Rules_Gte_case case_UInt32Rules_GreaterThan = 5 + +func (x *UInt32Rules) WhichGreaterThan() case_UInt32Rules_GreaterThan { + if x == nil { + return UInt32Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *uInt32Rules_Gt: + return UInt32Rules_Gt_case + case *uInt32Rules_Gte: + return UInt32Rules_Gte_case + default: + return UInt32Rules_GreaterThan_not_set_case + } +} + +type UInt32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // value must equal 42 + // uint32 value = 1 [(buf.validate.field).uint32.const = 42]; + // } + // + // ``` + Const *uint32 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than 10 + // uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; + // } + // + // ``` + Lt *uint32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than or equal to 10 + // uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; + // } + // + // ``` + Lte *uint32 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than 5 [uint32.gt] + // uint32 value = 1 [(buf.validate.field).uint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint32.gt_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than or equal to 5 [uint32.gte] + // uint32 value = 1 [(buf.validate.field).uint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint32.gte_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint32 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyUInt32 { + // // must be in list [1, 2, 3] + // uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyUInt32 { + // // value must not be in list [1, 2, 3] + // uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyUInt32 { + // uint32 value = 1 [ + // (buf.validate.field).uint32.example = 1, + // (buf.validate.field).uint32.example = 10 + // ]; + // } + // + // ``` + Example []uint32 +} + +func (b0 UInt32Rules_builder) Build() *UInt32Rules { + m0 := &UInt32Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &uInt32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &uInt32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &uInt32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &uInt32Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_UInt32Rules_LessThan protoreflect.FieldNumber + +func (x case_UInt32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[10].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_UInt32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_UInt32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[10].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isUInt32Rules_LessThan interface { + isUInt32Rules_LessThan() +} + +type uInt32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than 10 + // uint32 value = 1 [(buf.validate.field).uint32.lt = 10]; + // } + // + // ``` + Lt uint32 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type uInt32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be less than or equal to 10 + // uint32 value = 1 [(buf.validate.field).uint32.lte = 10]; + // } + // + // ``` + Lte uint32 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*uInt32Rules_Lt) isUInt32Rules_LessThan() {} + +func (*uInt32Rules_Lte) isUInt32Rules_LessThan() {} + +type isUInt32Rules_GreaterThan interface { + isUInt32Rules_GreaterThan() +} + +type uInt32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than 5 [uint32.gt] + // uint32 value = 1 [(buf.validate.field).uint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint32.gt_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint32 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type uInt32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt32 { + // // must be greater than or equal to 5 [uint32.gte] + // uint32 value = 1 [(buf.validate.field).uint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint32.gte_lt] + // uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive] + // uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint32 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*uInt32Rules_Gt) isUInt32Rules_GreaterThan() {} + +func (*uInt32Rules_Gte) isUInt32Rules_GreaterThan() {} + +// UInt64Rules describes the rules applied to `uint64` values. These +// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type. +type UInt64Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const uint64 `protobuf:"varint,1,opt,name=const"` + xxx_hidden_LessThan isUInt64Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isUInt64Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []uint64 `protobuf:"varint,6,rep,name=in"` + xxx_hidden_NotIn []uint64 `protobuf:"varint,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []uint64 `protobuf:"varint,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UInt64Rules) Reset() { + *x = UInt64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UInt64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UInt64Rules) ProtoMessage() {} + +func (x *UInt64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *UInt64Rules) GetConst() uint64 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *UInt64Rules) GetLt() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*uInt64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *UInt64Rules) GetLte() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*uInt64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *UInt64Rules) GetGt() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*uInt64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *UInt64Rules) GetGte() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*uInt64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *UInt64Rules) GetIn() []uint64 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *UInt64Rules) GetNotIn() []uint64 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *UInt64Rules) GetExample() []uint64 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *UInt64Rules) SetConst(v uint64) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *UInt64Rules) SetLt(v uint64) { + x.xxx_hidden_LessThan = &uInt64Rules_Lt{v} +} + +func (x *UInt64Rules) SetLte(v uint64) { + x.xxx_hidden_LessThan = &uInt64Rules_Lte{v} +} + +func (x *UInt64Rules) SetGt(v uint64) { + x.xxx_hidden_GreaterThan = &uInt64Rules_Gt{v} +} + +func (x *UInt64Rules) SetGte(v uint64) { + x.xxx_hidden_GreaterThan = &uInt64Rules_Gte{v} +} + +func (x *UInt64Rules) SetIn(v []uint64) { + x.xxx_hidden_In = v +} + +func (x *UInt64Rules) SetNotIn(v []uint64) { + x.xxx_hidden_NotIn = v +} + +func (x *UInt64Rules) SetExample(v []uint64) { + x.xxx_hidden_Example = v +} + +func (x *UInt64Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *UInt64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *UInt64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*uInt64Rules_Lt) + return ok +} + +func (x *UInt64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*uInt64Rules_Lte) + return ok +} + +func (x *UInt64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *UInt64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*uInt64Rules_Gt) + return ok +} + +func (x *UInt64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*uInt64Rules_Gte) + return ok +} + +func (x *UInt64Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *UInt64Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *UInt64Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*uInt64Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *UInt64Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*uInt64Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *UInt64Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *UInt64Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*uInt64Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *UInt64Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*uInt64Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const UInt64Rules_LessThan_not_set_case case_UInt64Rules_LessThan = 0 +const UInt64Rules_Lt_case case_UInt64Rules_LessThan = 2 +const UInt64Rules_Lte_case case_UInt64Rules_LessThan = 3 + +func (x *UInt64Rules) WhichLessThan() case_UInt64Rules_LessThan { + if x == nil { + return UInt64Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *uInt64Rules_Lt: + return UInt64Rules_Lt_case + case *uInt64Rules_Lte: + return UInt64Rules_Lte_case + default: + return UInt64Rules_LessThan_not_set_case + } +} + +const UInt64Rules_GreaterThan_not_set_case case_UInt64Rules_GreaterThan = 0 +const UInt64Rules_Gt_case case_UInt64Rules_GreaterThan = 4 +const UInt64Rules_Gte_case case_UInt64Rules_GreaterThan = 5 + +func (x *UInt64Rules) WhichGreaterThan() case_UInt64Rules_GreaterThan { + if x == nil { + return UInt64Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *uInt64Rules_Gt: + return UInt64Rules_Gt_case + case *uInt64Rules_Gte: + return UInt64Rules_Gte_case + default: + return UInt64Rules_GreaterThan_not_set_case + } +} + +type UInt64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // value must equal 42 + // uint64 value = 1 [(buf.validate.field).uint64.const = 42]; + // } + // + // ``` + Const *uint64 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than 10 + // uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; + // } + // + // ``` + Lt *uint64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than or equal to 10 + // uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; + // } + // + // ``` + Lte *uint64 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than 5 [uint64.gt] + // uint64 value = 1 [(buf.validate.field).uint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint64.gt_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than or equal to 5 [uint64.gte] + // uint64 value = 1 [(buf.validate.field).uint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint64.gte_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint64 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyUInt64 { + // // must be in list [1, 2, 3] + // uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyUInt64 { + // // value must not be in list [1, 2, 3] + // uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyUInt64 { + // uint64 value = 1 [ + // (buf.validate.field).uint64.example = 1, + // (buf.validate.field).uint64.example = -10 + // ]; + // } + // + // ``` + Example []uint64 +} + +func (b0 UInt64Rules_builder) Build() *UInt64Rules { + m0 := &UInt64Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &uInt64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &uInt64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &uInt64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &uInt64Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_UInt64Rules_LessThan protoreflect.FieldNumber + +func (x case_UInt64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[11].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_UInt64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_UInt64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[11].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isUInt64Rules_LessThan interface { + isUInt64Rules_LessThan() +} + +type uInt64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than 10 + // uint64 value = 1 [(buf.validate.field).uint64.lt = 10]; + // } + // + // ``` + Lt uint64 `protobuf:"varint,2,opt,name=lt,oneof"` +} + +type uInt64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be less than or equal to 10 + // uint64 value = 1 [(buf.validate.field).uint64.lte = 10]; + // } + // + // ``` + Lte uint64 `protobuf:"varint,3,opt,name=lte,oneof"` +} + +func (*uInt64Rules_Lt) isUInt64Rules_LessThan() {} + +func (*uInt64Rules_Lte) isUInt64Rules_LessThan() {} + +type isUInt64Rules_GreaterThan interface { + isUInt64Rules_GreaterThan() +} + +type uInt64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than 5 [uint64.gt] + // uint64 value = 1 [(buf.validate.field).uint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [uint64.gt_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint64 `protobuf:"varint,4,opt,name=gt,oneof"` +} + +type uInt64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyUInt64 { + // // must be greater than or equal to 5 [uint64.gte] + // uint64 value = 1 [(buf.validate.field).uint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [uint64.gte_lt] + // uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive] + // uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint64 `protobuf:"varint,5,opt,name=gte,oneof"` +} + +func (*uInt64Rules_Gt) isUInt64Rules_GreaterThan() {} + +func (*uInt64Rules_Gte) isUInt64Rules_GreaterThan() {} + +// SInt32Rules describes the rules applied to `sint32` values. +type SInt32Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int32 `protobuf:"zigzag32,1,opt,name=const"` + xxx_hidden_LessThan isSInt32Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isSInt32Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []int32 `protobuf:"zigzag32,6,rep,name=in"` + xxx_hidden_NotIn []int32 `protobuf:"zigzag32,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int32 `protobuf:"zigzag32,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SInt32Rules) Reset() { + *x = SInt32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SInt32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SInt32Rules) ProtoMessage() {} + +func (x *SInt32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SInt32Rules) GetConst() int32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *SInt32Rules) GetLt() int32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sInt32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SInt32Rules) GetLte() int32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sInt32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SInt32Rules) GetGt() int32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sInt32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SInt32Rules) GetGte() int32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sInt32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SInt32Rules) GetIn() []int32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *SInt32Rules) GetNotIn() []int32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *SInt32Rules) GetExample() []int32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *SInt32Rules) SetConst(v int32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *SInt32Rules) SetLt(v int32) { + x.xxx_hidden_LessThan = &sInt32Rules_Lt{v} +} + +func (x *SInt32Rules) SetLte(v int32) { + x.xxx_hidden_LessThan = &sInt32Rules_Lte{v} +} + +func (x *SInt32Rules) SetGt(v int32) { + x.xxx_hidden_GreaterThan = &sInt32Rules_Gt{v} +} + +func (x *SInt32Rules) SetGte(v int32) { + x.xxx_hidden_GreaterThan = &sInt32Rules_Gte{v} +} + +func (x *SInt32Rules) SetIn(v []int32) { + x.xxx_hidden_In = v +} + +func (x *SInt32Rules) SetNotIn(v []int32) { + x.xxx_hidden_NotIn = v +} + +func (x *SInt32Rules) SetExample(v []int32) { + x.xxx_hidden_Example = v +} + +func (x *SInt32Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SInt32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *SInt32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sInt32Rules_Lt) + return ok +} + +func (x *SInt32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sInt32Rules_Lte) + return ok +} + +func (x *SInt32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *SInt32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sInt32Rules_Gt) + return ok +} + +func (x *SInt32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sInt32Rules_Gte) + return ok +} + +func (x *SInt32Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *SInt32Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *SInt32Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*sInt32Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SInt32Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*sInt32Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SInt32Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *SInt32Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*sInt32Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *SInt32Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*sInt32Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const SInt32Rules_LessThan_not_set_case case_SInt32Rules_LessThan = 0 +const SInt32Rules_Lt_case case_SInt32Rules_LessThan = 2 +const SInt32Rules_Lte_case case_SInt32Rules_LessThan = 3 + +func (x *SInt32Rules) WhichLessThan() case_SInt32Rules_LessThan { + if x == nil { + return SInt32Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *sInt32Rules_Lt: + return SInt32Rules_Lt_case + case *sInt32Rules_Lte: + return SInt32Rules_Lte_case + default: + return SInt32Rules_LessThan_not_set_case + } +} + +const SInt32Rules_GreaterThan_not_set_case case_SInt32Rules_GreaterThan = 0 +const SInt32Rules_Gt_case case_SInt32Rules_GreaterThan = 4 +const SInt32Rules_Gte_case case_SInt32Rules_GreaterThan = 5 + +func (x *SInt32Rules) WhichGreaterThan() case_SInt32Rules_GreaterThan { + if x == nil { + return SInt32Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *sInt32Rules_Gt: + return SInt32Rules_Gt_case + case *sInt32Rules_Gte: + return SInt32Rules_Gte_case + default: + return SInt32Rules_GreaterThan_not_set_case + } +} + +type SInt32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // value must equal 42 + // sint32 value = 1 [(buf.validate.field).sint32.const = 42]; + // } + // + // ``` + Const *int32 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than 10 + // sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; + // } + // + // ``` + Lt *int32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than or equal to 10 + // sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; + // } + // + // ``` + Lte *int32 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than 5 [sint32.gt] + // sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint32.gt_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than or equal to 5 [sint32.gte] + // sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint32.gte_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int32 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySInt32 { + // // must be in list [1, 2, 3] + // sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySInt32 { + // // value must not be in list [1, 2, 3] + // sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySInt32 { + // sint32 value = 1 [ + // (buf.validate.field).sint32.example = 1, + // (buf.validate.field).sint32.example = -10 + // ]; + // } + // + // ``` + Example []int32 +} + +func (b0 SInt32Rules_builder) Build() *SInt32Rules { + m0 := &SInt32Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &sInt32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &sInt32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &sInt32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &sInt32Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_SInt32Rules_LessThan protoreflect.FieldNumber + +func (x case_SInt32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[12].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SInt32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SInt32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[12].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSInt32Rules_LessThan interface { + isSInt32Rules_LessThan() +} + +type sInt32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than 10 + // sint32 value = 1 [(buf.validate.field).sint32.lt = 10]; + // } + // + // ``` + Lt int32 `protobuf:"zigzag32,2,opt,name=lt,oneof"` +} + +type sInt32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be less than or equal to 10 + // sint32 value = 1 [(buf.validate.field).sint32.lte = 10]; + // } + // + // ``` + Lte int32 `protobuf:"zigzag32,3,opt,name=lte,oneof"` +} + +func (*sInt32Rules_Lt) isSInt32Rules_LessThan() {} + +func (*sInt32Rules_Lte) isSInt32Rules_LessThan() {} + +type isSInt32Rules_GreaterThan interface { + isSInt32Rules_GreaterThan() +} + +type sInt32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than 5 [sint32.gt] + // sint32 value = 1 [(buf.validate.field).sint32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint32.gt_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int32 `protobuf:"zigzag32,4,opt,name=gt,oneof"` +} + +type sInt32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt32 { + // // must be greater than or equal to 5 [sint32.gte] + // sint32 value = 1 [(buf.validate.field).sint32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint32.gte_lt] + // sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive] + // sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int32 `protobuf:"zigzag32,5,opt,name=gte,oneof"` +} + +func (*sInt32Rules_Gt) isSInt32Rules_GreaterThan() {} + +func (*sInt32Rules_Gte) isSInt32Rules_GreaterThan() {} + +// SInt64Rules describes the rules applied to `sint64` values. +type SInt64Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int64 `protobuf:"zigzag64,1,opt,name=const"` + xxx_hidden_LessThan isSInt64Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isSInt64Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []int64 `protobuf:"zigzag64,6,rep,name=in"` + xxx_hidden_NotIn []int64 `protobuf:"zigzag64,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int64 `protobuf:"zigzag64,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SInt64Rules) Reset() { + *x = SInt64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SInt64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SInt64Rules) ProtoMessage() {} + +func (x *SInt64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SInt64Rules) GetConst() int64 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *SInt64Rules) GetLt() int64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sInt64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SInt64Rules) GetLte() int64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sInt64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SInt64Rules) GetGt() int64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sInt64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SInt64Rules) GetGte() int64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sInt64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SInt64Rules) GetIn() []int64 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *SInt64Rules) GetNotIn() []int64 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *SInt64Rules) GetExample() []int64 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *SInt64Rules) SetConst(v int64) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *SInt64Rules) SetLt(v int64) { + x.xxx_hidden_LessThan = &sInt64Rules_Lt{v} +} + +func (x *SInt64Rules) SetLte(v int64) { + x.xxx_hidden_LessThan = &sInt64Rules_Lte{v} +} + +func (x *SInt64Rules) SetGt(v int64) { + x.xxx_hidden_GreaterThan = &sInt64Rules_Gt{v} +} + +func (x *SInt64Rules) SetGte(v int64) { + x.xxx_hidden_GreaterThan = &sInt64Rules_Gte{v} +} + +func (x *SInt64Rules) SetIn(v []int64) { + x.xxx_hidden_In = v +} + +func (x *SInt64Rules) SetNotIn(v []int64) { + x.xxx_hidden_NotIn = v +} + +func (x *SInt64Rules) SetExample(v []int64) { + x.xxx_hidden_Example = v +} + +func (x *SInt64Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SInt64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *SInt64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sInt64Rules_Lt) + return ok +} + +func (x *SInt64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sInt64Rules_Lte) + return ok +} + +func (x *SInt64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *SInt64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sInt64Rules_Gt) + return ok +} + +func (x *SInt64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sInt64Rules_Gte) + return ok +} + +func (x *SInt64Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *SInt64Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *SInt64Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*sInt64Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SInt64Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*sInt64Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SInt64Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *SInt64Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*sInt64Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *SInt64Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*sInt64Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const SInt64Rules_LessThan_not_set_case case_SInt64Rules_LessThan = 0 +const SInt64Rules_Lt_case case_SInt64Rules_LessThan = 2 +const SInt64Rules_Lte_case case_SInt64Rules_LessThan = 3 + +func (x *SInt64Rules) WhichLessThan() case_SInt64Rules_LessThan { + if x == nil { + return SInt64Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *sInt64Rules_Lt: + return SInt64Rules_Lt_case + case *sInt64Rules_Lte: + return SInt64Rules_Lte_case + default: + return SInt64Rules_LessThan_not_set_case + } +} + +const SInt64Rules_GreaterThan_not_set_case case_SInt64Rules_GreaterThan = 0 +const SInt64Rules_Gt_case case_SInt64Rules_GreaterThan = 4 +const SInt64Rules_Gte_case case_SInt64Rules_GreaterThan = 5 + +func (x *SInt64Rules) WhichGreaterThan() case_SInt64Rules_GreaterThan { + if x == nil { + return SInt64Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *sInt64Rules_Gt: + return SInt64Rules_Gt_case + case *sInt64Rules_Gte: + return SInt64Rules_Gte_case + default: + return SInt64Rules_GreaterThan_not_set_case + } +} + +type SInt64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // value must equal 42 + // sint64 value = 1 [(buf.validate.field).sint64.const = 42]; + // } + // + // ``` + Const *int64 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than 10 + // sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; + // } + // + // ``` + Lt *int64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than or equal to 10 + // sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; + // } + // + // ``` + Lte *int64 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than 5 [sint64.gt] + // sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint64.gt_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than or equal to 5 [sint64.gte] + // sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int64 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MySInt64 { + // // must be in list [1, 2, 3] + // sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySInt64 { + // // value must not be in list [1, 2, 3] + // sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySInt64 { + // sint64 value = 1 [ + // (buf.validate.field).sint64.example = 1, + // (buf.validate.field).sint64.example = -10 + // ]; + // } + // + // ``` + Example []int64 +} + +func (b0 SInt64Rules_builder) Build() *SInt64Rules { + m0 := &SInt64Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &sInt64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &sInt64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &sInt64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &sInt64Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_SInt64Rules_LessThan protoreflect.FieldNumber + +func (x case_SInt64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[13].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SInt64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SInt64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[13].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSInt64Rules_LessThan interface { + isSInt64Rules_LessThan() +} + +type sInt64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field + // < value). If the field value is equal to or greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than 10 + // sint64 value = 1 [(buf.validate.field).sint64.lt = 10]; + // } + // + // ``` + Lt int64 `protobuf:"zigzag64,2,opt,name=lt,oneof"` +} + +type sInt64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be less than or equal to 10 + // sint64 value = 1 [(buf.validate.field).sint64.lte = 10]; + // } + // + // ``` + Lte int64 `protobuf:"zigzag64,3,opt,name=lte,oneof"` +} + +func (*sInt64Rules_Lt) isSInt64Rules_LessThan() {} + +func (*sInt64Rules_Lte) isSInt64Rules_LessThan() {} + +type isSInt64Rules_GreaterThan interface { + isSInt64Rules_GreaterThan() +} + +type sInt64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than 5 [sint64.gt] + // sint64 value = 1 [(buf.validate.field).sint64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sint64.gt_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int64 `protobuf:"zigzag64,4,opt,name=gt,oneof"` +} + +type sInt64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySInt64 { + // // must be greater than or equal to 5 [sint64.gte] + // sint64 value = 1 [(buf.validate.field).sint64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sint64.gte_lt] + // sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive] + // sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int64 `protobuf:"zigzag64,5,opt,name=gte,oneof"` +} + +func (*sInt64Rules_Gt) isSInt64Rules_GreaterThan() {} + +func (*sInt64Rules_Gte) isSInt64Rules_GreaterThan() {} + +// Fixed32Rules describes the rules applied to `fixed32` values. +type Fixed32Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const uint32 `protobuf:"fixed32,1,opt,name=const"` + xxx_hidden_LessThan isFixed32Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isFixed32Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []uint32 `protobuf:"fixed32,6,rep,name=in"` + xxx_hidden_NotIn []uint32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []uint32 `protobuf:"fixed32,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Fixed32Rules) Reset() { + *x = Fixed32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Fixed32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Fixed32Rules) ProtoMessage() {} + +func (x *Fixed32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Fixed32Rules) GetConst() uint32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *Fixed32Rules) GetLt() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*fixed32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Fixed32Rules) GetLte() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*fixed32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Fixed32Rules) GetGt() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*fixed32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Fixed32Rules) GetGte() uint32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*fixed32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Fixed32Rules) GetIn() []uint32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *Fixed32Rules) GetNotIn() []uint32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *Fixed32Rules) GetExample() []uint32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *Fixed32Rules) SetConst(v uint32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *Fixed32Rules) SetLt(v uint32) { + x.xxx_hidden_LessThan = &fixed32Rules_Lt{v} +} + +func (x *Fixed32Rules) SetLte(v uint32) { + x.xxx_hidden_LessThan = &fixed32Rules_Lte{v} +} + +func (x *Fixed32Rules) SetGt(v uint32) { + x.xxx_hidden_GreaterThan = &fixed32Rules_Gt{v} +} + +func (x *Fixed32Rules) SetGte(v uint32) { + x.xxx_hidden_GreaterThan = &fixed32Rules_Gte{v} +} + +func (x *Fixed32Rules) SetIn(v []uint32) { + x.xxx_hidden_In = v +} + +func (x *Fixed32Rules) SetNotIn(v []uint32) { + x.xxx_hidden_NotIn = v +} + +func (x *Fixed32Rules) SetExample(v []uint32) { + x.xxx_hidden_Example = v +} + +func (x *Fixed32Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Fixed32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *Fixed32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*fixed32Rules_Lt) + return ok +} + +func (x *Fixed32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*fixed32Rules_Lte) + return ok +} + +func (x *Fixed32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *Fixed32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*fixed32Rules_Gt) + return ok +} + +func (x *Fixed32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*fixed32Rules_Gte) + return ok +} + +func (x *Fixed32Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *Fixed32Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *Fixed32Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*fixed32Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Fixed32Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*fixed32Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Fixed32Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *Fixed32Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*fixed32Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *Fixed32Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*fixed32Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const Fixed32Rules_LessThan_not_set_case case_Fixed32Rules_LessThan = 0 +const Fixed32Rules_Lt_case case_Fixed32Rules_LessThan = 2 +const Fixed32Rules_Lte_case case_Fixed32Rules_LessThan = 3 + +func (x *Fixed32Rules) WhichLessThan() case_Fixed32Rules_LessThan { + if x == nil { + return Fixed32Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *fixed32Rules_Lt: + return Fixed32Rules_Lt_case + case *fixed32Rules_Lte: + return Fixed32Rules_Lte_case + default: + return Fixed32Rules_LessThan_not_set_case + } +} + +const Fixed32Rules_GreaterThan_not_set_case case_Fixed32Rules_GreaterThan = 0 +const Fixed32Rules_Gt_case case_Fixed32Rules_GreaterThan = 4 +const Fixed32Rules_Gte_case case_Fixed32Rules_GreaterThan = 5 + +func (x *Fixed32Rules) WhichGreaterThan() case_Fixed32Rules_GreaterThan { + if x == nil { + return Fixed32Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *fixed32Rules_Gt: + return Fixed32Rules_Gt_case + case *fixed32Rules_Gte: + return Fixed32Rules_Gte_case + default: + return Fixed32Rules_GreaterThan_not_set_case + } +} + +type Fixed32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // value must equal 42 + // fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; + // } + // + // ``` + Const *uint32 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; + // } + // + // ``` + Lt *uint32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than or equal to 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; + // } + // + // ``` + Lte *uint32 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than 5 [fixed32.gt] + // fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed32.gt_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than or equal to 5 [fixed32.gte] + // fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint32 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message + // is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be in list [1, 2, 3] + // fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFixed32 { + // // value must not be in list [1, 2, 3] + // fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFixed32 { + // fixed32 value = 1 [ + // (buf.validate.field).fixed32.example = 1, + // (buf.validate.field).fixed32.example = 2 + // ]; + // } + // + // ``` + Example []uint32 +} + +func (b0 Fixed32Rules_builder) Build() *Fixed32Rules { + m0 := &Fixed32Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &fixed32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &fixed32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &fixed32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &fixed32Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_Fixed32Rules_LessThan protoreflect.FieldNumber + +func (x case_Fixed32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[14].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Fixed32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Fixed32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[14].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFixed32Rules_LessThan interface { + isFixed32Rules_LessThan() +} + +type fixed32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10]; + // } + // + // ``` + Lt uint32 `protobuf:"fixed32,2,opt,name=lt,oneof"` +} + +type fixed32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be less than or equal to 10 + // fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10]; + // } + // + // ``` + Lte uint32 `protobuf:"fixed32,3,opt,name=lte,oneof"` +} + +func (*fixed32Rules_Lt) isFixed32Rules_LessThan() {} + +func (*fixed32Rules_Lte) isFixed32Rules_LessThan() {} + +type isFixed32Rules_GreaterThan interface { + isFixed32Rules_GreaterThan() +} + +type fixed32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than 5 [fixed32.gt] + // fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed32.gt_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint32 `protobuf:"fixed32,4,opt,name=gt,oneof"` +} + +type fixed32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed32 { + // // must be greater than or equal to 5 [fixed32.gte] + // fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt] + // fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive] + // fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint32 `protobuf:"fixed32,5,opt,name=gte,oneof"` +} + +func (*fixed32Rules_Gt) isFixed32Rules_GreaterThan() {} + +func (*fixed32Rules_Gte) isFixed32Rules_GreaterThan() {} + +// Fixed64Rules describes the rules applied to `fixed64` values. +type Fixed64Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const uint64 `protobuf:"fixed64,1,opt,name=const"` + xxx_hidden_LessThan isFixed64Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isFixed64Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []uint64 `protobuf:"fixed64,6,rep,name=in"` + xxx_hidden_NotIn []uint64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []uint64 `protobuf:"fixed64,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Fixed64Rules) Reset() { + *x = Fixed64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Fixed64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Fixed64Rules) ProtoMessage() {} + +func (x *Fixed64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Fixed64Rules) GetConst() uint64 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *Fixed64Rules) GetLt() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*fixed64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *Fixed64Rules) GetLte() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*fixed64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *Fixed64Rules) GetGt() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*fixed64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *Fixed64Rules) GetGte() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*fixed64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *Fixed64Rules) GetIn() []uint64 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *Fixed64Rules) GetNotIn() []uint64 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *Fixed64Rules) GetExample() []uint64 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *Fixed64Rules) SetConst(v uint64) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *Fixed64Rules) SetLt(v uint64) { + x.xxx_hidden_LessThan = &fixed64Rules_Lt{v} +} + +func (x *Fixed64Rules) SetLte(v uint64) { + x.xxx_hidden_LessThan = &fixed64Rules_Lte{v} +} + +func (x *Fixed64Rules) SetGt(v uint64) { + x.xxx_hidden_GreaterThan = &fixed64Rules_Gt{v} +} + +func (x *Fixed64Rules) SetGte(v uint64) { + x.xxx_hidden_GreaterThan = &fixed64Rules_Gte{v} +} + +func (x *Fixed64Rules) SetIn(v []uint64) { + x.xxx_hidden_In = v +} + +func (x *Fixed64Rules) SetNotIn(v []uint64) { + x.xxx_hidden_NotIn = v +} + +func (x *Fixed64Rules) SetExample(v []uint64) { + x.xxx_hidden_Example = v +} + +func (x *Fixed64Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *Fixed64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *Fixed64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*fixed64Rules_Lt) + return ok +} + +func (x *Fixed64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*fixed64Rules_Lte) + return ok +} + +func (x *Fixed64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *Fixed64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*fixed64Rules_Gt) + return ok +} + +func (x *Fixed64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*fixed64Rules_Gte) + return ok +} + +func (x *Fixed64Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *Fixed64Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *Fixed64Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*fixed64Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Fixed64Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*fixed64Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *Fixed64Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *Fixed64Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*fixed64Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *Fixed64Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*fixed64Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const Fixed64Rules_LessThan_not_set_case case_Fixed64Rules_LessThan = 0 +const Fixed64Rules_Lt_case case_Fixed64Rules_LessThan = 2 +const Fixed64Rules_Lte_case case_Fixed64Rules_LessThan = 3 + +func (x *Fixed64Rules) WhichLessThan() case_Fixed64Rules_LessThan { + if x == nil { + return Fixed64Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *fixed64Rules_Lt: + return Fixed64Rules_Lt_case + case *fixed64Rules_Lte: + return Fixed64Rules_Lte_case + default: + return Fixed64Rules_LessThan_not_set_case + } +} + +const Fixed64Rules_GreaterThan_not_set_case case_Fixed64Rules_GreaterThan = 0 +const Fixed64Rules_Gt_case case_Fixed64Rules_GreaterThan = 4 +const Fixed64Rules_Gte_case case_Fixed64Rules_GreaterThan = 5 + +func (x *Fixed64Rules) WhichGreaterThan() case_Fixed64Rules_GreaterThan { + if x == nil { + return Fixed64Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *fixed64Rules_Gt: + return Fixed64Rules_Gt_case + case *fixed64Rules_Gte: + return Fixed64Rules_Gte_case + default: + return Fixed64Rules_GreaterThan_not_set_case + } +} + +type Fixed64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // value must equal 42 + // fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; + // } + // + // ``` + Const *uint64 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; + // } + // + // ``` + Lt *uint64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than or equal to 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; + // } + // + // ``` + Lte *uint64 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than 5 [fixed64.gt] + // fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed64.gt_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *uint64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than or equal to 5 [fixed64.gte] + // fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *uint64 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyFixed64 { + // // must be in list [1, 2, 3] + // fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []uint64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyFixed64 { + // // value must not be in list [1, 2, 3] + // fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []uint64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFixed64 { + // fixed64 value = 1 [ + // (buf.validate.field).fixed64.example = 1, + // (buf.validate.field).fixed64.example = 2 + // ]; + // } + // + // ``` + Example []uint64 +} + +func (b0 Fixed64Rules_builder) Build() *Fixed64Rules { + m0 := &Fixed64Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &fixed64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &fixed64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &fixed64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &fixed64Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_Fixed64Rules_LessThan protoreflect.FieldNumber + +func (x case_Fixed64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_Fixed64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_Fixed64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[15].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFixed64Rules_LessThan interface { + isFixed64Rules_LessThan() +} + +type fixed64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10]; + // } + // + // ``` + Lt uint64 `protobuf:"fixed64,2,opt,name=lt,oneof"` +} + +type fixed64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be less than or equal to 10 + // fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10]; + // } + // + // ``` + Lte uint64 `protobuf:"fixed64,3,opt,name=lte,oneof"` +} + +func (*fixed64Rules_Lt) isFixed64Rules_LessThan() {} + +func (*fixed64Rules_Lte) isFixed64Rules_LessThan() {} + +type isFixed64Rules_GreaterThan interface { + isFixed64Rules_GreaterThan() +} + +type fixed64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than 5 [fixed64.gt] + // fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [fixed64.gt_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt uint64 `protobuf:"fixed64,4,opt,name=gt,oneof"` +} + +type fixed64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyFixed64 { + // // must be greater than or equal to 5 [fixed64.gte] + // fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt] + // fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive] + // fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte uint64 `protobuf:"fixed64,5,opt,name=gte,oneof"` +} + +func (*fixed64Rules_Gt) isFixed64Rules_GreaterThan() {} + +func (*fixed64Rules_Gte) isFixed64Rules_GreaterThan() {} + +// SFixed32Rules describes the rules applied to `fixed32` values. +type SFixed32Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int32 `protobuf:"fixed32,1,opt,name=const"` + xxx_hidden_LessThan isSFixed32Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isSFixed32Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []int32 `protobuf:"fixed32,6,rep,name=in"` + xxx_hidden_NotIn []int32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int32 `protobuf:"fixed32,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SFixed32Rules) Reset() { + *x = SFixed32Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SFixed32Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SFixed32Rules) ProtoMessage() {} + +func (x *SFixed32Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SFixed32Rules) GetConst() int32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *SFixed32Rules) GetLt() int32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sFixed32Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SFixed32Rules) GetLte() int32 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sFixed32Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SFixed32Rules) GetGt() int32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sFixed32Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SFixed32Rules) GetGte() int32 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sFixed32Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SFixed32Rules) GetIn() []int32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *SFixed32Rules) GetNotIn() []int32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *SFixed32Rules) GetExample() []int32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *SFixed32Rules) SetConst(v int32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *SFixed32Rules) SetLt(v int32) { + x.xxx_hidden_LessThan = &sFixed32Rules_Lt{v} +} + +func (x *SFixed32Rules) SetLte(v int32) { + x.xxx_hidden_LessThan = &sFixed32Rules_Lte{v} +} + +func (x *SFixed32Rules) SetGt(v int32) { + x.xxx_hidden_GreaterThan = &sFixed32Rules_Gt{v} +} + +func (x *SFixed32Rules) SetGte(v int32) { + x.xxx_hidden_GreaterThan = &sFixed32Rules_Gte{v} +} + +func (x *SFixed32Rules) SetIn(v []int32) { + x.xxx_hidden_In = v +} + +func (x *SFixed32Rules) SetNotIn(v []int32) { + x.xxx_hidden_NotIn = v +} + +func (x *SFixed32Rules) SetExample(v []int32) { + x.xxx_hidden_Example = v +} + +func (x *SFixed32Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SFixed32Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *SFixed32Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sFixed32Rules_Lt) + return ok +} + +func (x *SFixed32Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sFixed32Rules_Lte) + return ok +} + +func (x *SFixed32Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *SFixed32Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sFixed32Rules_Gt) + return ok +} + +func (x *SFixed32Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sFixed32Rules_Gte) + return ok +} + +func (x *SFixed32Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *SFixed32Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *SFixed32Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*sFixed32Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SFixed32Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*sFixed32Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SFixed32Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *SFixed32Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*sFixed32Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *SFixed32Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*sFixed32Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const SFixed32Rules_LessThan_not_set_case case_SFixed32Rules_LessThan = 0 +const SFixed32Rules_Lt_case case_SFixed32Rules_LessThan = 2 +const SFixed32Rules_Lte_case case_SFixed32Rules_LessThan = 3 + +func (x *SFixed32Rules) WhichLessThan() case_SFixed32Rules_LessThan { + if x == nil { + return SFixed32Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *sFixed32Rules_Lt: + return SFixed32Rules_Lt_case + case *sFixed32Rules_Lte: + return SFixed32Rules_Lte_case + default: + return SFixed32Rules_LessThan_not_set_case + } +} + +const SFixed32Rules_GreaterThan_not_set_case case_SFixed32Rules_GreaterThan = 0 +const SFixed32Rules_Gt_case case_SFixed32Rules_GreaterThan = 4 +const SFixed32Rules_Gte_case case_SFixed32Rules_GreaterThan = 5 + +func (x *SFixed32Rules) WhichGreaterThan() case_SFixed32Rules_GreaterThan { + if x == nil { + return SFixed32Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *sFixed32Rules_Gt: + return SFixed32Rules_Gt_case + case *sFixed32Rules_Gte: + return SFixed32Rules_Gte_case + default: + return SFixed32Rules_GreaterThan_not_set_case + } +} + +type SFixed32Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // value must equal 42 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; + // } + // + // ``` + Const *int32 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; + // } + // + // ``` + Lt *int32 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than or equal to 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; + // } + // + // ``` + Lte *int32 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than 5 [sfixed32.gt] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed32.gt_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int32 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than or equal to 5 [sfixed32.gte] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int32 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySFixed32 { + // // must be in list [1, 2, 3] + // sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySFixed32 { + // // value must not be in list [1, 2, 3] + // sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySFixed32 { + // sfixed32 value = 1 [ + // (buf.validate.field).sfixed32.example = 1, + // (buf.validate.field).sfixed32.example = 2 + // ]; + // } + // + // ``` + Example []int32 +} + +func (b0 SFixed32Rules_builder) Build() *SFixed32Rules { + m0 := &SFixed32Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &sFixed32Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &sFixed32Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &sFixed32Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &sFixed32Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_SFixed32Rules_LessThan protoreflect.FieldNumber + +func (x case_SFixed32Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[16].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SFixed32Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SFixed32Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[16].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSFixed32Rules_LessThan interface { + isSFixed32Rules_LessThan() +} + +type sFixed32Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10]; + // } + // + // ``` + Lt int32 `protobuf:"fixed32,2,opt,name=lt,oneof"` +} + +type sFixed32Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be less than or equal to 10 + // sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10]; + // } + // + // ``` + Lte int32 `protobuf:"fixed32,3,opt,name=lte,oneof"` +} + +func (*sFixed32Rules_Lt) isSFixed32Rules_LessThan() {} + +func (*sFixed32Rules_Lte) isSFixed32Rules_LessThan() {} + +type isSFixed32Rules_GreaterThan interface { + isSFixed32Rules_GreaterThan() +} + +type sFixed32Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than 5 [sfixed32.gt] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed32.gt_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int32 `protobuf:"fixed32,4,opt,name=gt,oneof"` +} + +type sFixed32Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed32 { + // // must be greater than or equal to 5 [sfixed32.gte] + // sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt] + // sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive] + // sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int32 `protobuf:"fixed32,5,opt,name=gte,oneof"` +} + +func (*sFixed32Rules_Gt) isSFixed32Rules_GreaterThan() {} + +func (*sFixed32Rules_Gte) isSFixed32Rules_GreaterThan() {} + +// SFixed64Rules describes the rules applied to `fixed64` values. +type SFixed64Rules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int64 `protobuf:"fixed64,1,opt,name=const"` + xxx_hidden_LessThan isSFixed64Rules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isSFixed64Rules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In []int64 `protobuf:"fixed64,6,rep,name=in"` + xxx_hidden_NotIn []int64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int64 `protobuf:"fixed64,8,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SFixed64Rules) Reset() { + *x = SFixed64Rules{} + mi := &file_buf_validate_validate_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SFixed64Rules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SFixed64Rules) ProtoMessage() {} + +func (x *SFixed64Rules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SFixed64Rules) GetConst() int64 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *SFixed64Rules) GetLt() int64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sFixed64Rules_Lt); ok { + return x.Lt + } + } + return 0 +} + +func (x *SFixed64Rules) GetLte() int64 { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*sFixed64Rules_Lte); ok { + return x.Lte + } + } + return 0 +} + +func (x *SFixed64Rules) GetGt() int64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sFixed64Rules_Gt); ok { + return x.Gt + } + } + return 0 +} + +func (x *SFixed64Rules) GetGte() int64 { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*sFixed64Rules_Gte); ok { + return x.Gte + } + } + return 0 +} + +func (x *SFixed64Rules) GetIn() []int64 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *SFixed64Rules) GetNotIn() []int64 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *SFixed64Rules) GetExample() []int64 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *SFixed64Rules) SetConst(v int64) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *SFixed64Rules) SetLt(v int64) { + x.xxx_hidden_LessThan = &sFixed64Rules_Lt{v} +} + +func (x *SFixed64Rules) SetLte(v int64) { + x.xxx_hidden_LessThan = &sFixed64Rules_Lte{v} +} + +func (x *SFixed64Rules) SetGt(v int64) { + x.xxx_hidden_GreaterThan = &sFixed64Rules_Gt{v} +} + +func (x *SFixed64Rules) SetGte(v int64) { + x.xxx_hidden_GreaterThan = &sFixed64Rules_Gte{v} +} + +func (x *SFixed64Rules) SetIn(v []int64) { + x.xxx_hidden_In = v +} + +func (x *SFixed64Rules) SetNotIn(v []int64) { + x.xxx_hidden_NotIn = v +} + +func (x *SFixed64Rules) SetExample(v []int64) { + x.xxx_hidden_Example = v +} + +func (x *SFixed64Rules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *SFixed64Rules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *SFixed64Rules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sFixed64Rules_Lt) + return ok +} + +func (x *SFixed64Rules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*sFixed64Rules_Lte) + return ok +} + +func (x *SFixed64Rules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *SFixed64Rules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sFixed64Rules_Gt) + return ok +} + +func (x *SFixed64Rules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*sFixed64Rules_Gte) + return ok +} + +func (x *SFixed64Rules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *SFixed64Rules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *SFixed64Rules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*sFixed64Rules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SFixed64Rules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*sFixed64Rules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *SFixed64Rules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *SFixed64Rules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*sFixed64Rules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *SFixed64Rules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*sFixed64Rules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const SFixed64Rules_LessThan_not_set_case case_SFixed64Rules_LessThan = 0 +const SFixed64Rules_Lt_case case_SFixed64Rules_LessThan = 2 +const SFixed64Rules_Lte_case case_SFixed64Rules_LessThan = 3 + +func (x *SFixed64Rules) WhichLessThan() case_SFixed64Rules_LessThan { + if x == nil { + return SFixed64Rules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *sFixed64Rules_Lt: + return SFixed64Rules_Lt_case + case *sFixed64Rules_Lte: + return SFixed64Rules_Lte_case + default: + return SFixed64Rules_LessThan_not_set_case + } +} + +const SFixed64Rules_GreaterThan_not_set_case case_SFixed64Rules_GreaterThan = 0 +const SFixed64Rules_Gt_case case_SFixed64Rules_GreaterThan = 4 +const SFixed64Rules_Gte_case case_SFixed64Rules_GreaterThan = 5 + +func (x *SFixed64Rules) WhichGreaterThan() case_SFixed64Rules_GreaterThan { + if x == nil { + return SFixed64Rules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *sFixed64Rules_Gt: + return SFixed64Rules_Gt_case + case *sFixed64Rules_Gte: + return SFixed64Rules_Gte_case + default: + return SFixed64Rules_GreaterThan_not_set_case + } +} + +type SFixed64Rules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // value must equal 42 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; + // } + // + // ``` + Const *int64 + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; + // } + // + // ``` + Lt *int64 + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than or equal to 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; + // } + // + // ``` + Lte *int64 + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than 5 [sfixed64.gt] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed64.gt_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt *int64 + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than or equal to 5 [sfixed64.gte] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte *int64 + // -- end of xxx_hidden_GreaterThan + // `in` requires the field value to be equal to one of the specified values. + // If the field value isn't one of the specified values, an error message is + // generated. + // + // ```proto + // + // message MySFixed64 { + // // must be in list [1, 2, 3] + // sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }]; + // } + // + // ``` + In []int64 + // `not_in` requires the field value to not be equal to any of the specified + // values. If the field value is one of the specified values, an error + // message is generated. + // + // ```proto + // + // message MySFixed64 { + // // value must not be in list [1, 2, 3] + // sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }]; + // } + // + // ``` + NotIn []int64 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MySFixed64 { + // sfixed64 value = 1 [ + // (buf.validate.field).sfixed64.example = 1, + // (buf.validate.field).sfixed64.example = 2 + // ]; + // } + // + // ``` + Example []int64 +} + +func (b0 SFixed64Rules_builder) Build() *SFixed64Rules { + m0 := &SFixed64Rules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_Const = *b.Const + } + if b.Lt != nil { + x.xxx_hidden_LessThan = &sFixed64Rules_Lt{*b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &sFixed64Rules_Lte{*b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &sFixed64Rules_Gt{*b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &sFixed64Rules_Gte{*b.Gte} + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_SFixed64Rules_LessThan protoreflect.FieldNumber + +func (x case_SFixed64Rules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[17].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_SFixed64Rules_GreaterThan protoreflect.FieldNumber + +func (x case_SFixed64Rules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[17].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isSFixed64Rules_LessThan interface { + isSFixed64Rules_LessThan() +} + +type sFixed64Rules_Lt struct { + // `lt` requires the field value to be less than the specified value (field < + // value). If the field value is equal to or greater than the specified value, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10]; + // } + // + // ``` + Lt int64 `protobuf:"fixed64,2,opt,name=lt,oneof"` +} + +type sFixed64Rules_Lte struct { + // `lte` requires the field value to be less than or equal to the specified + // value (field <= value). If the field value is greater than the specified + // value, an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be less than or equal to 10 + // sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10]; + // } + // + // ``` + Lte int64 `protobuf:"fixed64,3,opt,name=lte,oneof"` +} + +func (*sFixed64Rules_Lt) isSFixed64Rules_LessThan() {} + +func (*sFixed64Rules_Lte) isSFixed64Rules_LessThan() {} + +type isSFixed64Rules_GreaterThan interface { + isSFixed64Rules_GreaterThan() +} + +type sFixed64Rules_Gt struct { + // `gt` requires the field value to be greater than the specified value + // (exclusive). If the value of `gt` is larger than a specified `lt` or + // `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than 5 [sfixed64.gt] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5]; + // + // // must be greater than 5 and less than 10 [sfixed64.gt_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }]; + // + // // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }]; + // } + // + // ``` + Gt int64 `protobuf:"fixed64,4,opt,name=gt,oneof"` +} + +type sFixed64Rules_Gte struct { + // `gte` requires the field value to be greater than or equal to the specified + // value (exclusive). If the value of `gte` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MySFixed64 { + // // must be greater than or equal to 5 [sfixed64.gte] + // sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5]; + // + // // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt] + // sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }]; + // + // // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive] + // sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }]; + // } + // + // ``` + Gte int64 `protobuf:"fixed64,5,opt,name=gte,oneof"` +} + +func (*sFixed64Rules_Gt) isSFixed64Rules_GreaterThan() {} + +func (*sFixed64Rules_Gte) isSFixed64Rules_GreaterThan() {} + +// BoolRules describes the rules applied to `bool` values. These rules +// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type. +type BoolRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const bool `protobuf:"varint,1,opt,name=const"` + xxx_hidden_Example []bool `protobuf:"varint,2,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BoolRules) Reset() { + *x = BoolRules{} + mi := &file_buf_validate_validate_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BoolRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoolRules) ProtoMessage() {} + +func (x *BoolRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BoolRules) GetConst() bool { + if x != nil { + return x.xxx_hidden_Const + } + return false +} + +func (x *BoolRules) GetExample() []bool { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *BoolRules) SetConst(v bool) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2) +} + +func (x *BoolRules) SetExample(v []bool) { + x.xxx_hidden_Example = v +} + +func (x *BoolRules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *BoolRules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = false +} + +type BoolRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified boolean value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBool { + // // value must equal true + // bool value = 1 [(buf.validate.field).bool.const = true]; + // } + // + // ``` + Const *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyBool { + // bool value = 1 [ + // (buf.validate.field).bool.example = 1, + // (buf.validate.field).bool.example = 2 + // ]; + // } + // + // ``` + Example []bool +} + +func (b0 BoolRules_builder) Build() *BoolRules { + m0 := &BoolRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2) + x.xxx_hidden_Const = *b.Const + } + x.xxx_hidden_Example = b.Example + return m0 +} + +// StringRules describes the rules applied to `string` values These +// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type. +type StringRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const *string `protobuf:"bytes,1,opt,name=const"` + xxx_hidden_Len uint64 `protobuf:"varint,19,opt,name=len"` + xxx_hidden_MinLen uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen"` + xxx_hidden_MaxLen uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen"` + xxx_hidden_LenBytes uint64 `protobuf:"varint,20,opt,name=len_bytes,json=lenBytes"` + xxx_hidden_MinBytes uint64 `protobuf:"varint,4,opt,name=min_bytes,json=minBytes"` + xxx_hidden_MaxBytes uint64 `protobuf:"varint,5,opt,name=max_bytes,json=maxBytes"` + xxx_hidden_Pattern *string `protobuf:"bytes,6,opt,name=pattern"` + xxx_hidden_Prefix *string `protobuf:"bytes,7,opt,name=prefix"` + xxx_hidden_Suffix *string `protobuf:"bytes,8,opt,name=suffix"` + xxx_hidden_Contains *string `protobuf:"bytes,9,opt,name=contains"` + xxx_hidden_NotContains *string `protobuf:"bytes,23,opt,name=not_contains,json=notContains"` + xxx_hidden_In []string `protobuf:"bytes,10,rep,name=in"` + xxx_hidden_NotIn []string `protobuf:"bytes,11,rep,name=not_in,json=notIn"` + xxx_hidden_WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"` + xxx_hidden_Strict bool `protobuf:"varint,25,opt,name=strict"` + xxx_hidden_Example []string `protobuf:"bytes,34,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StringRules) Reset() { + *x = StringRules{} + mi := &file_buf_validate_validate_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StringRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringRules) ProtoMessage() {} + +func (x *StringRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *StringRules) GetConst() string { + if x != nil { + if x.xxx_hidden_Const != nil { + return *x.xxx_hidden_Const + } + return "" + } + return "" +} + +func (x *StringRules) GetLen() uint64 { + if x != nil { + return x.xxx_hidden_Len + } + return 0 +} + +func (x *StringRules) GetMinLen() uint64 { + if x != nil { + return x.xxx_hidden_MinLen + } + return 0 +} + +func (x *StringRules) GetMaxLen() uint64 { + if x != nil { + return x.xxx_hidden_MaxLen + } + return 0 +} + +func (x *StringRules) GetLenBytes() uint64 { + if x != nil { + return x.xxx_hidden_LenBytes + } + return 0 +} + +func (x *StringRules) GetMinBytes() uint64 { + if x != nil { + return x.xxx_hidden_MinBytes + } + return 0 +} + +func (x *StringRules) GetMaxBytes() uint64 { + if x != nil { + return x.xxx_hidden_MaxBytes + } + return 0 +} + +func (x *StringRules) GetPattern() string { + if x != nil { + if x.xxx_hidden_Pattern != nil { + return *x.xxx_hidden_Pattern + } + return "" + } + return "" +} + +func (x *StringRules) GetPrefix() string { + if x != nil { + if x.xxx_hidden_Prefix != nil { + return *x.xxx_hidden_Prefix + } + return "" + } + return "" +} + +func (x *StringRules) GetSuffix() string { + if x != nil { + if x.xxx_hidden_Suffix != nil { + return *x.xxx_hidden_Suffix + } + return "" + } + return "" +} + +func (x *StringRules) GetContains() string { + if x != nil { + if x.xxx_hidden_Contains != nil { + return *x.xxx_hidden_Contains + } + return "" + } + return "" +} + +func (x *StringRules) GetNotContains() string { + if x != nil { + if x.xxx_hidden_NotContains != nil { + return *x.xxx_hidden_NotContains + } + return "" + } + return "" +} + +func (x *StringRules) GetIn() []string { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *StringRules) GetNotIn() []string { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *StringRules) GetEmail() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Email); ok { + return x.Email + } + } + return false +} + +func (x *StringRules) GetHostname() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Hostname); ok { + return x.Hostname + } + } + return false +} + +func (x *StringRules) GetIp() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ip); ok { + return x.Ip + } + } + return false +} + +func (x *StringRules) GetIpv4() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4); ok { + return x.Ipv4 + } + } + return false +} + +func (x *StringRules) GetIpv6() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6); ok { + return x.Ipv6 + } + } + return false +} + +func (x *StringRules) GetUri() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Uri); ok { + return x.Uri + } + } + return false +} + +func (x *StringRules) GetUriRef() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_UriRef); ok { + return x.UriRef + } + } + return false +} + +func (x *StringRules) GetAddress() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Address); ok { + return x.Address + } + } + return false +} + +func (x *StringRules) GetUuid() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Uuid); ok { + return x.Uuid + } + } + return false +} + +func (x *StringRules) GetTuuid() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Tuuid); ok { + return x.Tuuid + } + } + return false +} + +func (x *StringRules) GetIpWithPrefixlen() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_IpWithPrefixlen); ok { + return x.IpWithPrefixlen + } + } + return false +} + +func (x *StringRules) GetIpv4WithPrefixlen() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4WithPrefixlen); ok { + return x.Ipv4WithPrefixlen + } + } + return false +} + +func (x *StringRules) GetIpv6WithPrefixlen() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6WithPrefixlen); ok { + return x.Ipv6WithPrefixlen + } + } + return false +} + +func (x *StringRules) GetIpPrefix() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_IpPrefix); ok { + return x.IpPrefix + } + } + return false +} + +func (x *StringRules) GetIpv4Prefix() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4Prefix); ok { + return x.Ipv4Prefix + } + } + return false +} + +func (x *StringRules) GetIpv6Prefix() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6Prefix); ok { + return x.Ipv6Prefix + } + } + return false +} + +func (x *StringRules) GetHostAndPort() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_HostAndPort); ok { + return x.HostAndPort + } + } + return false +} + +func (x *StringRules) GetUlid() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_Ulid); ok { + return x.Ulid + } + } + return false +} + +func (x *StringRules) GetProtobufFqn() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_ProtobufFqn); ok { + return x.ProtobufFqn + } + } + return false +} + +func (x *StringRules) GetProtobufDotFqn() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_ProtobufDotFqn); ok { + return x.ProtobufDotFqn + } + } + return false +} + +func (x *StringRules) GetWellKnownRegex() KnownRegex { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*stringRules_WellKnownRegex); ok { + return x.WellKnownRegex + } + } + return KnownRegex_KNOWN_REGEX_UNSPECIFIED +} + +func (x *StringRules) GetStrict() bool { + if x != nil { + return x.xxx_hidden_Strict + } + return false +} + +func (x *StringRules) GetExample() []string { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *StringRules) SetConst(v string) { + x.xxx_hidden_Const = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 17) +} + +func (x *StringRules) SetLen(v uint64) { + x.xxx_hidden_Len = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 17) +} + +func (x *StringRules) SetMinLen(v uint64) { + x.xxx_hidden_MinLen = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 17) +} + +func (x *StringRules) SetMaxLen(v uint64) { + x.xxx_hidden_MaxLen = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 17) +} + +func (x *StringRules) SetLenBytes(v uint64) { + x.xxx_hidden_LenBytes = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 17) +} + +func (x *StringRules) SetMinBytes(v uint64) { + x.xxx_hidden_MinBytes = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 17) +} + +func (x *StringRules) SetMaxBytes(v uint64) { + x.xxx_hidden_MaxBytes = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 17) +} + +func (x *StringRules) SetPattern(v string) { + x.xxx_hidden_Pattern = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 7, 17) +} + +func (x *StringRules) SetPrefix(v string) { + x.xxx_hidden_Prefix = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 8, 17) +} + +func (x *StringRules) SetSuffix(v string) { + x.xxx_hidden_Suffix = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 9, 17) +} + +func (x *StringRules) SetContains(v string) { + x.xxx_hidden_Contains = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 10, 17) +} + +func (x *StringRules) SetNotContains(v string) { + x.xxx_hidden_NotContains = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 11, 17) +} + +func (x *StringRules) SetIn(v []string) { + x.xxx_hidden_In = v +} + +func (x *StringRules) SetNotIn(v []string) { + x.xxx_hidden_NotIn = v +} + +func (x *StringRules) SetEmail(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Email{v} +} + +func (x *StringRules) SetHostname(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Hostname{v} +} + +func (x *StringRules) SetIp(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ip{v} +} + +func (x *StringRules) SetIpv4(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ipv4{v} +} + +func (x *StringRules) SetIpv6(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ipv6{v} +} + +func (x *StringRules) SetUri(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Uri{v} +} + +func (x *StringRules) SetUriRef(v bool) { + x.xxx_hidden_WellKnown = &stringRules_UriRef{v} +} + +func (x *StringRules) SetAddress(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Address{v} +} + +func (x *StringRules) SetUuid(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Uuid{v} +} + +func (x *StringRules) SetTuuid(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Tuuid{v} +} + +func (x *StringRules) SetIpWithPrefixlen(v bool) { + x.xxx_hidden_WellKnown = &stringRules_IpWithPrefixlen{v} +} + +func (x *StringRules) SetIpv4WithPrefixlen(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ipv4WithPrefixlen{v} +} + +func (x *StringRules) SetIpv6WithPrefixlen(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ipv6WithPrefixlen{v} +} + +func (x *StringRules) SetIpPrefix(v bool) { + x.xxx_hidden_WellKnown = &stringRules_IpPrefix{v} +} + +func (x *StringRules) SetIpv4Prefix(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ipv4Prefix{v} +} + +func (x *StringRules) SetIpv6Prefix(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ipv6Prefix{v} +} + +func (x *StringRules) SetHostAndPort(v bool) { + x.xxx_hidden_WellKnown = &stringRules_HostAndPort{v} +} + +func (x *StringRules) SetUlid(v bool) { + x.xxx_hidden_WellKnown = &stringRules_Ulid{v} +} + +func (x *StringRules) SetProtobufFqn(v bool) { + x.xxx_hidden_WellKnown = &stringRules_ProtobufFqn{v} +} + +func (x *StringRules) SetProtobufDotFqn(v bool) { + x.xxx_hidden_WellKnown = &stringRules_ProtobufDotFqn{v} +} + +func (x *StringRules) SetWellKnownRegex(v KnownRegex) { + x.xxx_hidden_WellKnown = &stringRules_WellKnownRegex{v} +} + +func (x *StringRules) SetStrict(v bool) { + x.xxx_hidden_Strict = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 15, 17) +} + +func (x *StringRules) SetExample(v []string) { + x.xxx_hidden_Example = v +} + +func (x *StringRules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *StringRules) HasLen() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *StringRules) HasMinLen() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *StringRules) HasMaxLen() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *StringRules) HasLenBytes() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *StringRules) HasMinBytes() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *StringRules) HasMaxBytes() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *StringRules) HasPattern() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 7) +} + +func (x *StringRules) HasPrefix() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 8) +} + +func (x *StringRules) HasSuffix() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 9) +} + +func (x *StringRules) HasContains() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 10) +} + +func (x *StringRules) HasNotContains() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 11) +} + +func (x *StringRules) HasWellKnown() bool { + if x == nil { + return false + } + return x.xxx_hidden_WellKnown != nil +} + +func (x *StringRules) HasEmail() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Email) + return ok +} + +func (x *StringRules) HasHostname() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Hostname) + return ok +} + +func (x *StringRules) HasIp() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ip) + return ok +} + +func (x *StringRules) HasIpv4() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4) + return ok +} + +func (x *StringRules) HasIpv6() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6) + return ok +} + +func (x *StringRules) HasUri() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Uri) + return ok +} + +func (x *StringRules) HasUriRef() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_UriRef) + return ok +} + +func (x *StringRules) HasAddress() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Address) + return ok +} + +func (x *StringRules) HasUuid() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Uuid) + return ok +} + +func (x *StringRules) HasTuuid() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Tuuid) + return ok +} + +func (x *StringRules) HasIpWithPrefixlen() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_IpWithPrefixlen) + return ok +} + +func (x *StringRules) HasIpv4WithPrefixlen() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4WithPrefixlen) + return ok +} + +func (x *StringRules) HasIpv6WithPrefixlen() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6WithPrefixlen) + return ok +} + +func (x *StringRules) HasIpPrefix() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_IpPrefix) + return ok +} + +func (x *StringRules) HasIpv4Prefix() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4Prefix) + return ok +} + +func (x *StringRules) HasIpv6Prefix() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6Prefix) + return ok +} + +func (x *StringRules) HasHostAndPort() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_HostAndPort) + return ok +} + +func (x *StringRules) HasUlid() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ulid) + return ok +} + +func (x *StringRules) HasProtobufFqn() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_ProtobufFqn) + return ok +} + +func (x *StringRules) HasProtobufDotFqn() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_ProtobufDotFqn) + return ok +} + +func (x *StringRules) HasWellKnownRegex() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*stringRules_WellKnownRegex) + return ok +} + +func (x *StringRules) HasStrict() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 15) +} + +func (x *StringRules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = nil +} + +func (x *StringRules) ClearLen() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Len = 0 +} + +func (x *StringRules) ClearMinLen() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_MinLen = 0 +} + +func (x *StringRules) ClearMaxLen() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_MaxLen = 0 +} + +func (x *StringRules) ClearLenBytes() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_LenBytes = 0 +} + +func (x *StringRules) ClearMinBytes() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_MinBytes = 0 +} + +func (x *StringRules) ClearMaxBytes() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_MaxBytes = 0 +} + +func (x *StringRules) ClearPattern() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 7) + x.xxx_hidden_Pattern = nil +} + +func (x *StringRules) ClearPrefix() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 8) + x.xxx_hidden_Prefix = nil +} + +func (x *StringRules) ClearSuffix() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 9) + x.xxx_hidden_Suffix = nil +} + +func (x *StringRules) ClearContains() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 10) + x.xxx_hidden_Contains = nil +} + +func (x *StringRules) ClearNotContains() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 11) + x.xxx_hidden_NotContains = nil +} + +func (x *StringRules) ClearWellKnown() { + x.xxx_hidden_WellKnown = nil +} + +func (x *StringRules) ClearEmail() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Email); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearHostname() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Hostname); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIp() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ip); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpv4() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpv6() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearUri() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Uri); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearUriRef() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_UriRef); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearAddress() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Address); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearUuid() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Uuid); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearTuuid() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Tuuid); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpWithPrefixlen() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_IpWithPrefixlen); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpv4WithPrefixlen() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4WithPrefixlen); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpv6WithPrefixlen() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6WithPrefixlen); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpPrefix() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_IpPrefix); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpv4Prefix() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv4Prefix); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearIpv6Prefix() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ipv6Prefix); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearHostAndPort() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_HostAndPort); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearUlid() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_Ulid); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearProtobufFqn() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_ProtobufFqn); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearProtobufDotFqn() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_ProtobufDotFqn); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearWellKnownRegex() { + if _, ok := x.xxx_hidden_WellKnown.(*stringRules_WellKnownRegex); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *StringRules) ClearStrict() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 15) + x.xxx_hidden_Strict = false +} + +const StringRules_WellKnown_not_set_case case_StringRules_WellKnown = 0 +const StringRules_Email_case case_StringRules_WellKnown = 12 +const StringRules_Hostname_case case_StringRules_WellKnown = 13 +const StringRules_Ip_case case_StringRules_WellKnown = 14 +const StringRules_Ipv4_case case_StringRules_WellKnown = 15 +const StringRules_Ipv6_case case_StringRules_WellKnown = 16 +const StringRules_Uri_case case_StringRules_WellKnown = 17 +const StringRules_UriRef_case case_StringRules_WellKnown = 18 +const StringRules_Address_case case_StringRules_WellKnown = 21 +const StringRules_Uuid_case case_StringRules_WellKnown = 22 +const StringRules_Tuuid_case case_StringRules_WellKnown = 33 +const StringRules_IpWithPrefixlen_case case_StringRules_WellKnown = 26 +const StringRules_Ipv4WithPrefixlen_case case_StringRules_WellKnown = 27 +const StringRules_Ipv6WithPrefixlen_case case_StringRules_WellKnown = 28 +const StringRules_IpPrefix_case case_StringRules_WellKnown = 29 +const StringRules_Ipv4Prefix_case case_StringRules_WellKnown = 30 +const StringRules_Ipv6Prefix_case case_StringRules_WellKnown = 31 +const StringRules_HostAndPort_case case_StringRules_WellKnown = 32 +const StringRules_Ulid_case case_StringRules_WellKnown = 35 +const StringRules_ProtobufFqn_case case_StringRules_WellKnown = 37 +const StringRules_ProtobufDotFqn_case case_StringRules_WellKnown = 38 +const StringRules_WellKnownRegex_case case_StringRules_WellKnown = 24 + +func (x *StringRules) WhichWellKnown() case_StringRules_WellKnown { + if x == nil { + return StringRules_WellKnown_not_set_case + } + switch x.xxx_hidden_WellKnown.(type) { + case *stringRules_Email: + return StringRules_Email_case + case *stringRules_Hostname: + return StringRules_Hostname_case + case *stringRules_Ip: + return StringRules_Ip_case + case *stringRules_Ipv4: + return StringRules_Ipv4_case + case *stringRules_Ipv6: + return StringRules_Ipv6_case + case *stringRules_Uri: + return StringRules_Uri_case + case *stringRules_UriRef: + return StringRules_UriRef_case + case *stringRules_Address: + return StringRules_Address_case + case *stringRules_Uuid: + return StringRules_Uuid_case + case *stringRules_Tuuid: + return StringRules_Tuuid_case + case *stringRules_IpWithPrefixlen: + return StringRules_IpWithPrefixlen_case + case *stringRules_Ipv4WithPrefixlen: + return StringRules_Ipv4WithPrefixlen_case + case *stringRules_Ipv6WithPrefixlen: + return StringRules_Ipv6WithPrefixlen_case + case *stringRules_IpPrefix: + return StringRules_IpPrefix_case + case *stringRules_Ipv4Prefix: + return StringRules_Ipv4Prefix_case + case *stringRules_Ipv6Prefix: + return StringRules_Ipv6Prefix_case + case *stringRules_HostAndPort: + return StringRules_HostAndPort_case + case *stringRules_Ulid: + return StringRules_Ulid_case + case *stringRules_ProtobufFqn: + return StringRules_ProtobufFqn_case + case *stringRules_ProtobufDotFqn: + return StringRules_ProtobufDotFqn_case + case *stringRules_WellKnownRegex: + return StringRules_WellKnownRegex_case + default: + return StringRules_WellKnown_not_set_case + } +} + +type StringRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified value. If + // the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyString { + // // value must equal `hello` + // string value = 1 [(buf.validate.field).string.const = "hello"]; + // } + // + // ``` + Const *string + // `len` dictates that the field value must have the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value does not meet the specified + // length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be 5 characters + // string value = 1 [(buf.validate.field).string.len = 5]; + // } + // + // ``` + Len *uint64 + // `min_len` specifies that the field value must have at least the specified + // number of characters (Unicode code points), which may differ from the number + // of bytes in the string. If the field value contains fewer characters, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at least 3 characters + // string value = 1 [(buf.validate.field).string.min_len = 3]; + // } + // + // ``` + MinLen *uint64 + // `max_len` specifies that the field value must have no more than the specified + // number of characters (Unicode code points), which may differ from the + // number of bytes in the string. If the field value contains more characters, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at most 10 characters + // string value = 1 [(buf.validate.field).string.max_len = 10]; + // } + // + // ``` + MaxLen *uint64 + // `len_bytes` dictates that the field value must have the specified number of + // bytes. If the field value does not match the specified length in bytes, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be 6 bytes + // string value = 1 [(buf.validate.field).string.len_bytes = 6]; + // } + // + // ``` + LenBytes *uint64 + // `min_bytes` specifies that the field value must have at least the specified + // number of bytes. If the field value contains fewer bytes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at least 4 bytes + // string value = 1 [(buf.validate.field).string.min_bytes = 4]; + // } + // + // ``` + MinBytes *uint64 + // `max_bytes` specifies that the field value must have no more than the + // specified number of bytes. If the field value contains more bytes, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // value length must be at most 8 bytes + // string value = 1 [(buf.validate.field).string.max_bytes = 8]; + // } + // + // ``` + MaxBytes *uint64 + // `pattern` specifies that the field value must match the specified + // regular expression (RE2 syntax), with the expression provided without any + // delimiters. If the field value doesn't match the regular expression, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not match regex pattern `^[a-zA-Z]//$` + // string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; + // } + // + // ``` + Pattern *string + // `prefix` specifies that the field value must have the + // specified substring at the beginning of the string. If the field value + // doesn't start with the specified prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // value does not have prefix `pre` + // string value = 1 [(buf.validate.field).string.prefix = "pre"]; + // } + // + // ``` + Prefix *string + // `suffix` specifies that the field value must have the + // specified substring at the end of the string. If the field value doesn't + // end with the specified suffix, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not have suffix `post` + // string value = 1 [(buf.validate.field).string.suffix = "post"]; + // } + // + // ``` + Suffix *string + // `contains` specifies that the field value must have the + // specified substring anywhere in the string. If the field value doesn't + // contain the specified substring, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value does not contain substring `inside`. + // string value = 1 [(buf.validate.field).string.contains = "inside"]; + // } + // + // ``` + Contains *string + // `not_contains` specifies that the field value must not have the + // specified substring anywhere in the string. If the field value contains + // the specified substring, an error message will be generated. + // + // ```proto + // + // message MyString { + // // value contains substring `inside`. + // string value = 1 [(buf.validate.field).string.not_contains = "inside"]; + // } + // + // ``` + NotContains *string + // `in` specifies that the field value must be equal to one of the specified + // values. If the field value isn't one of the specified values, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be in list ["apple", "banana"] + // string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + // } + // + // ``` + In []string + // `not_in` specifies that the field value cannot be equal to any + // of the specified values. If the field value is one of the specified values, + // an error message will be generated. + // ```proto + // + // message MyString { + // // value must not be in list ["orange", "grape"] + // string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + // } + // + // ``` + NotIn []string + // `WellKnown` rules provide advanced rules against common string + // patterns. + + // Fields of oneof xxx_hidden_WellKnown: + // `email` specifies that the field value must be a valid email address, for + // example "foo@example.com". + // + // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address). + // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322), + // which allows many unexpected forms of email addresses and will easily match + // a typographical error. + // + // If the field value isn't a valid email address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid email address + // string value = 1 [(buf.validate.field).string.email = true]; + // } + // + // ``` + Email *bool + // `hostname` specifies that the field value must be a valid hostname, for + // example "foo.example.com". + // + // A valid hostname follows the rules below: + // - The name consists of one or more labels, separated by a dot ("."). + // - Each label can be 1 to 63 alphanumeric characters. + // - A label can contain hyphens ("-"), but must not start or end with a hyphen. + // - The right-most label must not be digits only. + // - The name can have a trailing dot—for example, "foo.example.com.". + // - The name can be 253 characters at most, excluding the optional trailing dot. + // + // If the field value isn't a valid hostname, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname + // string value = 1 [(buf.validate.field).string.hostname = true]; + // } + // + // ``` + Hostname *bool + // `ip` specifies that the field value must be a valid IP (v4 or v6) address. + // + // IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21". + // IPv6 addresses are expected in their text representation—for example, "::1", + // or "2001:0DB8:ABCD:0012::0". + // + // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported. + // + // If the field value isn't a valid IP address, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP address + // string value = 1 [(buf.validate.field).string.ip = true]; + // } + // + // ``` + Ip *bool + // `ipv4` specifies that the field value must be a valid IPv4 address—for + // example "192.168.5.21". If the field value isn't a valid IPv4 address, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address + // string value = 1 [(buf.validate.field).string.ipv4 = true]; + // } + // + // ``` + Ipv4 *bool + // `ipv6` specifies that the field value must be a valid IPv6 address—for + // example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field + // value is not a valid IPv6 address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address + // string value = 1 [(buf.validate.field).string.ipv6 = true]; + // } + // + // ``` + Ipv6 *bool + // `uri` specifies that the field value must be a valid URI, for example + // "https://example.com/foo/bar?baz=quux#frag". + // + // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI + // string value = 1 [(buf.validate.field).string.uri = true]; + // } + // + // ``` + Uri *bool + // `uri_ref` specifies that the field value must be a valid URI Reference—either + // a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative + // Reference such as "./foo/bar?query". + // + // URI, URI Reference, and Relative Reference are defined in the internet + // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone + // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI Reference, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI Reference + // string value = 1 [(buf.validate.field).string.uri_ref = true]; + // } + // + // ``` + UriRef *bool + // `address` specifies that the field value must be either a valid hostname + // (for example, "example.com"), or a valid IP (v4 or v6) address (for example, + // "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname, or ip address + // string value = 1 [(buf.validate.field).string.address = true]; + // } + // + // ``` + Address *bool + // `uuid` specifies that the field value must be a valid UUID as defined by + // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid UUID + // string value = 1 [(buf.validate.field).string.uuid = true]; + // } + // + // ``` + Uuid *bool + // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as + // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes + // omitted. If the field value isn't a valid UUID without dashes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid trimmed UUID + // string value = 1 [(buf.validate.field).string.tuuid = true]; + // } + // + // ``` + Tuuid *bool + // `ip_with_prefixlen` specifies that the field value must be a valid IP + // (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or + // "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with + // prefix length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP with prefix length + // string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + // } + // + // ``` + IpWithPrefixlen *bool + // `ipv4_with_prefixlen` specifies that the field value must be a valid + // IPv4 address with prefix length—for example, "192.168.5.21/16". If the + // field value isn't a valid IPv4 address with prefix length, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address with prefix length + // string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + // } + // + // ``` + Ipv4WithPrefixlen *bool + // `ipv6_with_prefixlen` specifies that the field value must be a valid + // IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64". + // If the field value is not a valid IPv6 address with prefix length, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address prefix length + // string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + // } + // + // ``` + Ipv6WithPrefixlen *bool + // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) + // prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value isn't a valid IP prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP prefix + // string value = 1 [(buf.validate.field).string.ip_prefix = true]; + // } + // + // ``` + IpPrefix *bool + // `ipv4_prefix` specifies that the field value must be a valid IPv4 + // prefix, for example "192.168.0.0/16". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "192.168.0.0/16" designates the left-most 16 bits for the prefix, + // and the remaining 16 bits must be zero. + // + // If the field value isn't a valid IPv4 prefix, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 prefix + // string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + // } + // + // ``` + Ipv4Prefix *bool + // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for + // example, "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value is not a valid IPv6 prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 prefix + // string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + // } + // + // ``` + Ipv6Prefix *bool + // `host_and_port` specifies that the field value must be a valid host/port + // pair—for example, "example.com:8080". + // + // The host can be one of: + // - An IPv4 address in dotted decimal format—for example, "192.168.5.21". + // - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]". + // - A hostname—for example, "example.com". + // + // The port is separated by a colon. It must be non-empty, with a decimal number + // in the range of 0-65535, inclusive. + HostAndPort *bool + // `ulid` specifies that the field value must be a valid ULID (Universally Unique + // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec). + // If the field value isn't a valid ULID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid ULID + // string value = 1 [(buf.validate.field).string.ulid = true]; + // } + // + // ``` + Ulid *bool + // `protobuf_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers, + // where each identifier starts with a letter or underscore and is followed by zero or + // more letters, underscores, or digits. + // + // Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage". + // + // Note: historically, fully-qualified Protobuf names were represented with a leading + // dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the + // leading dot, and most fully-qualified names are represented without it. Use + // `protobuf_dot_fqn` if a leading dot is required. + // + // If the field value isn't a valid fully-qualified Protobuf name, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name + // string value = 1 [(buf.validate.field).string.protobuf_fqn = true]; + // } + // + // ``` + ProtobufFqn *bool + // `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name with a leading dot, as defined by the + // [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name with a leading dot is a dot followed by a + // dot-separated list of Protobuf identifiers, where each identifier starts with a + // letter or underscore and is followed by zero or more letters, underscores, or + // digits. + // + // Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage". + // + // Note: this is the historical representation of fully-qualified Protobuf names, + // where a leading dot denotes an absolute reference. Modern Protobuf does not use + // the leading dot, and most fully-qualified names are represented without it. Most + // users will want to use `protobuf_fqn` instead. + // + // If the field value isn't a valid fully-qualified Protobuf name with a leading dot, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name with a leading dot + // string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true]; + // } + // + // ``` + ProtobufDotFqn *bool + // `well_known_regex` specifies a common well-known pattern + // defined as a regex. If the field value doesn't match the well-known + // regex, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid HTTP header value + // string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; + // } + // + // ``` + // + // #### KnownRegex + // + // `well_known_regex` contains some well-known patterns. + // + // | Name | Number | Description | + // |-------------------------------|--------|-------------------------------------------| + // | KNOWN_REGEX_UNSPECIFIED | 0 | | + // | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) | + // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) | + WellKnownRegex *KnownRegex + // -- end of xxx_hidden_WellKnown + // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + // enable strict header validation. By default, this is true, and HTTP header + // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser + // validations that only disallow `\r\n\0` characters, which can be used to + // bypass header matching rules. + // + // ```proto + // + // message MyString { + // // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. + // string value = 1 [(buf.validate.field).string.strict = false]; + // } + // + // ``` + Strict *bool + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyString { + // string value = 1 [ + // (buf.validate.field).string.example = "hello", + // (buf.validate.field).string.example = "world" + // ]; + // } + // + // ``` + Example []string +} + +func (b0 StringRules_builder) Build() *StringRules { + m0 := &StringRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 17) + x.xxx_hidden_Const = b.Const + } + if b.Len != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 17) + x.xxx_hidden_Len = *b.Len + } + if b.MinLen != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 17) + x.xxx_hidden_MinLen = *b.MinLen + } + if b.MaxLen != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 17) + x.xxx_hidden_MaxLen = *b.MaxLen + } + if b.LenBytes != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 17) + x.xxx_hidden_LenBytes = *b.LenBytes + } + if b.MinBytes != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 17) + x.xxx_hidden_MinBytes = *b.MinBytes + } + if b.MaxBytes != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 17) + x.xxx_hidden_MaxBytes = *b.MaxBytes + } + if b.Pattern != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 7, 17) + x.xxx_hidden_Pattern = b.Pattern + } + if b.Prefix != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 8, 17) + x.xxx_hidden_Prefix = b.Prefix + } + if b.Suffix != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 9, 17) + x.xxx_hidden_Suffix = b.Suffix + } + if b.Contains != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 10, 17) + x.xxx_hidden_Contains = b.Contains + } + if b.NotContains != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 11, 17) + x.xxx_hidden_NotContains = b.NotContains + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + if b.Email != nil { + x.xxx_hidden_WellKnown = &stringRules_Email{*b.Email} + } + if b.Hostname != nil { + x.xxx_hidden_WellKnown = &stringRules_Hostname{*b.Hostname} + } + if b.Ip != nil { + x.xxx_hidden_WellKnown = &stringRules_Ip{*b.Ip} + } + if b.Ipv4 != nil { + x.xxx_hidden_WellKnown = &stringRules_Ipv4{*b.Ipv4} + } + if b.Ipv6 != nil { + x.xxx_hidden_WellKnown = &stringRules_Ipv6{*b.Ipv6} + } + if b.Uri != nil { + x.xxx_hidden_WellKnown = &stringRules_Uri{*b.Uri} + } + if b.UriRef != nil { + x.xxx_hidden_WellKnown = &stringRules_UriRef{*b.UriRef} + } + if b.Address != nil { + x.xxx_hidden_WellKnown = &stringRules_Address{*b.Address} + } + if b.Uuid != nil { + x.xxx_hidden_WellKnown = &stringRules_Uuid{*b.Uuid} + } + if b.Tuuid != nil { + x.xxx_hidden_WellKnown = &stringRules_Tuuid{*b.Tuuid} + } + if b.IpWithPrefixlen != nil { + x.xxx_hidden_WellKnown = &stringRules_IpWithPrefixlen{*b.IpWithPrefixlen} + } + if b.Ipv4WithPrefixlen != nil { + x.xxx_hidden_WellKnown = &stringRules_Ipv4WithPrefixlen{*b.Ipv4WithPrefixlen} + } + if b.Ipv6WithPrefixlen != nil { + x.xxx_hidden_WellKnown = &stringRules_Ipv6WithPrefixlen{*b.Ipv6WithPrefixlen} + } + if b.IpPrefix != nil { + x.xxx_hidden_WellKnown = &stringRules_IpPrefix{*b.IpPrefix} + } + if b.Ipv4Prefix != nil { + x.xxx_hidden_WellKnown = &stringRules_Ipv4Prefix{*b.Ipv4Prefix} + } + if b.Ipv6Prefix != nil { + x.xxx_hidden_WellKnown = &stringRules_Ipv6Prefix{*b.Ipv6Prefix} + } + if b.HostAndPort != nil { + x.xxx_hidden_WellKnown = &stringRules_HostAndPort{*b.HostAndPort} + } + if b.Ulid != nil { + x.xxx_hidden_WellKnown = &stringRules_Ulid{*b.Ulid} + } + if b.ProtobufFqn != nil { + x.xxx_hidden_WellKnown = &stringRules_ProtobufFqn{*b.ProtobufFqn} + } + if b.ProtobufDotFqn != nil { + x.xxx_hidden_WellKnown = &stringRules_ProtobufDotFqn{*b.ProtobufDotFqn} + } + if b.WellKnownRegex != nil { + x.xxx_hidden_WellKnown = &stringRules_WellKnownRegex{*b.WellKnownRegex} + } + if b.Strict != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 15, 17) + x.xxx_hidden_Strict = *b.Strict + } + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_StringRules_WellKnown protoreflect.FieldNumber + +func (x case_StringRules_WellKnown) String() string { + md := file_buf_validate_validate_proto_msgTypes[19].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isStringRules_WellKnown interface { + isStringRules_WellKnown() +} + +type stringRules_Email struct { + // `email` specifies that the field value must be a valid email address, for + // example "foo@example.com". + // + // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address). + // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322), + // which allows many unexpected forms of email addresses and will easily match + // a typographical error. + // + // If the field value isn't a valid email address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid email address + // string value = 1 [(buf.validate.field).string.email = true]; + // } + // + // ``` + Email bool `protobuf:"varint,12,opt,name=email,oneof"` +} + +type stringRules_Hostname struct { + // `hostname` specifies that the field value must be a valid hostname, for + // example "foo.example.com". + // + // A valid hostname follows the rules below: + // - The name consists of one or more labels, separated by a dot ("."). + // - Each label can be 1 to 63 alphanumeric characters. + // - A label can contain hyphens ("-"), but must not start or end with a hyphen. + // - The right-most label must not be digits only. + // - The name can have a trailing dot—for example, "foo.example.com.". + // - The name can be 253 characters at most, excluding the optional trailing dot. + // + // If the field value isn't a valid hostname, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname + // string value = 1 [(buf.validate.field).string.hostname = true]; + // } + // + // ``` + Hostname bool `protobuf:"varint,13,opt,name=hostname,oneof"` +} + +type stringRules_Ip struct { + // `ip` specifies that the field value must be a valid IP (v4 or v6) address. + // + // IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21". + // IPv6 addresses are expected in their text representation—for example, "::1", + // or "2001:0DB8:ABCD:0012::0". + // + // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported. + // + // If the field value isn't a valid IP address, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP address + // string value = 1 [(buf.validate.field).string.ip = true]; + // } + // + // ``` + Ip bool `protobuf:"varint,14,opt,name=ip,oneof"` +} + +type stringRules_Ipv4 struct { + // `ipv4` specifies that the field value must be a valid IPv4 address—for + // example "192.168.5.21". If the field value isn't a valid IPv4 address, an + // error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address + // string value = 1 [(buf.validate.field).string.ipv4 = true]; + // } + // + // ``` + Ipv4 bool `protobuf:"varint,15,opt,name=ipv4,oneof"` +} + +type stringRules_Ipv6 struct { + // `ipv6` specifies that the field value must be a valid IPv6 address—for + // example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field + // value is not a valid IPv6 address, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address + // string value = 1 [(buf.validate.field).string.ipv6 = true]; + // } + // + // ``` + Ipv6 bool `protobuf:"varint,16,opt,name=ipv6,oneof"` +} + +type stringRules_Uri struct { + // `uri` specifies that the field value must be a valid URI, for example + // "https://example.com/foo/bar?baz=quux#frag". + // + // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). + // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI + // string value = 1 [(buf.validate.field).string.uri = true]; + // } + // + // ``` + Uri bool `protobuf:"varint,17,opt,name=uri,oneof"` +} + +type stringRules_UriRef struct { + // `uri_ref` specifies that the field value must be a valid URI Reference—either + // a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative + // Reference such as "./foo/bar?query". + // + // URI, URI Reference, and Relative Reference are defined in the internet + // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone + // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)). + // + // If the field value isn't a valid URI Reference, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid URI Reference + // string value = 1 [(buf.validate.field).string.uri_ref = true]; + // } + // + // ``` + UriRef bool `protobuf:"varint,18,opt,name=uri_ref,json=uriRef,oneof"` +} + +type stringRules_Address struct { + // `address` specifies that the field value must be either a valid hostname + // (for example, "example.com"), or a valid IP (v4 or v6) address (for example, + // "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid hostname, or ip address + // string value = 1 [(buf.validate.field).string.address = true]; + // } + // + // ``` + Address bool `protobuf:"varint,21,opt,name=address,oneof"` +} + +type stringRules_Uuid struct { + // `uuid` specifies that the field value must be a valid UUID as defined by + // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid UUID + // string value = 1 [(buf.validate.field).string.uuid = true]; + // } + // + // ``` + Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"` +} + +type stringRules_Tuuid struct { + // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as + // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes + // omitted. If the field value isn't a valid UUID without dashes, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid trimmed UUID + // string value = 1 [(buf.validate.field).string.tuuid = true]; + // } + // + // ``` + Tuuid bool `protobuf:"varint,33,opt,name=tuuid,oneof"` +} + +type stringRules_IpWithPrefixlen struct { + // `ip_with_prefixlen` specifies that the field value must be a valid IP + // (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or + // "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with + // prefix length, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP with prefix length + // string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true]; + // } + // + // ``` + IpWithPrefixlen bool `protobuf:"varint,26,opt,name=ip_with_prefixlen,json=ipWithPrefixlen,oneof"` +} + +type stringRules_Ipv4WithPrefixlen struct { + // `ipv4_with_prefixlen` specifies that the field value must be a valid + // IPv4 address with prefix length—for example, "192.168.5.21/16". If the + // field value isn't a valid IPv4 address with prefix length, an error + // message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 address with prefix length + // string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; + // } + // + // ``` + Ipv4WithPrefixlen bool `protobuf:"varint,27,opt,name=ipv4_with_prefixlen,json=ipv4WithPrefixlen,oneof"` +} + +type stringRules_Ipv6WithPrefixlen struct { + // `ipv6_with_prefixlen` specifies that the field value must be a valid + // IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64". + // If the field value is not a valid IPv6 address with prefix length, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 address prefix length + // string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true]; + // } + // + // ``` + Ipv6WithPrefixlen bool `protobuf:"varint,28,opt,name=ipv6_with_prefixlen,json=ipv6WithPrefixlen,oneof"` +} + +type stringRules_IpPrefix struct { + // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) + // prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value isn't a valid IP prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IP prefix + // string value = 1 [(buf.validate.field).string.ip_prefix = true]; + // } + // + // ``` + IpPrefix bool `protobuf:"varint,29,opt,name=ip_prefix,json=ipPrefix,oneof"` +} + +type stringRules_Ipv4Prefix struct { + // `ipv4_prefix` specifies that the field value must be a valid IPv4 + // prefix, for example "192.168.0.0/16". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "192.168.0.0/16" designates the left-most 16 bits for the prefix, + // and the remaining 16 bits must be zero. + // + // If the field value isn't a valid IPv4 prefix, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv4 prefix + // string value = 1 [(buf.validate.field).string.ipv4_prefix = true]; + // } + // + // ``` + Ipv4Prefix bool `protobuf:"varint,30,opt,name=ipv4_prefix,json=ipv4Prefix,oneof"` +} + +type stringRules_Ipv6Prefix struct { + // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for + // example, "2001:0DB8:ABCD:0012::0/64". + // + // The prefix must have all zeros for the unmasked bits. For example, + // "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the + // prefix, and the remaining 64 bits must be zero. + // + // If the field value is not a valid IPv6 prefix, an error message will be + // generated. + // + // ```proto + // + // message MyString { + // // must be a valid IPv6 prefix + // string value = 1 [(buf.validate.field).string.ipv6_prefix = true]; + // } + // + // ``` + Ipv6Prefix bool `protobuf:"varint,31,opt,name=ipv6_prefix,json=ipv6Prefix,oneof"` +} + +type stringRules_HostAndPort struct { + // `host_and_port` specifies that the field value must be a valid host/port + // pair—for example, "example.com:8080". + // + // The host can be one of: + // - An IPv4 address in dotted decimal format—for example, "192.168.5.21". + // - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]". + // - A hostname—for example, "example.com". + // + // The port is separated by a colon. It must be non-empty, with a decimal number + // in the range of 0-65535, inclusive. + HostAndPort bool `protobuf:"varint,32,opt,name=host_and_port,json=hostAndPort,oneof"` +} + +type stringRules_Ulid struct { + // `ulid` specifies that the field value must be a valid ULID (Universally Unique + // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec). + // If the field value isn't a valid ULID, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid ULID + // string value = 1 [(buf.validate.field).string.ulid = true]; + // } + // + // ``` + Ulid bool `protobuf:"varint,35,opt,name=ulid,oneof"` +} + +type stringRules_ProtobufFqn struct { + // `protobuf_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers, + // where each identifier starts with a letter or underscore and is followed by zero or + // more letters, underscores, or digits. + // + // Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage". + // + // Note: historically, fully-qualified Protobuf names were represented with a leading + // dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the + // leading dot, and most fully-qualified names are represented without it. Use + // `protobuf_dot_fqn` if a leading dot is required. + // + // If the field value isn't a valid fully-qualified Protobuf name, an error message + // will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name + // string value = 1 [(buf.validate.field).string.protobuf_fqn = true]; + // } + // + // ``` + ProtobufFqn bool `protobuf:"varint,37,opt,name=protobuf_fqn,json=protobufFqn,oneof"` +} + +type stringRules_ProtobufDotFqn struct { + // `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified + // Protobuf name with a leading dot, as defined by the + // [Protobuf Language Specification](https://protobuf.com/docs/language-spec). + // + // A fully-qualified Protobuf name with a leading dot is a dot followed by a + // dot-separated list of Protobuf identifiers, where each identifier starts with a + // letter or underscore and is followed by zero or more letters, underscores, or + // digits. + // + // Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage". + // + // Note: this is the historical representation of fully-qualified Protobuf names, + // where a leading dot denotes an absolute reference. Modern Protobuf does not use + // the leading dot, and most fully-qualified names are represented without it. Most + // users will want to use `protobuf_fqn` instead. + // + // If the field value isn't a valid fully-qualified Protobuf name with a leading dot, + // an error message will be generated. + // + // ```proto + // + // message MyString { + // // value must be a valid fully-qualified Protobuf name with a leading dot + // string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true]; + // } + // + // ``` + ProtobufDotFqn bool `protobuf:"varint,38,opt,name=protobuf_dot_fqn,json=protobufDotFqn,oneof"` +} + +type stringRules_WellKnownRegex struct { + // `well_known_regex` specifies a common well-known pattern + // defined as a regex. If the field value doesn't match the well-known + // regex, an error message will be generated. + // + // ```proto + // + // message MyString { + // // must be a valid HTTP header value + // string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE]; + // } + // + // ``` + // + // #### KnownRegex + // + // `well_known_regex` contains some well-known patterns. + // + // | Name | Number | Description | + // |-------------------------------|--------|-------------------------------------------| + // | KNOWN_REGEX_UNSPECIFIED | 0 | | + // | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) | + // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) | + WellKnownRegex KnownRegex `protobuf:"varint,24,opt,name=well_known_regex,json=wellKnownRegex,enum=buf.validate.KnownRegex,oneof"` +} + +func (*stringRules_Email) isStringRules_WellKnown() {} + +func (*stringRules_Hostname) isStringRules_WellKnown() {} + +func (*stringRules_Ip) isStringRules_WellKnown() {} + +func (*stringRules_Ipv4) isStringRules_WellKnown() {} + +func (*stringRules_Ipv6) isStringRules_WellKnown() {} + +func (*stringRules_Uri) isStringRules_WellKnown() {} + +func (*stringRules_UriRef) isStringRules_WellKnown() {} + +func (*stringRules_Address) isStringRules_WellKnown() {} + +func (*stringRules_Uuid) isStringRules_WellKnown() {} + +func (*stringRules_Tuuid) isStringRules_WellKnown() {} + +func (*stringRules_IpWithPrefixlen) isStringRules_WellKnown() {} + +func (*stringRules_Ipv4WithPrefixlen) isStringRules_WellKnown() {} + +func (*stringRules_Ipv6WithPrefixlen) isStringRules_WellKnown() {} + +func (*stringRules_IpPrefix) isStringRules_WellKnown() {} + +func (*stringRules_Ipv4Prefix) isStringRules_WellKnown() {} + +func (*stringRules_Ipv6Prefix) isStringRules_WellKnown() {} + +func (*stringRules_HostAndPort) isStringRules_WellKnown() {} + +func (*stringRules_Ulid) isStringRules_WellKnown() {} + +func (*stringRules_ProtobufFqn) isStringRules_WellKnown() {} + +func (*stringRules_ProtobufDotFqn) isStringRules_WellKnown() {} + +func (*stringRules_WellKnownRegex) isStringRules_WellKnown() {} + +// BytesRules describe the rules applied to `bytes` values. These rules +// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type. +type BytesRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const []byte `protobuf:"bytes,1,opt,name=const"` + xxx_hidden_Len uint64 `protobuf:"varint,13,opt,name=len"` + xxx_hidden_MinLen uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen"` + xxx_hidden_MaxLen uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen"` + xxx_hidden_Pattern *string `protobuf:"bytes,4,opt,name=pattern"` + xxx_hidden_Prefix []byte `protobuf:"bytes,5,opt,name=prefix"` + xxx_hidden_Suffix []byte `protobuf:"bytes,6,opt,name=suffix"` + xxx_hidden_Contains []byte `protobuf:"bytes,7,opt,name=contains"` + xxx_hidden_In [][]byte `protobuf:"bytes,8,rep,name=in"` + xxx_hidden_NotIn [][]byte `protobuf:"bytes,9,rep,name=not_in,json=notIn"` + xxx_hidden_WellKnown isBytesRules_WellKnown `protobuf_oneof:"well_known"` + xxx_hidden_Example [][]byte `protobuf:"bytes,14,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BytesRules) Reset() { + *x = BytesRules{} + mi := &file_buf_validate_validate_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BytesRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BytesRules) ProtoMessage() {} + +func (x *BytesRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BytesRules) GetConst() []byte { + if x != nil { + return x.xxx_hidden_Const + } + return nil +} + +func (x *BytesRules) GetLen() uint64 { + if x != nil { + return x.xxx_hidden_Len + } + return 0 +} + +func (x *BytesRules) GetMinLen() uint64 { + if x != nil { + return x.xxx_hidden_MinLen + } + return 0 +} + +func (x *BytesRules) GetMaxLen() uint64 { + if x != nil { + return x.xxx_hidden_MaxLen + } + return 0 +} + +func (x *BytesRules) GetPattern() string { + if x != nil { + if x.xxx_hidden_Pattern != nil { + return *x.xxx_hidden_Pattern + } + return "" + } + return "" +} + +func (x *BytesRules) GetPrefix() []byte { + if x != nil { + return x.xxx_hidden_Prefix + } + return nil +} + +func (x *BytesRules) GetSuffix() []byte { + if x != nil { + return x.xxx_hidden_Suffix + } + return nil +} + +func (x *BytesRules) GetContains() []byte { + if x != nil { + return x.xxx_hidden_Contains + } + return nil +} + +func (x *BytesRules) GetIn() [][]byte { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *BytesRules) GetNotIn() [][]byte { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *BytesRules) GetIp() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ip); ok { + return x.Ip + } + } + return false +} + +func (x *BytesRules) GetIpv4() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ipv4); ok { + return x.Ipv4 + } + } + return false +} + +func (x *BytesRules) GetIpv6() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ipv6); ok { + return x.Ipv6 + } + } + return false +} + +func (x *BytesRules) GetUuid() bool { + if x != nil { + if x, ok := x.xxx_hidden_WellKnown.(*bytesRules_Uuid); ok { + return x.Uuid + } + } + return false +} + +func (x *BytesRules) GetExample() [][]byte { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *BytesRules) SetConst(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 12) +} + +func (x *BytesRules) SetLen(v uint64) { + x.xxx_hidden_Len = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 12) +} + +func (x *BytesRules) SetMinLen(v uint64) { + x.xxx_hidden_MinLen = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 12) +} + +func (x *BytesRules) SetMaxLen(v uint64) { + x.xxx_hidden_MaxLen = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 12) +} + +func (x *BytesRules) SetPattern(v string) { + x.xxx_hidden_Pattern = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 12) +} + +func (x *BytesRules) SetPrefix(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Prefix = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 12) +} + +func (x *BytesRules) SetSuffix(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Suffix = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 6, 12) +} + +func (x *BytesRules) SetContains(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Contains = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 7, 12) +} + +func (x *BytesRules) SetIn(v [][]byte) { + x.xxx_hidden_In = v +} + +func (x *BytesRules) SetNotIn(v [][]byte) { + x.xxx_hidden_NotIn = v +} + +func (x *BytesRules) SetIp(v bool) { + x.xxx_hidden_WellKnown = &bytesRules_Ip{v} +} + +func (x *BytesRules) SetIpv4(v bool) { + x.xxx_hidden_WellKnown = &bytesRules_Ipv4{v} +} + +func (x *BytesRules) SetIpv6(v bool) { + x.xxx_hidden_WellKnown = &bytesRules_Ipv6{v} +} + +func (x *BytesRules) SetUuid(v bool) { + x.xxx_hidden_WellKnown = &bytesRules_Uuid{v} +} + +func (x *BytesRules) SetExample(v [][]byte) { + x.xxx_hidden_Example = v +} + +func (x *BytesRules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *BytesRules) HasLen() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *BytesRules) HasMinLen() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *BytesRules) HasMaxLen() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *BytesRules) HasPattern() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *BytesRules) HasPrefix() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 5) +} + +func (x *BytesRules) HasSuffix() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 6) +} + +func (x *BytesRules) HasContains() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 7) +} + +func (x *BytesRules) HasWellKnown() bool { + if x == nil { + return false + } + return x.xxx_hidden_WellKnown != nil +} + +func (x *BytesRules) HasIp() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ip) + return ok +} + +func (x *BytesRules) HasIpv4() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ipv4) + return ok +} + +func (x *BytesRules) HasIpv6() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ipv6) + return ok +} + +func (x *BytesRules) HasUuid() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Uuid) + return ok +} + +func (x *BytesRules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = nil +} + +func (x *BytesRules) ClearLen() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_Len = 0 +} + +func (x *BytesRules) ClearMinLen() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_MinLen = 0 +} + +func (x *BytesRules) ClearMaxLen() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_MaxLen = 0 +} + +func (x *BytesRules) ClearPattern() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_Pattern = nil +} + +func (x *BytesRules) ClearPrefix() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5) + x.xxx_hidden_Prefix = nil +} + +func (x *BytesRules) ClearSuffix() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 6) + x.xxx_hidden_Suffix = nil +} + +func (x *BytesRules) ClearContains() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 7) + x.xxx_hidden_Contains = nil +} + +func (x *BytesRules) ClearWellKnown() { + x.xxx_hidden_WellKnown = nil +} + +func (x *BytesRules) ClearIp() { + if _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ip); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *BytesRules) ClearIpv4() { + if _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ipv4); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *BytesRules) ClearIpv6() { + if _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Ipv6); ok { + x.xxx_hidden_WellKnown = nil + } +} + +func (x *BytesRules) ClearUuid() { + if _, ok := x.xxx_hidden_WellKnown.(*bytesRules_Uuid); ok { + x.xxx_hidden_WellKnown = nil + } +} + +const BytesRules_WellKnown_not_set_case case_BytesRules_WellKnown = 0 +const BytesRules_Ip_case case_BytesRules_WellKnown = 10 +const BytesRules_Ipv4_case case_BytesRules_WellKnown = 11 +const BytesRules_Ipv6_case case_BytesRules_WellKnown = 12 +const BytesRules_Uuid_case case_BytesRules_WellKnown = 15 + +func (x *BytesRules) WhichWellKnown() case_BytesRules_WellKnown { + if x == nil { + return BytesRules_WellKnown_not_set_case + } + switch x.xxx_hidden_WellKnown.(type) { + case *bytesRules_Ip: + return BytesRules_Ip_case + case *bytesRules_Ipv4: + return BytesRules_Ipv4_case + case *bytesRules_Ipv6: + return BytesRules_Ipv6_case + case *bytesRules_Uuid: + return BytesRules_Uuid_case + default: + return BytesRules_WellKnown_not_set_case + } +} + +type BytesRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified bytes + // value. If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be "\x01\x02\x03\x04" + // bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"]; + // } + // + // ``` + Const []byte + // `len` requires the field value to have the specified length in bytes. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value length must be 4 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + // } + // + // ``` + Len *uint64 + // `min_len` requires the field value to have at least the specified minimum + // length in bytes. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value length must be at least 2 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + // } + // + // ``` + MinLen *uint64 + // `max_len` requires the field value to have at most the specified maximum + // length in bytes. + // If the field value exceeds the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be at most 6 bytes. + // optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + // } + // + // ``` + MaxLen *uint64 + // `pattern` requires the field value to match the specified regular + // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + // The value of the field must be valid UTF-8 or validation will fail with a + // runtime error. + // If the field value doesn't match the pattern, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value must match regex pattern "^[a-zA-Z0-9]+$". + // optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + // } + // + // ``` + Pattern *string + // `prefix` requires the field value to have the specified bytes at the + // beginning of the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not have prefix \x01\x02 + // optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"]; + // } + // + // ``` + Prefix []byte + // `suffix` requires the field value to have the specified bytes at the end + // of the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not have suffix \x03\x04 + // optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"]; + // } + // + // ``` + Suffix []byte + // `contains` requires the field value to have the specified bytes anywhere in + // the string. + // If the field value doesn't meet the requirement, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // value does not contain \x02\x03 + // optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"]; + // } + // + // ``` + Contains []byte + // `in` requires the field value to be equal to one of the specified + // values. If the field value doesn't match any of the specified values, an + // error message is generated. + // + // ```proto + // + // message MyBytes { + // // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // + // ``` + In [][]byte + // `not_in` requires the field value to be not equal to any of the specified + // values. + // If the field value matches any of the specified values, an error message is + // generated. + // + // ```proto + // + // message MyBytes { + // // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] + // optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + // } + // + // ``` + NotIn [][]byte + // WellKnown rules provide advanced rules against common byte + // patterns + + // Fields of oneof xxx_hidden_WellKnown: + // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IP address + // optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + // } + // + // ``` + Ip *bool + // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IPv4 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + // } + // + // ``` + Ipv4 *bool + // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // ```proto + // + // message MyBytes { + // // must be a valid IPv6 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + // } + // + // ``` + Ipv6 *bool + // `uuid` ensures that the field value encodes 128-bit UUID data as defined + // by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). + // The field must contain exactly 16 bytes representing the UUID. If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid UUID + // optional bytes value = 1 [(buf.validate.field).bytes.uuid = true]; + // } + // + // ``` + Uuid *bool + // -- end of xxx_hidden_WellKnown + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyBytes { + // bytes value = 1 [ + // (buf.validate.field).bytes.example = "\x01\x02", + // (buf.validate.field).bytes.example = "\x02\x03" + // ]; + // } + // + // ``` + Example [][]byte +} + +func (b0 BytesRules_builder) Build() *BytesRules { + m0 := &BytesRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 12) + x.xxx_hidden_Const = b.Const + } + if b.Len != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 12) + x.xxx_hidden_Len = *b.Len + } + if b.MinLen != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 12) + x.xxx_hidden_MinLen = *b.MinLen + } + if b.MaxLen != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 12) + x.xxx_hidden_MaxLen = *b.MaxLen + } + if b.Pattern != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 12) + x.xxx_hidden_Pattern = b.Pattern + } + if b.Prefix != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 12) + x.xxx_hidden_Prefix = b.Prefix + } + if b.Suffix != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 6, 12) + x.xxx_hidden_Suffix = b.Suffix + } + if b.Contains != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 7, 12) + x.xxx_hidden_Contains = b.Contains + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + if b.Ip != nil { + x.xxx_hidden_WellKnown = &bytesRules_Ip{*b.Ip} + } + if b.Ipv4 != nil { + x.xxx_hidden_WellKnown = &bytesRules_Ipv4{*b.Ipv4} + } + if b.Ipv6 != nil { + x.xxx_hidden_WellKnown = &bytesRules_Ipv6{*b.Ipv6} + } + if b.Uuid != nil { + x.xxx_hidden_WellKnown = &bytesRules_Uuid{*b.Uuid} + } + x.xxx_hidden_Example = b.Example + return m0 +} + +type case_BytesRules_WellKnown protoreflect.FieldNumber + +func (x case_BytesRules_WellKnown) String() string { + md := file_buf_validate_validate_proto_msgTypes[20].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isBytesRules_WellKnown interface { + isBytesRules_WellKnown() +} + +type bytesRules_Ip struct { + // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IP address + // optional bytes value = 1 [(buf.validate.field).bytes.ip = true]; + // } + // + // ``` + Ip bool `protobuf:"varint,10,opt,name=ip,oneof"` +} + +type bytesRules_Ipv4 struct { + // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid IPv4 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true]; + // } + // + // ``` + Ipv4 bool `protobuf:"varint,11,opt,name=ipv4,oneof"` +} + +type bytesRules_Ipv6 struct { + // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format. + // If the field value doesn't meet this rule, an error message is generated. + // ```proto + // + // message MyBytes { + // // must be a valid IPv6 address + // optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true]; + // } + // + // ``` + Ipv6 bool `protobuf:"varint,12,opt,name=ipv6,oneof"` +} + +type bytesRules_Uuid struct { + // `uuid` ensures that the field value encodes 128-bit UUID data as defined + // by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). + // The field must contain exactly 16 bytes representing the UUID. If the + // field value isn't a valid UUID, an error message will be generated. + // + // ```proto + // + // message MyBytes { + // // must be a valid UUID + // optional bytes value = 1 [(buf.validate.field).bytes.uuid = true]; + // } + // + // ``` + Uuid bool `protobuf:"varint,15,opt,name=uuid,oneof"` +} + +func (*bytesRules_Ip) isBytesRules_WellKnown() {} + +func (*bytesRules_Ipv4) isBytesRules_WellKnown() {} + +func (*bytesRules_Ipv6) isBytesRules_WellKnown() {} + +func (*bytesRules_Uuid) isBytesRules_WellKnown() {} + +// EnumRules describe the rules applied to `enum` values. +type EnumRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const int32 `protobuf:"varint,1,opt,name=const"` + xxx_hidden_DefinedOnly bool `protobuf:"varint,2,opt,name=defined_only,json=definedOnly"` + xxx_hidden_In []int32 `protobuf:"varint,3,rep,name=in"` + xxx_hidden_NotIn []int32 `protobuf:"varint,4,rep,name=not_in,json=notIn"` + xxx_hidden_Example []int32 `protobuf:"varint,5,rep,name=example"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnumRules) Reset() { + *x = EnumRules{} + mi := &file_buf_validate_validate_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnumRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnumRules) ProtoMessage() {} + +func (x *EnumRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EnumRules) GetConst() int32 { + if x != nil { + return x.xxx_hidden_Const + } + return 0 +} + +func (x *EnumRules) GetDefinedOnly() bool { + if x != nil { + return x.xxx_hidden_DefinedOnly + } + return false +} + +func (x *EnumRules) GetIn() []int32 { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *EnumRules) GetNotIn() []int32 { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *EnumRules) GetExample() []int32 { + if x != nil { + return x.xxx_hidden_Example + } + return nil +} + +func (x *EnumRules) SetConst(v int32) { + x.xxx_hidden_Const = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5) +} + +func (x *EnumRules) SetDefinedOnly(v bool) { + x.xxx_hidden_DefinedOnly = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5) +} + +func (x *EnumRules) SetIn(v []int32) { + x.xxx_hidden_In = v +} + +func (x *EnumRules) SetNotIn(v []int32) { + x.xxx_hidden_NotIn = v +} + +func (x *EnumRules) SetExample(v []int32) { + x.xxx_hidden_Example = v +} + +func (x *EnumRules) HasConst() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *EnumRules) HasDefinedOnly() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *EnumRules) ClearConst() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_Const = 0 +} + +func (x *EnumRules) ClearDefinedOnly() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_DefinedOnly = false +} + +type EnumRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` requires the field value to exactly match the specified enum value. + // If the field value doesn't match, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be exactly MY_ENUM_VALUE1. + // MyEnum value = 1 [(buf.validate.field).enum.const = 1]; + // } + // + // ``` + Const *int32 + // `defined_only` requires the field value to be one of the defined values for + // this enum, failing on any undefined value. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be a defined value of MyEnum. + // MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; + // } + // + // ``` + DefinedOnly *bool + // `in` requires the field value to be equal to one of the + // specified enum values. If the field value doesn't match any of the + // specified values, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must be equal to one of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + // } + // + // ``` + In []int32 + // `not_in` requires the field value to be not equal to any of the + // specified enum values. If the field value matches one of the specified + // values, an error message is generated. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // // The field `value` must not be equal to any of the specified values. + // MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + // } + // + // ``` + NotIn []int32 + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // enum MyEnum { + // MY_ENUM_UNSPECIFIED = 0; + // MY_ENUM_VALUE1 = 1; + // MY_ENUM_VALUE2 = 2; + // } + // + // message MyMessage { + // (buf.validate.field).enum.example = 1, + // (buf.validate.field).enum.example = 2 + // } + // + // ``` + Example []int32 +} + +func (b0 EnumRules_builder) Build() *EnumRules { + m0 := &EnumRules{} + b, x := &b0, m0 + _, _ = b, x + if b.Const != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5) + x.xxx_hidden_Const = *b.Const + } + if b.DefinedOnly != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5) + x.xxx_hidden_DefinedOnly = *b.DefinedOnly + } + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = b.Example + return m0 +} + +// RepeatedRules describe the rules applied to `repeated` values. +type RepeatedRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_MinItems uint64 `protobuf:"varint,1,opt,name=min_items,json=minItems"` + xxx_hidden_MaxItems uint64 `protobuf:"varint,2,opt,name=max_items,json=maxItems"` + xxx_hidden_Unique bool `protobuf:"varint,3,opt,name=unique"` + xxx_hidden_Items *FieldRules `protobuf:"bytes,4,opt,name=items"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepeatedRules) Reset() { + *x = RepeatedRules{} + mi := &file_buf_validate_validate_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RepeatedRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepeatedRules) ProtoMessage() {} + +func (x *RepeatedRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *RepeatedRules) GetMinItems() uint64 { + if x != nil { + return x.xxx_hidden_MinItems + } + return 0 +} + +func (x *RepeatedRules) GetMaxItems() uint64 { + if x != nil { + return x.xxx_hidden_MaxItems + } + return 0 +} + +func (x *RepeatedRules) GetUnique() bool { + if x != nil { + return x.xxx_hidden_Unique + } + return false +} + +func (x *RepeatedRules) GetItems() *FieldRules { + if x != nil { + return x.xxx_hidden_Items + } + return nil +} + +func (x *RepeatedRules) SetMinItems(v uint64) { + x.xxx_hidden_MinItems = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *RepeatedRules) SetMaxItems(v uint64) { + x.xxx_hidden_MaxItems = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *RepeatedRules) SetUnique(v bool) { + x.xxx_hidden_Unique = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4) +} + +func (x *RepeatedRules) SetItems(v *FieldRules) { + x.xxx_hidden_Items = v +} + +func (x *RepeatedRules) HasMinItems() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *RepeatedRules) HasMaxItems() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *RepeatedRules) HasUnique() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *RepeatedRules) HasItems() bool { + if x == nil { + return false + } + return x.xxx_hidden_Items != nil +} + +func (x *RepeatedRules) ClearMinItems() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_MinItems = 0 +} + +func (x *RepeatedRules) ClearMaxItems() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_MaxItems = 0 +} + +func (x *RepeatedRules) ClearUnique() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_Unique = false +} + +func (x *RepeatedRules) ClearItems() { + x.xxx_hidden_Items = nil +} + +type RepeatedRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `min_items` requires that this field must contain at least the specified + // minimum number of items. + // + // Note that `min_items = 1` is equivalent to setting a field as `required`. + // + // ```proto + // + // message MyRepeated { + // // value must contain at least 2 items + // repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + // } + // + // ``` + MinItems *uint64 + // `max_items` denotes that this field must not exceed a + // certain number of items as the upper limit. If the field contains more + // items than specified, an error message will be generated, requiring the + // field to maintain no more than the specified number of items. + // + // ```proto + // + // message MyRepeated { + // // value must contain no more than 3 item(s) + // repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + // } + // + // ``` + MaxItems *uint64 + // `unique` indicates that all elements in this field must + // be unique. This rule is strictly applicable to scalar and enum + // types, with message types not being supported. + // + // ```proto + // + // message MyRepeated { + // // repeated value must contain unique items + // repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + // } + // + // ``` + Unique *bool + // `items` details the rules to be applied to each item + // in the field. Even for repeated message fields, validation is executed + // against each item unless `ignore` is specified. + // + // ```proto + // + // message MyRepeated { + // // The items in the field `value` must follow the specified rules. + // repeated string value = 1 [(buf.validate.field).repeated.items = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // + // ``` + // + // Note that the `required` rule does not apply. Repeated items + // cannot be unset. + Items *FieldRules +} + +func (b0 RepeatedRules_builder) Build() *RepeatedRules { + m0 := &RepeatedRules{} + b, x := &b0, m0 + _, _ = b, x + if b.MinItems != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_MinItems = *b.MinItems + } + if b.MaxItems != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_MaxItems = *b.MaxItems + } + if b.Unique != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4) + x.xxx_hidden_Unique = *b.Unique + } + x.xxx_hidden_Items = b.Items + return m0 +} + +// MapRules describe the rules applied to `map` values. +type MapRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_MinPairs uint64 `protobuf:"varint,1,opt,name=min_pairs,json=minPairs"` + xxx_hidden_MaxPairs uint64 `protobuf:"varint,2,opt,name=max_pairs,json=maxPairs"` + xxx_hidden_Keys *FieldRules `protobuf:"bytes,4,opt,name=keys"` + xxx_hidden_Values *FieldRules `protobuf:"bytes,5,opt,name=values"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MapRules) Reset() { + *x = MapRules{} + mi := &file_buf_validate_validate_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MapRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MapRules) ProtoMessage() {} + +func (x *MapRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MapRules) GetMinPairs() uint64 { + if x != nil { + return x.xxx_hidden_MinPairs + } + return 0 +} + +func (x *MapRules) GetMaxPairs() uint64 { + if x != nil { + return x.xxx_hidden_MaxPairs + } + return 0 +} + +func (x *MapRules) GetKeys() *FieldRules { + if x != nil { + return x.xxx_hidden_Keys + } + return nil +} + +func (x *MapRules) GetValues() *FieldRules { + if x != nil { + return x.xxx_hidden_Values + } + return nil +} + +func (x *MapRules) SetMinPairs(v uint64) { + x.xxx_hidden_MinPairs = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4) +} + +func (x *MapRules) SetMaxPairs(v uint64) { + x.xxx_hidden_MaxPairs = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4) +} + +func (x *MapRules) SetKeys(v *FieldRules) { + x.xxx_hidden_Keys = v +} + +func (x *MapRules) SetValues(v *FieldRules) { + x.xxx_hidden_Values = v +} + +func (x *MapRules) HasMinPairs() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *MapRules) HasMaxPairs() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *MapRules) HasKeys() bool { + if x == nil { + return false + } + return x.xxx_hidden_Keys != nil +} + +func (x *MapRules) HasValues() bool { + if x == nil { + return false + } + return x.xxx_hidden_Values != nil +} + +func (x *MapRules) ClearMinPairs() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_MinPairs = 0 +} + +func (x *MapRules) ClearMaxPairs() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_MaxPairs = 0 +} + +func (x *MapRules) ClearKeys() { + x.xxx_hidden_Keys = nil +} + +func (x *MapRules) ClearValues() { + x.xxx_hidden_Values = nil +} + +type MapRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // Specifies the minimum number of key-value pairs allowed. If the field has + // fewer key-value pairs than specified, an error message is generated. + // + // ```proto + // + // message MyMap { + // // The field `value` must have at least 2 key-value pairs. + // map value = 1 [(buf.validate.field).map.min_pairs = 2]; + // } + // + // ``` + MinPairs *uint64 + // Specifies the maximum number of key-value pairs allowed. If the field has + // more key-value pairs than specified, an error message is generated. + // + // ```proto + // + // message MyMap { + // // The field `value` must have at most 3 key-value pairs. + // map value = 1 [(buf.validate.field).map.max_pairs = 3]; + // } + // + // ``` + MaxPairs *uint64 + // Specifies the rules to be applied to each key in the field. + // + // ```proto + // + // message MyMap { + // // The keys in the field `value` must follow the specified rules. + // map value = 1 [(buf.validate.field).map.keys = { + // string: { + // min_len: 3 + // max_len: 10 + // } + // }]; + // } + // + // ``` + // + // Note that the `required` rule does not apply. Map keys cannot be unset. + Keys *FieldRules + // Specifies the rules to be applied to the value of each key in the + // field. Message values will still have their validations evaluated unless + // `ignore` is specified. + // + // ```proto + // + // message MyMap { + // // The values in the field `value` must follow the specified rules. + // map value = 1 [(buf.validate.field).map.values = { + // string: { + // min_len: 5 + // max_len: 20 + // } + // }]; + // } + // + // ``` + // Note that the `required` rule does not apply. Map values cannot be unset. + Values *FieldRules +} + +func (b0 MapRules_builder) Build() *MapRules { + m0 := &MapRules{} + b, x := &b0, m0 + _, _ = b, x + if b.MinPairs != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4) + x.xxx_hidden_MinPairs = *b.MinPairs + } + if b.MaxPairs != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4) + x.xxx_hidden_MaxPairs = *b.MaxPairs + } + x.xxx_hidden_Keys = b.Keys + x.xxx_hidden_Values = b.Values + return m0 +} + +// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type. +type AnyRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_In []string `protobuf:"bytes,2,rep,name=in"` + xxx_hidden_NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AnyRules) Reset() { + *x = AnyRules{} + mi := &file_buf_validate_validate_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AnyRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnyRules) ProtoMessage() {} + +func (x *AnyRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AnyRules) GetIn() []string { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *AnyRules) GetNotIn() []string { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *AnyRules) SetIn(v []string) { + x.xxx_hidden_In = v +} + +func (x *AnyRules) SetNotIn(v []string) { + x.xxx_hidden_NotIn = v +} + +type AnyRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `in` requires the field's `type_url` to be equal to one of the + // specified values. If it doesn't match any of the specified values, an error + // message is generated. + // + // ```proto + // + // message MyAny { + // // The `value` field must have a `type_url` equal to one of the specified values. + // google.protobuf.Any value = 1 [(buf.validate.field).any = { + // in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"] + // }]; + // } + // + // ``` + In []string + // `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated. + // + // ```proto + // + // message MyAny { + // // The `value` field must not have a `type_url` equal to any of the specified values. + // google.protobuf.Any value = 1 [(buf.validate.field).any = { + // not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"] + // }]; + // } + // + // ``` + NotIn []string +} + +func (b0 AnyRules_builder) Build() *AnyRules { + m0 := &AnyRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + return m0 +} + +// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type. +type DurationRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const *durationpb.Duration `protobuf:"bytes,2,opt,name=const"` + xxx_hidden_LessThan isDurationRules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isDurationRules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_In *[]*durationpb.Duration `protobuf:"bytes,7,rep,name=in"` + xxx_hidden_NotIn *[]*durationpb.Duration `protobuf:"bytes,8,rep,name=not_in,json=notIn"` + xxx_hidden_Example *[]*durationpb.Duration `protobuf:"bytes,9,rep,name=example"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DurationRules) Reset() { + *x = DurationRules{} + mi := &file_buf_validate_validate_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DurationRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DurationRules) ProtoMessage() {} + +func (x *DurationRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *DurationRules) GetConst() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_Const + } + return nil +} + +func (x *DurationRules) GetLt() *durationpb.Duration { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*durationRules_Lt); ok { + return x.Lt + } + } + return nil +} + +func (x *DurationRules) GetLte() *durationpb.Duration { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*durationRules_Lte); ok { + return x.Lte + } + } + return nil +} + +func (x *DurationRules) GetGt() *durationpb.Duration { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*durationRules_Gt); ok { + return x.Gt + } + } + return nil +} + +func (x *DurationRules) GetGte() *durationpb.Duration { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*durationRules_Gte); ok { + return x.Gte + } + } + return nil +} + +func (x *DurationRules) GetIn() []*durationpb.Duration { + if x != nil { + if x.xxx_hidden_In != nil { + return *x.xxx_hidden_In + } + } + return nil +} + +func (x *DurationRules) GetNotIn() []*durationpb.Duration { + if x != nil { + if x.xxx_hidden_NotIn != nil { + return *x.xxx_hidden_NotIn + } + } + return nil +} + +func (x *DurationRules) GetExample() []*durationpb.Duration { + if x != nil { + if x.xxx_hidden_Example != nil { + return *x.xxx_hidden_Example + } + } + return nil +} + +func (x *DurationRules) SetConst(v *durationpb.Duration) { + x.xxx_hidden_Const = v +} + +func (x *DurationRules) SetLt(v *durationpb.Duration) { + if v == nil { + x.xxx_hidden_LessThan = nil + return + } + x.xxx_hidden_LessThan = &durationRules_Lt{v} +} + +func (x *DurationRules) SetLte(v *durationpb.Duration) { + if v == nil { + x.xxx_hidden_LessThan = nil + return + } + x.xxx_hidden_LessThan = &durationRules_Lte{v} +} + +func (x *DurationRules) SetGt(v *durationpb.Duration) { + if v == nil { + x.xxx_hidden_GreaterThan = nil + return + } + x.xxx_hidden_GreaterThan = &durationRules_Gt{v} +} + +func (x *DurationRules) SetGte(v *durationpb.Duration) { + if v == nil { + x.xxx_hidden_GreaterThan = nil + return + } + x.xxx_hidden_GreaterThan = &durationRules_Gte{v} +} + +func (x *DurationRules) SetIn(v []*durationpb.Duration) { + x.xxx_hidden_In = &v +} + +func (x *DurationRules) SetNotIn(v []*durationpb.Duration) { + x.xxx_hidden_NotIn = &v +} + +func (x *DurationRules) SetExample(v []*durationpb.Duration) { + x.xxx_hidden_Example = &v +} + +func (x *DurationRules) HasConst() bool { + if x == nil { + return false + } + return x.xxx_hidden_Const != nil +} + +func (x *DurationRules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *DurationRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*durationRules_Lt) + return ok +} + +func (x *DurationRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*durationRules_Lte) + return ok +} + +func (x *DurationRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *DurationRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*durationRules_Gt) + return ok +} + +func (x *DurationRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*durationRules_Gte) + return ok +} + +func (x *DurationRules) ClearConst() { + x.xxx_hidden_Const = nil +} + +func (x *DurationRules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *DurationRules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*durationRules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *DurationRules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*durationRules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *DurationRules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *DurationRules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*durationRules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *DurationRules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*durationRules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +const DurationRules_LessThan_not_set_case case_DurationRules_LessThan = 0 +const DurationRules_Lt_case case_DurationRules_LessThan = 3 +const DurationRules_Lte_case case_DurationRules_LessThan = 4 + +func (x *DurationRules) WhichLessThan() case_DurationRules_LessThan { + if x == nil { + return DurationRules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *durationRules_Lt: + return DurationRules_Lt_case + case *durationRules_Lte: + return DurationRules_Lte_case + default: + return DurationRules_LessThan_not_set_case + } +} + +const DurationRules_GreaterThan_not_set_case case_DurationRules_GreaterThan = 0 +const DurationRules_Gt_case case_DurationRules_GreaterThan = 5 +const DurationRules_Gte_case case_DurationRules_GreaterThan = 6 + +func (x *DurationRules) WhichGreaterThan() case_DurationRules_GreaterThan { + if x == nil { + return DurationRules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *durationRules_Gt: + return DurationRules_Gt_case + case *durationRules_Gte: + return DurationRules_Gte_case + default: + return DurationRules_GreaterThan_not_set_case + } +} + +type DurationRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. + // + // ```proto + // + // message MyDuration { + // // value must equal 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; + // } + // + // ``` + Const *durationpb.Duration + // Fields of oneof xxx_hidden_LessThan: + // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + // exclusive. If the field's value is greater than or equal to the specified + // value, an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; + // } + // + // ``` + Lt *durationpb.Duration + // `lte` indicates that the field must be less than or equal to the specified + // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than or equal to 10s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; + // } + // + // ``` + Lte *durationpb.Duration + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the duration field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than 5s [duration.gt] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + // + // // duration must be greater than 5s and less than 10s [duration.gt_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gt *durationpb.Duration + // `gte` requires the duration field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value must + // be outside the specified range. If the field value doesn't meet the + // required conditions, an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than or equal to 5s [duration.gte] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; + // + // // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gte *durationpb.Duration + // -- end of xxx_hidden_GreaterThan + // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + // If the field's value doesn't correspond to any of the specified values, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be in list [1s, 2s, 3s] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; + // } + // + // ``` + In []*durationpb.Duration + // `not_in` denotes that the field must not be equal to + // any of the specified values of the `google.protobuf.Duration` type. + // If the field's value matches any of these values, an error message will be + // generated. + // + // ```proto + // + // message MyDuration { + // // value must not be in list [1s, 2s, 3s] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; + // } + // + // ``` + NotIn []*durationpb.Duration + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyDuration { + // google.protobuf.Duration value = 1 [ + // (buf.validate.field).duration.example = { seconds: 1 }, + // (buf.validate.field).duration.example = { seconds: 2 }, + // ]; + // } + // + // ``` + Example []*durationpb.Duration +} + +func (b0 DurationRules_builder) Build() *DurationRules { + m0 := &DurationRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Const = b.Const + if b.Lt != nil { + x.xxx_hidden_LessThan = &durationRules_Lt{b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = &durationRules_Lte{b.Lte} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = &durationRules_Gt{b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = &durationRules_Gte{b.Gte} + } + x.xxx_hidden_In = &b.In + x.xxx_hidden_NotIn = &b.NotIn + x.xxx_hidden_Example = &b.Example + return m0 +} + +type case_DurationRules_LessThan protoreflect.FieldNumber + +func (x case_DurationRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[25].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_DurationRules_GreaterThan protoreflect.FieldNumber + +func (x case_DurationRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[25].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isDurationRules_LessThan interface { + isDurationRules_LessThan() +} + +type durationRules_Lt struct { + // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type, + // exclusive. If the field's value is greater than or equal to the specified + // value, an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than 5s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; + // } + // + // ``` + Lt *durationpb.Duration `protobuf:"bytes,3,opt,name=lt,oneof"` +} + +type durationRules_Lte struct { + // `lte` indicates that the field must be less than or equal to the specified + // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value, + // an error message will be generated. + // + // ```proto + // + // message MyDuration { + // // must be less than or equal to 10s + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; + // } + // + // ``` + Lte *durationpb.Duration `protobuf:"bytes,4,opt,name=lte,oneof"` +} + +func (*durationRules_Lt) isDurationRules_LessThan() {} + +func (*durationRules_Lte) isDurationRules_LessThan() {} + +type isDurationRules_GreaterThan interface { + isDurationRules_GreaterThan() +} + +type durationRules_Gt struct { + // `gt` requires the duration field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than 5s [duration.gt] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }]; + // + // // duration must be greater than 5s and less than 10s [duration.gt_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gt *durationpb.Duration `protobuf:"bytes,5,opt,name=gt,oneof"` +} + +type durationRules_Gte struct { + // `gte` requires the duration field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value must + // be outside the specified range. If the field value doesn't meet the + // required conditions, an error message is generated. + // + // ```proto + // + // message MyDuration { + // // duration must be greater than or equal to 5s [duration.gte] + // google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }]; + // + // // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt] + // google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }]; + // + // // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive] + // google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }]; + // } + // + // ``` + Gte *durationpb.Duration `protobuf:"bytes,6,opt,name=gte,oneof"` +} + +func (*durationRules_Gt) isDurationRules_GreaterThan() {} + +func (*durationRules_Gte) isDurationRules_GreaterThan() {} + +// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type. +type FieldMaskRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const *fieldmaskpb.FieldMask `protobuf:"bytes,1,opt,name=const"` + xxx_hidden_In []string `protobuf:"bytes,2,rep,name=in"` + xxx_hidden_NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn"` + xxx_hidden_Example *[]*fieldmaskpb.FieldMask `protobuf:"bytes,4,rep,name=example"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldMaskRules) Reset() { + *x = FieldMaskRules{} + mi := &file_buf_validate_validate_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldMaskRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldMaskRules) ProtoMessage() {} + +func (x *FieldMaskRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldMaskRules) GetConst() *fieldmaskpb.FieldMask { + if x != nil { + return x.xxx_hidden_Const + } + return nil +} + +func (x *FieldMaskRules) GetIn() []string { + if x != nil { + return x.xxx_hidden_In + } + return nil +} + +func (x *FieldMaskRules) GetNotIn() []string { + if x != nil { + return x.xxx_hidden_NotIn + } + return nil +} + +func (x *FieldMaskRules) GetExample() []*fieldmaskpb.FieldMask { + if x != nil { + if x.xxx_hidden_Example != nil { + return *x.xxx_hidden_Example + } + } + return nil +} + +func (x *FieldMaskRules) SetConst(v *fieldmaskpb.FieldMask) { + x.xxx_hidden_Const = v +} + +func (x *FieldMaskRules) SetIn(v []string) { + x.xxx_hidden_In = v +} + +func (x *FieldMaskRules) SetNotIn(v []string) { + x.xxx_hidden_NotIn = v +} + +func (x *FieldMaskRules) SetExample(v []*fieldmaskpb.FieldMask) { + x.xxx_hidden_Example = &v +} + +func (x *FieldMaskRules) HasConst() bool { + if x == nil { + return false + } + return x.xxx_hidden_Const != nil +} + +func (x *FieldMaskRules) ClearConst() { + x.xxx_hidden_Const = nil +} + +type FieldMaskRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly. + // If the field's value deviates from the specified value, an error message + // will be generated. + // + // ```proto + // + // message MyFieldMask { + // // value must equal ["a"] + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = { + // paths: ["a"] + // }]; + // } + // + // ``` + Const *fieldmaskpb.FieldMask + // `in` requires the field value to only contain paths matching specified + // values or their subpaths. + // If any of the field value's paths doesn't match the rule, + // an error message is generated. + // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + // + // ```proto + // + // message MyFieldMask { + // // The `value` FieldMask must only contain paths listed in `in`. + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + // in: ["a", "b", "c.a"] + // }]; + // } + // + // ``` + In []string + // `not_in` requires the field value to not contain paths matching specified + // values or their subpaths. + // If any of the field value's paths matches the rule, + // an error message is generated. + // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + // + // ```proto + // + // message MyFieldMask { + // // The `value` FieldMask shall not contain paths listed in `not_in`. + // google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + // not_in: ["forbidden", "immutable", "c.a"] + // }]; + // } + // + // ``` + NotIn []string + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyFieldMask { + // google.protobuf.FieldMask value = 1 [ + // (buf.validate.field).field_mask.example = { paths: ["a", "b"] }, + // (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }, + // ]; + // } + // + // ``` + Example []*fieldmaskpb.FieldMask +} + +func (b0 FieldMaskRules_builder) Build() *FieldMaskRules { + m0 := &FieldMaskRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Const = b.Const + x.xxx_hidden_In = b.In + x.xxx_hidden_NotIn = b.NotIn + x.xxx_hidden_Example = &b.Example + return m0 +} + +// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type. +type TimestampRules struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Const *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=const"` + xxx_hidden_LessThan isTimestampRules_LessThan `protobuf_oneof:"less_than"` + xxx_hidden_GreaterThan isTimestampRules_GreaterThan `protobuf_oneof:"greater_than"` + xxx_hidden_Within *durationpb.Duration `protobuf:"bytes,9,opt,name=within"` + xxx_hidden_Example *[]*timestamppb.Timestamp `protobuf:"bytes,10,rep,name=example"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TimestampRules) Reset() { + *x = TimestampRules{} + mi := &file_buf_validate_validate_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TimestampRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimestampRules) ProtoMessage() {} + +func (x *TimestampRules) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TimestampRules) GetConst() *timestamppb.Timestamp { + if x != nil { + return x.xxx_hidden_Const + } + return nil +} + +func (x *TimestampRules) GetLt() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*timestampRules_Lt); ok { + return x.Lt + } + } + return nil +} + +func (x *TimestampRules) GetLte() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*timestampRules_Lte); ok { + return x.Lte + } + } + return nil +} + +func (x *TimestampRules) GetLtNow() bool { + if x != nil { + if x, ok := x.xxx_hidden_LessThan.(*timestampRules_LtNow); ok { + return x.LtNow + } + } + return false +} + +func (x *TimestampRules) GetGt() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*timestampRules_Gt); ok { + return x.Gt + } + } + return nil +} + +func (x *TimestampRules) GetGte() *timestamppb.Timestamp { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*timestampRules_Gte); ok { + return x.Gte + } + } + return nil +} + +func (x *TimestampRules) GetGtNow() bool { + if x != nil { + if x, ok := x.xxx_hidden_GreaterThan.(*timestampRules_GtNow); ok { + return x.GtNow + } + } + return false +} + +func (x *TimestampRules) GetWithin() *durationpb.Duration { + if x != nil { + return x.xxx_hidden_Within + } + return nil +} + +func (x *TimestampRules) GetExample() []*timestamppb.Timestamp { + if x != nil { + if x.xxx_hidden_Example != nil { + return *x.xxx_hidden_Example + } + } + return nil +} + +func (x *TimestampRules) SetConst(v *timestamppb.Timestamp) { + x.xxx_hidden_Const = v +} + +func (x *TimestampRules) SetLt(v *timestamppb.Timestamp) { + if v == nil { + x.xxx_hidden_LessThan = nil + return + } + x.xxx_hidden_LessThan = ×tampRules_Lt{v} +} + +func (x *TimestampRules) SetLte(v *timestamppb.Timestamp) { + if v == nil { + x.xxx_hidden_LessThan = nil + return + } + x.xxx_hidden_LessThan = ×tampRules_Lte{v} +} + +func (x *TimestampRules) SetLtNow(v bool) { + x.xxx_hidden_LessThan = ×tampRules_LtNow{v} +} + +func (x *TimestampRules) SetGt(v *timestamppb.Timestamp) { + if v == nil { + x.xxx_hidden_GreaterThan = nil + return + } + x.xxx_hidden_GreaterThan = ×tampRules_Gt{v} +} + +func (x *TimestampRules) SetGte(v *timestamppb.Timestamp) { + if v == nil { + x.xxx_hidden_GreaterThan = nil + return + } + x.xxx_hidden_GreaterThan = ×tampRules_Gte{v} +} + +func (x *TimestampRules) SetGtNow(v bool) { + x.xxx_hidden_GreaterThan = ×tampRules_GtNow{v} +} + +func (x *TimestampRules) SetWithin(v *durationpb.Duration) { + x.xxx_hidden_Within = v +} + +func (x *TimestampRules) SetExample(v []*timestamppb.Timestamp) { + x.xxx_hidden_Example = &v +} + +func (x *TimestampRules) HasConst() bool { + if x == nil { + return false + } + return x.xxx_hidden_Const != nil +} + +func (x *TimestampRules) HasLessThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_LessThan != nil +} + +func (x *TimestampRules) HasLt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*timestampRules_Lt) + return ok +} + +func (x *TimestampRules) HasLte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*timestampRules_Lte) + return ok +} + +func (x *TimestampRules) HasLtNow() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_LessThan.(*timestampRules_LtNow) + return ok +} + +func (x *TimestampRules) HasGreaterThan() bool { + if x == nil { + return false + } + return x.xxx_hidden_GreaterThan != nil +} + +func (x *TimestampRules) HasGt() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*timestampRules_Gt) + return ok +} + +func (x *TimestampRules) HasGte() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*timestampRules_Gte) + return ok +} + +func (x *TimestampRules) HasGtNow() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_GreaterThan.(*timestampRules_GtNow) + return ok +} + +func (x *TimestampRules) HasWithin() bool { + if x == nil { + return false + } + return x.xxx_hidden_Within != nil +} + +func (x *TimestampRules) ClearConst() { + x.xxx_hidden_Const = nil +} + +func (x *TimestampRules) ClearLessThan() { + x.xxx_hidden_LessThan = nil +} + +func (x *TimestampRules) ClearLt() { + if _, ok := x.xxx_hidden_LessThan.(*timestampRules_Lt); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *TimestampRules) ClearLte() { + if _, ok := x.xxx_hidden_LessThan.(*timestampRules_Lte); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *TimestampRules) ClearLtNow() { + if _, ok := x.xxx_hidden_LessThan.(*timestampRules_LtNow); ok { + x.xxx_hidden_LessThan = nil + } +} + +func (x *TimestampRules) ClearGreaterThan() { + x.xxx_hidden_GreaterThan = nil +} + +func (x *TimestampRules) ClearGt() { + if _, ok := x.xxx_hidden_GreaterThan.(*timestampRules_Gt); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *TimestampRules) ClearGte() { + if _, ok := x.xxx_hidden_GreaterThan.(*timestampRules_Gte); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *TimestampRules) ClearGtNow() { + if _, ok := x.xxx_hidden_GreaterThan.(*timestampRules_GtNow); ok { + x.xxx_hidden_GreaterThan = nil + } +} + +func (x *TimestampRules) ClearWithin() { + x.xxx_hidden_Within = nil +} + +const TimestampRules_LessThan_not_set_case case_TimestampRules_LessThan = 0 +const TimestampRules_Lt_case case_TimestampRules_LessThan = 3 +const TimestampRules_Lte_case case_TimestampRules_LessThan = 4 +const TimestampRules_LtNow_case case_TimestampRules_LessThan = 7 + +func (x *TimestampRules) WhichLessThan() case_TimestampRules_LessThan { + if x == nil { + return TimestampRules_LessThan_not_set_case + } + switch x.xxx_hidden_LessThan.(type) { + case *timestampRules_Lt: + return TimestampRules_Lt_case + case *timestampRules_Lte: + return TimestampRules_Lte_case + case *timestampRules_LtNow: + return TimestampRules_LtNow_case + default: + return TimestampRules_LessThan_not_set_case + } +} + +const TimestampRules_GreaterThan_not_set_case case_TimestampRules_GreaterThan = 0 +const TimestampRules_Gt_case case_TimestampRules_GreaterThan = 5 +const TimestampRules_Gte_case case_TimestampRules_GreaterThan = 6 +const TimestampRules_GtNow_case case_TimestampRules_GreaterThan = 8 + +func (x *TimestampRules) WhichGreaterThan() case_TimestampRules_GreaterThan { + if x == nil { + return TimestampRules_GreaterThan_not_set_case + } + switch x.xxx_hidden_GreaterThan.(type) { + case *timestampRules_Gt: + return TimestampRules_Gt_case + case *timestampRules_Gte: + return TimestampRules_Gte_case + case *timestampRules_GtNow: + return TimestampRules_GtNow_case + default: + return TimestampRules_GreaterThan_not_set_case + } +} + +type TimestampRules_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated. + // + // ```proto + // + // message MyTimestamp { + // // value must equal 2023-05-03T10:00:00Z + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; + // } + // + // ``` + Const *timestamppb.Timestamp + // Fields of oneof xxx_hidden_LessThan: + // `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }]; + // } + // + // ``` + Lt *timestamppb.Timestamp + // `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }]; + // } + // + // ``` + Lte *timestamppb.Timestamp + // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be less than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; + // } + // + // ``` + LtNow *bool + // -- end of xxx_hidden_LessThan + // Fields of oneof xxx_hidden_GreaterThan: + // `gt` requires the timestamp field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + // + // // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gt *timestamppb.Timestamp + // `gte` requires the timestamp field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value + // must be outside the specified range. If the field value doesn't meet + // the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + // + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gte *timestamppb.Timestamp + // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be greater than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; + // } + // + // ``` + GtNow *bool + // -- end of xxx_hidden_GreaterThan + // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // must be within 1 hour of now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; + // } + // + // ``` + Within *durationpb.Duration + // `example` specifies values that the field may have. These values SHOULD + // conform to other rules. `example` values will not impact validation + // but may be used as helpful guidance on how to populate the given field. + // + // ```proto + // + // message MyTimestamp { + // google.protobuf.Timestamp value = 1 [ + // (buf.validate.field).timestamp.example = { seconds: 1672444800 }, + // (buf.validate.field).timestamp.example = { seconds: 1672531200 }, + // ]; + // } + // + // ``` + Example []*timestamppb.Timestamp +} + +func (b0 TimestampRules_builder) Build() *TimestampRules { + m0 := &TimestampRules{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Const = b.Const + if b.Lt != nil { + x.xxx_hidden_LessThan = ×tampRules_Lt{b.Lt} + } + if b.Lte != nil { + x.xxx_hidden_LessThan = ×tampRules_Lte{b.Lte} + } + if b.LtNow != nil { + x.xxx_hidden_LessThan = ×tampRules_LtNow{*b.LtNow} + } + if b.Gt != nil { + x.xxx_hidden_GreaterThan = ×tampRules_Gt{b.Gt} + } + if b.Gte != nil { + x.xxx_hidden_GreaterThan = ×tampRules_Gte{b.Gte} + } + if b.GtNow != nil { + x.xxx_hidden_GreaterThan = ×tampRules_GtNow{*b.GtNow} + } + x.xxx_hidden_Within = b.Within + x.xxx_hidden_Example = &b.Example + return m0 +} + +type case_TimestampRules_LessThan protoreflect.FieldNumber + +func (x case_TimestampRules_LessThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[27].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type case_TimestampRules_GreaterThan protoreflect.FieldNumber + +func (x case_TimestampRules_GreaterThan) String() string { + md := file_buf_validate_validate_proto_msgTypes[27].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isTimestampRules_LessThan interface { + isTimestampRules_LessThan() +} + +type timestampRules_Lt struct { + // `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }]; + // } + // + // ``` + Lt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lt,oneof"` +} + +type timestampRules_Lte struct { + // `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }]; + // } + // + // ``` + Lte *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=lte,oneof"` +} + +type timestampRules_LtNow struct { + // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be less than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true]; + // } + // + // ``` + LtNow bool `protobuf:"varint,7,opt,name=lt_now,json=ltNow,oneof"` +} + +func (*timestampRules_Lt) isTimestampRules_LessThan() {} + +func (*timestampRules_Lte) isTimestampRules_LessThan() {} + +func (*timestampRules_LtNow) isTimestampRules_LessThan() {} + +type isTimestampRules_GreaterThan interface { + isTimestampRules_GreaterThan() +} + +type timestampRules_Gt struct { + // `gt` requires the timestamp field value to be greater than the specified + // value (exclusive). If the value of `gt` is larger than a specified `lt` + // or `lte`, the range is reversed, and the field value must be outside the + // specified range. If the field value doesn't meet the required conditions, + // an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }]; + // + // // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=gt,oneof"` +} + +type timestampRules_Gte struct { + // `gte` requires the timestamp field value to be greater than or equal to the + // specified value (exclusive). If the value of `gte` is larger than a + // specified `lt` or `lte`, the range is reversed, and the field value + // must be outside the specified range. If the field value doesn't meet + // the required conditions, an error message is generated. + // + // ```proto + // + // message MyTimestamp { + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte] + // google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }]; + // + // // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt] + // google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }]; + // + // // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive] + // google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }]; + // } + // + // ``` + Gte *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=gte,oneof"` +} + +type timestampRules_GtNow struct { + // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule. + // + // ```proto + // + // message MyTimestamp { + // // must be greater than now + // google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true]; + // } + // + // ``` + GtNow bool `protobuf:"varint,8,opt,name=gt_now,json=gtNow,oneof"` +} + +func (*timestampRules_Gt) isTimestampRules_GreaterThan() {} + +func (*timestampRules_Gte) isTimestampRules_GreaterThan() {} + +func (*timestampRules_GtNow) isTimestampRules_GreaterThan() {} + +// `Violations` is a collection of `Violation` messages. This message type is returned by +// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules. +// Each individual violation is represented by a `Violation` message. +type Violations struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Violations *[]*Violation `protobuf:"bytes,1,rep,name=violations"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Violations) Reset() { + *x = Violations{} + mi := &file_buf_validate_validate_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Violations) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Violations) ProtoMessage() {} + +func (x *Violations) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Violations) GetViolations() []*Violation { + if x != nil { + if x.xxx_hidden_Violations != nil { + return *x.xxx_hidden_Violations + } + } + return nil +} + +func (x *Violations) SetViolations(v []*Violation) { + x.xxx_hidden_Violations = &v +} + +type Violations_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. + Violations []*Violation +} + +func (b0 Violations_builder) Build() *Violations { + m0 := &Violations{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Violations = &b.Violations + return m0 +} + +// `Violation` represents a single instance where a validation rule, expressed +// as a `Rule`, was not met. It provides information about the field that +// caused the violation, the specific rule that wasn't fulfilled, and a +// human-readable error message. +// +// For example, consider the following message: +// +// ```proto +// +// message User { +// int32 age = 1 [(buf.validate.field).cel = { +// id: "user.age", +// expression: "this < 18 ? 'User must be at least 18 years old' : ''", +// }]; +// } +// +// ``` +// +// It could produce the following violation: +// +// ```json +// +// { +// "ruleId": "user.age", +// "message": "User must be at least 18 years old", +// "field": { +// "elements": [ +// { +// "fieldNumber": 1, +// "fieldName": "age", +// "fieldType": "TYPE_INT32" +// } +// ] +// }, +// "rule": { +// "elements": [ +// { +// "fieldNumber": 23, +// "fieldName": "cel", +// "fieldType": "TYPE_MESSAGE", +// "index": "0" +// } +// ] +// } +// } +// +// ``` +type Violation struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Field *FieldPath `protobuf:"bytes,5,opt,name=field"` + xxx_hidden_Rule *FieldPath `protobuf:"bytes,6,opt,name=rule"` + xxx_hidden_RuleId *string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId"` + xxx_hidden_Message *string `protobuf:"bytes,3,opt,name=message"` + xxx_hidden_ForKey bool `protobuf:"varint,4,opt,name=for_key,json=forKey"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Violation) Reset() { + *x = Violation{} + mi := &file_buf_validate_validate_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Violation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Violation) ProtoMessage() {} + +func (x *Violation) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Violation) GetField() *FieldPath { + if x != nil { + return x.xxx_hidden_Field + } + return nil +} + +func (x *Violation) GetRule() *FieldPath { + if x != nil { + return x.xxx_hidden_Rule + } + return nil +} + +func (x *Violation) GetRuleId() string { + if x != nil { + if x.xxx_hidden_RuleId != nil { + return *x.xxx_hidden_RuleId + } + return "" + } + return "" +} + +func (x *Violation) GetMessage() string { + if x != nil { + if x.xxx_hidden_Message != nil { + return *x.xxx_hidden_Message + } + return "" + } + return "" +} + +func (x *Violation) GetForKey() bool { + if x != nil { + return x.xxx_hidden_ForKey + } + return false +} + +func (x *Violation) SetField(v *FieldPath) { + x.xxx_hidden_Field = v +} + +func (x *Violation) SetRule(v *FieldPath) { + x.xxx_hidden_Rule = v +} + +func (x *Violation) SetRuleId(v string) { + x.xxx_hidden_RuleId = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5) +} + +func (x *Violation) SetMessage(v string) { + x.xxx_hidden_Message = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5) +} + +func (x *Violation) SetForKey(v bool) { + x.xxx_hidden_ForKey = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 5) +} + +func (x *Violation) HasField() bool { + if x == nil { + return false + } + return x.xxx_hidden_Field != nil +} + +func (x *Violation) HasRule() bool { + if x == nil { + return false + } + return x.xxx_hidden_Rule != nil +} + +func (x *Violation) HasRuleId() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *Violation) HasMessage() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *Violation) HasForKey() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *Violation) ClearField() { + x.xxx_hidden_Field = nil +} + +func (x *Violation) ClearRule() { + x.xxx_hidden_Rule = nil +} + +func (x *Violation) ClearRuleId() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_RuleId = nil +} + +func (x *Violation) ClearMessage() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_Message = nil +} + +func (x *Violation) ClearForKey() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_ForKey = false +} + +type Violation_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `field` is a machine-readable path to the field that failed validation. + // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. + // + // For example, consider the following message: + // + // ```proto + // + // message Message { + // bool a = 1 [(buf.validate.field).required = true]; + // } + // + // ``` + // + // It could produce the following violation: + // + // ```textproto + // + // violation { + // field { element { field_number: 1, field_name: "a", field_type: 8 } } + // ... + // } + // + // ``` + Field *FieldPath + // `rule` is a machine-readable path that points to the specific rule that failed validation. + // This will be a nested field starting from the FieldRules of the field that failed validation. + // For custom rules, this will provide the path of the rule, e.g. `cel[0]`. + // + // For example, consider the following message: + // + // ```proto + // + // message Message { + // bool a = 1 [(buf.validate.field).required = true]; + // bool b = 2 [(buf.validate.field).cel = { + // id: "custom_rule", + // expression: "!this ? 'b must be true': ''" + // }] + // } + // + // ``` + // + // It could produce the following violations: + // + // ```textproto + // + // violation { + // rule { element { field_number: 25, field_name: "required", field_type: 8 } } + // ... + // } + // + // violation { + // rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } } + // ... + // } + // + // ``` + Rule *FieldPath + // `rule_id` is the unique identifier of the `Rule` that was not fulfilled. + // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated. + RuleId *string + // `message` is a human-readable error message that describes the nature of the violation. + // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation. + Message *string + // `for_key` indicates whether the violation was caused by a map key, rather than a value. + ForKey *bool +} + +func (b0 Violation_builder) Build() *Violation { + m0 := &Violation{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Field = b.Field + x.xxx_hidden_Rule = b.Rule + if b.RuleId != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5) + x.xxx_hidden_RuleId = b.RuleId + } + if b.Message != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5) + x.xxx_hidden_Message = b.Message + } + if b.ForKey != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 5) + x.xxx_hidden_ForKey = *b.ForKey + } + return m0 +} + +// `FieldPath` provides a path to a nested protobuf field. +// +// This message provides enough information to render a dotted field path even without protobuf descriptors. +// It also provides enough information to resolve a nested field through unknown wire data. +type FieldPath struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Elements *[]*FieldPathElement `protobuf:"bytes,1,rep,name=elements"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldPath) Reset() { + *x = FieldPath{} + mi := &file_buf_validate_validate_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldPath) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldPath) ProtoMessage() {} + +func (x *FieldPath) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldPath) GetElements() []*FieldPathElement { + if x != nil { + if x.xxx_hidden_Elements != nil { + return *x.xxx_hidden_Elements + } + } + return nil +} + +func (x *FieldPath) SetElements(v []*FieldPathElement) { + x.xxx_hidden_Elements = &v +} + +type FieldPath_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `elements` contains each element of the path, starting from the root and recursing downward. + Elements []*FieldPathElement +} + +func (b0 FieldPath_builder) Build() *FieldPath { + m0 := &FieldPath{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Elements = &b.Elements + return m0 +} + +// `FieldPathElement` provides enough information to nest through a single protobuf field. +// +// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it. +// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value. +// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available. +type FieldPathElement struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_FieldNumber int32 `protobuf:"varint,1,opt,name=field_number,json=fieldNumber"` + xxx_hidden_FieldName *string `protobuf:"bytes,2,opt,name=field_name,json=fieldName"` + xxx_hidden_FieldType descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,3,opt,name=field_type,json=fieldType,enum=google.protobuf.FieldDescriptorProto_Type"` + xxx_hidden_KeyType descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,4,opt,name=key_type,json=keyType,enum=google.protobuf.FieldDescriptorProto_Type"` + xxx_hidden_ValueType descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=value_type,json=valueType,enum=google.protobuf.FieldDescriptorProto_Type"` + xxx_hidden_Subscript isFieldPathElement_Subscript `protobuf_oneof:"subscript"` + XXX_raceDetectHookData protoimpl.RaceDetectHookData + XXX_presence [1]uint32 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FieldPathElement) Reset() { + *x = FieldPathElement{} + mi := &file_buf_validate_validate_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FieldPathElement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldPathElement) ProtoMessage() {} + +func (x *FieldPathElement) ProtoReflect() protoreflect.Message { + mi := &file_buf_validate_validate_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *FieldPathElement) GetFieldNumber() int32 { + if x != nil { + return x.xxx_hidden_FieldNumber + } + return 0 +} + +func (x *FieldPathElement) GetFieldName() string { + if x != nil { + if x.xxx_hidden_FieldName != nil { + return *x.xxx_hidden_FieldName + } + return "" + } + return "" +} + +func (x *FieldPathElement) GetFieldType() descriptorpb.FieldDescriptorProto_Type { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 2) { + return x.xxx_hidden_FieldType + } + } + return descriptorpb.FieldDescriptorProto_Type(1) +} + +func (x *FieldPathElement) GetKeyType() descriptorpb.FieldDescriptorProto_Type { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 3) { + return x.xxx_hidden_KeyType + } + } + return descriptorpb.FieldDescriptorProto_Type(1) +} + +func (x *FieldPathElement) GetValueType() descriptorpb.FieldDescriptorProto_Type { + if x != nil { + if protoimpl.X.Present(&(x.XXX_presence[0]), 4) { + return x.xxx_hidden_ValueType + } + } + return descriptorpb.FieldDescriptorProto_Type(1) +} + +func (x *FieldPathElement) GetIndex() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_Subscript.(*fieldPathElement_Index); ok { + return x.Index + } + } + return 0 +} + +func (x *FieldPathElement) GetBoolKey() bool { + if x != nil { + if x, ok := x.xxx_hidden_Subscript.(*fieldPathElement_BoolKey); ok { + return x.BoolKey + } + } + return false +} + +func (x *FieldPathElement) GetIntKey() int64 { + if x != nil { + if x, ok := x.xxx_hidden_Subscript.(*fieldPathElement_IntKey); ok { + return x.IntKey + } + } + return 0 +} + +func (x *FieldPathElement) GetUintKey() uint64 { + if x != nil { + if x, ok := x.xxx_hidden_Subscript.(*fieldPathElement_UintKey); ok { + return x.UintKey + } + } + return 0 +} + +func (x *FieldPathElement) GetStringKey() string { + if x != nil { + if x, ok := x.xxx_hidden_Subscript.(*fieldPathElement_StringKey); ok { + return x.StringKey + } + } + return "" +} + +func (x *FieldPathElement) SetFieldNumber(v int32) { + x.xxx_hidden_FieldNumber = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6) +} + +func (x *FieldPathElement) SetFieldName(v string) { + x.xxx_hidden_FieldName = &v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 6) +} + +func (x *FieldPathElement) SetFieldType(v descriptorpb.FieldDescriptorProto_Type) { + x.xxx_hidden_FieldType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6) +} + +func (x *FieldPathElement) SetKeyType(v descriptorpb.FieldDescriptorProto_Type) { + x.xxx_hidden_KeyType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 6) +} + +func (x *FieldPathElement) SetValueType(v descriptorpb.FieldDescriptorProto_Type) { + x.xxx_hidden_ValueType = v + protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 6) +} + +func (x *FieldPathElement) SetIndex(v uint64) { + x.xxx_hidden_Subscript = &fieldPathElement_Index{v} +} + +func (x *FieldPathElement) SetBoolKey(v bool) { + x.xxx_hidden_Subscript = &fieldPathElement_BoolKey{v} +} + +func (x *FieldPathElement) SetIntKey(v int64) { + x.xxx_hidden_Subscript = &fieldPathElement_IntKey{v} +} + +func (x *FieldPathElement) SetUintKey(v uint64) { + x.xxx_hidden_Subscript = &fieldPathElement_UintKey{v} +} + +func (x *FieldPathElement) SetStringKey(v string) { + x.xxx_hidden_Subscript = &fieldPathElement_StringKey{v} +} + +func (x *FieldPathElement) HasFieldNumber() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 0) +} + +func (x *FieldPathElement) HasFieldName() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 1) +} + +func (x *FieldPathElement) HasFieldType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 2) +} + +func (x *FieldPathElement) HasKeyType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 3) +} + +func (x *FieldPathElement) HasValueType() bool { + if x == nil { + return false + } + return protoimpl.X.Present(&(x.XXX_presence[0]), 4) +} + +func (x *FieldPathElement) HasSubscript() bool { + if x == nil { + return false + } + return x.xxx_hidden_Subscript != nil +} + +func (x *FieldPathElement) HasIndex() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_Index) + return ok +} + +func (x *FieldPathElement) HasBoolKey() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_BoolKey) + return ok +} + +func (x *FieldPathElement) HasIntKey() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_IntKey) + return ok +} + +func (x *FieldPathElement) HasUintKey() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_UintKey) + return ok +} + +func (x *FieldPathElement) HasStringKey() bool { + if x == nil { + return false + } + _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_StringKey) + return ok +} + +func (x *FieldPathElement) ClearFieldNumber() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0) + x.xxx_hidden_FieldNumber = 0 +} + +func (x *FieldPathElement) ClearFieldName() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1) + x.xxx_hidden_FieldName = nil +} + +func (x *FieldPathElement) ClearFieldType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2) + x.xxx_hidden_FieldType = descriptorpb.FieldDescriptorProto_TYPE_DOUBLE +} + +func (x *FieldPathElement) ClearKeyType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3) + x.xxx_hidden_KeyType = descriptorpb.FieldDescriptorProto_TYPE_DOUBLE +} + +func (x *FieldPathElement) ClearValueType() { + protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4) + x.xxx_hidden_ValueType = descriptorpb.FieldDescriptorProto_TYPE_DOUBLE +} + +func (x *FieldPathElement) ClearSubscript() { + x.xxx_hidden_Subscript = nil +} + +func (x *FieldPathElement) ClearIndex() { + if _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_Index); ok { + x.xxx_hidden_Subscript = nil + } +} + +func (x *FieldPathElement) ClearBoolKey() { + if _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_BoolKey); ok { + x.xxx_hidden_Subscript = nil + } +} + +func (x *FieldPathElement) ClearIntKey() { + if _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_IntKey); ok { + x.xxx_hidden_Subscript = nil + } +} + +func (x *FieldPathElement) ClearUintKey() { + if _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_UintKey); ok { + x.xxx_hidden_Subscript = nil + } +} + +func (x *FieldPathElement) ClearStringKey() { + if _, ok := x.xxx_hidden_Subscript.(*fieldPathElement_StringKey); ok { + x.xxx_hidden_Subscript = nil + } +} + +const FieldPathElement_Subscript_not_set_case case_FieldPathElement_Subscript = 0 +const FieldPathElement_Index_case case_FieldPathElement_Subscript = 6 +const FieldPathElement_BoolKey_case case_FieldPathElement_Subscript = 7 +const FieldPathElement_IntKey_case case_FieldPathElement_Subscript = 8 +const FieldPathElement_UintKey_case case_FieldPathElement_Subscript = 9 +const FieldPathElement_StringKey_case case_FieldPathElement_Subscript = 10 + +func (x *FieldPathElement) WhichSubscript() case_FieldPathElement_Subscript { + if x == nil { + return FieldPathElement_Subscript_not_set_case + } + switch x.xxx_hidden_Subscript.(type) { + case *fieldPathElement_Index: + return FieldPathElement_Index_case + case *fieldPathElement_BoolKey: + return FieldPathElement_BoolKey_case + case *fieldPathElement_IntKey: + return FieldPathElement_IntKey_case + case *fieldPathElement_UintKey: + return FieldPathElement_UintKey_case + case *fieldPathElement_StringKey: + return FieldPathElement_StringKey_case + default: + return FieldPathElement_Subscript_not_set_case + } +} + +type FieldPathElement_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + // `field_number` is the field number this path element refers to. + FieldNumber *int32 + // `field_name` contains the field name this path element refers to. + // This can be used to display a human-readable path even if the field number is unknown. + FieldName *string + // `field_type` specifies the type of this field. When using reflection, this value is not needed. + // + // This value is provided to make it possible to traverse unknown fields through wire data. + // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes. + // + // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and + // can be explicitly used in Protocol Buffers 2023 Edition. + // + // [1]: https://protobuf.dev/programming-guides/encoding/#packed + // [2]: https://protobuf.dev/programming-guides/encoding/#groups + FieldType *descriptorpb.FieldDescriptorProto_Type + // `key_type` specifies the map key type of this field. This value is useful when traversing + // unknown fields through wire data: specifically, it allows handling the differences between + // different integer encodings. + KeyType *descriptorpb.FieldDescriptorProto_Type + // `value_type` specifies map value type of this field. This is useful if you want to display a + // value inside unknown fields through wire data. + ValueType *descriptorpb.FieldDescriptorProto_Type + // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field. + + // Fields of oneof xxx_hidden_Subscript: + // `index` specifies a 0-based index into a repeated field. + Index *uint64 + // `bool_key` specifies a map key of type bool. + BoolKey *bool + // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64. + IntKey *int64 + // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64. + UintKey *uint64 + // `string_key` specifies a map key of type string. + StringKey *string + // -- end of xxx_hidden_Subscript +} + +func (b0 FieldPathElement_builder) Build() *FieldPathElement { + m0 := &FieldPathElement{} + b, x := &b0, m0 + _, _ = b, x + if b.FieldNumber != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6) + x.xxx_hidden_FieldNumber = *b.FieldNumber + } + if b.FieldName != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 6) + x.xxx_hidden_FieldName = b.FieldName + } + if b.FieldType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6) + x.xxx_hidden_FieldType = *b.FieldType + } + if b.KeyType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 6) + x.xxx_hidden_KeyType = *b.KeyType + } + if b.ValueType != nil { + protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 6) + x.xxx_hidden_ValueType = *b.ValueType + } + if b.Index != nil { + x.xxx_hidden_Subscript = &fieldPathElement_Index{*b.Index} + } + if b.BoolKey != nil { + x.xxx_hidden_Subscript = &fieldPathElement_BoolKey{*b.BoolKey} + } + if b.IntKey != nil { + x.xxx_hidden_Subscript = &fieldPathElement_IntKey{*b.IntKey} + } + if b.UintKey != nil { + x.xxx_hidden_Subscript = &fieldPathElement_UintKey{*b.UintKey} + } + if b.StringKey != nil { + x.xxx_hidden_Subscript = &fieldPathElement_StringKey{*b.StringKey} + } + return m0 +} + +type case_FieldPathElement_Subscript protoreflect.FieldNumber + +func (x case_FieldPathElement_Subscript) String() string { + md := file_buf_validate_validate_proto_msgTypes[31].Descriptor() + if x == 0 { + return "not set" + } + return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x)) +} + +type isFieldPathElement_Subscript interface { + isFieldPathElement_Subscript() +} + +type fieldPathElement_Index struct { + // `index` specifies a 0-based index into a repeated field. + Index uint64 `protobuf:"varint,6,opt,name=index,oneof"` +} + +type fieldPathElement_BoolKey struct { + // `bool_key` specifies a map key of type bool. + BoolKey bool `protobuf:"varint,7,opt,name=bool_key,json=boolKey,oneof"` +} + +type fieldPathElement_IntKey struct { + // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64. + IntKey int64 `protobuf:"varint,8,opt,name=int_key,json=intKey,oneof"` +} + +type fieldPathElement_UintKey struct { + // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64. + UintKey uint64 `protobuf:"varint,9,opt,name=uint_key,json=uintKey,oneof"` +} + +type fieldPathElement_StringKey struct { + // `string_key` specifies a map key of type string. + StringKey string `protobuf:"bytes,10,opt,name=string_key,json=stringKey,oneof"` +} + +func (*fieldPathElement_Index) isFieldPathElement_Subscript() {} + +func (*fieldPathElement_BoolKey) isFieldPathElement_Subscript() {} + +func (*fieldPathElement_IntKey) isFieldPathElement_Subscript() {} + +func (*fieldPathElement_UintKey) isFieldPathElement_Subscript() {} + +func (*fieldPathElement_StringKey) isFieldPathElement_Subscript() {} + +var file_buf_validate_validate_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*MessageRules)(nil), + Field: 1159, + Name: "buf.validate.message", + Tag: "bytes,1159,opt,name=message", + Filename: "buf/validate/validate.proto", + }, + { + ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtensionType: (*OneofRules)(nil), + Field: 1159, + Name: "buf.validate.oneof", + Tag: "bytes,1159,opt,name=oneof", + Filename: "buf/validate/validate.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*FieldRules)(nil), + Field: 1159, + Name: "buf.validate.field", + Tag: "bytes,1159,opt,name=field", + Filename: "buf/validate/validate.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*PredefinedRules)(nil), + Field: 1160, + Name: "buf.validate.predefined", + Tag: "bytes,1160,opt,name=predefined", + Filename: "buf/validate/validate.proto", + }, +} + +// Extension fields to descriptorpb.MessageOptions. +var ( + // Rules specify the validations to be performed on this message. By default, + // no validation is performed against a message. + // + // optional buf.validate.MessageRules message = 1159; + E_Message = &file_buf_validate_validate_proto_extTypes[0] +) + +// Extension fields to descriptorpb.OneofOptions. +var ( + // Rules specify the validations to be performed on this oneof. By default, + // no validation is performed against a oneof. + // + // optional buf.validate.OneofRules oneof = 1159; + E_Oneof = &file_buf_validate_validate_proto_extTypes[1] +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // Rules specify the validations to be performed on this field. By default, + // no validation is performed against a field. + // + // optional buf.validate.FieldRules field = 1159; + E_Field = &file_buf_validate_validate_proto_extTypes[2] + // Specifies predefined rules. When extending a standard rule message, + // this adds additional CEL expressions that apply when the extension is used. + // + // ```proto + // + // extend buf.validate.Int32Rules { + // bool is_zero [(buf.validate.predefined).cel = { + // id: "int32.is_zero", + // message: "must be zero", + // expression: "!rule || this == 0", + // }]; + // } + // + // message Foo { + // int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true]; + // } + // + // ``` + // + // optional buf.validate.PredefinedRules predefined = 1160; + E_Predefined = &file_buf_validate_validate_proto_extTypes[3] +) + +var File_buf_validate_validate_proto protoreflect.FileDescriptor + +const file_buf_validate_validate_proto_rawDesc = "" + + "\n" + + "\x1bbuf/validate/validate.proto\x12\fbuf.validate\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"P\n" + + "\x04Rule\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x1e\n" + + "\n" + + "expression\x18\x03 \x01(\tR\n" + + "expression\"\xa1\x01\n" + + "\fMessageRules\x12%\n" + + "\x0ecel_expression\x18\x05 \x03(\tR\rcelExpression\x12$\n" + + "\x03cel\x18\x03 \x03(\v2\x12.buf.validate.RuleR\x03cel\x124\n" + + "\x05oneof\x18\x04 \x03(\v2\x1e.buf.validate.MessageOneofRuleR\x05oneofJ\x04\b\x01\x10\x02R\bdisabled\"F\n" + + "\x10MessageOneofRule\x12\x16\n" + + "\x06fields\x18\x01 \x03(\tR\x06fields\x12\x1a\n" + + "\brequired\x18\x02 \x01(\bR\brequired\"(\n" + + "\n" + + "OneofRules\x12\x1a\n" + + "\brequired\x18\x01 \x01(\bR\brequired\"\xe3\n" + + "\n" + + "\n" + + "FieldRules\x12%\n" + + "\x0ecel_expression\x18\x1d \x03(\tR\rcelExpression\x12$\n" + + "\x03cel\x18\x17 \x03(\v2\x12.buf.validate.RuleR\x03cel\x12\x1a\n" + + "\brequired\x18\x19 \x01(\bR\brequired\x12,\n" + + "\x06ignore\x18\x1b \x01(\x0e2\x14.buf.validate.IgnoreR\x06ignore\x120\n" + + "\x05float\x18\x01 \x01(\v2\x18.buf.validate.FloatRulesH\x00R\x05float\x123\n" + + "\x06double\x18\x02 \x01(\v2\x19.buf.validate.DoubleRulesH\x00R\x06double\x120\n" + + "\x05int32\x18\x03 \x01(\v2\x18.buf.validate.Int32RulesH\x00R\x05int32\x120\n" + + "\x05int64\x18\x04 \x01(\v2\x18.buf.validate.Int64RulesH\x00R\x05int64\x123\n" + + "\x06uint32\x18\x05 \x01(\v2\x19.buf.validate.UInt32RulesH\x00R\x06uint32\x123\n" + + "\x06uint64\x18\x06 \x01(\v2\x19.buf.validate.UInt64RulesH\x00R\x06uint64\x123\n" + + "\x06sint32\x18\a \x01(\v2\x19.buf.validate.SInt32RulesH\x00R\x06sint32\x123\n" + + "\x06sint64\x18\b \x01(\v2\x19.buf.validate.SInt64RulesH\x00R\x06sint64\x126\n" + + "\afixed32\x18\t \x01(\v2\x1a.buf.validate.Fixed32RulesH\x00R\afixed32\x126\n" + + "\afixed64\x18\n" + + " \x01(\v2\x1a.buf.validate.Fixed64RulesH\x00R\afixed64\x129\n" + + "\bsfixed32\x18\v \x01(\v2\x1b.buf.validate.SFixed32RulesH\x00R\bsfixed32\x129\n" + + "\bsfixed64\x18\f \x01(\v2\x1b.buf.validate.SFixed64RulesH\x00R\bsfixed64\x12-\n" + + "\x04bool\x18\r \x01(\v2\x17.buf.validate.BoolRulesH\x00R\x04bool\x123\n" + + "\x06string\x18\x0e \x01(\v2\x19.buf.validate.StringRulesH\x00R\x06string\x120\n" + + "\x05bytes\x18\x0f \x01(\v2\x18.buf.validate.BytesRulesH\x00R\x05bytes\x12-\n" + + "\x04enum\x18\x10 \x01(\v2\x17.buf.validate.EnumRulesH\x00R\x04enum\x129\n" + + "\brepeated\x18\x12 \x01(\v2\x1b.buf.validate.RepeatedRulesH\x00R\brepeated\x12*\n" + + "\x03map\x18\x13 \x01(\v2\x16.buf.validate.MapRulesH\x00R\x03map\x12*\n" + + "\x03any\x18\x14 \x01(\v2\x16.buf.validate.AnyRulesH\x00R\x03any\x129\n" + + "\bduration\x18\x15 \x01(\v2\x1b.buf.validate.DurationRulesH\x00R\bduration\x12=\n" + + "\n" + + "field_mask\x18\x1c \x01(\v2\x1c.buf.validate.FieldMaskRulesH\x00R\tfieldMask\x12<\n" + + "\ttimestamp\x18\x16 \x01(\v2\x1c.buf.validate.TimestampRulesH\x00R\ttimestampB\x06\n" + + "\x04typeJ\x04\b\x18\x10\x19J\x04\b\x1a\x10\x1bR\askippedR\fignore_empty\"Z\n" + + "\x0fPredefinedRules\x12$\n" + + "\x03cel\x18\x01 \x03(\v2\x12.buf.validate.RuleR\x03celJ\x04\b\x18\x10\x19J\x04\b\x1a\x10\x1bR\askippedR\fignore_empty\"\xae\x17\n" + + "\n" + + "FloatRules\x12\x84\x01\n" + + "\x05const\x18\x01 \x01(\x02Bn\xc2Hk\n" + + "i\n" + + "\vfloat.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x9d\x01\n" + + "\x02lt\x18\x02 \x01(\x02B\x8a\x01\xc2H\x86\x01\n" + + "\x83\x01\n" + + "\bfloat.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xae\x01\n" + + "\x03lte\x18\x03 \x01(\x02B\x99\x01\xc2H\x95\x01\n" + + "\x92\x01\n" + + "\tfloat.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xd4\a\n" + + "\x02gt\x18\x04 \x01(\x02B\xc1\a\xc2H\xbd\a\n" + + "\x86\x01\n" + + "\bfloat.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xbd\x01\n" + + "\vfloat.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x15float.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\ffloat.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x16float.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xa1\b\n" + + "\x03gte\x18\x05 \x01(\x02B\x8c\b\xc2H\x88\b\n" + + "\x95\x01\n" + + "\tfloat.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xcc\x01\n" + + "\ffloat.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xd6\x01\n" + + "\x16float.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xdc\x01\n" + + "\rfloat.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xe6\x01\n" + + "\x17float.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12}\n" + + "\x02in\x18\x06 \x03(\x02Bm\xc2Hj\n" + + "h\n" + + "\bfloat.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\a \x03(\x02B`\xc2H]\n" + + "[\n" + + "\ffloat.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12w\n" + + "\x06finite\x18\b \x01(\bB_\xc2H\\\n" + + "Z\n" + + "\ffloat.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? 'must be finite' : '') : ''R\x06finite\x124\n" + + "\aexample\x18\t \x03(\x02B\x1a\xc2H\x17\n" + + "\x15\n" + + "\rfloat.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xc0\x17\n" + + "\vDoubleRules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x01Bo\xc2Hl\n" + + "j\n" + + "\fdouble.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x9e\x01\n" + + "\x02lt\x18\x02 \x01(\x01B\x8b\x01\xc2H\x87\x01\n" + + "\x84\x01\n" + + "\tdouble.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xaf\x01\n" + + "\x03lte\x18\x03 \x01(\x01B\x9a\x01\xc2H\x96\x01\n" + + "\x93\x01\n" + + "\n" + + "double.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xd9\a\n" + + "\x02gt\x18\x04 \x01(\x01B\xc6\a\xc2H\xc2\a\n" + + "\x87\x01\n" + + "\tdouble.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xbe\x01\n" + + "\fdouble.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc8\x01\n" + + "\x16double.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xce\x01\n" + + "\rdouble.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xd8\x01\n" + + "\x17double.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xa6\b\n" + + "\x03gte\x18\x05 \x01(\x01B\x91\b\xc2H\x8d\b\n" + + "\x96\x01\n" + + "\n" + + "double.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xcd\x01\n" + + "\rdouble.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xd7\x01\n" + + "\x17double.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xdd\x01\n" + + "\x0edouble.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xe7\x01\n" + + "\x18double.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x01Bn\xc2Hk\n" + + "i\n" + + "\tdouble.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x01Ba\xc2H^\n" + + "\\\n" + + "\rdouble.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12x\n" + + "\x06finite\x18\b \x01(\bB`\xc2H]\n" + + "[\n" + + "\rdouble.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? 'must be finite' : '') : ''R\x06finite\x125\n" + + "\aexample\x18\t \x03(\x01B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0edouble.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xde\x14\n" + + "\n" + + "Int32Rules\x12\x84\x01\n" + + "\x05const\x18\x01 \x01(\x05Bn\xc2Hk\n" + + "i\n" + + "\vint32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x88\x01\n" + + "\x02lt\x18\x02 \x01(\x05Bv\xc2Hs\n" + + "q\n" + + "\bint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9a\x01\n" + + "\x03lte\x18\x03 \x01(\x05B\x85\x01\xc2H\x81\x01\n" + + "\x7f\n" + + "\tint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xfd\x06\n" + + "\x02gt\x18\x04 \x01(\x05B\xea\x06\xc2H\xe6\x06\n" + + "t\n" + + "\bint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xad\x01\n" + + "\vint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb5\x01\n" + + "\x15int32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbd\x01\n" + + "\fint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc5\x01\n" + + "\x16int32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xca\a\n" + + "\x03gte\x18\x05 \x01(\x05B\xb5\a\xc2H\xb1\a\n" + + "\x82\x01\n" + + "\tint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbc\x01\n" + + "\fint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc4\x01\n" + + "\x16int32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcc\x01\n" + + "\rint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd4\x01\n" + + "\x17int32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12}\n" + + "\x02in\x18\x06 \x03(\x05Bm\xc2Hj\n" + + "h\n" + + "\bint32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\a \x03(\x05B`\xc2H]\n" + + "[\n" + + "\fint32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x124\n" + + "\aexample\x18\b \x03(\x05B\x1a\xc2H\x17\n" + + "\x15\n" + + "\rint32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xde\x14\n" + + "\n" + + "Int64Rules\x12\x84\x01\n" + + "\x05const\x18\x01 \x01(\x03Bn\xc2Hk\n" + + "i\n" + + "\vint64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x88\x01\n" + + "\x02lt\x18\x02 \x01(\x03Bv\xc2Hs\n" + + "q\n" + + "\bint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9a\x01\n" + + "\x03lte\x18\x03 \x01(\x03B\x85\x01\xc2H\x81\x01\n" + + "\x7f\n" + + "\tint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xfd\x06\n" + + "\x02gt\x18\x04 \x01(\x03B\xea\x06\xc2H\xe6\x06\n" + + "t\n" + + "\bint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xad\x01\n" + + "\vint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb5\x01\n" + + "\x15int64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbd\x01\n" + + "\fint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc5\x01\n" + + "\x16int64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xca\a\n" + + "\x03gte\x18\x05 \x01(\x03B\xb5\a\xc2H\xb1\a\n" + + "\x82\x01\n" + + "\tint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbc\x01\n" + + "\fint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc4\x01\n" + + "\x16int64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcc\x01\n" + + "\rint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd4\x01\n" + + "\x17int64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12}\n" + + "\x02in\x18\x06 \x03(\x03Bm\xc2Hj\n" + + "h\n" + + "\bint64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\a \x03(\x03B`\xc2H]\n" + + "[\n" + + "\fint64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x124\n" + + "\aexample\x18\t \x03(\x03B\x1a\xc2H\x17\n" + + "\x15\n" + + "\rint64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vUInt32Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\rBo\xc2Hl\n" + + "j\n" + + "\fuint32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\rBw\xc2Ht\n" + + "r\n" + + "\tuint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\rB\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "uint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\rB\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tuint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fuint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16uint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\ruint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17uint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\rB\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "uint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\ruint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17uint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0euint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18uint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\rBn\xc2Hk\n" + + "i\n" + + "\tuint32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\rBa\xc2H^\n" + + "\\\n" + + "\ruint32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\rB\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0euint32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vUInt64Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x04Bo\xc2Hl\n" + + "j\n" + + "\fuint64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\x04Bw\xc2Ht\n" + + "r\n" + + "\tuint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\x04B\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "uint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\x04B\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tuint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fuint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16uint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\ruint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17uint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\x04B\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "uint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\ruint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17uint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0euint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18uint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x04Bn\xc2Hk\n" + + "i\n" + + "\tuint64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x04Ba\xc2H^\n" + + "\\\n" + + "\ruint64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\x04B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0euint64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vSInt32Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x11Bo\xc2Hl\n" + + "j\n" + + "\fsint32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\x11Bw\xc2Ht\n" + + "r\n" + + "\tsint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\x11B\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "sint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\x11B\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tsint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fsint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16sint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\rsint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17sint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\x11B\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "sint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\rsint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17sint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0esint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18sint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x11Bn\xc2Hk\n" + + "i\n" + + "\tsint32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x11Ba\xc2H^\n" + + "\\\n" + + "\rsint32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\x11B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0esint32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xf0\x14\n" + + "\vSInt64Rules\x12\x85\x01\n" + + "\x05const\x18\x01 \x01(\x12Bo\xc2Hl\n" + + "j\n" + + "\fsint64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x89\x01\n" + + "\x02lt\x18\x02 \x01(\x12Bw\xc2Ht\n" + + "r\n" + + "\tsint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9c\x01\n" + + "\x03lte\x18\x03 \x01(\x12B\x87\x01\xc2H\x83\x01\n" + + "\x80\x01\n" + + "\n" + + "sint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x82\a\n" + + "\x02gt\x18\x04 \x01(\x12B\xef\x06\xc2H\xeb\x06\n" + + "u\n" + + "\tsint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xae\x01\n" + + "\fsint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb6\x01\n" + + "\x16sint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbe\x01\n" + + "\rsint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc6\x01\n" + + "\x17sint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xcf\a\n" + + "\x03gte\x18\x05 \x01(\x12B\xba\a\xc2H\xb6\a\n" + + "\x83\x01\n" + + "\n" + + "sint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbd\x01\n" + + "\rsint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc5\x01\n" + + "\x17sint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcd\x01\n" + + "\x0esint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd5\x01\n" + + "\x18sint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12~\n" + + "\x02in\x18\x06 \x03(\x12Bn\xc2Hk\n" + + "i\n" + + "\tsint64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\a \x03(\x12Ba\xc2H^\n" + + "\\\n" + + "\rsint64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x125\n" + + "\aexample\x18\b \x03(\x12B\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0esint64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x81\x15\n" + + "\fFixed32Rules\x12\x86\x01\n" + + "\x05const\x18\x01 \x01(\aBp\xc2Hm\n" + + "k\n" + + "\rfixed32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8a\x01\n" + + "\x02lt\x18\x02 \x01(\aBx\xc2Hu\n" + + "s\n" + + "\n" + + "fixed32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9d\x01\n" + + "\x03lte\x18\x03 \x01(\aB\x88\x01\xc2H\x84\x01\n" + + "\x81\x01\n" + + "\vfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x87\a\n" + + "\x02gt\x18\x04 \x01(\aB\xf4\x06\xc2H\xf0\x06\n" + + "v\n" + + "\n" + + "fixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xaf\x01\n" + + "\rfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb7\x01\n" + + "\x17fixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbf\x01\n" + + "\x0efixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc7\x01\n" + + "\x18fixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd4\a\n" + + "\x03gte\x18\x05 \x01(\aB\xbf\a\xc2H\xbb\a\n" + + "\x84\x01\n" + + "\vfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbe\x01\n" + + "\x0efixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc6\x01\n" + + "\x18fixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xce\x01\n" + + "\x0ffixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd6\x01\n" + + "\x19fixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x7f\n" + + "\x02in\x18\x06 \x03(\aBo\xc2Hl\n" + + "j\n" + + "\n" + + "fixed32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12y\n" + + "\x06not_in\x18\a \x03(\aBb\xc2H_\n" + + "]\n" + + "\x0efixed32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x126\n" + + "\aexample\x18\b \x03(\aB\x1c\xc2H\x19\n" + + "\x17\n" + + "\x0ffixed32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x81\x15\n" + + "\fFixed64Rules\x12\x86\x01\n" + + "\x05const\x18\x01 \x01(\x06Bp\xc2Hm\n" + + "k\n" + + "\rfixed64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8a\x01\n" + + "\x02lt\x18\x02 \x01(\x06Bx\xc2Hu\n" + + "s\n" + + "\n" + + "fixed64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9d\x01\n" + + "\x03lte\x18\x03 \x01(\x06B\x88\x01\xc2H\x84\x01\n" + + "\x81\x01\n" + + "\vfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x87\a\n" + + "\x02gt\x18\x04 \x01(\x06B\xf4\x06\xc2H\xf0\x06\n" + + "v\n" + + "\n" + + "fixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xaf\x01\n" + + "\rfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb7\x01\n" + + "\x17fixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xbf\x01\n" + + "\x0efixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc7\x01\n" + + "\x18fixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd4\a\n" + + "\x03gte\x18\x05 \x01(\x06B\xbf\a\xc2H\xbb\a\n" + + "\x84\x01\n" + + "\vfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbe\x01\n" + + "\x0efixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc6\x01\n" + + "\x18fixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xce\x01\n" + + "\x0ffixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd6\x01\n" + + "\x19fixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x7f\n" + + "\x02in\x18\x06 \x03(\x06Bo\xc2Hl\n" + + "j\n" + + "\n" + + "fixed64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12y\n" + + "\x06not_in\x18\a \x03(\x06Bb\xc2H_\n" + + "]\n" + + "\x0efixed64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x126\n" + + "\aexample\x18\b \x03(\x06B\x1c\xc2H\x19\n" + + "\x17\n" + + "\x0ffixed64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x93\x15\n" + + "\rSFixed32Rules\x12\x87\x01\n" + + "\x05const\x18\x01 \x01(\x0fBq\xc2Hn\n" + + "l\n" + + "\x0esfixed32.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8b\x01\n" + + "\x02lt\x18\x02 \x01(\x0fBy\xc2Hv\n" + + "t\n" + + "\vsfixed32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9e\x01\n" + + "\x03lte\x18\x03 \x01(\x0fB\x89\x01\xc2H\x85\x01\n" + + "\x82\x01\n" + + "\fsfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x8c\a\n" + + "\x02gt\x18\x04 \x01(\x0fB\xf9\x06\xc2H\xf5\x06\n" + + "w\n" + + "\vsfixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb0\x01\n" + + "\x0esfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb8\x01\n" + + "\x18sfixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc0\x01\n" + + "\x0fsfixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc8\x01\n" + + "\x19sfixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd9\a\n" + + "\x03gte\x18\x05 \x01(\x0fB\xc4\a\xc2H\xc0\a\n" + + "\x85\x01\n" + + "\fsfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbf\x01\n" + + "\x0fsfixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x19sfixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcf\x01\n" + + "\x10sfixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x1asfixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x80\x01\n" + + "\x02in\x18\x06 \x03(\x0fBp\xc2Hm\n" + + "k\n" + + "\vsfixed32.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12z\n" + + "\x06not_in\x18\a \x03(\x0fBc\xc2H`\n" + + "^\n" + + "\x0fsfixed32.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x127\n" + + "\aexample\x18\b \x03(\x0fB\x1d\xc2H\x1a\n" + + "\x18\n" + + "\x10sfixed32.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x93\x15\n" + + "\rSFixed64Rules\x12\x87\x01\n" + + "\x05const\x18\x01 \x01(\x10Bq\xc2Hn\n" + + "l\n" + + "\x0esfixed64.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\x8b\x01\n" + + "\x02lt\x18\x02 \x01(\x10By\xc2Hv\n" + + "t\n" + + "\vsfixed64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\x9e\x01\n" + + "\x03lte\x18\x03 \x01(\x10B\x89\x01\xc2H\x85\x01\n" + + "\x82\x01\n" + + "\fsfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\x8c\a\n" + + "\x02gt\x18\x04 \x01(\x10B\xf9\x06\xc2H\xf5\x06\n" + + "w\n" + + "\vsfixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb0\x01\n" + + "\x0esfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb8\x01\n" + + "\x18sfixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc0\x01\n" + + "\x0fsfixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc8\x01\n" + + "\x19sfixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xd9\a\n" + + "\x03gte\x18\x05 \x01(\x10B\xc4\a\xc2H\xc0\a\n" + + "\x85\x01\n" + + "\fsfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbf\x01\n" + + "\x0fsfixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x19sfixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcf\x01\n" + + "\x10sfixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x1asfixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x80\x01\n" + + "\x02in\x18\x06 \x03(\x10Bp\xc2Hm\n" + + "k\n" + + "\vsfixed64.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12z\n" + + "\x06not_in\x18\a \x03(\x10Bc\xc2H`\n" + + "^\n" + + "\x0fsfixed64.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x127\n" + + "\aexample\x18\b \x03(\x10B\x1d\xc2H\x1a\n" + + "\x18\n" + + "\x10sfixed64.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\xd1\x01\n" + + "\tBoolRules\x12\x83\x01\n" + + "\x05const\x18\x01 \x01(\bBm\xc2Hj\n" + + "h\n" + + "\n" + + "bool.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x123\n" + + "\aexample\x18\x02 \x03(\bB\x19\xc2H\x16\n" + + "\x14\n" + + "\fbool.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xcf?\n" + + "\vStringRules\x12\x87\x01\n" + + "\x05const\x18\x01 \x01(\tBq\xc2Hn\n" + + "l\n" + + "\fstring.const\x1a\\this != getField(rules, 'const') ? 'must equal `%s`'.format([getField(rules, 'const')]) : ''R\x05const\x12v\n" + + "\x03len\x18\x13 \x01(\x04Bd\xc2Ha\n" + + "_\n" + + "\n" + + "string.len\x1aQuint(this.size()) != rules.len ? 'must be %s characters'.format([rules.len]) : ''R\x03len\x12\x91\x01\n" + + "\amin_len\x18\x02 \x01(\x04Bx\xc2Hu\n" + + "s\n" + + "\x0estring.min_len\x1aauint(this.size()) < rules.min_len ? 'must be at least %s characters'.format([rules.min_len]) : ''R\x06minLen\x12\x90\x01\n" + + "\amax_len\x18\x03 \x01(\x04Bw\xc2Ht\n" + + "r\n" + + "\x0estring.max_len\x1a`uint(this.size()) > rules.max_len ? 'must be at most %s characters'.format([rules.max_len]) : ''R\x06maxLen\x12\x95\x01\n" + + "\tlen_bytes\x18\x14 \x01(\x04Bx\xc2Hu\n" + + "s\n" + + "\x10string.len_bytes\x1a_uint(bytes(this).size()) != rules.len_bytes ? 'must be %s bytes'.format([rules.len_bytes]) : ''R\blenBytes\x12\x9e\x01\n" + + "\tmin_bytes\x18\x04 \x01(\x04B\x80\x01\xc2H}\n" + + "{\n" + + "\x10string.min_bytes\x1aguint(bytes(this).size()) < rules.min_bytes ? 'must be at least %s bytes'.format([rules.min_bytes]) : ''R\bminBytes\x12\x9c\x01\n" + + "\tmax_bytes\x18\x05 \x01(\x04B\x7f\xc2H|\n" + + "z\n" + + "\x10string.max_bytes\x1afuint(bytes(this).size()) > rules.max_bytes ? 'must be at most %s bytes'.format([rules.max_bytes]) : ''R\bmaxBytes\x12\x90\x01\n" + + "\apattern\x18\x06 \x01(\tBv\xc2Hs\n" + + "q\n" + + "\x0estring.pattern\x1a_!this.matches(rules.pattern) ? 'does not match regex pattern `%s`'.format([rules.pattern]) : ''R\apattern\x12\x86\x01\n" + + "\x06prefix\x18\a \x01(\tBn\xc2Hk\n" + + "i\n" + + "\rstring.prefix\x1aX!this.startsWith(rules.prefix) ? 'does not have prefix `%s`'.format([rules.prefix]) : ''R\x06prefix\x12\x84\x01\n" + + "\x06suffix\x18\b \x01(\tBl\xc2Hi\n" + + "g\n" + + "\rstring.suffix\x1aV!this.endsWith(rules.suffix) ? 'does not have suffix `%s`'.format([rules.suffix]) : ''R\x06suffix\x12\x94\x01\n" + + "\bcontains\x18\t \x01(\tBx\xc2Hu\n" + + "s\n" + + "\x0fstring.contains\x1a`!this.contains(rules.contains) ? 'does not contain substring `%s`'.format([rules.contains]) : ''R\bcontains\x12\x9e\x01\n" + + "\fnot_contains\x18\x17 \x01(\tB{\xc2Hx\n" + + "v\n" + + "\x13string.not_contains\x1a_this.contains(rules.not_contains) ? 'contains substring `%s`'.format([rules.not_contains]) : ''R\vnotContains\x12~\n" + + "\x02in\x18\n" + + " \x03(\tBn\xc2Hk\n" + + "i\n" + + "\tstring.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12x\n" + + "\x06not_in\x18\v \x03(\tBa\xc2H^\n" + + "\\\n" + + "\rstring.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12\xe0\x01\n" + + "\x05email\x18\f \x01(\bB\xc7\x01\xc2H\xc3\x01\n" + + "[\n" + + "\fstring.email\x12\x1dmust be a valid email address\x1a,!rules.email || this == '' || this.isEmail()\n" + + "d\n" + + "\x12string.email_empty\x122value is empty, which is not a valid email address\x1a\x1a!rules.email || this != ''H\x00R\x05email\x12\xeb\x01\n" + + "\bhostname\x18\r \x01(\bB\xcc\x01\xc2H\xc8\x01\n" + + "_\n" + + "\x0fstring.hostname\x12\x18must be a valid hostname\x1a2!rules.hostname || this == '' || this.isHostname()\n" + + "e\n" + + "\x15string.hostname_empty\x12-value is empty, which is not a valid hostname\x1a\x1d!rules.hostname || this != ''H\x00R\bhostname\x12\xc5\x01\n" + + "\x02ip\x18\x0e \x01(\bB\xb2\x01\xc2H\xae\x01\n" + + "O\n" + + "\tstring.ip\x12\x1amust be a valid IP address\x1a&!rules.ip || this == '' || this.isIp()\n" + + "[\n" + + "\x0fstring.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x17!rules.ip || this != ''H\x00R\x02ip\x12\xd6\x01\n" + + "\x04ipv4\x18\x0f \x01(\bB\xbf\x01\xc2H\xbb\x01\n" + + "V\n" + + "\vstring.ipv4\x12\x1cmust be a valid IPv4 address\x1a)!rules.ipv4 || this == '' || this.isIp(4)\n" + + "a\n" + + "\x11string.ipv4_empty\x121value is empty, which is not a valid IPv4 address\x1a\x19!rules.ipv4 || this != ''H\x00R\x04ipv4\x12\xd6\x01\n" + + "\x04ipv6\x18\x10 \x01(\bB\xbf\x01\xc2H\xbb\x01\n" + + "V\n" + + "\vstring.ipv6\x12\x1cmust be a valid IPv6 address\x1a)!rules.ipv6 || this == '' || this.isIp(6)\n" + + "a\n" + + "\x11string.ipv6_empty\x121value is empty, which is not a valid IPv6 address\x1a\x19!rules.ipv6 || this != ''H\x00R\x04ipv6\x12\xbe\x01\n" + + "\x03uri\x18\x11 \x01(\bB\xa9\x01\xc2H\xa5\x01\n" + + "K\n" + + "\n" + + "string.uri\x12\x13must be a valid URI\x1a(!rules.uri || this == '' || this.isUri()\n" + + "V\n" + + "\x10string.uri_empty\x12(value is empty, which is not a valid URI\x1a\x18!rules.uri || this != ''H\x00R\x03uri\x12r\n" + + "\auri_ref\x18\x12 \x01(\bBW\xc2HT\n" + + "R\n" + + "\x0estring.uri_ref\x12\x1dmust be a valid URI Reference\x1a!!rules.uri_ref || this.isUriRef()H\x00R\x06uriRef\x12\x92\x02\n" + + "\aaddress\x18\x15 \x01(\bB\xf5\x01\xc2H\xf1\x01\n" + + "{\n" + + "\x0estring.address\x12'must be a valid hostname, or ip address\x1a@!rules.address || this == '' || this.isHostname() || this.isIp()\n" + + "r\n" + + "\x14string.address_empty\x12!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\n" + + "\x92\x01\n" + + " string.ipv4_with_prefixlen_empty\x12Dvalue is empty, which is not a valid IPv4 address with prefix length\x1a(!rules.ipv4_with_prefixlen || this != ''H\x00R\x11ipv4WithPrefixlen\x12\xdc\x02\n" + + "\x13ipv6_with_prefixlen\x18\x1c \x01(\bB\xa9\x02\xc2H\xa5\x02\n" + + "\x8d\x01\n" + + "\x1astring.ipv6_with_prefixlen\x12/must be a valid IPv6 address with prefix length\x1a>!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\n" + + "\x92\x01\n" + + " string.ipv6_with_prefixlen_empty\x12Dvalue is empty, which is not a valid IPv6 address with prefix length\x1a(!rules.ipv6_with_prefixlen || this != ''H\x00R\x11ipv6WithPrefixlen\x12\xf6\x01\n" + + "\tip_prefix\x18\x1d \x01(\bB\xd6\x01\xc2H\xd2\x01\n" + + "f\n" + + "\x10string.ip_prefix\x12\x19must be a valid IP prefix\x1a7!rules.ip_prefix || this == '' || this.isIpPrefix(true)\n" + + "h\n" + + "\x16string.ip_prefix_empty\x12.value is empty, which is not a valid IP prefix\x1a\x1e!rules.ip_prefix || this != ''H\x00R\bipPrefix\x12\x89\x02\n" + + "\vipv4_prefix\x18\x1e \x01(\bB\xe5\x01\xc2H\xe1\x01\n" + + "o\n" + + "\x12string.ipv4_prefix\x12\x1bmust be a valid IPv4 prefix\x1a!rules.host_and_port || this == '' || this.isHostAndPort(true)\n" + + "y\n" + + "\x1astring.host_and_port_empty\x127value is empty, which is not a valid host and port pair\x1a\"!rules.host_and_port || this != ''H\x00R\vhostAndPort\x12\xf4\x01\n" + + "\x04ulid\x18# \x01(\bB\xdd\x01\xc2H\xd9\x01\n" + + "|\n" + + "\vstring.ulid\x12\x14must be a valid ULID\x1aW!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\n" + + "Y\n" + + "\x11string.ulid_empty\x12)value is empty, which is not a valid ULID\x1a\x19!rules.ulid || this != ''H\x00R\x04ulid\x12\xe1\x02\n" + + "\fprotobuf_fqn\x18% \x01(\bB\xbb\x02\xc2H\xb7\x02\n" + + "\xaf\x01\n" + + "\x13string.protobuf_fqn\x12-must be a valid fully-qualified Protobuf name\x1ai!rules.protobuf_fqn || this == '' || this.matches('^[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$')\n" + + "\x82\x01\n" + + "\x19string.protobuf_fqn_empty\x12Bvalue is empty, which is not a valid fully-qualified Protobuf name\x1a!!rules.protobuf_fqn || this != ''H\x00R\vprotobufFqn\x12\xa1\x03\n" + + "\x10protobuf_dot_fqn\x18& \x01(\bB\xf4\x02\xc2H\xf0\x02\n" + + "\xcd\x01\n" + + "\x17string.protobuf_dot_fqn\x12@must be a valid fully-qualified Protobuf name with a leading dot\x1ap!rules.protobuf_dot_fqn || this == '' || this.matches('^\\\\.[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$')\n" + + "\x9d\x01\n" + + "\x1dstring.protobuf_dot_fqn_empty\x12Uvalue is empty, which is not a valid fully-qualified Protobuf name with a leading dot\x1a%!rules.protobuf_dot_fqn || this != ''H\x00R\x0eprotobufDotFqn\x12\xac\x05\n" + + "\x10well_known_regex\x18\x18 \x01(\x0e2\x18.buf.validate.KnownRegexB\xe5\x04\xc2H\xe1\x04\n" + + "\xea\x01\n" + + "#string.well_known_regex.header_name\x12 must be a valid HTTP header name\x1a\xa0\x01rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?'^:?[0-9a-zA-Z!#$%&\\'*+-.^_|~\\x60]+$' :'^[^\\u0000\\u000A\\u000D]+$')\n" + + "\x8d\x01\n" + + ")string.well_known_regex.header_name_empty\x125value is empty, which is not a valid HTTP header name\x1a)rules.well_known_regex != 1 || this != ''\n" + + "\xe1\x01\n" + + "$string.well_known_regex.header_value\x12!must be a valid HTTP header value\x1a\x95\x01rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$' :'^[^\\u0000\\u000A\\u000D]*$')H\x00R\x0ewellKnownRegex\x12\x16\n" + + "\x06strict\x18\x19 \x01(\bR\x06strict\x125\n" + + "\aexample\x18\" \x03(\tB\x1b\xc2H\x18\n" + + "\x16\n" + + "\x0estring.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\f\n" + + "\n" + + "well_known\"\xca\x12\n" + + "\n" + + "BytesRules\x12\x81\x01\n" + + "\x05const\x18\x01 \x01(\fBk\xc2Hh\n" + + "f\n" + + "\vbytes.const\x1aWthis != getField(rules, 'const') ? 'must be %x'.format([getField(rules, 'const')]) : ''R\x05const\x12p\n" + + "\x03len\x18\r \x01(\x04B^\xc2H[\n" + + "Y\n" + + "\tbytes.len\x1aLuint(this.size()) != rules.len ? 'must be %s bytes'.format([rules.len]) : ''R\x03len\x12\x8b\x01\n" + + "\amin_len\x18\x02 \x01(\x04Br\xc2Ho\n" + + "m\n" + + "\rbytes.min_len\x1a\\uint(this.size()) < rules.min_len ? 'must be at least %s bytes'.format([rules.min_len]) : ''R\x06minLen\x12\x8a\x01\n" + + "\amax_len\x18\x03 \x01(\x04Bq\xc2Hn\n" + + "l\n" + + "\rbytes.max_len\x1a[uint(this.size()) > rules.max_len ? 'must be at most %s bytes'.format([rules.max_len]) : ''R\x06maxLen\x12\x93\x01\n" + + "\apattern\x18\x04 \x01(\tBy\xc2Hv\n" + + "t\n" + + "\rbytes.pattern\x1ac!string(this).matches(rules.pattern) ? 'must match regex pattern `%s`'.format([rules.pattern]) : ''R\apattern\x12\x83\x01\n" + + "\x06prefix\x18\x05 \x01(\fBk\xc2Hh\n" + + "f\n" + + "\fbytes.prefix\x1aV!this.startsWith(rules.prefix) ? 'does not have prefix %x'.format([rules.prefix]) : ''R\x06prefix\x12\x81\x01\n" + + "\x06suffix\x18\x06 \x01(\fBi\xc2Hf\n" + + "d\n" + + "\fbytes.suffix\x1aT!this.endsWith(rules.suffix) ? 'does not have suffix %x'.format([rules.suffix]) : ''R\x06suffix\x12\x87\x01\n" + + "\bcontains\x18\a \x01(\fBk\xc2Hh\n" + + "f\n" + + "\x0ebytes.contains\x1aT!this.contains(rules.contains) ? 'does not contain %x'.format([rules.contains]) : ''R\bcontains\x12\xa5\x01\n" + + "\x02in\x18\b \x03(\fB\x94\x01\xc2H\x90\x01\n" + + "\x8d\x01\n" + + "\bbytes.in\x1a\x80\x01getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12w\n" + + "\x06not_in\x18\t \x03(\fB`\xc2H]\n" + + "[\n" + + "\fbytes.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12\xe9\x01\n" + + "\x02ip\x18\n" + + " \x01(\bB\xd6\x01\xc2H\xd2\x01\n" + + "n\n" + + "\bbytes.ip\x12\x1amust be a valid IP address\x1aF!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n" + + "`\n" + + "\x0ebytes.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x1d!rules.ip || this.size() != 0H\x00R\x02ip\x12\xe4\x01\n" + + "\x04ipv4\x18\v \x01(\bB\xcd\x01\xc2H\xc9\x01\n" + + "_\n" + + "\n" + + "bytes.ipv4\x12\x1cmust be a valid IPv4 address\x1a3!rules.ipv4 || this.size() == 0 || this.size() == 4\n" + + "f\n" + + "\x10bytes.ipv4_empty\x121value is empty, which is not a valid IPv4 address\x1a\x1f!rules.ipv4 || this.size() != 0H\x00R\x04ipv4\x12\xe5\x01\n" + + "\x04ipv6\x18\f \x01(\bB\xce\x01\xc2H\xca\x01\n" + + "`\n" + + "\n" + + "bytes.ipv6\x12\x1cmust be a valid IPv6 address\x1a4!rules.ipv6 || this.size() == 0 || this.size() == 16\n" + + "f\n" + + "\x10bytes.ipv6_empty\x121value is empty, which is not a valid IPv6 address\x1a\x1f!rules.ipv6 || this.size() != 0H\x00R\x04ipv6\x12\xd5\x01\n" + + "\x04uuid\x18\x0f \x01(\bB\xbe\x01\xc2H\xba\x01\n" + + "X\n" + + "\n" + + "bytes.uuid\x12\x14must be a valid UUID\x1a4!rules.uuid || this.size() == 0 || this.size() == 16\n" + + "^\n" + + "\x10bytes.uuid_empty\x12)value is empty, which is not a valid UUID\x1a\x1f!rules.uuid || this.size() != 0H\x00R\x04uuid\x124\n" + + "\aexample\x18\x0e \x03(\fB\x1a\xc2H\x17\n" + + "\x15\n" + + "\rbytes.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\f\n" + + "\n" + + "well_known\"\xea\x03\n" + + "\tEnumRules\x12\x83\x01\n" + + "\x05const\x18\x01 \x01(\x05Bm\xc2Hj\n" + + "h\n" + + "\n" + + "enum.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12!\n" + + "\fdefined_only\x18\x02 \x01(\bR\vdefinedOnly\x12|\n" + + "\x02in\x18\x03 \x03(\x05Bl\xc2Hi\n" + + "g\n" + + "\aenum.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12v\n" + + "\x06not_in\x18\x04 \x03(\x05B_\xc2H\\\n" + + "Z\n" + + "\venum.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x123\n" + + "\aexample\x18\x05 \x03(\x05B\x19\xc2H\x16\n" + + "\x14\n" + + "\fenum.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x90\x04\n" + + "\rRepeatedRules\x12\xa0\x01\n" + + "\tmin_items\x18\x01 \x01(\x04B\x82\x01\xc2H\x7f\n" + + "}\n" + + "\x12repeated.min_items\x1aguint(this.size()) < rules.min_items ? 'must contain at least %d item(s)'.format([rules.min_items]) : ''R\bminItems\x12\xa6\x01\n" + + "\tmax_items\x18\x02 \x01(\x04B\x88\x01\xc2H\x84\x01\n" + + "\x81\x01\n" + + "\x12repeated.max_items\x1akuint(this.size()) > rules.max_items ? 'must contain no more than %s item(s)'.format([rules.max_items]) : ''R\bmaxItems\x12x\n" + + "\x06unique\x18\x03 \x01(\bB`\xc2H]\n" + + "[\n" + + "\x0frepeated.unique\x12(repeated value must contain unique items\x1a\x1e!rules.unique || this.unique()R\x06unique\x12.\n" + + "\x05items\x18\x04 \x01(\v2\x18.buf.validate.FieldRulesR\x05items*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xac\x03\n" + + "\bMapRules\x12\x99\x01\n" + + "\tmin_pairs\x18\x01 \x01(\x04B|\xc2Hy\n" + + "w\n" + + "\rmap.min_pairs\x1afuint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''R\bminPairs\x12\x98\x01\n" + + "\tmax_pairs\x18\x02 \x01(\x04B{\xc2Hx\n" + + "v\n" + + "\rmap.max_pairs\x1aeuint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''R\bmaxPairs\x12,\n" + + "\x04keys\x18\x04 \x01(\v2\x18.buf.validate.FieldRulesR\x04keys\x120\n" + + "\x06values\x18\x05 \x01(\v2\x18.buf.validate.FieldRulesR\x06values*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"1\n" + + "\bAnyRules\x12\x0e\n" + + "\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n" + + "\x06not_in\x18\x03 \x03(\tR\x05notIn\"\xec\x16\n" + + "\rDurationRules\x12\xa2\x01\n" + + "\x05const\x18\x02 \x01(\v2\x19.google.protobuf.DurationBq\xc2Hn\n" + + "l\n" + + "\x0eduration.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\xa6\x01\n" + + "\x02lt\x18\x03 \x01(\v2\x19.google.protobuf.DurationBy\xc2Hv\n" + + "t\n" + + "\vduration.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xb9\x01\n" + + "\x03lte\x18\x04 \x01(\v2\x19.google.protobuf.DurationB\x89\x01\xc2H\x85\x01\n" + + "\x82\x01\n" + + "\fduration.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12\xa7\a\n" + + "\x02gt\x18\x05 \x01(\v2\x19.google.protobuf.DurationB\xf9\x06\xc2H\xf5\x06\n" + + "w\n" + + "\vduration.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb0\x01\n" + + "\x0eduration.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb8\x01\n" + + "\x18duration.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc0\x01\n" + + "\x0fduration.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc8\x01\n" + + "\x19duration.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xf4\a\n" + + "\x03gte\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\xc4\a\xc2H\xc0\a\n" + + "\x85\x01\n" + + "\fduration.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xbf\x01\n" + + "\x0fduration.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc7\x01\n" + + "\x19duration.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xcf\x01\n" + + "\x10duration.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd7\x01\n" + + "\x1aduration.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12\x9b\x01\n" + + "\x02in\x18\a \x03(\v2\x19.google.protobuf.DurationBp\xc2Hm\n" + + "k\n" + + "\vduration.in\x1a\\!(this in getField(rules, 'in')) ? 'must be in list %s'.format([getField(rules, 'in')]) : ''R\x02in\x12\x95\x01\n" + + "\x06not_in\x18\b \x03(\v2\x19.google.protobuf.DurationBc\xc2H`\n" + + "^\n" + + "\x0fduration.not_in\x1aKthis in rules.not_in ? 'must not be in list %s'.format([rules.not_in]) : ''R\x05notIn\x12R\n" + + "\aexample\x18\t \x03(\v2\x19.google.protobuf.DurationB\x1d\xc2H\x1a\n" + + "\x18\n" + + "\x10duration.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"\x86\x06\n" + + "\x0eFieldMaskRules\x12\xc0\x01\n" + + "\x05const\x18\x01 \x01(\v2\x1a.google.protobuf.FieldMaskB\x8d\x01\xc2H\x89\x01\n" + + "\x86\x01\n" + + "\x10field_mask.const\x1arthis.paths != getField(rules, 'const').paths ? 'must equal paths %s'.format([getField(rules, 'const').paths]) : ''R\x05const\x12\xd7\x01\n" + + "\x02in\x18\x02 \x03(\tB\xc6\x01\xc2H\xc2\x01\n" + + "\xbf\x01\n" + + "\rfield_mask.in\x1a\xad\x01!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'must only contain paths in %s'.format([getField(rules, 'in')]) : ''R\x02in\x12\xf4\x01\n" + + "\x06not_in\x18\x03 \x03(\tB\xdc\x01\xc2H\xd8\x01\n" + + "\xd5\x01\n" + + "\x11field_mask.not_in\x1a\xbf\x01!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''R\x05notIn\x12U\n" + + "\aexample\x18\x04 \x03(\v2\x1a.google.protobuf.FieldMaskB\x1f\xc2H\x1c\n" + + "\x1a\n" + + "\x12field_mask.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xe8\x17\n" + + "\x0eTimestampRules\x12\xa4\x01\n" + + "\x05const\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampBr\xc2Ho\n" + + "m\n" + + "\x0ftimestamp.const\x1aZthis != getField(rules, 'const') ? 'must equal %s'.format([getField(rules, 'const')]) : ''R\x05const\x12\xa8\x01\n" + + "\x02lt\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampBz\xc2Hw\n" + + "u\n" + + "\ftimestamp.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? 'must be less than %s'.format([rules.lt]) : ''H\x00R\x02lt\x12\xbb\x01\n" + + "\x03lte\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB\x8a\x01\xc2H\x86\x01\n" + + "\x83\x01\n" + + "\rtimestamp.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? 'must be less than or equal to %s'.format([rules.lte]) : ''H\x00R\x03lte\x12m\n" + + "\x06lt_now\x18\a \x01(\bBT\xc2HQ\n" + + "O\n" + + "\x10timestamp.lt_now\x1a;(rules.lt_now && this > now) ? 'must be less than now' : ''H\x00R\x05ltNow\x12\xad\a\n" + + "\x02gt\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampB\xfe\x06\xc2H\xfa\x06\n" + + "x\n" + + "\ftimestamp.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? 'must be greater than %s'.format([rules.gt]) : ''\n" + + "\xb1\x01\n" + + "\x0ftimestamp.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? 'must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xb9\x01\n" + + "\x19timestamp.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? 'must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\n" + + "\xc1\x01\n" + + "\x10timestamp.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? 'must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\n" + + "\xc9\x01\n" + + "\x1atimestamp.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? 'must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''H\x01R\x02gt\x12\xfa\a\n" + + "\x03gte\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\xc9\a\xc2H\xc5\a\n" + + "\x86\x01\n" + + "\rtimestamp.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? 'must be greater than or equal to %s'.format([rules.gte]) : ''\n" + + "\xc0\x01\n" + + "\x10timestamp.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? 'must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xc8\x01\n" + + "\x1atimestamp.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? 'must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\n" + + "\xd0\x01\n" + + "\x11timestamp.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? 'must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\n" + + "\xd8\x01\n" + + "\x1btimestamp.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? 'must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''H\x01R\x03gte\x12p\n" + + "\x06gt_now\x18\b \x01(\bBW\xc2HT\n" + + "R\n" + + "\x10timestamp.gt_now\x1a>(rules.gt_now && this < now) ? 'must be greater than now' : ''H\x01R\x05gtNow\x12\xb9\x01\n" + + "\x06within\x18\t \x01(\v2\x19.google.protobuf.DurationB\x85\x01\xc2H\x81\x01\n" + + "\x7f\n" + + "\x10timestamp.within\x1akthis < now-rules.within || this > now+rules.within ? 'must be within %s of now'.format([rules.within]) : ''R\x06within\x12T\n" + + "\aexample\x18\n" + + " \x03(\v2\x1a.google.protobuf.TimestampB\x1e\xc2H\x1b\n" + + "\x19\n" + + "\x11timestamp.example\x1a\x04trueR\aexample*\t\b\xe8\a\x10\x80\x80\x80\x80\x02B\v\n" + + "\tless_thanB\x0e\n" + + "\fgreater_than\"E\n" + + "\n" + + "Violations\x127\n" + + "\n" + + "violations\x18\x01 \x03(\v2\x17.buf.validate.ViolationR\n" + + "violations\"\xc5\x01\n" + + "\tViolation\x12-\n" + + "\x05field\x18\x05 \x01(\v2\x17.buf.validate.FieldPathR\x05field\x12+\n" + + "\x04rule\x18\x06 \x01(\v2\x17.buf.validate.FieldPathR\x04rule\x12\x17\n" + + "\arule_id\x18\x02 \x01(\tR\x06ruleId\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\x12\x17\n" + + "\afor_key\x18\x04 \x01(\bR\x06forKeyJ\x04\b\x01\x10\x02R\n" + + "field_path\"G\n" + + "\tFieldPath\x12:\n" + + "\belements\x18\x01 \x03(\v2\x1e.buf.validate.FieldPathElementR\belements\"\xcc\x03\n" + + "\x10FieldPathElement\x12!\n" + + "\ffield_number\x18\x01 \x01(\x05R\vfieldNumber\x12\x1d\n" + + "\n" + + "field_name\x18\x02 \x01(\tR\tfieldName\x12I\n" + + "\n" + + "field_type\x18\x03 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\tfieldType\x12E\n" + + "\bkey_type\x18\x04 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\akeyType\x12I\n" + + "\n" + + "value_type\x18\x05 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\tvalueType\x12\x16\n" + + "\x05index\x18\x06 \x01(\x04H\x00R\x05index\x12\x1b\n" + + "\bbool_key\x18\a \x01(\bH\x00R\aboolKey\x12\x19\n" + + "\aint_key\x18\b \x01(\x03H\x00R\x06intKey\x12\x1b\n" + + "\buint_key\x18\t \x01(\x04H\x00R\auintKey\x12\x1f\n" + + "\n" + + "string_key\x18\n" + + " \x01(\tH\x00R\tstringKeyB\v\n" + + "\tsubscript*\xa1\x01\n" + + "\x06Ignore\x12\x16\n" + + "\x12IGNORE_UNSPECIFIED\x10\x00\x12\x18\n" + + "\x14IGNORE_IF_ZERO_VALUE\x10\x01\x12\x11\n" + + "\rIGNORE_ALWAYS\x10\x03\"\x04\b\x02\x10\x02*\fIGNORE_EMPTY*\x0eIGNORE_DEFAULT*\x17IGNORE_IF_DEFAULT_VALUE*\x15IGNORE_IF_UNPOPULATED*n\n" + + "\n" + + "KnownRegex\x12\x1b\n" + + "\x17KNOWN_REGEX_UNSPECIFIED\x10\x00\x12 \n" + + "\x1cKNOWN_REGEX_HTTP_HEADER_NAME\x10\x01\x12!\n" + + "\x1dKNOWN_REGEX_HTTP_HEADER_VALUE\x10\x02:V\n" + + "\amessage\x12\x1f.google.protobuf.MessageOptions\x18\x87\t \x01(\v2\x1a.buf.validate.MessageRulesR\amessage:N\n" + + "\x05oneof\x12\x1d.google.protobuf.OneofOptions\x18\x87\t \x01(\v2\x18.buf.validate.OneofRulesR\x05oneof:N\n" + + "\x05field\x12\x1d.google.protobuf.FieldOptions\x18\x87\t \x01(\v2\x18.buf.validate.FieldRulesR\x05field:]\n" + + "\n" + + "predefined\x12\x1d.google.protobuf.FieldOptions\x18\x88\t \x01(\v2\x1d.buf.validate.PredefinedRulesR\n" + + "predefinedBn\n" + + "\x12build.buf.validateB\rValidateProtoP\x01ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + +var file_buf_validate_validate_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_buf_validate_validate_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_buf_validate_validate_proto_goTypes = []any{ + (Ignore)(0), // 0: buf.validate.Ignore + (KnownRegex)(0), // 1: buf.validate.KnownRegex + (*Rule)(nil), // 2: buf.validate.Rule + (*MessageRules)(nil), // 3: buf.validate.MessageRules + (*MessageOneofRule)(nil), // 4: buf.validate.MessageOneofRule + (*OneofRules)(nil), // 5: buf.validate.OneofRules + (*FieldRules)(nil), // 6: buf.validate.FieldRules + (*PredefinedRules)(nil), // 7: buf.validate.PredefinedRules + (*FloatRules)(nil), // 8: buf.validate.FloatRules + (*DoubleRules)(nil), // 9: buf.validate.DoubleRules + (*Int32Rules)(nil), // 10: buf.validate.Int32Rules + (*Int64Rules)(nil), // 11: buf.validate.Int64Rules + (*UInt32Rules)(nil), // 12: buf.validate.UInt32Rules + (*UInt64Rules)(nil), // 13: buf.validate.UInt64Rules + (*SInt32Rules)(nil), // 14: buf.validate.SInt32Rules + (*SInt64Rules)(nil), // 15: buf.validate.SInt64Rules + (*Fixed32Rules)(nil), // 16: buf.validate.Fixed32Rules + (*Fixed64Rules)(nil), // 17: buf.validate.Fixed64Rules + (*SFixed32Rules)(nil), // 18: buf.validate.SFixed32Rules + (*SFixed64Rules)(nil), // 19: buf.validate.SFixed64Rules + (*BoolRules)(nil), // 20: buf.validate.BoolRules + (*StringRules)(nil), // 21: buf.validate.StringRules + (*BytesRules)(nil), // 22: buf.validate.BytesRules + (*EnumRules)(nil), // 23: buf.validate.EnumRules + (*RepeatedRules)(nil), // 24: buf.validate.RepeatedRules + (*MapRules)(nil), // 25: buf.validate.MapRules + (*AnyRules)(nil), // 26: buf.validate.AnyRules + (*DurationRules)(nil), // 27: buf.validate.DurationRules + (*FieldMaskRules)(nil), // 28: buf.validate.FieldMaskRules + (*TimestampRules)(nil), // 29: buf.validate.TimestampRules + (*Violations)(nil), // 30: buf.validate.Violations + (*Violation)(nil), // 31: buf.validate.Violation + (*FieldPath)(nil), // 32: buf.validate.FieldPath + (*FieldPathElement)(nil), // 33: buf.validate.FieldPathElement + (*durationpb.Duration)(nil), // 34: google.protobuf.Duration + (*fieldmaskpb.FieldMask)(nil), // 35: google.protobuf.FieldMask + (*timestamppb.Timestamp)(nil), // 36: google.protobuf.Timestamp + (descriptorpb.FieldDescriptorProto_Type)(0), // 37: google.protobuf.FieldDescriptorProto.Type + (*descriptorpb.MessageOptions)(nil), // 38: google.protobuf.MessageOptions + (*descriptorpb.OneofOptions)(nil), // 39: google.protobuf.OneofOptions + (*descriptorpb.FieldOptions)(nil), // 40: google.protobuf.FieldOptions +} +var file_buf_validate_validate_proto_depIdxs = []int32{ + 2, // 0: buf.validate.MessageRules.cel:type_name -> buf.validate.Rule + 4, // 1: buf.validate.MessageRules.oneof:type_name -> buf.validate.MessageOneofRule + 2, // 2: buf.validate.FieldRules.cel:type_name -> buf.validate.Rule + 0, // 3: buf.validate.FieldRules.ignore:type_name -> buf.validate.Ignore + 8, // 4: buf.validate.FieldRules.float:type_name -> buf.validate.FloatRules + 9, // 5: buf.validate.FieldRules.double:type_name -> buf.validate.DoubleRules + 10, // 6: buf.validate.FieldRules.int32:type_name -> buf.validate.Int32Rules + 11, // 7: buf.validate.FieldRules.int64:type_name -> buf.validate.Int64Rules + 12, // 8: buf.validate.FieldRules.uint32:type_name -> buf.validate.UInt32Rules + 13, // 9: buf.validate.FieldRules.uint64:type_name -> buf.validate.UInt64Rules + 14, // 10: buf.validate.FieldRules.sint32:type_name -> buf.validate.SInt32Rules + 15, // 11: buf.validate.FieldRules.sint64:type_name -> buf.validate.SInt64Rules + 16, // 12: buf.validate.FieldRules.fixed32:type_name -> buf.validate.Fixed32Rules + 17, // 13: buf.validate.FieldRules.fixed64:type_name -> buf.validate.Fixed64Rules + 18, // 14: buf.validate.FieldRules.sfixed32:type_name -> buf.validate.SFixed32Rules + 19, // 15: buf.validate.FieldRules.sfixed64:type_name -> buf.validate.SFixed64Rules + 20, // 16: buf.validate.FieldRules.bool:type_name -> buf.validate.BoolRules + 21, // 17: buf.validate.FieldRules.string:type_name -> buf.validate.StringRules + 22, // 18: buf.validate.FieldRules.bytes:type_name -> buf.validate.BytesRules + 23, // 19: buf.validate.FieldRules.enum:type_name -> buf.validate.EnumRules + 24, // 20: buf.validate.FieldRules.repeated:type_name -> buf.validate.RepeatedRules + 25, // 21: buf.validate.FieldRules.map:type_name -> buf.validate.MapRules + 26, // 22: buf.validate.FieldRules.any:type_name -> buf.validate.AnyRules + 27, // 23: buf.validate.FieldRules.duration:type_name -> buf.validate.DurationRules + 28, // 24: buf.validate.FieldRules.field_mask:type_name -> buf.validate.FieldMaskRules + 29, // 25: buf.validate.FieldRules.timestamp:type_name -> buf.validate.TimestampRules + 2, // 26: buf.validate.PredefinedRules.cel:type_name -> buf.validate.Rule + 1, // 27: buf.validate.StringRules.well_known_regex:type_name -> buf.validate.KnownRegex + 6, // 28: buf.validate.RepeatedRules.items:type_name -> buf.validate.FieldRules + 6, // 29: buf.validate.MapRules.keys:type_name -> buf.validate.FieldRules + 6, // 30: buf.validate.MapRules.values:type_name -> buf.validate.FieldRules + 34, // 31: buf.validate.DurationRules.const:type_name -> google.protobuf.Duration + 34, // 32: buf.validate.DurationRules.lt:type_name -> google.protobuf.Duration + 34, // 33: buf.validate.DurationRules.lte:type_name -> google.protobuf.Duration + 34, // 34: buf.validate.DurationRules.gt:type_name -> google.protobuf.Duration + 34, // 35: buf.validate.DurationRules.gte:type_name -> google.protobuf.Duration + 34, // 36: buf.validate.DurationRules.in:type_name -> google.protobuf.Duration + 34, // 37: buf.validate.DurationRules.not_in:type_name -> google.protobuf.Duration + 34, // 38: buf.validate.DurationRules.example:type_name -> google.protobuf.Duration + 35, // 39: buf.validate.FieldMaskRules.const:type_name -> google.protobuf.FieldMask + 35, // 40: buf.validate.FieldMaskRules.example:type_name -> google.protobuf.FieldMask + 36, // 41: buf.validate.TimestampRules.const:type_name -> google.protobuf.Timestamp + 36, // 42: buf.validate.TimestampRules.lt:type_name -> google.protobuf.Timestamp + 36, // 43: buf.validate.TimestampRules.lte:type_name -> google.protobuf.Timestamp + 36, // 44: buf.validate.TimestampRules.gt:type_name -> google.protobuf.Timestamp + 36, // 45: buf.validate.TimestampRules.gte:type_name -> google.protobuf.Timestamp + 34, // 46: buf.validate.TimestampRules.within:type_name -> google.protobuf.Duration + 36, // 47: buf.validate.TimestampRules.example:type_name -> google.protobuf.Timestamp + 31, // 48: buf.validate.Violations.violations:type_name -> buf.validate.Violation + 32, // 49: buf.validate.Violation.field:type_name -> buf.validate.FieldPath + 32, // 50: buf.validate.Violation.rule:type_name -> buf.validate.FieldPath + 33, // 51: buf.validate.FieldPath.elements:type_name -> buf.validate.FieldPathElement + 37, // 52: buf.validate.FieldPathElement.field_type:type_name -> google.protobuf.FieldDescriptorProto.Type + 37, // 53: buf.validate.FieldPathElement.key_type:type_name -> google.protobuf.FieldDescriptorProto.Type + 37, // 54: buf.validate.FieldPathElement.value_type:type_name -> google.protobuf.FieldDescriptorProto.Type + 38, // 55: buf.validate.message:extendee -> google.protobuf.MessageOptions + 39, // 56: buf.validate.oneof:extendee -> google.protobuf.OneofOptions + 40, // 57: buf.validate.field:extendee -> google.protobuf.FieldOptions + 40, // 58: buf.validate.predefined:extendee -> google.protobuf.FieldOptions + 3, // 59: buf.validate.message:type_name -> buf.validate.MessageRules + 5, // 60: buf.validate.oneof:type_name -> buf.validate.OneofRules + 6, // 61: buf.validate.field:type_name -> buf.validate.FieldRules + 7, // 62: buf.validate.predefined:type_name -> buf.validate.PredefinedRules + 63, // [63:63] is the sub-list for method output_type + 63, // [63:63] is the sub-list for method input_type + 59, // [59:63] is the sub-list for extension type_name + 55, // [55:59] is the sub-list for extension extendee + 0, // [0:55] is the sub-list for field type_name +} + +func init() { file_buf_validate_validate_proto_init() } +func file_buf_validate_validate_proto_init() { + if File_buf_validate_validate_proto != nil { + return + } + file_buf_validate_validate_proto_msgTypes[4].OneofWrappers = []any{ + (*fieldRules_Float)(nil), + (*fieldRules_Double)(nil), + (*fieldRules_Int32)(nil), + (*fieldRules_Int64)(nil), + (*fieldRules_Uint32)(nil), + (*fieldRules_Uint64)(nil), + (*fieldRules_Sint32)(nil), + (*fieldRules_Sint64)(nil), + (*fieldRules_Fixed32)(nil), + (*fieldRules_Fixed64)(nil), + (*fieldRules_Sfixed32)(nil), + (*fieldRules_Sfixed64)(nil), + (*fieldRules_Bool)(nil), + (*fieldRules_String_)(nil), + (*fieldRules_Bytes)(nil), + (*fieldRules_Enum)(nil), + (*fieldRules_Repeated)(nil), + (*fieldRules_Map)(nil), + (*fieldRules_Any)(nil), + (*fieldRules_Duration)(nil), + (*fieldRules_FieldMask)(nil), + (*fieldRules_Timestamp)(nil), + } + file_buf_validate_validate_proto_msgTypes[6].OneofWrappers = []any{ + (*floatRules_Lt)(nil), + (*floatRules_Lte)(nil), + (*floatRules_Gt)(nil), + (*floatRules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[7].OneofWrappers = []any{ + (*doubleRules_Lt)(nil), + (*doubleRules_Lte)(nil), + (*doubleRules_Gt)(nil), + (*doubleRules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[8].OneofWrappers = []any{ + (*int32Rules_Lt)(nil), + (*int32Rules_Lte)(nil), + (*int32Rules_Gt)(nil), + (*int32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[9].OneofWrappers = []any{ + (*int64Rules_Lt)(nil), + (*int64Rules_Lte)(nil), + (*int64Rules_Gt)(nil), + (*int64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[10].OneofWrappers = []any{ + (*uInt32Rules_Lt)(nil), + (*uInt32Rules_Lte)(nil), + (*uInt32Rules_Gt)(nil), + (*uInt32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[11].OneofWrappers = []any{ + (*uInt64Rules_Lt)(nil), + (*uInt64Rules_Lte)(nil), + (*uInt64Rules_Gt)(nil), + (*uInt64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[12].OneofWrappers = []any{ + (*sInt32Rules_Lt)(nil), + (*sInt32Rules_Lte)(nil), + (*sInt32Rules_Gt)(nil), + (*sInt32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[13].OneofWrappers = []any{ + (*sInt64Rules_Lt)(nil), + (*sInt64Rules_Lte)(nil), + (*sInt64Rules_Gt)(nil), + (*sInt64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[14].OneofWrappers = []any{ + (*fixed32Rules_Lt)(nil), + (*fixed32Rules_Lte)(nil), + (*fixed32Rules_Gt)(nil), + (*fixed32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[15].OneofWrappers = []any{ + (*fixed64Rules_Lt)(nil), + (*fixed64Rules_Lte)(nil), + (*fixed64Rules_Gt)(nil), + (*fixed64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[16].OneofWrappers = []any{ + (*sFixed32Rules_Lt)(nil), + (*sFixed32Rules_Lte)(nil), + (*sFixed32Rules_Gt)(nil), + (*sFixed32Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[17].OneofWrappers = []any{ + (*sFixed64Rules_Lt)(nil), + (*sFixed64Rules_Lte)(nil), + (*sFixed64Rules_Gt)(nil), + (*sFixed64Rules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[19].OneofWrappers = []any{ + (*stringRules_Email)(nil), + (*stringRules_Hostname)(nil), + (*stringRules_Ip)(nil), + (*stringRules_Ipv4)(nil), + (*stringRules_Ipv6)(nil), + (*stringRules_Uri)(nil), + (*stringRules_UriRef)(nil), + (*stringRules_Address)(nil), + (*stringRules_Uuid)(nil), + (*stringRules_Tuuid)(nil), + (*stringRules_IpWithPrefixlen)(nil), + (*stringRules_Ipv4WithPrefixlen)(nil), + (*stringRules_Ipv6WithPrefixlen)(nil), + (*stringRules_IpPrefix)(nil), + (*stringRules_Ipv4Prefix)(nil), + (*stringRules_Ipv6Prefix)(nil), + (*stringRules_HostAndPort)(nil), + (*stringRules_Ulid)(nil), + (*stringRules_ProtobufFqn)(nil), + (*stringRules_ProtobufDotFqn)(nil), + (*stringRules_WellKnownRegex)(nil), + } + file_buf_validate_validate_proto_msgTypes[20].OneofWrappers = []any{ + (*bytesRules_Ip)(nil), + (*bytesRules_Ipv4)(nil), + (*bytesRules_Ipv6)(nil), + (*bytesRules_Uuid)(nil), + } + file_buf_validate_validate_proto_msgTypes[25].OneofWrappers = []any{ + (*durationRules_Lt)(nil), + (*durationRules_Lte)(nil), + (*durationRules_Gt)(nil), + (*durationRules_Gte)(nil), + } + file_buf_validate_validate_proto_msgTypes[27].OneofWrappers = []any{ + (*timestampRules_Lt)(nil), + (*timestampRules_Lte)(nil), + (*timestampRules_LtNow)(nil), + (*timestampRules_Gt)(nil), + (*timestampRules_Gte)(nil), + (*timestampRules_GtNow)(nil), + } + file_buf_validate_validate_proto_msgTypes[31].OneofWrappers = []any{ + (*fieldPathElement_Index)(nil), + (*fieldPathElement_BoolKey)(nil), + (*fieldPathElement_IntKey)(nil), + (*fieldPathElement_UintKey)(nil), + (*fieldPathElement_StringKey)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_buf_validate_validate_proto_rawDesc), len(file_buf_validate_validate_proto_rawDesc)), + NumEnums: 2, + NumMessages: 32, + NumExtensions: 4, + NumServices: 0, + }, + GoTypes: file_buf_validate_validate_proto_goTypes, + DependencyIndexes: file_buf_validate_validate_proto_depIdxs, + EnumInfos: file_buf_validate_validate_proto_enumTypes, + MessageInfos: file_buf_validate_validate_proto_msgTypes, + ExtensionInfos: file_buf_validate_validate_proto_extTypes, + }.Build() + File_buf_validate_validate_proto = out.File + file_buf_validate_validate_proto_goTypes = nil + file_buf_validate_validate_proto_depIdxs = nil +} diff --git a/vendor/connectrpc.com/connect/.gitignore b/vendor/connectrpc.com/connect/.gitignore new file mode 100644 index 000000000..1daeabb68 --- /dev/null +++ b/vendor/connectrpc.com/connect/.gitignore @@ -0,0 +1,7 @@ +/.tmp/ +/dist/ +*.pprof +*.svg +.idea +cover.out +connect.test diff --git a/vendor/connectrpc.com/connect/.golangci.yml b/vendor/connectrpc.com/connect/.golangci.yml new file mode 100644 index 000000000..6c4c77b44 --- /dev/null +++ b/vendor/connectrpc.com/connect/.golangci.yml @@ -0,0 +1,182 @@ +version: "2" +linters: + default: all + disable: + - cyclop # covered by gocyclo + - depguard # unnecessary for small libraries + - exhaustruct # deprecated, replaced by exhaustruct_v5 + - funcorder # consider enabling in the future + - funlen # rely on code review to limit function length + - gocognit # dubious "cognitive overhead" quantification + - goconst # too many false positives + - gomodguard # deprecated, replaced by gomodguard_v2 + - inamedparam # convention is not followed + - ireturn # "accept interfaces, return structs" isn't ironclad + - lll # don't want hard limits for line length + - maintidx # covered by gocyclo + - mnd # status codes are clearer than constants + - nlreturn # generous whitespace violates house style + - noinlineerr # inline is fine + - nonamedreturns # named returns are fine; it's *bare* returns that are bad + - protogetter # too many false positives + - testpackage # internal tests are fine + - wrapcheck # don't _always_ need to wrap errors + - wsl # generous whitespace violates house style + - wsl_v5 # generous whitespace violates house style + settings: + errcheck: + check-type-assertions: true + exhaustruct_v5: + enforce-patterns: + - connectrpc\.com/connect\..*[pP]arams + explicit-mode: true + forbidigo: + forbid: + - pattern: ^fmt\.Print + - pattern: ^log\. + - pattern: ^print$ + - pattern: ^println$ + - pattern: ^panic$ + godox: + keywords: + - FIXME + importas: + alias: + - pkg: connectrpc.com/connect/internal/gen/connect/ping/v1 + alias: pingv1 + no-unaliased: true + varnamelen: + ignore-decls: + - T any + - i int + - wg sync.WaitGroup + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + # Loosen requirements on tests + - linters: + - funlen + - gosec + - gosmopolitan + - unparam + - varnamelen + - prealloc + path: _test.go + # If future reflect.Kinds are nil-able, we'll find out when a test fails. + - linters: + - exhaustive + path: internal/assert/assert.go + # We need our duplex HTTP call to have access to the context. + - linters: + - containedctx + path: duplex_http_call.go + # blockUntilResponseReady returns the shared response, whose body is + # closed once by CloseRead rather than at each call site. + - linters: + - bodyclose + source: blockUntilResponseReady + # We need to init a global in-mem HTTP server for testable examples. + - linters: + - gochecknoglobals + - gochecknoinits + path: example_init_test.go + # We purposefully do an ineffectual assignment for an example. + - linters: + - ineffassign + path: client_example_test.go + # The generated file is effectively a global receiver. + - linters: + - varnamelen + path: cmd/protoc-gen-connect-go + text: parameter name 'g' is too short + # Thorough error logging and timeout config make this example unreadably long. + - linters: + - errcheck + - gosec + path: error_writer_example_test.go + # It should be crystal clear that Connect uses plain *http.Clients. + - linters: + - revive + - staticcheck + path: client_example_test.go + # Don't complain about timeout management or lack of output assertions in examples. + - linters: + - gosec + - testableexamples + path: handler_example_test.go + # No output assertions needed for these examples. + - linters: + - testableexamples + path: error_writer_example_test.go + - linters: + - testableexamples + path: error_not_modified_example_test.go + - linters: + - testableexamples + path: error_example_test.go + # In examples, it's okay to use http.ListenAndServe. + - linters: + - gosec + path: error_not_modified_example_test.go + # There are many instances where we want to keep unused parameters + # as a matter of style or convention, for example when a context.Context + # is the first parameter, we choose to just globally ignore this. + - linters: + - revive + text: '^unused-parameter: ' + # We want to return explicit nils in protocol_grpc.go + - linters: + - revive + path: protocol_grpc.go + text: '^if-return: ' + # We want to return explicit nils in protocol_connect.go + - linters: + - revive + path: protocol_connect.go + text: '^if-return: ' + # We want to return explicit nils in error_writer.go + - linters: + - revive + path: error_writer.go + text: '^if-return: ' + # We want to set http.Server's logger + - linters: + - forbidigo + path: internal/memhttp + text: use of `log.(New|Logger|Lshortfile)` forbidden by pattern .* + # We want to show examples with http.Get + - linters: + - noctx + path: internal/memhttp/memhttp_test.go + # Allow fmt.Sprintf for cmd/protoc-gen-connect-go for consistency + - linters: + - perfsprint + path: cmd/protoc-gen-connect-go/main.go + # Allow non-canonical headers in tests + - linters: + - canonicalheader + path: .*_test.go + # Allow Code pointer receiver for UnmarshalText method + - linters: + - recvcheck + path: code.go + # Avoid false positives for int overflow in tests + - linters: + - gosec + path: .*_test.go + text: '^G115: integer overflow conversion' + # Don't ban use of fmt.Errorf to create new errors, but the remaining + # checks from err113 are useful. + - path: (.+)\.go$ + text: 'do not define dynamic errors, use wrapped static errors instead: .*' +formatters: + enable: + - gci + - gofmt + exclusions: + generated: lax diff --git a/vendor/connectrpc.com/connect/.goreleaser.yaml b/vendor/connectrpc.com/connect/.goreleaser.yaml new file mode 100644 index 000000000..2ca70f295 --- /dev/null +++ b/vendor/connectrpc.com/connect/.goreleaser.yaml @@ -0,0 +1,65 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +version: 2 +project_name: protoc-gen-connect-go + +before: + hooks: + # connect.go's Version constant is edited by hand (RELEASE.md step 2) and is + # what the plugin reports via --version, while the archive names below come + # from the git tag. Nothing else checks that the two agree, so a missed edit + # would silently ship mislabelled binaries. Skipped for snapshot builds, + # where there is no release tag to compare against. + - sh -c 'if [ "{{ .IsSnapshot }}" != "true" ]; then version="v$(go run ./cmd/protoc-gen-connect-go --version)"; if [ "$version" != "{{ .Tag }}" ]; then echo "connect.Version is $version, but the release tag is {{ .Tag }}" >&2; exit 1; fi; fi' + +builds: + - id: protoc-gen-connect-go + binary: protoc-gen-connect-go + main: ./cmd/protoc-gen-connect-go + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + ldflags: + # Omit the symbol table and DWARF data, this is not a debuggable artifact. + - -s -w + +archives: + - formats: [tar.gz] + format_overrides: + - goos: windows + formats: [zip] + # Matches the naming used by bufbuild/buf and connectconformance releases. + name_template: >- + protoc-gen-connect-go- + {{- .Tag }}- + {{- title .Os }}- + {{- if and (eq .Os "linux") (eq .Arch "arm64") }}aarch64 + {{- else if eq .Arch "amd64" }}x86_64 + {{- else }}{{ .Arch }}{{ end }} + files: + - LICENSE + +checksum: + # The default template uses .Version, which renders without the leading "v" + # that the archives above use. Pin it so the whole release is consistent. + name_template: 'protoc-gen-connect-go-{{ .Tag }}-checksums.txt' + +changelog: + # Release notes are written by hand in the GitHub UI, so there is nothing to + # generate here. Skipping it also avoids walking history that the release + # workflow's shallow checkout doesn't have. + disable: true + +release: + github: + owner: connectrpc + name: connect-go + # Releases are created and their notes curated by hand in the GitHub UI, as + # described in RELEASE.md. This only attaches artifacts to the existing + # release. + mode: keep-existing diff --git a/vendor/connectrpc.com/connect/LICENSE b/vendor/connectrpc.com/connect/LICENSE new file mode 100644 index 000000000..62b825afb --- /dev/null +++ b/vendor/connectrpc.com/connect/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021-2025 The Connect Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/connectrpc.com/connect/MAINTAINERS.md b/vendor/connectrpc.com/connect/MAINTAINERS.md new file mode 100644 index 000000000..165a9d132 --- /dev/null +++ b/vendor/connectrpc.com/connect/MAINTAINERS.md @@ -0,0 +1,14 @@ +Maintainers +=========== + +## Current +* [Peter Edge](https://github.com/bufdev), [Buf](https://buf.build) +* [Josh Humphries](https://github.com/jhump), [Buf](https://buf.build) +* [Matt Robenolt](https://github.com/mattrobenolt), [PlanetScale](https://planetscale.com) +* [Edward McFarlane](https://github.com/emcfarlane), [Buf](https://buf.build) +* [Timo Stamm](https://github.com/timostamm), [Buf](https://buf.build) +* [Philip Warren](https://github.com/pkwarren), [Buf](https://buf.build) + +## Former +* [Akshay Shah](https://github.com/akshayjshah) +* [Alex McKinney](https://github.com/amckinney) diff --git a/vendor/connectrpc.com/connect/Makefile b/vendor/connectrpc.com/connect/Makefile new file mode 100644 index 000000000..0d26ebf31 --- /dev/null +++ b/vendor/connectrpc.com/connect/Makefile @@ -0,0 +1,137 @@ +# See https://tech.davis-hansson.com/p/make/ +SHELL := bash +.DELETE_ON_ERROR: +.SHELLFLAGS := -eu -o pipefail -c +.DEFAULT_GOAL := all +MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules +MAKEFLAGS += --no-print-directory +BIN := .tmp/bin +export PATH := $(abspath $(BIN)):$(PATH) +export GOBIN := $(abspath $(BIN)) +COPYRIGHT_YEARS := 2021-2026 +LICENSE_IGNORE := --ignore .github/ --ignore ".*\.ya?ml" +BUF_VERSION := 1.69.0 +GOLANGCI_LINT_VERSION ?= v2.14.0 +GORELEASER_VERSION ?= v2.18.0 + +.PHONY: help +help: ## Describe useful make targets + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}' + +.PHONY: all +all: ## Build, test, and lint (default) + $(MAKE) test + $(MAKE) lint + +.PHONY: clean +clean: ## Delete intermediate build artifacts + @# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs + git clean -Xdf + +.PHONY: test +test: shorttest slowtest + +.PHONY: shorttest +shorttest: build ## Run unit tests + go test -vet=off -race -cover -short ./... + +.PHONY: slowtest +# Runs all tests, including known long/slow ones. The +# race detector is not used for a few reasons: +# 1. Race coverage of the short tests should be +# adequate to catch race conditions. +# 2. It slows tests down, which is not good if we +# know these are already slow tests. +# 3. Some of the slow tests can't repro issues and +# find regressions as reliably with the race +# detector enabled. +slowtest: build + go test ./... + +.PHONY: runconformance +runconformance: build ## Run conformance test suite + cd internal/conformance && ./runconformance.sh + +.PHONY: bench +bench: BENCH ?= .* +bench: build ## Run benchmarks for root package + go test -vet=off -run '^$$' -bench '$(BENCH)' -benchmem -cpuprofile cpu.pprof -memprofile mem.pprof . + +.PHONY: build +build: generate ## Build all packages + go build ./... + +.PHONY: install +install: ## Install all binaries + go install ./... + +.PHONY: lint +lint: $(BIN)/golangci-lint $(BIN)/buf ## Lint Go and protobuf + go vet ./... + golangci-lint run --modules-download-mode=readonly --timeout=3m0s + buf lint + buf format -d --exit-code + +.PHONY: lintfix +lintfix: $(BIN)/golangci-lint $(BIN)/buf ## Automatically fix some lint errors + golangci-lint run --fix --modules-download-mode=readonly --timeout=3m0s + buf format -w + +.PHONY: generate +generate: $(BIN)/buf $(BIN)/protoc-gen-go $(BIN)/protoc-gen-connect-go $(BIN)/license-header ## Regenerate code and licenses + go mod tidy + cd ./internal/conformance && go mod tidy + buf generate + cd ./cmd/protoc-gen-connect-go/internal && \ + find ./testdata -maxdepth 1 -type d \( ! -name testdata \) | xargs -n 1 -I % bash -c "cd '%' && buf generate" + license-header \ + --license-type apache \ + --copyright-holder "The Connect Authors" \ + --year-range "$(COPYRIGHT_YEARS)" $(LICENSE_IGNORE) + +.PHONY: upgrade +upgrade: ## Upgrade dependencies + go get -u -t ./... && go mod tidy -v + +.PHONY: checkgenerate +checkgenerate: + @# Used in CI to verify that `make generate` doesn't produce a diff. + test -z "$$(git status --porcelain | tee /dev/stderr)" + +.PHONY: release +release: $(BIN)/goreleaser ## Build release artifacts and attach them to the release + goreleaser release + +.PHONY: checkrelease +checkrelease: $(BIN)/goreleaser + @# Used in CI to verify that the release build works. Skips validation and + @# doesn't publish anything. + goreleaser release --clean --snapshot + +.PHONY: $(BIN)/protoc-gen-connect-go +$(BIN)/protoc-gen-connect-go: + @mkdir -p $(@D) + go build -o $(@) ./cmd/protoc-gen-connect-go + +$(BIN)/buf: Makefile + @mkdir -p $(@D) + go install github.com/bufbuild/buf/cmd/buf@v${BUF_VERSION} + +$(BIN)/license-header: Makefile + @mkdir -p $(@D) + go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v${BUF_VERSION} + +$(BIN)/golangci-lint: Makefile + @mkdir -p $(@D) + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) + +$(BIN)/goreleaser: Makefile + @mkdir -p $(@D) + go install github.com/goreleaser/goreleaser/v2@$(GORELEASER_VERSION) + +$(BIN)/protoc-gen-go: Makefile go.mod + @mkdir -p $(@D) + @# The version of protoc-gen-go is determined by the version in go.mod + go install google.golang.org/protobuf/cmd/protoc-gen-go + diff --git a/vendor/connectrpc.com/connect/README.md b/vendor/connectrpc.com/connect/README.md new file mode 100644 index 000000000..31bd414ae --- /dev/null +++ b/vendor/connectrpc.com/connect/README.md @@ -0,0 +1,183 @@ +Connect +======= + +[![Build](https://github.com/connectrpc/connect-go/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/connectrpc/connect-go/actions/workflows/ci.yaml) +[![GoDoc](https://pkg.go.dev/badge/connectrpc.com/connect.svg)](https://pkg.go.dev/connectrpc.com/connect) +[![Slack](https://img.shields.io/badge/slack-buf-%23e01563)][slack] +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8972/badge)](https://www.bestpractices.dev/projects/8972) + +Connect is a slim library for building browser and gRPC-compatible HTTP APIs. +You write a short [Protocol Buffer][protobuf] schema and implement your +application logic, and Connect generates code to handle marshaling, routing, +compression, and content type negotiation. It also generates an idiomatic, +type-safe client. Handlers and clients support three protocols: gRPC, gRPC-Web, +and Connect's own protocol. + +The [Connect protocol][protocol] is a simple protocol that works over HTTP/1.1 +or HTTP/2. It takes the best portions of gRPC and gRPC-Web, including +streaming, and packages them into a protocol that works equally well in +browsers, monoliths, and microservices. Calling a Connect API is as easy as +using `curl`. Try it with our live demo: + +``` +curl \ + --header "Content-Type: application/json" \ + --data '{"sentence": "I feel happy."}' \ + https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say +``` + +Handlers and clients also support the gRPC and gRPC-Web protocols, including +streaming, headers, trailers, and error details. gRPC-compatible [server +reflection][grpcreflect] and [health checks][grpchealth] are available as +standalone packages. Instead of cURL, we could call our API with a gRPC client: + +``` +go install github.com/bufbuild/buf/cmd/buf@latest +buf curl --protocol grpc \ + --data '{"sentence": "I feel happy."}' \ + https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say +``` + +Under the hood, Connect is just [Protocol Buffers][protobuf] and the standard +library: no custom HTTP implementation, no new name resolution or load +balancing APIs, and no surprises. Everything you already know about `net/http` +still applies, and any package that works with an `http.Server`, `http.Client`, +or `http.Handler` also works with Connect. + +For more on Connect, see the [announcement blog post][blog], the documentation +on [connectrpc.com][docs] (especially the [Getting Started] guide for Go), the +[demo service][examples-go], or the [protocol specification][protocol]. + +## A small example + +Curious what all this looks like in practice? From a [Protobuf +schema](internal/proto/connect/ping/v1/ping.proto), we generate [a small RPC +package](internal/gen/simple/connect/ping/v1/pingv1connect/ping.connect.go). Using that +package, we can build a server. This example is available at [internal/example](internal/example): + +```go +package main + +import ( + "context" + "log" + "net/http" + + "connectrpc.com/connect" + pingv1 "connectrpc.com/connect/internal/gen/connect/ping/v1" + "connectrpc.com/connect/internal/gen/simple/connect/ping/v1/pingv1connect" + "connectrpc.com/validate" +) + +type PingServer struct { + pingv1connect.UnimplementedPingServiceHandler // returns errors from all methods +} + +func (ps *PingServer) Ping(ctx context.Context, req *pingv1.PingRequest) (*pingv1.PingResponse, error) { + return &pingv1.PingResponse{ + Number: req.Number, + }, nil +} + +func main() { + mux := http.NewServeMux() + // The generated constructors return a path and a plain net/http + // handler. + mux.Handle( + pingv1connect.NewPingServiceHandler( + &PingServer{}, + // Validation via Protovalidate is almost always recommended + connect.WithInterceptors(validate.NewInterceptor()), + ), + ) + p := new(http.Protocols) + p.SetHTTP1(true) + // For gRPC clients, it's convenient to support HTTP/2 without TLS. + p.SetUnencryptedHTTP2(true) + s := &http.Server{ + Addr: "localhost:8080", + Handler: mux, + Protocols: p, + } + if err := s.ListenAndServe(); err != nil { + log.Fatalf("listen failed: %v", err) + } +} +``` + +With that server running, you can make requests with any gRPC or Connect +client. To write a client using Connect: + +```go +package main + +import ( + "context" + "log" + "net/http" + + pingv1 "connectrpc.com/connect/internal/gen/connect/ping/v1" + "connectrpc.com/connect/internal/gen/simple/connect/ping/v1/pingv1connect" +) + +func main() { + client := pingv1connect.NewPingServiceClient( + http.DefaultClient, + "http://localhost:8080/", + ) + req := &pingv1.PingRequest{Number: 42} + res, err := client.Ping(context.Background(), req) + if err != nil { + log.Fatalln(err) + } + log.Println(res) +} +``` + +Of course, `http.ListenAndServe` and `http.DefaultClient` aren't fit for +production use! See Connect's [deployment docs][docs-deployment] for a guide to +configuring timeouts, connection pools, observability, and h2c. + +## Ecosystem + +* [grpchealth]: gRPC-compatible health checks for connect-go +* [grpcreflect]: gRPC-compatible server reflection for connect-go +* [validate]: [Protovalidate][protovalidate] interceptor for connect-go +* [examples-go]: service powering [demo.connectrpc.com](https://demo.connectrpc.com), including bidi streaming +* [connect-es]: Type-safe APIs with Protobuf and TypeScript +* [Buf Studio]: web UI for ad-hoc RPCs +* [conformance]: Connect, gRPC, and gRPC-Web interoperability tests + +## Status: Stable + +This module is stable. It supports: + +* The two most recent major releases of Go (the same versions of Go that continue + to [receive security patches][go-support-policy]). +* [APIv2] of Protocol Buffers in Go (`google.golang.org/protobuf`). + +Within those parameters, `connect` follows semantic versioning. We will +_not_ make breaking changes in the 1.x series of releases. + +## Legal + +Offered under the [Apache 2 license][license]. + +[APIv2]: https://blog.golang.org/protobuf-apiv2 +[Buf Studio]: https://buf.build/studio +[Getting Started]: https://connectrpc.com/docs/go/getting-started +[blog]: https://buf.build/blog/connect-a-better-grpc +[conformance]: https://github.com/connectrpc/conformance +[grpchealth]: https://github.com/connectrpc/grpchealth-go +[grpcreflect]: https://github.com/connectrpc/grpcreflect-go +[connect-es]: https://github.com/connectrpc/connect-es +[examples-go]: https://github.com/connectrpc/examples-go +[docs-deployment]: https://connectrpc.com/docs/go/deployment +[docs]: https://connectrpc.com +[go-support-policy]: https://golang.org/doc/devel/release#policy +[license]: https://github.com/connectrpc/connect-go/blob/main/LICENSE +[protobuf]: https://developers.google.com/protocol-buffers +[protocol]: https://connectrpc.com/docs/protocol +[slack]: https://buf.build/links/slack +[validate]: https://github.com/connectrpc/validate-go +[protovalidate]: https://protovalidate.com diff --git a/vendor/connectrpc.com/connect/RELEASE.md b/vendor/connectrpc.com/connect/RELEASE.md new file mode 100644 index 000000000..e42947bc2 --- /dev/null +++ b/vendor/connectrpc.com/connect/RELEASE.md @@ -0,0 +1,47 @@ +# Releasing connect-go + +This document outlines how to create a release of connect-go. + +1. Clone the repo, ensuring you have the latest main. + +2. On a new branch, open [connect.go](connect.go) and change the `Version` constant to an appropriate [semantic version](https://semver.org/). To select the correct version, look at the version number of the [latest release] and the changes that are included in this new release. + * If there are only bug fixes and no new features, remove the `-dev` suffix, set MINOR number to be equal to the [latest release], and set the PATCH number to be 1 more than the PATCH number of the [latest release]. + * If there are features being released, remove the `-dev` suffix, set the MINOR number to be 1 more than the MINOR number of the [latest release], and set the PATCH number to `0`. In the common case, the diff here will just be to remove the `-dev` suffix. + + ```patch + -const Version = "1.14.0-dev" + +const Version = "1.14.0" + ``` + +3. Check for any changes in [cmd/protoc-gen-connect-go/main.go](cmd/protoc-gen-connect-go/main.go) that require a version restriction. A constant `IsAtLeastVersionX_Y_Z` should be defined in [connect.go](connect.go) if generated code has begun to use a new API. Make sure the generated code references this constant. If a new constant has been added since the last release, ensure that the name of the constant matches the version being released ([Example PR #496](https://github.com/connectrpc/connect-go/pull/496)). + +4. Open a PR titled "Prepare for vX.Y.Z" ([Example PR #661](https://github.com/connectrpc/connect-go/pull/661)) and a description tagging all current maintainers. Once it's reviewed and CI passes, merge it. + + *Make sure no new commits are merged until the release is complete.* + +5. Review all commits in the new release and for each PR check an appropriate label is used and edit the title to be meaningful to end users. This will help auto-generated release notes match the final notes as closely as possible. + +6. Using the Github UI, create a new release. + - Under “Choose a tag”, type in “vX.Y.Z” to create a new tag for the release upon publish. + - Target the main branch. + - Title the Release “vX.Y.Z”. + - Click “set as latest release”. + - Set the last version as the “Previous tag”. + - Click “Generate release notes” to autogenerate release notes. + - Edit the release notes. A summary and other sub categories may be added if required but should, in most cases, be left as ### Enhancements and ### Bugfixes. Feel free to collect multiple small changes to docs or Github config into one line, but try to tag every contributor. Make especially sure to credit new external contributors! + +7. Publish the release. + +8. Check the [release workflow] triggered by publishing. It attaches the `protoc-gen-connect-go` binaries and a checksums file to the release. It fails if the `Version` constant doesn't match the tag: correct the constant, then delete the release and its tag and repeat step 6. + +9. On a new branch, open [connect.go](connect.go) and change the `Version` to increment the minor tag and append the `-dev` suffix. Use the next minor release - we never anticipate bugs and patch releases. + + ```patch + -const Version = "1.14.0" + +const Version = "1.15.0-dev" + ``` + +10. Open a PR titled "Back to development" ([Example PR #662](https://github.com/connectrpc/connect-go/pull/662)). Once it's reviewed and CI passes, merge it. + +[latest release]: https://github.com/connectrpc/connect-go/releases/latest +[release workflow]: https://github.com/connectrpc/connect-go/actions/workflows/release.yaml diff --git a/vendor/connectrpc.com/connect/SECURITY.md b/vendor/connectrpc.com/connect/SECURITY.md new file mode 100644 index 000000000..04dcde521 --- /dev/null +++ b/vendor/connectrpc.com/connect/SECURITY.md @@ -0,0 +1,5 @@ +Security Policy +=============== + +This project follows the [Connect security policy and reporting +process](https://connectrpc.com/docs/governance/security). diff --git a/vendor/connectrpc.com/connect/buf.gen.yaml b/vendor/connectrpc.com/connect/buf.gen.yaml new file mode 100644 index 000000000..45beb82af --- /dev/null +++ b/vendor/connectrpc.com/connect/buf.gen.yaml @@ -0,0 +1,19 @@ +version: v2 +managed: + enabled: true + override: + - file_option: go_package_prefix + value: connectrpc.com/connect/internal/gen +plugins: + - local: protoc-gen-go + out: internal/gen + opt: paths=source_relative + - local: protoc-gen-connect-go + out: internal/gen/generics + opt: paths=source_relative + - local: protoc-gen-connect-go + out: internal/gen/simple + opt: + - paths=source_relative + - simple +clean: true diff --git a/vendor/connectrpc.com/connect/buf.yaml b/vendor/connectrpc.com/connect/buf.yaml new file mode 100644 index 000000000..0ab5a0944 --- /dev/null +++ b/vendor/connectrpc.com/connect/buf.yaml @@ -0,0 +1,14 @@ +version: v2 +modules: + - path: internal/proto +lint: + use: + - STANDARD + ignore: + - internal/proto/connectext/grpc/health/v1/health.proto + - internal/proto/connectext/grpc/reflection/v1alpha/reflection.proto + - internal/proto/connectext/grpc/status/v1/status.proto + disallow_comment_ignores: true +breaking: + use: + - WIRE_JSON diff --git a/vendor/connectrpc.com/connect/buffer_pool.go b/vendor/connectrpc.com/connect/buffer_pool.go new file mode 100644 index 000000000..006ad5bed --- /dev/null +++ b/vendor/connectrpc.com/connect/buffer_pool.go @@ -0,0 +1,54 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bytes" + "sync" +) + +const ( + initialBufferSize = 512 + maxRecycleBufferSize = 8 * 1024 * 1024 // if >8MiB, don't hold onto a buffer +) + +type bufferPool struct { + sync.Pool +} + +func newBufferPool() *bufferPool { + return &bufferPool{ + Pool: sync.Pool{ + New: func() any { + return bytes.NewBuffer(make([]byte, 0, initialBufferSize)) + }, + }, + } +} + +func (b *bufferPool) Get() *bytes.Buffer { + if buf, ok := b.Pool.Get().(*bytes.Buffer); ok { + return buf + } + return bytes.NewBuffer(make([]byte, 0, initialBufferSize)) +} + +func (b *bufferPool) Put(buffer *bytes.Buffer) { + if buffer.Cap() > maxRecycleBufferSize { + return + } + buffer.Reset() + b.Pool.Put(buffer) +} diff --git a/vendor/connectrpc.com/connect/client.go b/vendor/connectrpc.com/connect/client.go new file mode 100644 index 000000000..d44e6e4a8 --- /dev/null +++ b/vendor/connectrpc.com/connect/client.go @@ -0,0 +1,392 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" +) + +// Client is a reusable, concurrency-safe client for a single procedure. +// Depending on the procedure's type, use the CallUnary, CallClientStream, +// CallServerStream, or CallBidiStream method. +// +// By default, clients use the Connect protocol with the binary Protobuf Codec, +// ask for gzipped responses, and send uncompressed requests. To use the gRPC +// or gRPC-Web protocols, use the [WithGRPC] or [WithGRPCWeb] options. +type Client[Req, Res any] struct { + config *clientConfig + callUnary func(context.Context, *Request[Req]) (*Response[Res], error) + protocolClient protocolClient + err error +} + +// NewClient constructs a new Client. +func NewClient[Req, Res any](httpClient HTTPClient, url string, options ...ClientOption) *Client[Req, Res] { + client := &Client[Req, Res]{} + config, err := newClientConfig(url, options) + if err != nil { + client.err = err + return client + } + client.config = config + protocolClient, protocolErr := client.config.Protocol.NewClient( + &protocolClientParams{ + CompressionName: config.RequestCompressionName, + CompressionPools: newReadOnlyCompressionPools( + config.CompressionPools, + config.CompressionNames, + ), + Codec: config.Codec, + Protobuf: config.protobuf(), + CompressMinBytes: config.CompressMinBytes, + HTTPClient: httpClient, + URL: config.URL, + BufferPool: config.BufferPool, + ReadMaxBytes: config.ReadMaxBytes, + SendMaxBytes: config.SendMaxBytes, + EnableGet: config.EnableGet, + GetURLMaxBytes: config.GetURLMaxBytes, + GetUseFallback: config.GetUseFallback, + }, + ) + if protocolErr != nil { + client.err = protocolErr + return client + } + client.protocolClient = protocolClient + // Rather than applying unary interceptors along the hot path, we can do it + // once at client creation. + unarySpec := config.newSpec(StreamTypeUnary) + unaryFunc := UnaryFunc(func(ctx context.Context, request AnyRequest) (AnyResponse, error) { + conn := client.protocolClient.NewConn(ctx, unarySpec, request.Header()) + conn.onRequestSend(func(r *http.Request) { + request.setRequestMethod(r.Method) + callInfo, ok := clientCallInfoForContext(ctx) + if ok { + callInfo.method = r.Method + callInfo.responseSource = conn + } + }) + // Send always returns an io.EOF unless the error is from the client-side. + // We want the user to continue to call Receive in those cases to get the + // full error from the server-side. + if err := conn.Send(request.Any()); err != nil && !errors.Is(err, io.EOF) { + _ = conn.CloseRequest() + _ = conn.CloseResponse() + return nil, err + } + if err := conn.CloseRequest(); err != nil { + _ = conn.CloseResponse() + return nil, err + } + response, err := receiveUnaryResponse[Res](conn, config.Initializer) + if err != nil { + _ = conn.CloseResponse() + return nil, err + } + return response, conn.CloseResponse() + }) + if interceptor := config.Interceptor; interceptor != nil { + // interceptor is the full chain of all interceptors provided + unaryFunc = interceptor.WrapUnary(unaryFunc) + } + client.callUnary = func(ctx context.Context, request *Request[Req]) (*Response[Res], error) { + // To make the specification, peer, and RPC headers visible to the full + // interceptor chain (as though they were supplied by the caller), we'll + // add them here. + request.spec = unarySpec + request.peer = client.protocolClient.Peer() + protocolClient.WriteRequestHeader(StreamTypeUnary, request.Header()) + + // Also set them in the context if there's a call info present + callInfo, callInfoOk := clientCallInfoForContext(ctx) + if callInfoOk { + callInfo.peer = request.Peer() + callInfo.spec = request.Spec() + // A client could have set request headers in the call info OR the request wrapper + // So if a callInfo exists in context, merge any headers from there into the request wrapper + // so that all headers are sent in the request + mergeHeaders(request.Header(), callInfo.requestHeader) + + // Copy the call info into a sentinel value. This is so we can compare + // the sentinel value against the call info in context. If they're different, + // we can stop the request. This protects against changing the context in interceptors. + ctx = context.WithValue(ctx, sentinelContextKey{}, callInfo) + } + + response, err := unaryFunc(ctx, request) + if err != nil { + return nil, err + } + typed, ok := response.(*Response[Res]) + if !ok { + return nil, errorf(CodeInternal, "unexpected client response type %T", response) + } + return typed, nil + } + return client +} + +// CallUnary calls a request-response procedure. +func (c *Client[Req, Res]) CallUnary(ctx context.Context, request *Request[Req]) (*Response[Res], error) { + if c.err != nil { + return nil, c.err + } + return c.callUnary(ctx, request) +} + +// CallClientStream calls a client streaming procedure. +// +// Request headers can be sent via the [ClientStreamForClient.RequestHeader] method on the stream. Note that the +// request headers are not sent automatically when this method is invoked and instead require an explicit call to +// [ClientStreamForClient.Send]. +func (c *Client[Req, Res]) CallClientStream(ctx context.Context) *ClientStreamForClient[Req, Res] { + if c.err != nil { + return &ClientStreamForClient[Req, Res]{err: c.err} + } + return &ClientStreamForClient[Req, Res]{ + conn: c.newConn(ctx, StreamTypeClient, nil), + initializer: c.config.Initializer, + } +} + +// CallClientStreamSimple calls a client streaming procedure. +// +// Request headers should be set in a [CallInfo] object inside the context using [NewClientContext]. These headers are +// transmitted when this method is called and do not require an explicit call to [ClientStreamForClientSimple.Send]. +// +// In addition, when calling [ClientStreamForClientSimple.CloseAndReceive] on the returned stream, the returned response +// is the response type defined for the stream and _not_ a Connect [Response] wrapper type. As a result, any response +// headers and trailers should be read from the [CallInfo] object in context. +func (c *Client[Req, Res]) CallClientStreamSimple(ctx context.Context) (*ClientStreamForClientSimple[Req, Res], error) { + if c.err != nil { + return &ClientStreamForClientSimple[Req, Res]{ + stream: &ClientStreamForClient[Req, Res]{err: c.err}, + }, c.err + } + + stream := &ClientStreamForClientSimple[Req, Res]{ + stream: &ClientStreamForClient[Req, Res]{ + conn: c.newConn(ctx, StreamTypeClient, nil), + initializer: c.config.Initializer, + }, + } + if err := stream.Send(nil); err != nil { + return nil, err + } + return stream, nil +} + +// CallServerStream calls a server streaming procedure. +func (c *Client[Req, Res]) CallServerStream(ctx context.Context, request *Request[Req]) (*ServerStreamForClient[Res], error) { + if c.err != nil { + return nil, c.err + } + conn := c.newConn(ctx, StreamTypeServer, func(r *http.Request) { + request.method = r.Method + }) + request.peer = conn.Peer() + request.spec = conn.Spec() + + mergeHeaders(conn.RequestHeader(), request.header) + + // Send always returns an io.EOF unless the error is from the client-side. + // We want the user to continue to call Receive in those cases to get the + // full error from the server-side. + if err := conn.Send(request.Msg); err != nil && !errors.Is(err, io.EOF) { + _ = conn.CloseRequest() + _ = conn.CloseResponse() + return nil, err + } + if err := conn.CloseRequest(); err != nil { + return nil, err + } + return &ServerStreamForClient[Res]{ + conn: conn, + initializer: c.config.Initializer, + }, nil +} + +// CallBidiStream calls a bidirectional streaming procedure. +// +// Request headers can be sent via the [BidiStreamForClient.RequestHeader] method. Note that the +// request headers are not sent automatically when this method is invoked and instead require an explicit call to +// [BidiStreamForClient.Send]. +func (c *Client[Req, Res]) CallBidiStream(ctx context.Context) *BidiStreamForClient[Req, Res] { + if c.err != nil { + return &BidiStreamForClient[Req, Res]{err: c.err} + } + return &BidiStreamForClient[Req, Res]{ + conn: c.newConn(ctx, StreamTypeBidi, nil), + initializer: c.config.Initializer, + } +} + +// CallBidiStreamSimple calls a bidirectional streaming procedure. +// +// Request headers should be set in a [CallInfo] object inside the context using [NewClientContext]. These headers +// are transmitted when this method is called and do not require an explicit call to [BidiStreamForClient.Send]. +// +// Likewise, response headers and trailers should be read from the [CallInfo] object in context. +func (c *Client[Req, Res]) CallBidiStreamSimple(ctx context.Context) (*BidiStreamForClientSimple[Req, Res], error) { + if c.err != nil { + return &BidiStreamForClientSimple[Req, Res]{ + stream: &BidiStreamForClient[Req, Res]{err: c.err}, + }, c.err + } + + stream := &BidiStreamForClientSimple[Req, Res]{ + stream: &BidiStreamForClient[Req, Res]{ + conn: c.newConn(ctx, StreamTypeBidi, nil), + initializer: c.config.Initializer, + }, + } + + if err := stream.Send(nil); err != nil { + return nil, err + } + return stream, nil +} + +func (c *Client[Req, Res]) newConn(ctx context.Context, streamType StreamType, onRequestSend func(r *http.Request)) StreamingClientConn { + callInfo, callInfoOk := clientCallInfoForContext(ctx) + // Set values in the context if there's a call info present + if callInfoOk { + // Copy the call info into a sentinel value. This is so we can compare + // the sentinel value against the call info in context. If they're different, + // we can stop the request. This protects against changing the context in interceptors. + ctx = context.WithValue(ctx, sentinelContextKey{}, callInfo) + } + newConn := func(ctx context.Context, spec Spec) StreamingClientConn { + header := make(http.Header, 8) // arbitrary power of two, prevent immediate resizing + c.protocolClient.WriteRequestHeader(streamType, header) + conn := c.protocolClient.NewConn(ctx, spec, header) + conn.onRequestSend(onRequestSend) + return conn + } + if interceptor := c.config.Interceptor; interceptor != nil { + newConn = interceptor.WrapStreamingClient(newConn) + } + conn := newConn(ctx, c.config.newSpec(streamType)) + + // Set values in the context if there's a call info present + if callInfoOk { + callInfo.peer = conn.Peer() + callInfo.spec = conn.Spec() + callInfo.responseSource = conn + + // Merge any callInfo request headers first, then do the request, + // so that context headers show first in the list of headers. + mergeHeaders(conn.RequestHeader(), callInfo.RequestHeader()) + } + + return conn +} + +type clientConfig struct { + URL *url.URL + Protocol protocol + Procedure string + Schema any + Initializer maybeInitializer + CompressMinBytes int + Interceptor Interceptor + CompressionPools map[string]*compressionPool + CompressionNames []string + Codec Codec + RequestCompressionName string + BufferPool *bufferPool + ReadMaxBytes int + SendMaxBytes int + EnableGet bool + GetURLMaxBytes int + GetUseFallback bool + IdempotencyLevel IdempotencyLevel +} + +func newClientConfig(rawURL string, options []ClientOption) (*clientConfig, *Error) { + url, err := parseRequestURL(rawURL) + if err != nil { + return nil, err + } + protoPath := extractProtoPath(url.Path) + config := clientConfig{ + URL: url, + Protocol: &protocolConnect{}, + Procedure: protoPath, + CompressionPools: make(map[string]*compressionPool), + BufferPool: newBufferPool(), + } + withProtoBinaryCodec().applyToClient(&config) + withGzip().applyToClient(&config) + for _, opt := range options { + opt.applyToClient(&config) + } + if err := config.validate(); err != nil { + return nil, err + } + return &config, nil +} + +func (c *clientConfig) validate() *Error { + if c.Codec == nil || c.Codec.Name() == "" { + return errorf(CodeUnknown, "no codec configured") + } + if c.RequestCompressionName != "" && c.RequestCompressionName != compressionIdentity { + if _, ok := c.CompressionPools[c.RequestCompressionName]; !ok { + return errorf(CodeUnknown, "unknown compression %q", c.RequestCompressionName) + } + } + return nil +} + +func (c *clientConfig) protobuf() Codec { + if c.Codec.Name() == codecNameProto { + return c.Codec + } + return &protoBinaryCodec{} +} + +func (c *clientConfig) newSpec(t StreamType) Spec { + return Spec{ + StreamType: t, + Procedure: c.Procedure, + Schema: c.Schema, + IsClient: true, + IdempotencyLevel: c.IdempotencyLevel, + } +} + +func parseRequestURL(rawURL string) (*url.URL, *Error) { + url, err := url.ParseRequestURI(rawURL) + if err == nil { + return url, nil + } + if !strings.Contains(rawURL, "://") { + // URL doesn't have a scheme, so the user is likely accustomed to + // grpc-go's APIs. + err = fmt.Errorf( + "URL %q missing scheme: use http:// or https:// (unlike grpc-go)", + rawURL, + ) + } + return nil, NewError(CodeUnavailable, err) +} diff --git a/vendor/connectrpc.com/connect/client_stream.go b/vendor/connectrpc.com/connect/client_stream.go new file mode 100644 index 000000000..10f3d5b21 --- /dev/null +++ b/vendor/connectrpc.com/connect/client_stream.go @@ -0,0 +1,465 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "errors" + "io" + "net/http" +) + +var ( + // errNoStreamInitialized signals that a no stream has been initialized when + // attempting to access stream-related methods. + errNoStreamInitialized = errors.New("no stream initialized") +) + +// ClientStreamForClient is the client's view of a client streaming RPC. +// +// It's returned from [Client].CallClientStream, but doesn't currently have an +// exported constructor function. +// +// When using this stream, request headers should be set via the [ClientStreamForClient.RequestHeader] method. +// +// Send is not safe to call concurrently. +type ClientStreamForClient[Req, Res any] struct { + conn StreamingClientConn + initializer maybeInitializer + // Error from client construction. If non-nil, return for all calls. + err error +} + +// Spec returns the specification for the RPC. +func (c *ClientStreamForClient[_, _]) Spec() Spec { + if c.err != nil { + return Spec{} + } + return c.conn.Spec() +} + +// Peer describes the server for the RPC. +func (c *ClientStreamForClient[_, _]) Peer() Peer { + if c.err != nil { + return Peer{} + } + return c.conn.Peer() +} + +// RequestHeader returns the request headers. Headers are sent to the server with the +// first call to Send. +// +// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols. Applications shouldn't write them. +func (c *ClientStreamForClient[Req, Res]) RequestHeader() http.Header { + if c.err != nil { + return http.Header{} + } + return c.conn.RequestHeader() +} + +// Send a message to the server. The first call to Send also sends the request +// headers. +// +// If the server returns an error, Send returns an error that wraps [io.EOF]. +// Clients should check for case using the standard library's [errors.Is] and +// unmarshal the error using CloseAndReceive. +func (c *ClientStreamForClient[Req, Res]) Send(request *Req) error { + if c.err != nil { + return c.err + } + if request == nil { + return c.conn.Send(nil) + } + return c.conn.Send(request) +} + +// CloseAndReceive closes the send side of the stream and waits for the +// response. +func (c *ClientStreamForClient[Req, Res]) CloseAndReceive() (*Response[Res], error) { + if c.err != nil { + return nil, c.err + } + if err := c.conn.CloseRequest(); err != nil { + _ = c.conn.CloseResponse() + return nil, err + } + response, err := receiveUnaryResponse[Res](c.conn, c.initializer) + if err != nil { + _ = c.conn.CloseResponse() + return nil, err + } + return response, c.conn.CloseResponse() +} + +// Conn exposes the underlying StreamingClientConn. This may be useful if +// you'd prefer to wrap the connection in a different high-level API. +func (c *ClientStreamForClient[Req, Res]) Conn() (StreamingClientConn, error) { + return c.conn, c.err +} + +// ClientStreamForClientSimple is the client's view of a client streaming RPC. +// +// It's returned from [Client.CallClientStreamSimple], but doesn't currently have an +// exported constructor function. +// +// Usage of this stream requires that request headers be set in a [CallInfo] object in context via [NewClientContext]. +// In addition, the response returned by [ClientStreamForClientSimple.CloseAndReceive] is the response type defined for +// the stream and _not_ a Connect [Response] wrapper type. As a result, response headers/trailers should be read from +// the [CallInfo] object in context. +// +// Send is not safe to call concurrently. +type ClientStreamForClientSimple[Req, Res any] struct { + stream *ClientStreamForClient[Req, Res] +} + +// Spec returns the specification for the RPC. +func (c *ClientStreamForClientSimple[_, _]) Spec() Spec { + if c.stream == nil { + return Spec{} + } + return c.stream.Spec() +} + +// Peer describes the server for the RPC. +func (c *ClientStreamForClientSimple[_, _]) Peer() Peer { + if c.stream == nil { + return Peer{} + } + return c.stream.Peer() +} + +// Send a message to the server. The first call to Send also sends the request +// headers. +// +// If the server returns an error, Send returns an error that wraps [io.EOF]. +// Clients should check for case using the standard library's [errors.Is] and +// unmarshal the error using CloseAndReceive. +func (c *ClientStreamForClientSimple[Req, Res]) Send(request *Req) error { + if c.stream == nil { + return errNoStreamInitialized + } + return c.stream.Send(request) +} + +// CloseAndReceive closes the send side of the stream and waits for the +// response. +func (c *ClientStreamForClientSimple[Req, Res]) CloseAndReceive() (*Res, error) { + if c.stream == nil { + return nil, errNoStreamInitialized + } + res, err := c.stream.CloseAndReceive() + if err != nil { + return nil, err + } + return res.Msg, nil +} + +// ServerStreamForClient is the client's view of a server streaming RPC. +// +// It's returned from [Client].CallServerStream, but doesn't currently have an +// exported constructor function. +// +// Receive is not safe to call concurrently. +type ServerStreamForClient[Res any] struct { + conn StreamingClientConn + initializer maybeInitializer + msg *Res + // Error from client construction. If non-nil, return for all calls. + constructErr error + // Error from conn.Receive(). + receiveErr error +} + +// Receive advances the stream to the next message, which will then be +// available through the Msg method. It returns false when the stream stops, +// either by reaching the end or by encountering an unexpected error. After +// Receive returns false, the Err method will return any unexpected error +// encountered. +func (s *ServerStreamForClient[Res]) Receive() bool { + if s.constructErr != nil || s.receiveErr != nil { + return false + } + s.msg = new(Res) + if err := s.initializer.maybe(s.conn.Spec(), s.msg); err != nil { + s.receiveErr = err + return false + } + s.receiveErr = s.conn.Receive(s.msg) + return s.receiveErr == nil +} + +// Msg returns the most recent message unmarshaled by a call to Receive. +func (s *ServerStreamForClient[Res]) Msg() *Res { + if s.msg == nil { + s.msg = new(Res) + } + return s.msg +} + +// Err returns the first non-EOF error that was encountered by Receive. +func (s *ServerStreamForClient[Res]) Err() error { + if s.constructErr != nil { + return s.constructErr + } + if s.receiveErr != nil && !errors.Is(s.receiveErr, io.EOF) { + return s.receiveErr + } + return nil +} + +// ResponseHeader returns the headers received from the server. It blocks until +// the first call to Receive returns. +func (s *ServerStreamForClient[Res]) ResponseHeader() http.Header { + if s.constructErr != nil { + return http.Header{} + } + return s.conn.ResponseHeader() +} + +// ResponseTrailer returns the trailers received from the server. Trailers +// aren't fully populated until Receive() returns an error wrapping io.EOF. +func (s *ServerStreamForClient[Res]) ResponseTrailer() http.Header { + if s.constructErr != nil { + return http.Header{} + } + return s.conn.ResponseTrailer() +} + +// Close the receive side of the stream. +// +// Close is non-blocking. To gracefully close the stream and allow for +// connection resuse ensure all messages have been received before calling +// Close. All messages are received when Receive returns false. +func (s *ServerStreamForClient[Res]) Close() error { + if s.constructErr != nil { + return s.constructErr + } + return s.conn.CloseResponse() +} + +// Conn exposes the underlying StreamingClientConn. This may be useful if +// you'd prefer to wrap the connection in a different high-level API. +func (s *ServerStreamForClient[Res]) Conn() (StreamingClientConn, error) { + return s.conn, s.constructErr +} + +// BidiStreamForClient is the client's view of a bidirectional streaming RPC. +// +// It's returned from [Client].CallBidiStream, but doesn't currently have an +// exported constructor function. +// +// Send and Receive may be called from separate goroutines concurrently, but +// neither may be called concurrently with itself. +type BidiStreamForClient[Req, Res any] struct { + conn StreamingClientConn + initializer maybeInitializer + // Error from client construction. If non-nil, return for all calls. + err error +} + +// Spec returns the specification for the RPC. +func (b *BidiStreamForClient[_, _]) Spec() Spec { + if b.err != nil { + return Spec{} + } + return b.conn.Spec() +} + +// Peer describes the server for the RPC. +func (b *BidiStreamForClient[_, _]) Peer() Peer { + if b.err != nil { + return Peer{} + } + return b.conn.Peer() +} + +// RequestHeader returns the request headers. Headers are sent with the first +// call to Send. +// +// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols. Applications shouldn't write them. +func (b *BidiStreamForClient[Req, Res]) RequestHeader() http.Header { + if b.err != nil { + return http.Header{} + } + return b.conn.RequestHeader() +} + +// Send a message to the server. The first call to Send also sends the request +// headers. To send just the request headers, without a body, call Send with a +// nil pointer. +// +// If the server returns an error, Send returns an error that wraps [io.EOF]. +// Clients should check for EOF using the standard library's [errors.Is] and +// call Receive to retrieve the error. +func (b *BidiStreamForClient[Req, Res]) Send(msg *Req) error { + if b.err != nil { + return b.err + } + if msg == nil { + return b.conn.Send(nil) + } + return b.conn.Send(msg) +} + +// CloseRequest closes the send side of the stream. +func (b *BidiStreamForClient[Req, Res]) CloseRequest() error { + if b.err != nil { + return b.err + } + return b.conn.CloseRequest() +} + +// Receive a message. When the server is done sending messages and no other +// errors have occurred, Receive will return an error that wraps [io.EOF]. +func (b *BidiStreamForClient[Req, Res]) Receive() (*Res, error) { + if b.err != nil { + return nil, b.err + } + var msg Res + if err := b.initializer.maybe(b.conn.Spec(), &msg); err != nil { + return nil, err + } + if err := b.conn.Receive(&msg); err != nil { + return nil, err + } + return &msg, nil +} + +// CloseResponse closes the receive side of the stream. +// +// CloseResponse is non-blocking. To gracefully close the stream and allow for +// connection resuse ensure all messages have been received before calling +// CloseResponse. All messages are received when Receive returns an error +// wrapping [io.EOF]. +func (b *BidiStreamForClient[Req, Res]) CloseResponse() error { + if b.err != nil { + return b.err + } + return b.conn.CloseResponse() +} + +// ResponseHeader returns the headers received from the server. It blocks until +// the first call to Receive returns. +func (b *BidiStreamForClient[Req, Res]) ResponseHeader() http.Header { + if b.err != nil { + return http.Header{} + } + return b.conn.ResponseHeader() +} + +// ResponseTrailer returns the trailers received from the server. Trailers +// aren't fully populated until Receive() returns an error wrapping [io.EOF]. +func (b *BidiStreamForClient[Req, Res]) ResponseTrailer() http.Header { + if b.err != nil { + return http.Header{} + } + return b.conn.ResponseTrailer() +} + +// Conn exposes the underlying StreamingClientConn. This may be useful if +// you'd prefer to wrap the connection in a different high-level API. +func (b *BidiStreamForClient[Req, Res]) Conn() (StreamingClientConn, error) { + return b.conn, b.err +} + +// BidiStreamForClientSimple is the client's view of a bidirectional streaming RPC. +// +// It's returned from [Client].CallBidiStream, but doesn't currently have an +// exported constructor function. +// +// Send and Receive may be called from separate goroutines concurrently, but +// neither may be called concurrently with itself. +type BidiStreamForClientSimple[Req, Res any] struct { + stream *BidiStreamForClient[Req, Res] +} + +// Spec returns the specification for the RPC. +func (b *BidiStreamForClientSimple[_, _]) Spec() Spec { + if b.stream == nil { + return Spec{} + } + return b.stream.Spec() +} + +// Peer describes the server for the RPC. +func (b *BidiStreamForClientSimple[_, _]) Peer() Peer { + if b.stream == nil { + return Peer{} + } + return b.stream.Peer() +} + +// Send a message to the server. The first call to Send also sends the request +// headers. To send just the request headers, without a body, call Send with a +// nil pointer. +// +// If the server returns an error, Send returns an error that wraps [io.EOF]. +// Clients should check for EOF using the standard library's [errors.Is] and +// call Receive to retrieve the error. +func (b *BidiStreamForClientSimple[Req, Res]) Send(msg *Req) error { + if b.stream == nil { + return errNoStreamInitialized + } + return b.stream.Send(msg) +} + +// CloseRequest closes the send side of the stream. +func (b *BidiStreamForClientSimple[Req, Res]) CloseRequest() error { + if b.stream == nil { + return errNoStreamInitialized + } + return b.stream.CloseRequest() +} + +// Receive a message. When the server is done sending messages and no other +// errors have occurred, Receive will return an error that wraps [io.EOF]. +func (b *BidiStreamForClientSimple[Req, Res]) Receive() (*Res, error) { + if b.stream == nil { + return nil, errNoStreamInitialized + } + return b.stream.Receive() +} + +// CloseResponse closes the receive side of the stream. +// +// CloseResponse is non-blocking. To gracefully close the stream and allow for +// connection resuse ensure all messages have been received before calling +// CloseResponse. All messages are received when Receive returns an error +// wrapping [io.EOF]. +func (b *BidiStreamForClientSimple[Req, Res]) CloseResponse() error { + if b.stream == nil { + return errNoStreamInitialized + } + return b.stream.CloseResponse() +} + +// ResponseHeader returns the headers received from the server. It blocks until +// the first call to Receive returns. +func (b *BidiStreamForClientSimple[Req, Res]) ResponseHeader() http.Header { + if b.stream == nil { + return make(http.Header) + } + return b.stream.ResponseHeader() +} + +// ResponseTrailer returns the trailers received from the server. Trailers +// aren't fully populated until Receive() returns an error wrapping [io.EOF]. +func (b *BidiStreamForClientSimple[Req, Res]) ResponseTrailer() http.Header { + if b.stream == nil { + return make(http.Header) + } + return b.stream.ResponseTrailer() +} diff --git a/vendor/connectrpc.com/connect/code.go b/vendor/connectrpc.com/connect/code.go new file mode 100644 index 000000000..6677ae452 --- /dev/null +++ b/vendor/connectrpc.com/connect/code.go @@ -0,0 +1,226 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "fmt" + "strconv" + "strings" +) + +// A Code is one of the Connect protocol's error codes. There are no user-defined +// codes, so only the codes enumerated below are valid. In both name and +// semantics, these codes match the gRPC status codes. +// +// The descriptions below are optimized for brevity rather than completeness. +// See the [Connect protocol specification] for detailed descriptions of each +// code and example usage. +// +// [Connect protocol specification]: https://connectrpc.com/docs/protocol +type Code uint32 + +const ( + // The zero code in gRPC is OK, which indicates that the operation was a + // success. We don't define a constant for it because it overlaps awkwardly + // with Go's error semantics: what does it mean to have a non-nil error with + // an OK status? (Also, the Connect protocol doesn't use a code for + // successes.) + + // CodeCanceled indicates that the operation was canceled, typically by the + // caller. + CodeCanceled Code = 1 + + // CodeUnknown indicates that the operation failed for an unknown reason. + CodeUnknown Code = 2 + + // CodeInvalidArgument indicates that client supplied an invalid argument. + CodeInvalidArgument Code = 3 + + // CodeDeadlineExceeded indicates that deadline expired before the operation + // could complete. + CodeDeadlineExceeded Code = 4 + + // CodeNotFound indicates that some requested entity (for example, a file or + // directory) was not found. + CodeNotFound Code = 5 + + // CodeAlreadyExists indicates that client attempted to create an entity (for + // example, a file or directory) that already exists. + CodeAlreadyExists Code = 6 + + // CodePermissionDenied indicates that the caller doesn't have permission to + // execute the specified operation. + CodePermissionDenied Code = 7 + + // CodeResourceExhausted indicates that some resource has been exhausted. For + // example, a per-user quota may be exhausted or the entire file system may + // be full. + CodeResourceExhausted Code = 8 + + // CodeFailedPrecondition indicates that the system is not in a state + // required for the operation's execution. + CodeFailedPrecondition Code = 9 + + // CodeAborted indicates that operation was aborted by the system, usually + // because of a concurrency issue such as a sequencer check failure or + // transaction abort. + CodeAborted Code = 10 + + // CodeOutOfRange indicates that the operation was attempted past the valid + // range (for example, seeking past end-of-file). + CodeOutOfRange Code = 11 + + // CodeUnimplemented indicates that the operation isn't implemented, + // supported, or enabled in this service. + CodeUnimplemented Code = 12 + + // CodeInternal indicates that some invariants expected by the underlying + // system have been broken. This code is reserved for serious errors. + CodeInternal Code = 13 + + // CodeUnavailable indicates that the service is currently unavailable. This + // is usually temporary, so clients can back off and retry idempotent + // operations. + CodeUnavailable Code = 14 + + // CodeDataLoss indicates that the operation has resulted in unrecoverable + // data loss or corruption. + CodeDataLoss Code = 15 + + // CodeUnauthenticated indicates that the request does not have valid + // authentication credentials for the operation. + CodeUnauthenticated Code = 16 + + minCode = CodeCanceled + maxCode = CodeUnauthenticated +) + +func (c Code) String() string { + switch c { + case CodeCanceled: + return "canceled" + case CodeUnknown: + return "unknown" + case CodeInvalidArgument: + return "invalid_argument" + case CodeDeadlineExceeded: + return "deadline_exceeded" + case CodeNotFound: + return "not_found" + case CodeAlreadyExists: + return "already_exists" + case CodePermissionDenied: + return "permission_denied" + case CodeResourceExhausted: + return "resource_exhausted" + case CodeFailedPrecondition: + return "failed_precondition" + case CodeAborted: + return "aborted" + case CodeOutOfRange: + return "out_of_range" + case CodeUnimplemented: + return "unimplemented" + case CodeInternal: + return "internal" + case CodeUnavailable: + return "unavailable" + case CodeDataLoss: + return "data_loss" + case CodeUnauthenticated: + return "unauthenticated" + } + return fmt.Sprintf("code_%d", c) +} + +// MarshalText implements [encoding.TextMarshaler]. +func (c Code) MarshalText() ([]byte, error) { + return []byte(c.String()), nil +} + +// UnmarshalText implements [encoding.TextUnmarshaler]. +func (c *Code) UnmarshalText(data []byte) error { + dataStr := string(data) + switch dataStr { + case "canceled": + *c = CodeCanceled + return nil + case "unknown": + *c = CodeUnknown + return nil + case "invalid_argument": + *c = CodeInvalidArgument + return nil + case "deadline_exceeded": + *c = CodeDeadlineExceeded + return nil + case "not_found": + *c = CodeNotFound + return nil + case "already_exists": + *c = CodeAlreadyExists + return nil + case "permission_denied": + *c = CodePermissionDenied + return nil + case "resource_exhausted": + *c = CodeResourceExhausted + return nil + case "failed_precondition": + *c = CodeFailedPrecondition + return nil + case "aborted": + *c = CodeAborted + return nil + case "out_of_range": + *c = CodeOutOfRange + return nil + case "unimplemented": + *c = CodeUnimplemented + return nil + case "internal": + *c = CodeInternal + return nil + case "unavailable": + *c = CodeUnavailable + return nil + case "data_loss": + *c = CodeDataLoss + return nil + case "unauthenticated": + *c = CodeUnauthenticated + return nil + } + // Ensure that non-canonical codes round-trip through MarshalText and + // UnmarshalText. + if after, ok := strings.CutPrefix(dataStr, "code_"); ok { + dataStr = after + code, err := strconv.ParseUint(dataStr, 10 /* base */, 32 /* bitsize */) + if err == nil && (code < uint64(minCode) || code > uint64(maxCode)) { + *c = Code(code) + return nil + } + } + return fmt.Errorf("invalid code %q", dataStr) +} + +// CodeOf returns the error's status code if it is or wraps an [*Error] and +// [CodeUnknown] otherwise. +func CodeOf(err error) Code { + if connectErr, ok := asError(err); ok { + return connectErr.Code() + } + return CodeUnknown +} diff --git a/vendor/connectrpc.com/connect/codec.go b/vendor/connectrpc.com/connect/codec.go new file mode 100644 index 000000000..58af6b8d2 --- /dev/null +++ b/vendor/connectrpc.com/connect/codec.go @@ -0,0 +1,259 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoiface" +) + +const ( + codecNameProto = "proto" + codecNameJSON = "json" + codecNameJSONCharsetUTF8 = codecNameJSON + "; charset=utf-8" +) + +// Codec marshals structs (typically generated from a schema) to and from bytes. +type Codec interface { + // Name returns the name of the Codec. + // + // This may be used as part of the Content-Type within HTTP. For example, + // with gRPC this is the content subtype, so "application/grpc+proto" will + // map to the Codec with name "proto". + // + // Names must not be empty. + Name() string + // Marshal marshals the given message. + // + // Marshal may expect a specific type of message, and will error if this type + // is not given. + Marshal(any) ([]byte, error) + // Unmarshal unmarshals the given message. + // + // Unmarshal may expect a specific type of message, and will error if this + // type is not given. + Unmarshal([]byte, any) error +} + +// marshalAppender is an extension to Codec for appending to a byte slice. +type marshalAppender interface { + Codec + + // MarshalAppend marshals the given message and appends it to the given + // byte slice. + // + // MarshalAppend may expect a specific type of message, and will error if + // this type is not given. + MarshalAppend([]byte, any) ([]byte, error) +} + +// stableCodec is an extension to Codec for serializing with stable output. +type stableCodec interface { + Codec + + // MarshalStable marshals the given message with stable field ordering. + // + // MarshalStable should return the same output for a given input. Although + // it is not guaranteed to be canonicalized, the marshalling routine for + // MarshalStable will opt for the most normalized output available for a + // given serialization. + // + // For practical reasons, it is possible for MarshalStable to return two + // different results for two inputs considered to be "equal" in their own + // domain, and it may change in the future with codec updates, but for + // any given concrete value and any given version, it should return the + // same output. + MarshalStable(any) ([]byte, error) + + // IsBinary returns true if the marshalled data is binary for this codec. + // + // If this function returns false, the data returned from Marshal and + // MarshalStable are considered valid text and may be used in contexts + // where text is expected. + IsBinary() bool +} + +type protoBinaryCodec struct{} + +var _ Codec = (*protoBinaryCodec)(nil) + +func (c *protoBinaryCodec) Name() string { return codecNameProto } + +func (c *protoBinaryCodec) Marshal(message any) ([]byte, error) { + protoMessage, ok := message.(proto.Message) + if !ok { + return nil, errNotProto(message) + } + return proto.Marshal(protoMessage) +} + +func (c *protoBinaryCodec) MarshalAppend(dst []byte, message any) ([]byte, error) { + protoMessage, ok := message.(proto.Message) + if !ok { + return nil, errNotProto(message) + } + return proto.MarshalOptions{}.MarshalAppend(dst, protoMessage) +} + +func (c *protoBinaryCodec) Unmarshal(data []byte, message any) error { + protoMessage, ok := message.(proto.Message) + if !ok { + return errNotProto(message) + } + err := proto.Unmarshal(data, protoMessage) + if err != nil { + return fmt.Errorf("unmarshal into %T: %w", message, err) + } + return nil +} + +func (c *protoBinaryCodec) MarshalStable(message any) ([]byte, error) { + protoMessage, ok := message.(proto.Message) + if !ok { + return nil, errNotProto(message) + } + // protobuf does not offer a canonical output today, so this format is not + // guaranteed to match deterministic output from other protobuf libraries. + // In addition, unknown fields may cause inconsistent output for otherwise + // equal messages. + // https://github.com/golang/protobuf/issues/1121 + options := proto.MarshalOptions{Deterministic: true} + return options.Marshal(protoMessage) +} + +func (c *protoBinaryCodec) IsBinary() bool { + return true +} + +type protoJSONCodec struct { + name string +} + +var _ Codec = (*protoJSONCodec)(nil) + +func (c *protoJSONCodec) Name() string { return c.name } + +func (c *protoJSONCodec) Marshal(message any) ([]byte, error) { + protoMessage, ok := message.(proto.Message) + if !ok { + return nil, errNotProto(message) + } + return protojson.MarshalOptions{}.Marshal(protoMessage) +} + +func (c *protoJSONCodec) MarshalAppend(dst []byte, message any) ([]byte, error) { + protoMessage, ok := message.(proto.Message) + if !ok { + return nil, errNotProto(message) + } + return protojson.MarshalOptions{}.MarshalAppend(dst, protoMessage) +} + +func (c *protoJSONCodec) Unmarshal(binary []byte, message any) error { + protoMessage, ok := message.(proto.Message) + if !ok { + return errNotProto(message) + } + if len(binary) == 0 { + return errors.New("zero-length payload is not a valid JSON object") + } + // Discard unknown fields so clients and servers aren't forced to always use + // exactly the same version of the schema. + options := protojson.UnmarshalOptions{DiscardUnknown: true} + err := options.Unmarshal(binary, protoMessage) + if err != nil { + return fmt.Errorf("unmarshal into %T: %w", message, err) + } + return nil +} + +func (c *protoJSONCodec) MarshalStable(message any) ([]byte, error) { + // protojson does not offer a "deterministic" field ordering, but fields + // are still ordered consistently by their index. However, protojson can + // output inconsistent whitespace for some reason, therefore it is + // suggested to use a formatter to ensure consistent formatting. + // https://github.com/golang/protobuf/issues/1373 + messageJSON, err := c.Marshal(message) + if err != nil { + return nil, err + } + compactedJSON := bytes.NewBuffer(messageJSON[:0]) + if err = json.Compact(compactedJSON, messageJSON); err != nil { + return nil, err + } + return compactedJSON.Bytes(), nil +} + +func (c *protoJSONCodec) IsBinary() bool { + return false +} + +// readOnlyCodecs is a read-only interface to a map of named codecs. +type readOnlyCodecs interface { + // Get gets the Codec with the given name. + Get(string) Codec + // Protobuf gets the user-supplied protobuf codec, falling back to the default + // implementation if necessary. + // + // This is helpful in the gRPC protocol, where the wire protocol requires + // marshaling protobuf structs to binary even if the RPC procedures were + // generated from a different IDL. + Protobuf() Codec + // Names returns a copy of the registered codec names. The returned slice is + // safe for the caller to mutate. + Names() []string +} + +func newReadOnlyCodecs(nameToCodec map[string]Codec) readOnlyCodecs { + return &codecMap{ + nameToCodec: nameToCodec, + } +} + +type codecMap struct { + nameToCodec map[string]Codec +} + +func (m *codecMap) Get(name string) Codec { + return m.nameToCodec[name] +} + +func (m *codecMap) Protobuf() Codec { + if pb, ok := m.nameToCodec[codecNameProto]; ok { + return pb + } + return &protoBinaryCodec{} +} + +func (m *codecMap) Names() []string { + names := make([]string, 0, len(m.nameToCodec)) + for name := range m.nameToCodec { + names = append(names, name) + } + return names +} + +func errNotProto(message any) error { + if _, ok := message.(protoiface.MessageV1); ok { + return fmt.Errorf("%T uses github.com/golang/protobuf, but connect-go only supports google.golang.org/protobuf: see https://go.dev/blog/protobuf-apiv2", message) + } + return fmt.Errorf("%T doesn't implement proto.Message", message) +} diff --git a/vendor/connectrpc.com/connect/compression.go b/vendor/connectrpc.com/connect/compression.go new file mode 100644 index 000000000..24251a232 --- /dev/null +++ b/vendor/connectrpc.com/connect/compression.go @@ -0,0 +1,224 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bytes" + "errors" + "io" + "math" + "net/http" + "slices" + "strings" + "sync" +) + +const ( + compressionGzip = "gzip" + compressionIdentity = "identity" +) + +// A Decompressor is a reusable wrapper that decompresses an underlying data +// source. The standard library's [*gzip.Reader] implements Decompressor. +type Decompressor interface { + io.Reader + + // Close closes the Decompressor, but not the underlying data source. It may + // return an error if the Decompressor wasn't read to EOF. + Close() error + + // Reset discards the Decompressor's internal state, if any, and prepares it + // to read from a new source of compressed data. + Reset(io.Reader) error +} + +// A Compressor is a reusable wrapper that compresses data written to an +// underlying sink. The standard library's [*gzip.Writer] implements Compressor. +type Compressor interface { + io.Writer + + // Close flushes any buffered data to the underlying sink, then closes the + // Compressor. It must not close the underlying sink. + Close() error + + // Reset discards the Compressor's internal state, if any, and prepares it to + // write compressed data to a new sink. + Reset(io.Writer) +} + +type compressionPool struct { + decompressors sync.Pool + compressors sync.Pool +} + +func newCompressionPool( + newDecompressor func() Decompressor, + newCompressor func() Compressor, +) *compressionPool { + if newDecompressor == nil && newCompressor == nil { + return nil + } + return &compressionPool{ + decompressors: sync.Pool{ + New: func() any { return newDecompressor() }, + }, + compressors: sync.Pool{ + New: func() any { return newCompressor() }, + }, + } +} + +func (c *compressionPool) Decompress(dst *bytes.Buffer, src *bytes.Buffer, readMaxBytes int64) *Error { + decompressor, err := c.getDecompressor(src) + if err != nil { + return errorf(CodeInvalidArgument, "get decompressor: %w", err) + } + reader := io.Reader(decompressor) + if readMaxBytes > 0 && readMaxBytes < math.MaxInt64 { + reader = io.LimitReader(decompressor, readMaxBytes+1) + } + bytesRead, err := dst.ReadFrom(reader) + if err != nil { + _ = c.putDecompressor(decompressor) + err = wrapIfContextError(err) + if connectErr, ok := asError(err); ok { + return connectErr + } + return errorf(CodeInvalidArgument, "decompress: %w", err) + } + if readMaxBytes > 0 && bytesRead > readMaxBytes { + discardedBytes, err := io.Copy(io.Discard, decompressor) + _ = c.putDecompressor(decompressor) + if err != nil { + return errorf(CodeResourceExhausted, "message is larger than configured max %d - unable to determine message size: %w", readMaxBytes, err) + } + return errorf(CodeResourceExhausted, "message size %d is larger than configured max %d", bytesRead+discardedBytes, readMaxBytes) + } + if err := c.putDecompressor(decompressor); err != nil { + return errorf(CodeUnknown, "recycle decompressor: %w", err) + } + return nil +} + +func (c *compressionPool) Compress(dst *bytes.Buffer, src *bytes.Buffer) *Error { + compressor, err := c.getCompressor(dst) + if err != nil { + return errorf(CodeUnknown, "get compressor: %w", err) + } + if _, err := src.WriteTo(compressor); err != nil { + _ = c.putCompressor(compressor) + err = wrapIfContextError(err) + if connectErr, ok := asError(err); ok { + return connectErr + } + return errorf(CodeInternal, "compress: %w", err) + } + if err := c.putCompressor(compressor); err != nil { + return errorf(CodeInternal, "recycle compressor: %w", err) + } + return nil +} + +func (c *compressionPool) getDecompressor(reader io.Reader) (Decompressor, error) { + decompressor, ok := c.decompressors.Get().(Decompressor) + if !ok { + return nil, errors.New("expected Decompressor, got incorrect type from pool") + } + return decompressor, decompressor.Reset(reader) +} + +func (c *compressionPool) putDecompressor(decompressor Decompressor) error { + if err := decompressor.Close(); err != nil { + return err + } + // While it's in the pool, we don't want the decompressor to retain a + // reference to the underlying reader. However, most decompressors attempt to + // read some header data from the new data source when Reset; since we don't + // know the compression format, we can't provide a valid header. Since we + // also reset the decompressor when it's pulled out of the pool, we can + // ignore errors here. + _ = decompressor.Reset(http.NoBody) + c.decompressors.Put(decompressor) + return nil +} + +func (c *compressionPool) getCompressor(writer io.Writer) (Compressor, error) { + compressor, ok := c.compressors.Get().(Compressor) + if !ok { + return nil, errors.New("expected Compressor, got incorrect type from pool") + } + compressor.Reset(writer) + return compressor, nil +} + +func (c *compressionPool) putCompressor(compressor Compressor) error { + if err := compressor.Close(); err != nil { + return err + } + compressor.Reset(io.Discard) // don't keep references + c.compressors.Put(compressor) + return nil +} + +// readOnlyCompressionPools is a read-only interface to a map of named +// compressionPools. +type readOnlyCompressionPools interface { + Get(string) *compressionPool + Contains(string) bool + // Wordy, but clarifies how this is different from readOnlyCodecs.Names(). + CommaSeparatedNames() string +} + +func newReadOnlyCompressionPools( + nameToPool map[string]*compressionPool, + reversedNames []string, +) readOnlyCompressionPools { + // Client and handler configs keep compression names in registration order, + // but we want the last registered to be the most preferred. + names := make([]string, 0, len(reversedNames)) + seen := make(map[string]struct{}, len(reversedNames)) + for _, name := range slices.Backward(reversedNames) { + if _, ok := seen[name]; ok { + continue + } + seen[name] = struct{}{} + names = append(names, name) + } + return &namedCompressionPools{ + nameToPool: nameToPool, + commaSeparatedNames: strings.Join(names, ","), + } +} + +type namedCompressionPools struct { + nameToPool map[string]*compressionPool + commaSeparatedNames string +} + +func (m *namedCompressionPools) Get(name string) *compressionPool { + if name == "" || name == compressionIdentity { + return nil + } + return m.nameToPool[name] +} + +func (m *namedCompressionPools) Contains(name string) bool { + _, ok := m.nameToPool[name] + return ok +} + +func (m *namedCompressionPools) CommaSeparatedNames() string { + return m.commaSeparatedNames +} diff --git a/vendor/connectrpc.com/connect/connect.go b/vendor/connectrpc.com/connect/connect.go new file mode 100644 index 000000000..1585c084e --- /dev/null +++ b/vendor/connectrpc.com/connect/connect.go @@ -0,0 +1,511 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package connect is a slim RPC framework built on Protocol Buffers and +// [net/http]. In addition to supporting its own protocol, Connect handlers and +// clients are wire-compatible with gRPC and gRPC-Web, including streaming. +// +// This documentation is intended to explain each type and function in +// isolation. Walkthroughs, FAQs, and other narrative docs are available on the +// [Connect website], and there's a working [demonstration service] on Github. +// +// [Connect website]: https://connectrpc.com +// [demonstration service]: https://github.com/connectrpc/examples-go +package connect + +import ( + "errors" + "fmt" + "io" + "net/http" + "net/url" +) + +// Version is the semantic version of the connect module. +const Version = "1.21.1" + +// These constants are used in compile-time handshakes with connect's generated +// code. +const ( + IsAtLeastVersion0_0_1 = true + IsAtLeastVersion0_1_0 = true + IsAtLeastVersion1_7_0 = true + IsAtLeastVersion1_13_0 = true +) + +// StreamType describes whether the client, server, neither, or both is +// streaming. +type StreamType uint8 + +const ( + StreamTypeUnary StreamType = 0b00 + StreamTypeClient StreamType = 0b01 + StreamTypeServer StreamType = 0b10 + StreamTypeBidi = StreamTypeClient | StreamTypeServer +) + +func (s StreamType) String() string { + switch s { + case StreamTypeUnary: + return "unary" + case StreamTypeClient: + return "client" + case StreamTypeServer: + return "server" + case StreamTypeBidi: + return "bidi" + } + return fmt.Sprintf("stream_%d", s) +} + +// StreamingHandlerConn is the server's view of a bidirectional message +// exchange. Interceptors for streaming RPCs may wrap StreamingHandlerConns. +// +// Like the standard library's [http.ResponseWriter], StreamingHandlerConns write +// response headers to the network with the first call to Send. Any subsequent +// mutations are effectively no-ops. Handlers may mutate response trailers at +// any time before returning. When the client has finished sending data, +// Receive returns an error wrapping [io.EOF]. Handlers should check for this +// using the standard library's [errors.Is]. +// +// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for +// use by the gRPC and Connect protocols: applications may read them but +// shouldn't write them. +// +// StreamingHandlerConn implementations provided by this module guarantee that +// all returned errors can be cast to [*Error] using the standard library's +// [errors.As]. +// +// StreamingHandlerConn implementations provided by this module support limited +// concurrent use: the read side (Receive, RequestHeader) may be called +// concurrently with the write side (Send, ResponseHeader, ResponseTrailer), but +// the read side must not be called concurrently with itself, and the write side +// must not be called concurrently with itself. +type StreamingHandlerConn interface { + Spec() Spec + Peer() Peer + + // Receive and RequestHeader form the read side of the stream. They are not + // safe to call concurrently with each other, but may be called concurrently + // with Send, ResponseHeader, and ResponseTrailer. + Receive(any) error + RequestHeader() http.Header + + // Send, ResponseHeader, and ResponseTrailer form the write side of the + // stream. They are not safe to call concurrently with each other, but may + // be called concurrently with Receive and RequestHeader. + Send(any) error + ResponseHeader() http.Header + ResponseTrailer() http.Header +} + +// StreamingClientConn is the client's view of a bidirectional message exchange. +// Interceptors for streaming RPCs may wrap StreamingClientConns. +// +// StreamingClientConns write request headers to the network with the first +// call to Send. Any subsequent mutations are effectively no-ops. When the +// server is done sending data, the StreamingClientConn's Receive method +// returns an error wrapping [io.EOF]. Clients should check for this using the +// standard library's [errors.Is]. If the server encounters an error during +// processing, subsequent calls to the StreamingClientConn's Send method will +// return an error wrapping [io.EOF]; clients may then call Receive to unmarshal +// the error. +// +// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for +// use by the gRPC and Connect protocols: applications may read them but +// shouldn't write them. +// +// StreamingClientConn implementations provided by this module guarantee that +// all returned errors can be cast to [*Error] using the standard library's +// [errors.As]. +// +// StreamingClientConn implementations provided by this module support limited +// concurrent use: the read side (Receive, ResponseHeader, ResponseTrailer, +// CloseResponse) may be called concurrently with the write side (Send, +// RequestHeader, CloseRequest), but the read side must not be called +// concurrently with itself, and the write side must not be called concurrently +// with itself. +type StreamingClientConn interface { + // Spec and Peer are safe to call concurrently with all other methods. + Spec() Spec + Peer() Peer + + // Send, RequestHeader, and CloseRequest form the write side of the stream. + // They are not safe to call concurrently with each other, but may be called + // concurrently with Receive, ResponseHeader, ResponseTrailer, and + // CloseResponse. + Send(any) error + RequestHeader() http.Header + CloseRequest() error + + // Receive, ResponseHeader, ResponseTrailer, and CloseResponse form the read + // side of the stream. They are not safe to call concurrently with each + // other, but may be called concurrently with Send, RequestHeader, and + // CloseRequest. + Receive(any) error + ResponseHeader() http.Header + ResponseTrailer() http.Header + CloseResponse() error +} + +// Request is a wrapper around a generated request message. It provides +// access to metadata like headers and the RPC specification, as well as +// strongly-typed access to the message itself. +type Request[T any] struct { + Msg *T + + spec Spec + peer Peer + header http.Header + method string +} + +// NewRequest wraps a generated request message. +func NewRequest[T any](message *T) *Request[T] { + return &Request[T]{ + Msg: message, + // Initialized lazily so we don't allocate unnecessarily. + header: nil, + } +} + +// Any returns the concrete request message as an empty interface, so that +// *Request implements the [AnyRequest] interface. +func (r *Request[_]) Any() any { + return r.Msg +} + +// Spec returns a description of this RPC. +func (r *Request[_]) Spec() Spec { + return r.spec +} + +// Peer describes the other party for this RPC. +func (r *Request[_]) Peer() Peer { + return r.peer +} + +// Header returns the HTTP headers for this request. Headers beginning with +// "Connect-" and "Grpc-" are reserved for use by the Connect and gRPC +// protocols: applications may read them but shouldn't write them. +func (r *Request[_]) Header() http.Header { + if r.header == nil { + r.header = make(http.Header) + } + return r.header +} + +// HTTPMethod returns the HTTP method for this request. This is nearly always +// POST, but side-effect-free unary RPCs could be made via a GET. +// +// On a newly created request, via NewRequest, this will return the empty +// string until the actual request is actually sent and the HTTP method +// determined. This means that client interceptor functions will see the +// empty string until *after* they delegate to the handler they wrapped. It +// is even possible for this to return the empty string after such delegation, +// if the request was never actually sent to the server (and thus no +// determination ever made about the HTTP method). +func (r *Request[_]) HTTPMethod() string { + return r.method +} + +// internalOnly implements AnyRequest. +func (r *Request[_]) internalOnly() {} + +// setRequestMethod sets the request method to the given value. +func (r *Request[_]) setRequestMethod(method string) { + r.method = method +} + +// AnyRequest is the common method set of every [Request], regardless of type +// parameter. It's used in unary interceptors. +// +// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for +// use by the gRPC and Connect protocols: applications may read them but +// shouldn't write them. +// +// To preserve our ability to add methods to this interface without breaking +// backward compatibility, only types defined in this package can implement +// AnyRequest. +type AnyRequest interface { + Any() any + Spec() Spec + Peer() Peer + Header() http.Header + HTTPMethod() string + + internalOnly() + setRequestMethod(string) +} + +// Response is a wrapper around a generated response message. It provides +// access to metadata like headers and trailers, as well as strongly-typed +// access to the message itself. +type Response[T any] struct { + Msg *T + + header http.Header + trailer http.Header +} + +// NewResponse wraps a generated response message. +func NewResponse[T any](message *T) *Response[T] { + return &Response[T]{ + Msg: message, + // Initialized lazily so we don't allocate unnecessarily. + header: nil, + trailer: nil, + } +} + +// Any returns the concrete response message as an empty interface, so that +// *Response implements the [AnyResponse] interface. +func (r *Response[_]) Any() any { + return r.Msg +} + +// Header returns the HTTP headers for this response. Headers beginning with +// "Connect-" and "Grpc-" are reserved for use by the Connect and gRPC +// protocols: applications may read them but shouldn't write them. +func (r *Response[_]) Header() http.Header { + if r.header == nil { + r.header = make(http.Header) + } + return r.header +} + +// Trailer returns the trailers for this response. Depending on the underlying +// RPC protocol, trailers may be sent as HTTP trailers or a protocol-specific +// block of in-body metadata. +// +// Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols: applications may read them but shouldn't write +// them. +func (r *Response[_]) Trailer() http.Header { + if r.trailer == nil { + r.trailer = make(http.Header) + } + return r.trailer +} + +// internalOnly implements AnyResponse. +func (r *Response[_]) internalOnly() {} + +// AnyResponse is the common method set of every [Response], regardless of type +// parameter. It's used in unary interceptors. +// +// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for +// use by the gRPC and Connect protocols: applications may read them but +// shouldn't write them. +// +// To preserve our ability to add methods to this interface without breaking +// backward compatibility, only types defined in this package can implement +// AnyResponse. +type AnyResponse interface { + Any() any + Header() http.Header + Trailer() http.Header + + internalOnly() +} + +// HTTPClient is the interface connect expects HTTP clients to implement. The +// standard library's *http.Client implements HTTPClient. +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Spec is a description of a client call or a handler invocation. +// +// If you're using Protobuf, protoc-gen-connect-go generates a constant for the +// fully-qualified Procedure corresponding to each RPC in your schema. +type Spec struct { + StreamType StreamType + Schema any // for protobuf RPCs, a protoreflect.MethodDescriptor + Procedure string // for example, "/acme.foo.v1.FooService/Bar" + IsClient bool // otherwise we're in a handler + IdempotencyLevel IdempotencyLevel +} + +// Peer describes the other party to an RPC. +// +// When accessed client-side, Addr contains the host or host:port from the +// server's URL. When accessed server-side, Addr contains the client's address +// in IP:port format. +// +// On both the client and the server, Protocol is the RPC protocol in use. +// Currently, it's either [ProtocolConnect], [ProtocolGRPC], or +// [ProtocolGRPCWeb], but additional protocols may be added in the future. +// +// Query contains the query parameters for the request. For the server, this +// will reflect the actual query parameters sent. For the client, it is unset. +type Peer struct { + Addr string + Protocol string + Query url.Values // server-only +} + +func newPeerForURL(url *url.URL, protocol string) Peer { + return Peer{ + Addr: url.Host, + Protocol: protocol, + } +} + +// handlerConnCloser extends StreamingHandlerConn with a method for handlers to +// terminate the message exchange (and optionally send an error to the client). +type handlerConnCloser interface { + StreamingHandlerConn + + Close(error) error +} + +// receiveConn represents the shared methods of both StreamingClientConn and StreamingHandlerConn +// that the below helper functions use for implementing the rules around a "unary" stream, that +// is expected to have exactly one message (or zero messages followed by a non-EOF error). +type receiveConn interface { + Spec() Spec + Receive(any) error +} + +// hasHTTPMethod is implemented by streaming connections that support HTTP methods other than +// POST. +type hasHTTPMethod interface { + getHTTPMethod() string +} + +// errStreamingClientConn is a sentinel error implementation of StreamingClientConn. +type errStreamingClientConn struct { + err error + requestHeader http.Header + responseHeader http.Header + responseTrailer http.Header +} + +func newErrStreamingClientConn(err error) *errStreamingClientConn { + return &errStreamingClientConn{ + err: err, + requestHeader: make(http.Header), + responseHeader: make(http.Header), + responseTrailer: make(http.Header), + } +} + +func (c *errStreamingClientConn) Receive(msg any) error { + return c.err +} + +func (c *errStreamingClientConn) Spec() Spec { + return Spec{} +} + +func (c *errStreamingClientConn) Peer() Peer { + return Peer{} +} + +func (c *errStreamingClientConn) Send(msg any) error { + return c.err +} + +func (c *errStreamingClientConn) CloseRequest() error { + return c.err +} + +func (c *errStreamingClientConn) CloseResponse() error { + return c.err +} + +func (c *errStreamingClientConn) RequestHeader() http.Header { + return c.requestHeader +} + +func (c *errStreamingClientConn) ResponseHeader() http.Header { + return c.responseHeader +} + +func (c *errStreamingClientConn) ResponseTrailer() http.Header { + return c.responseTrailer +} + +// receiveUnaryResponse unmarshals a message from a StreamingClientConn, then +// envelopes the message and attaches headers and trailers. It attempts to +// consume the response stream and isn't appropriate when receiving multiple +// messages. +func receiveUnaryResponse[T any](conn StreamingClientConn, initializer maybeInitializer) (*Response[T], error) { + msg, err := receiveUnaryMessage[T](conn, initializer, "response") + if err != nil { + return nil, err + } + return &Response[T]{ + Msg: msg, + header: conn.ResponseHeader(), + trailer: conn.ResponseTrailer(), + }, nil +} + +// receiveUnaryRequest unmarshals a message from a StreamingClientConn, then +// envelopes the message and attaches headers and other request properties. It +// attempts to consume the request stream and isn't appropriate when receiving +// multiple messages. +func receiveUnaryRequest[T any](conn StreamingHandlerConn, initializer maybeInitializer) (*Request[T], error) { + msg, err := receiveUnaryMessage[T](conn, initializer, "request") + if err != nil { + return nil, err + } + method := http.MethodPost + if hasRequestMethod, ok := conn.(hasHTTPMethod); ok { + method = hasRequestMethod.getHTTPMethod() + } + return &Request[T]{ + Msg: msg, + spec: conn.Spec(), + peer: conn.Peer(), + header: conn.RequestHeader(), + method: method, + }, nil +} + +func receiveUnaryMessage[T any](conn receiveConn, initializer maybeInitializer, what string) (*T, error) { + var msg T + if err := initializer.maybe(conn.Spec(), &msg); err != nil { + return nil, err + } + // Possibly counter-intuitive, but the gRPC specs about error codes state that both clients + // and servers should return "unimplemented" when they encounter a cardinality violation: where + // the number of messages in the stream is wrong. Search for "cardinality violation" in the + // following docs: + // https://grpc.github.io/grpc/core/md_doc_statuscodes.html + if err := conn.Receive(&msg); err != nil { + if errors.Is(err, io.EOF) { + err = NewError(CodeUnimplemented, fmt.Errorf("unary %s has zero messages", what)) + } + return nil, err + } + // In a well-formed stream, the one message must be the only content in the body. + // To verify that it is well-formed, try to read another message from the stream. + // TODO: optimize this second receive: ideally do it w/out allocation, w/out + // fully reading next message (if one is present), and w/out trying to + // actually unmarshal the bytes) + var msg2 T + if err := initializer.maybe(conn.Spec(), &msg2); err != nil { + return nil, err + } + if err := conn.Receive(&msg2); !errors.Is(err, io.EOF) { + if err == nil { + err = NewError(CodeUnimplemented, fmt.Errorf("unary %s has multiple messages", what)) + } + return nil, err + } + return &msg, nil +} diff --git a/vendor/connectrpc.com/connect/context.go b/vendor/connectrpc.com/connect/context.go new file mode 100644 index 000000000..32f265de1 --- /dev/null +++ b/vendor/connectrpc.com/connect/context.go @@ -0,0 +1,243 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "net/http" +) + +// CallInfo represents information relevant to an RPC call. +type CallInfo interface { + // Spec returns a description of this call. + Spec() Spec + // Peer describes the other party for this call. + Peer() Peer + // RequestHeader returns the HTTP headers for this request. Headers beginning with + // "Connect-" and "Grpc-" are reserved for use by the Connect and gRPC + // protocols: applications may read them but shouldn't write them. + RequestHeader() http.Header + // ResponseHeader returns the HTTP headers for this response. Headers beginning with + // "Connect-" and "Grpc-" are reserved for use by the Connect and gRPC + // protocols: applications may read them but shouldn't write them. + // On the client side, this method returns nil before + // the call is actually made. After the call is made, for streaming operations, + // this method will block for the server to actually return response headers. + ResponseHeader() http.Header + // ResponseTrailer returns the trailers for this response. Depending on the underlying + // RPC protocol, trailers may be sent as HTTP trailers or a protocol-specific + // block of in-body metadata. + // + // Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the + // Connect and gRPC protocols: applications may read them but shouldn't write + // them. + // + // On the client side, this method returns nil before the call is actually made. + // After the call is made, for streaming operations, this method will block + // for the server to actually return response trailers. + ResponseTrailer() http.Header + // HTTPMethod returns the HTTP method for this request. This is nearly always + // POST, but side-effect-free unary RPCs could be made via a GET. + // + // On a newly created request, via NewRequest, this will return the empty + // string until the actual request is actually sent and the HTTP method + // determined. This means that client interceptor functions will see the + // empty string until *after* they delegate to the handler they wrapped. It + // is even possible for this to return the empty string after such delegation, + // if the request was never actually sent to the server (and thus no + // determination ever made about the HTTP method). + HTTPMethod() string + + internalOnly() +} + +// NewClientContext creates a new client (i.e. outgoing) context for use from a +// client. When the returned context is passed to RPCs, the returned call info +// can be used to set request metadata before the RPC is invoked and to inspect +// response metadata after the RPC completes. +// +// The returned context may be re-used across RPCs as long as they are +// not concurrent. Results of all CallInfo methods other than +// RequestHeader() are undefined if the context is used with concurrent RPCs. +func NewClientContext(ctx context.Context) (context.Context, CallInfo) { + info := &clientCallInfo{} + return context.WithValue(ctx, clientCallInfoContextKey{}, info), info +} + +// CallInfoForHandlerContext returns the CallInfo for the given handler (i.e. incoming) context, if there is one. +func CallInfoForHandlerContext(ctx context.Context) (CallInfo, bool) { + value, ok := ctx.Value(handlerCallInfoContextKey{}).(CallInfo) + return value, ok +} + +// handlerCallInfo is a CallInfo implementation used for unary handlers. +type handlerCallInfo struct { + spec Spec + peer Peer + method string + requestHeader http.Header + responseHeader http.Header + responseTrailer http.Header +} + +func (c *handlerCallInfo) Spec() Spec { + return c.spec +} + +func (c *handlerCallInfo) Peer() Peer { + return c.peer +} + +func (c *handlerCallInfo) RequestHeader() http.Header { + if c.requestHeader == nil { + c.requestHeader = make(http.Header) + } + return c.requestHeader +} + +func (c *handlerCallInfo) ResponseHeader() http.Header { + if c.responseHeader == nil { + c.responseHeader = make(http.Header) + } + return c.responseHeader +} + +func (c *handlerCallInfo) ResponseTrailer() http.Header { + if c.responseTrailer == nil { + c.responseTrailer = make(http.Header) + } + return c.responseTrailer +} + +func (c *handlerCallInfo) HTTPMethod() string { + return c.method +} + +// internalOnly implements CallInfo. +func (c *handlerCallInfo) internalOnly() {} + +// streamingHandlerCallInfo is a CallInfo implementation used for streaming RPC handlers. +type streamingHandlerCallInfo struct { + conn StreamingHandlerConn +} + +func (c *streamingHandlerCallInfo) Spec() Spec { + return c.conn.Spec() +} + +func (c *streamingHandlerCallInfo) Peer() Peer { + return c.conn.Peer() +} + +func (c *streamingHandlerCallInfo) RequestHeader() http.Header { + return c.conn.RequestHeader() +} + +func (c *streamingHandlerCallInfo) ResponseHeader() http.Header { + return c.conn.ResponseHeader() +} + +func (c *streamingHandlerCallInfo) ResponseTrailer() http.Header { + return c.conn.ResponseTrailer() +} + +func (c *streamingHandlerCallInfo) HTTPMethod() string { + // All stream calls are POSTs + return http.MethodPost +} + +// internalOnly implements CallInfo. +func (c *streamingHandlerCallInfo) internalOnly() {} + +// clientCallInfo is a CallInfo implementation used for clients. +type clientCallInfo struct { + responseSource + + spec Spec + peer Peer + method string + requestHeader http.Header +} + +func (c *clientCallInfo) Spec() Spec { + return c.spec +} + +func (c *clientCallInfo) Peer() Peer { + return c.peer +} + +func (c *clientCallInfo) RequestHeader() http.Header { + if c.requestHeader == nil { + c.requestHeader = make(http.Header) + } + return c.requestHeader +} + +func (c *clientCallInfo) ResponseHeader() http.Header { + if c.responseSource == nil { + return nil + } + return c.responseSource.ResponseHeader() +} + +func (c *clientCallInfo) ResponseTrailer() http.Header { + if c.responseSource == nil { + return nil + } + return c.responseSource.ResponseTrailer() +} + +func (c *clientCallInfo) HTTPMethod() string { + return c.method +} + +// internalOnly implements CallInfo. +func (c *clientCallInfo) internalOnly() {} + +// clientCallInfoContextKey is the key used to store client call info in context. +type clientCallInfoContextKey struct{} + +// sentinelContextKey is the key used to store a copy of client call info in context +// when a request is made. +// Each step in an interceptor chain compares the actual call info with the +// sentinel call info. If the two values are different, the request will +// return an error in the interceptor. +// This protects against changing the call info in interceptors, which is prohibited +// as it would allow users to modify call info mid-flight independent of the actual +// request or response. +// Users who wish to modify call info data such as headers and trailers should instead +// use Connect [Request] and [Response] wrapper types. +type sentinelContextKey struct{} + +// handlerCallInfoContextKey is the key used to store handler call info in context. +type handlerCallInfoContextKey struct{} + +// responseSource indicates a type that manages response headers and trailers. +type responseSource interface { + ResponseHeader() http.Header + ResponseTrailer() http.Header +} + +// clientCallInfoForContext gets the call info from a client/outgoing context. +func clientCallInfoForContext(ctx context.Context) (*clientCallInfo, bool) { + info, ok := ctx.Value(clientCallInfoContextKey{}).(*clientCallInfo) + return info, ok +} + +// newHandlerContext creates a new handler/incoming context. +func newHandlerContext(ctx context.Context, info CallInfo) context.Context { + return context.WithValue(ctx, handlerCallInfoContextKey{}, info) +} diff --git a/vendor/connectrpc.com/connect/duplex_http_call.go b/vendor/connectrpc.com/connect/duplex_http_call.go new file mode 100644 index 000000000..8a368ebd7 --- /dev/null +++ b/vendor/connectrpc.com/connect/duplex_http_call.go @@ -0,0 +1,494 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bytes" + "context" + "errors" + "io" + "net/http" + "net/url" + "sync" + "sync/atomic" +) + +// duplexHTTPCall is a full-duplex stream between the client and server. The +// request body is the stream from client to server, and the response body is +// the reverse. +// +// Be warned: we need to use some lesser-known APIs to do this with net/http. +type duplexHTTPCall struct { + ctx context.Context + httpClient HTTPClient + streamType StreamType + onRequestSend func(*http.Request) + validateResponse func(*http.Response) *Error + + // requestBodyWriter streams the request body for client-streaming and bidi + // RPCs. Assigned once in newDuplexHTTPCall and never reassigned, so it is + // safe to read without synchronisation. Nil for unary and server-streaming. + requestBodyWriter *io.PipeWriter + + // requestSent ensures we only send the request once. + requestSent atomic.Bool + request *http.Request + + // responseReady is closed when the response is ready or when the request + // fails. Any error on request initialisation will be set on the + // responseErr. There's always a response if responseErr is nil. + responseReady chan struct{} + response *http.Response + responseErr error +} + +func newDuplexHTTPCall( + ctx context.Context, + httpClient HTTPClient, + url *url.URL, + spec Spec, + header http.Header, +) *duplexHTTPCall { + // ensure we make a copy of the url before we pass along to the + // Request. This ensures if a transport out of our control wants + // to mutate the req.URL, we don't feel the effects of it. + url = cloneURL(url) + + // This is mirroring what http.NewRequestContext did, but + // using an already parsed url.URL object, rather than a string + // and parsing it again. This is a bit funny with HTTP/1.1 + // explicitly, but this is logic copied over from + // NewRequestContext and doesn't effect the actual version + // being transmitted. + request := (&http.Request{ + Method: http.MethodPost, + URL: url, + Header: header, + Proto: "HTTP/1.1", + ProtoMajor: 1, + ProtoMinor: 1, + Body: http.NoBody, + GetBody: getNoBody, + Host: url.Host, + }).WithContext(ctx) + duplex := &duplexHTTPCall{ + ctx: ctx, + httpClient: httpClient, + streamType: spec.StreamType, + request: request, + responseReady: make(chan struct{}), + } + // Client-streaming and bidi RPCs stream the request body through an + // io.Pipe. Set it up here so requestBodyWriter is assigned once at + // construction and safe to read concurrently from Send and CloseWrite. + if spec.StreamType&StreamTypeClient != 0 { + pipeReader, pipeWriter := io.Pipe() + duplex.requestBodyWriter = pipeWriter + duplex.request.Body = pipeReader + duplex.request.GetBody = nil // GetBody is not supported for client streaming. + duplex.request.ContentLength = -1 + } + return duplex +} + +// Send sends a message to the server. +func (d *duplexHTTPCall) Send(payload messagePayload) (int64, error) { + if d.streamType&StreamTypeClient == 0 { + return d.sendUnary(payload) + } + isFirst := d.requestSent.CompareAndSwap(false, true) + if isFirst { + // This is the first time we're sending a message to the server. The + // request body pipe has already been set up by newDuplexHTTPCall, so + // we just kick off the HTTP request here. + go d.makeRequest() // concurrent request + } + if err := d.ctx.Err(); err != nil { + return 0, wrapIfContextError(err) + } + if isFirst && payload.Len() == 0 { + // On first write a nil Send is used to send request headers. Avoid + // writing a zero-length payload to avoid superfluous errors with close. + return 0, nil + } + // It's safe to write to this side of the pipe while net/http concurrently + // reads from the other side. + bytesWritten, err := payload.WriteTo(d.requestBodyWriter) + if err != nil && errors.Is(err, io.ErrClosedPipe) { + // Signal that the stream is closed with the more-typical io.EOF instead of + // io.ErrClosedPipe. This makes it easier for protocol-specific wrappers to + // match grpc-go's behavior. + err = io.EOF + } + return bytesWritten, err +} + +func (d *duplexHTTPCall) sendUnary(payload messagePayload) (int64, error) { + // Unary messages are sent as a single HTTP request. We don't need to use a + // pipe for the request body and we don't need to send headers separately. + if !d.requestSent.CompareAndSwap(false, true) { + return 0, errors.New("request already sent") + } + payloadLength := int64(payload.Len()) + if payloadLength > 0 { + // Build the request body from the payload. + payloadBody := newPayloadCloser(payload) + d.request.Body = payloadBody + d.request.ContentLength = payloadLength + d.request.GetBody = func() (io.ReadCloser, error) { + if !payloadBody.Rewind() { + return nil, errors.New("payload cannot be retried") + } + return payloadBody, nil + } + // Release the payload ensuring that after Send returns the + // payload is safe to be reused. See [http.RoundTripper] for + // more details. + defer payloadBody.Release() + } + d.makeRequest() // synchronous request + if d.responseErr != nil { + // Check on response errors for context errors. Other errors are + // handled on read. + if err := d.ctx.Err(); err != nil { + return 0, wrapIfContextError(err) + } + } + return payloadLength, nil +} + +// CloseWrite closes the request body. Callers *must* call CloseWrite before Read when +// using HTTP/1.x. +func (d *duplexHTTPCall) CloseWrite() error { + // Even if Write was never called, we need to make an HTTP request. This + // ensures that we've sent any headers to the server and that we have an HTTP + // response to read from. + if d.requestSent.CompareAndSwap(false, true) { + go d.makeRequest() + } + // The user calls CloseWrite to indicate that they're done sending data. It's + // safe to close the write side of the pipe while net/http is reading from + // it. + // + // Because connect also supports some RPC types over HTTP/1.1, we need to be + // careful how we expose this method to users. HTTP/1.1 doesn't support + // bidirectional streaming - the write side of the stream (aka request body) + // must be closed before we start reading the response or we'll just block + // forever. To make sure users don't have to worry about this, the generated + // code for unary, client streaming, and server streaming RPCs must call + // CloseWrite automatically rather than requiring the user to do it. + // + // For client-streaming and bidi RPCs requestBodyWriter is always non-nil + // (it is set in newDuplexHTTPCall); for unary and server-streaming RPCs + // it remains nil and we fall back to closing whatever request body was + // attached (typically http.NoBody or a payloadCloser set by sendUnary). + if d.requestBodyWriter != nil { + return d.requestBodyWriter.Close() + } + return d.request.Body.Close() +} + +// Header returns the HTTP request headers. +func (d *duplexHTTPCall) Header() http.Header { + return d.request.Header +} + +// Trailer returns the HTTP request trailers. +func (d *duplexHTTPCall) Trailer() http.Header { + return d.request.Trailer +} + +// URL returns the URL for the request. +func (d *duplexHTTPCall) URL() *url.URL { + return d.request.URL +} + +// Method returns the HTTP method for the request (GET or POST). +func (d *duplexHTTPCall) Method() string { + return d.request.Method +} + +// SetMethod changes the method of the request before it is sent. +func (d *duplexHTTPCall) SetMethod(method string) { + d.request.Method = method +} + +// Read from the response body. Returns the first error passed to SetError. +func (d *duplexHTTPCall) Read(data []byte) (int, error) { + // First, we wait until we've gotten the response headers and established the + // server-to-client side of the stream. + if _, err := d.blockUntilResponseReady(); err != nil { + // The stream is already closed or corrupted. + return 0, err + } + // Before we read, check if the context has been canceled. + if err := d.ctx.Err(); err != nil { + return 0, wrapIfContextError(err) + } + n, err := d.response.Body.Read(data) + if err != nil && !errors.Is(err, io.EOF) { + err = wrapIfContextDone(d.ctx, err) + err = wrapIfRSTError(d.ctx, err) + } + return n, err +} + +func (d *duplexHTTPCall) CloseRead() error { + // Ignore the error: an error response still has a body that must be closed. + response, _ := d.blockUntilResponseReady() + if response == nil { + return nil // No response, so nothing to close. + } + err := response.Body.Close() + err = wrapIfContextDone(d.ctx, err) + return wrapIfRSTError(d.ctx, err) +} + +// ResponseStatusCode is the response's HTTP status code. +func (d *duplexHTTPCall) ResponseStatusCode() (int, error) { + response, err := d.blockUntilResponseReady() + if err != nil { + return 0, err + } + return response.StatusCode, nil +} + +// ResponseHeader returns the response HTTP headers. +func (d *duplexHTTPCall) ResponseHeader() http.Header { + // Ignore the error: an error response still carries headers to forward. + if response, _ := d.blockUntilResponseReady(); response != nil { + return response.Header + } + return make(http.Header) +} + +// ResponseTrailer returns the response HTTP trailers. +func (d *duplexHTTPCall) ResponseTrailer() http.Header { + // Ignore the error: an error response still carries trailers to forward. + if response, _ := d.blockUntilResponseReady(); response != nil { + return response.Trailer + } + return make(http.Header) +} + +// SetValidateResponse sets the response validation function. The function runs +// in a background goroutine. +func (d *duplexHTTPCall) SetValidateResponse(validate func(*http.Response) *Error) { + d.validateResponse = validate +} + +// blockUntilResponseReady blocks until the response is ready or the context is +// cancelled. It returns a nil response when none was received, either because +// the request failed or the context was cancelled before the response arrived. +// +// The response and the error may both be non-nil. An error response (one with a +// non-success status or that fails validation) still carries a body to close +// and headers to forward, so it is returned alongside its error. +func (d *duplexHTTPCall) blockUntilResponseReady() (*http.Response, error) { + select { + case <-d.responseReady: + return d.response, d.responseErr + default: + } + select { + case <-d.responseReady: + return d.response, d.responseErr + case <-d.ctx.Done(): + return nil, wrapIfContextError(d.ctx.Err()) + } +} + +func (d *duplexHTTPCall) makeRequest() { + // This runs concurrently with Write and CloseWrite. Read and CloseRead wait + // on d.responseReady, so we can't race with them. + defer close(d.responseReady) + + // Promote the header Host to the request object. + if host := getHeaderCanonical(d.request.Header, headerHost); len(host) > 0 { + d.request.Host = host + } + if d.onRequestSend != nil { + d.onRequestSend(d.request) + } + // Once we send a message to the server, they send a message back and + // establish the receive side of the stream. + // On error, we close the request body using the Write side of the pipe. + // This ensures HTTP2 streams receive an io.EOF from the Read side of the + // pipe. Write's check for io.ErrClosedPipe and will convert this to io.EOF. + response, err := d.httpClient.Do(d.request) //nolint:bodyclose + if err != nil { + if errors.Is(err, io.EOF) { + // We use io.EOF as a sentinel in many places and don't want this + // transport error to be confused for those other situations. + err = io.ErrUnexpectedEOF + } + err = wrapIfContextError(err) + err = wrapIfLikelyH2CNotConfiguredError(d.request, err) + err = wrapIfLikelyWithGRPCNotUsedError(err) + err = wrapIfRSTError(d.ctx, err) + if _, ok := asError(err); !ok { + err = NewError(CodeUnavailable, err) + } + d.responseErr = err + _ = d.CloseWrite() + return + } + // We've got a response. We can now read from the response body. + // Closing the response body is delegated to the caller even on error. + d.response = response + if err := d.validateResponse(response); err != nil { + d.responseErr = err + _ = d.CloseWrite() + return + } + if (d.streamType&StreamTypeBidi) == StreamTypeBidi && response.ProtoMajor < 2 { + // If we somehow dialed an HTTP/1.x server, fail with an explicit message + // rather than returning a more cryptic error later on. + d.responseErr = errorf( + CodeUnimplemented, + "response from %v is HTTP/%d.%d: bidi streams require at least HTTP/2", + d.request.URL, + response.ProtoMajor, + response.ProtoMinor, + ) + _ = d.CloseWrite() + } +} + +// getNoBody is a GetBody function for http.NoBody. +func getNoBody() (io.ReadCloser, error) { + return http.NoBody, nil +} + +// messagePayload is a sized and seekable message payload. The interface is +// implemented by [*bytes.Reader] and *envelope. Reads must be non-blocking. +type messagePayload interface { + io.Reader + io.WriterTo + io.Seeker + Len() int +} + +// nopPayload is a message payload that does nothing. It's used to send headers +// to the server. +type nopPayload struct{} + +var _ messagePayload = nopPayload{} + +func (nopPayload) Read([]byte) (int, error) { + return 0, io.EOF +} + +func (nopPayload) WriteTo(io.Writer) (int64, error) { + return 0, nil +} + +func (nopPayload) Seek(int64, int) (int64, error) { + return 0, nil +} + +func (nopPayload) Len() int { + return 0 +} + +// messageSender sends a message payload. The interface is implemented by +// [*duplexHTTPCall] and writeSender. +type messageSender interface { + Send(messagePayload) (int64, error) +} + +// writeSender is a sender that writes to an [io.Writer]. Useful for wrapping +// [http.ResponseWriter]. +type writeSender struct { + writer io.Writer +} + +var _ messageSender = writeSender{} + +func (w writeSender) Send(payload messagePayload) (int64, error) { + return payload.WriteTo(w.writer) +} + +// See: https://cs.opensource.google/go/go/+/refs/tags/go1.20.1:src/net/http/clone.go;l=22-33 +func cloneURL(oldURL *url.URL) *url.URL { + if oldURL == nil { + return nil + } + newURL := new(url.URL) + *newURL = *oldURL + if oldURL.User != nil { + newURL.User = new(url.Userinfo) + *newURL.User = *oldURL.User + } + return newURL +} + +// payloadCloser is an [io.ReadCloser] that wraps a messagePayload. It's used to +// implement the request body for unary calls. To safely reuse the buffer +// call Release after the response is received to ensure the payload is safe for +// reuse. +type payloadCloser struct { + mu sync.Mutex + payload messagePayload +} + +func newPayloadCloser(payload messagePayload) *payloadCloser { + return &payloadCloser{ + payload: payload, + } +} + +// Read implements [io.Reader]. +func (p *payloadCloser) Read(dst []byte) (readN int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + return p.payload.Read(dst) +} + +// WriteTo implements [io.WriterTo]. +func (p *payloadCloser) WriteTo(dst io.Writer) (int64, error) { + p.mu.Lock() + defer p.mu.Unlock() + return p.payload.WriteTo(dst) +} + +// Close implements [io.Closer]. +func (p *payloadCloser) Close() error { + return nil +} + +// Rewind rewinds the payload to the beginning. It must not be called after +// Release, which is only called once the request is no longer retried. +func (p *payloadCloser) Rewind() bool { + p.mu.Lock() + defer p.mu.Unlock() + _, err := p.payload.Seek(0, io.SeekStart) + return err == nil +} + +// Release detaches the payload so the caller's buffer is safe to reuse. The +// transport may still be sending it if the server responded early, so unread +// bytes are copied rather than dropped. +func (p *payloadCloser) Release() { + p.mu.Lock() + defer p.mu.Unlock() + if p.payload.Len() == 0 { + p.payload = nopPayload{} + return + } + unread := make([]byte, p.payload.Len()) + n, _ := io.ReadFull(p.payload, unread) + p.payload = bytes.NewReader(unread[:n]) +} diff --git a/vendor/connectrpc.com/connect/envelope.go b/vendor/connectrpc.com/connect/envelope.go new file mode 100644 index 000000000..5225baaf4 --- /dev/null +++ b/vendor/connectrpc.com/connect/envelope.go @@ -0,0 +1,392 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bytes" + "context" + "encoding/binary" + "errors" + "fmt" + "io" + "math" +) + +// flagEnvelopeCompressed indicates that the data is compressed. It has the +// same meaning in the gRPC-Web, gRPC-HTTP2, and Connect protocols. +const flagEnvelopeCompressed = 0b00000001 + +var errSpecialEnvelope = errorf( + CodeUnknown, + "final message has protocol-specific flags: %w", + // User code checks for end of stream with errors.Is(err, io.EOF). + io.EOF, +) + +// envelope is a block of arbitrary bytes wrapped in gRPC and Connect's framing +// protocol. +// +// Each message is preceded by a 5-byte prefix. The first byte is a uint8 used +// as a set of bitwise flags, and the remainder is a uint32 indicating the +// message length. gRPC and Connect interpret the bitwise flags differently, so +// envelope leaves their interpretation up to the caller. +type envelope struct { + Data *bytes.Buffer + Flags uint8 + offset int64 +} + +var _ messagePayload = (*envelope)(nil) + +func (e *envelope) IsSet(flag uint8) bool { + return e.Flags&flag == flag +} + +// Read implements [io.Reader]. +func (e *envelope) Read(data []byte) (readN int, err error) { + if e.offset < 5 { + prefix, err := makeEnvelopePrefix(e.Flags, e.Data.Len()) + if err != nil { + return 0, err + } + readN = copy(data, prefix[e.offset:]) + e.offset += int64(readN) + if e.offset < 5 { + return readN, nil + } + data = data[readN:] + } + n := copy(data, e.Data.Bytes()[e.offset-5:]) + e.offset += int64(n) + readN += n + if readN == 0 && e.offset == int64(e.Data.Len()+5) { + err = io.EOF + } + return readN, err +} + +// WriteTo implements [io.WriterTo]. +func (e *envelope) WriteTo(dst io.Writer) (wroteN int64, err error) { + if e.offset < 5 { + prefix, err := makeEnvelopePrefix(e.Flags, e.Data.Len()) + if err != nil { + return 0, err + } + prefixN, err := dst.Write(prefix[e.offset:]) + e.offset += int64(prefixN) + wroteN += int64(prefixN) + if e.offset < 5 { + return wroteN, err + } + } + n, err := dst.Write(e.Data.Bytes()[e.offset-5:]) + e.offset += int64(n) + wroteN += int64(n) + return wroteN, err +} + +// Seek implements [io.Seeker]. Based on the implementation of [bytes.Reader]. +func (e *envelope) Seek(offset int64, whence int) (int64, error) { + var abs int64 + switch whence { + case io.SeekStart: + abs = offset + case io.SeekCurrent: + abs = e.offset + offset + case io.SeekEnd: + abs = int64(e.Data.Len()) + offset + default: + return 0, errors.New("connect.envelope.Seek: invalid whence") + } + if abs < 0 { + return 0, errors.New("connect.envelope.Seek: negative position") + } + e.offset = abs + return abs, nil +} + +// Len returns the number of bytes of the unread portion of the envelope. +func (e *envelope) Len() int { + if length := int(int64(e.Data.Len()) + 5 - e.offset); length > 0 { + return length + } + return 0 +} + +type envelopeWriter struct { + ctx context.Context //nolint:containedctx + sender messageSender + codec Codec + compressMinBytes int + compressionPool *compressionPool + bufferPool *bufferPool + sendMaxBytes int +} + +func (w *envelopeWriter) Marshal(message any) *Error { + if message == nil { + // Send no-op message to create the request and send headers. + payload := nopPayload{} + if _, err := w.sender.Send(payload); err != nil { + if connectErr, ok := asError(err); ok { + return connectErr + } + return NewError(CodeUnknown, err) + } + return nil + } + if appender, ok := w.codec.(marshalAppender); ok { + return w.marshalAppend(message, appender) + } + return w.marshal(message) +} + +// Write writes the enveloped message, compressing as necessary. It doesn't +// retain any references to the supplied envelope or its underlying data. +func (w *envelopeWriter) Write(env *envelope) *Error { + if env.IsSet(flagEnvelopeCompressed) || + w.compressionPool == nil || + env.Data.Len() < w.compressMinBytes { + if w.sendMaxBytes > 0 && env.Data.Len() > w.sendMaxBytes { + return errorf(CodeResourceExhausted, "message size %d exceeds sendMaxBytes %d", env.Data.Len(), w.sendMaxBytes) + } + return w.write(env) + } + data := w.bufferPool.Get() + defer w.bufferPool.Put(data) + if err := w.compressionPool.Compress(data, env.Data); err != nil { + return err + } + if w.sendMaxBytes > 0 && data.Len() > w.sendMaxBytes { + return errorf(CodeResourceExhausted, "compressed message size %d exceeds sendMaxBytes %d", data.Len(), w.sendMaxBytes) + } + return w.write(&envelope{ + Data: data, + Flags: env.Flags | flagEnvelopeCompressed, + }) +} + +func (w *envelopeWriter) marshalAppend(message any, codec marshalAppender) *Error { + // Codec supports MarshalAppend; try to re-use a []byte from the pool. + buffer := w.bufferPool.Get() + defer w.bufferPool.Put(buffer) + raw, err := codec.MarshalAppend(buffer.Bytes(), message) + if err != nil { + return errorf(CodeInternal, "marshal message: %w", err) + } + if cap(raw) > buffer.Cap() { + // The buffer from the pool was too small, so MarshalAppend grew the slice. + // Pessimistically assume that the too-small buffer is insufficient for the + // application workload, so there's no point in keeping it in the pool. + // Instead, replace it with the larger, newly-allocated slice. This + // allocates, but it's a small, constant-size allocation. + *buffer = *bytes.NewBuffer(raw) + } else { + // MarshalAppend didn't allocate, but we need to fix the internal state of + // the buffer. Compared to replacing the buffer (as above), buffer.Write + // copies but avoids allocating. + buffer.Write(raw) + } + envelope := &envelope{Data: buffer} + return w.Write(envelope) +} + +func (w *envelopeWriter) marshal(message any) *Error { + // Codec doesn't support MarshalAppend; let Marshal allocate a []byte. + raw, err := w.codec.Marshal(message) + if err != nil { + return errorf(CodeInternal, "marshal message: %w", err) + } + buffer := bytes.NewBuffer(raw) + // Put our new []byte into the pool for later reuse. + defer w.bufferPool.Put(buffer) + envelope := &envelope{Data: buffer} + return w.Write(envelope) +} + +func (w *envelopeWriter) write(env *envelope) *Error { + if _, err := w.sender.Send(env); err != nil { + err = wrapIfContextDone(w.ctx, err) + if connectErr, ok := asError(err); ok { + return connectErr + } + return errorf(CodeUnknown, "write envelope: %w", err) + } + return nil +} + +type envelopeReader struct { + ctx context.Context //nolint:containedctx + reader io.Reader + bytesRead int64 // detect trailers-only gRPC responses + codec Codec + last envelope + compressionPool *compressionPool + bufferPool *bufferPool + readMaxBytes int +} + +func (r *envelopeReader) Unmarshal(message any) *Error { + buffer := r.bufferPool.Get() + var dontRelease *bytes.Buffer + defer func() { + if buffer != dontRelease { + r.bufferPool.Put(buffer) + } + }() + + env := &envelope{Data: buffer} + err := r.Read(env) + switch { + case err == nil && env.IsSet(flagEnvelopeCompressed) && r.compressionPool == nil: + return errorf( + CodeInternal, + "protocol error: sent compressed message without compression support", + ) + case err == nil && + (env.Flags == 0 || env.Flags == flagEnvelopeCompressed) && + env.Data.Len() == 0: + // This is a standard message (because none of the top 7 bits are set) and + // there's no data, so the zero value of the message is correct. + return nil + case err != nil && errors.Is(err, io.EOF): + // The stream has ended. Propagate the EOF to the caller. + return err + case err != nil: + // Something's wrong. + return err + } + + data := env.Data + if data.Len() > 0 && env.IsSet(flagEnvelopeCompressed) { + decompressed := r.bufferPool.Get() + defer func() { + if decompressed != dontRelease { + r.bufferPool.Put(decompressed) + } + }() + if err := r.compressionPool.Decompress(decompressed, data, int64(r.readMaxBytes)); err != nil { + return err + } + data = decompressed + } + + if env.Flags != 0 && env.Flags != flagEnvelopeCompressed { + // Drain the rest of the stream to ensure there is no extra data. + numBytes, err := discard(r.reader) + r.bytesRead += numBytes + if err != nil { + err = wrapIfContextError(err) + if connErr, ok := asError(err); ok { + return connErr + } + // Ignore uncoded read errors if the complete end-stream message was + // already received. In HTTP/1.1, http.Transport closes the connection + // on request write failures, which can cause subsequent reads to fail + // despite having received the entire response. + } + if numBytes > 0 { + return errorf(CodeInternal, "corrupt response: %d extra bytes after end of stream", numBytes) + } + // One of the protocol-specific flags are set, so this is the end of the + // stream. Save the message for protocol-specific code to process and + // return a sentinel error. We alias the buffer with dontRelease as a + // way of marking it so above defers don't release it to the pool. + r.last = envelope{ + Data: data, + Flags: env.Flags, + } + dontRelease = data + return errSpecialEnvelope + } + + if err := r.codec.Unmarshal(data.Bytes(), message); err != nil { + return errorf(CodeInvalidArgument, "unmarshal message: %w", err) + } + return nil +} + +func (r *envelopeReader) Read(env *envelope) *Error { + prefixes := [5]byte{} + // io.ReadFull reads the number of bytes requested, or returns an error. + // io.EOF will only be returned if no bytes were read. + n, err := io.ReadFull(r.reader, prefixes[:]) + r.bytesRead += int64(n) + if err != nil { + if errors.Is(err, io.EOF) { + // The stream ended cleanly. That's expected, but we need to propagate an EOF + // to the user so that they know that the stream has ended. We shouldn't + // add any alarming text about protocol errors, though. + return NewError(CodeUnknown, err) + } + err = wrapIfMaxBytesError(err, "read 5 byte message prefix") + err = wrapIfContextDone(r.ctx, err) + if connectErr, ok := asError(err); ok { + return connectErr + } + // Something else has gone wrong - the stream didn't end cleanly. + return errorf( + CodeInternal, + "protocol error: incomplete envelope: %w", err, + ) + } + size := int64(binary.BigEndian.Uint32(prefixes[1:5])) + if r.readMaxBytes > 0 && size > int64(r.readMaxBytes) { + n, err := io.CopyN(io.Discard, r.reader, size) + r.bytesRead += n + if err != nil && !errors.Is(err, io.EOF) { + return errorf(CodeResourceExhausted, "message is larger than configured max %d - unable to determine message size: %w", r.readMaxBytes, err) + } + return errorf(CodeResourceExhausted, "message size %d is larger than configured max %d", size, r.readMaxBytes) + } + // We've read the prefix, so we know how many bytes to expect. + // CopyN will return an error if it doesn't read the requested + // number of bytes. + readN, err := io.CopyN(env.Data, r.reader, size) + r.bytesRead += readN + if err != nil { + if errors.Is(err, io.EOF) { + // We've gotten fewer bytes than we expected, so the stream has ended + // unexpectedly. + return errorf( + CodeInternal, + "protocol error: promised %d bytes in enveloped message, got %d bytes: %w", + size, + readN, + io.ErrUnexpectedEOF, + ) + } + err = wrapIfMaxBytesError(err, "read %d byte message", size) + err = wrapIfContextDone(r.ctx, err) + if connectErr, ok := asError(err); ok { + return connectErr + } + return errorf(CodeUnknown, "read enveloped message: %w", err) + } + env.Flags = prefixes[0] + return nil +} + +func makeEnvelopePrefix(flags uint8, size int) ([5]byte, error) { + // Cast as 64-bit to ensure comparison works on all architectures. + size64 := int64(size) + if size64 < 0 || size64 > math.MaxUint32 { + return [5]byte{}, fmt.Errorf("connect.makeEnvelopePrefix: size %d out of bounds", size) + } + prefix := [5]byte{} + prefix[0] = flags + binary.BigEndian.PutUint32(prefix[1:5], uint32(size64)) + return prefix, nil +} diff --git a/vendor/connectrpc.com/connect/error.go b/vendor/connectrpc.com/connect/error.go new file mode 100644 index 000000000..f5d30f1d3 --- /dev/null +++ b/vendor/connectrpc.com/connect/error.go @@ -0,0 +1,500 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/url" + "os" + "strings" + "syscall" + "time" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +const ( + commonErrorsURL = "https://connectrpc.com/docs/go/common-errors" + defaultAnyResolverPrefix = "type.googleapis.com/" +) + +// Messages of the unexported net/http errors for a write to a stream the +// client has abandoned. +const ( + clientDisconnectedMessage = "client disconnected" + streamClosedMessage = "http2: stream closed" +) + +var ( + // errNotModified signals Connect-protocol responses to GET requests to use the + // 304 Not Modified HTTP error code. + errNotModified = errors.New("not modified") + // errNotModifiedClient wraps ErrNotModified for use client-side. + errNotModifiedClient = fmt.Errorf("HTTP 304: %w", errNotModified) +) + +// An ErrorDetail is a self-describing Protobuf message attached to an [*Error]. +// Error details are sent over the network to clients, which can then work with +// strongly-typed data rather than trying to parse a complex error message. For +// example, you might use details to send a localized error message or retry +// parameters to the client. +// +// The [google.golang.org/genproto/googleapis/rpc/errdetails] package contains a +// variety of Protobuf messages commonly used as error details. +type ErrorDetail struct { + pbAny *anypb.Any + pbInner proto.Message // if nil, must be extracted from pbAny + wireJSON string // preserve human-readable JSON +} + +// NewErrorDetail constructs a new error detail. If msg is an *[anypb.Any] then +// it is used as is. Otherwise, it is first marshalled into an *[anypb.Any] +// value. This returns an error if msg cannot be marshalled. +func NewErrorDetail(msg proto.Message) (*ErrorDetail, error) { + // If it's already an Any, don't wrap it inside another. + if pb, ok := msg.(*anypb.Any); ok { + return &ErrorDetail{pbAny: pb}, nil + } + pb, err := anypb.New(msg) + if err != nil { + return nil, err + } + return &ErrorDetail{pbAny: pb, pbInner: msg}, nil +} + +// Type is the fully-qualified name of the detail's Protobuf message (for +// example, acme.foo.v1.FooDetail). +func (d *ErrorDetail) Type() string { + // proto.Any tries to make messages self-describing by using type URLs rather + // than plain type names, but there aren't any descriptor registries + // deployed. With the current state of the `Any` code, it's not possible to + // build a useful type registry either. To hide this from users, we should + // trim the URL prefix is added to the type name. + // + // If we ever want to support remote registries, we can add an explicit + // `TypeURL` method. + return typeNameForURL(d.pbAny.GetTypeUrl()) +} + +// Bytes returns a copy of the Protobuf-serialized detail. +func (d *ErrorDetail) Bytes() []byte { + out := make([]byte, len(d.pbAny.GetValue())) + copy(out, d.pbAny.GetValue()) + return out +} + +// Value uses the Protobuf runtime's package-global registry to unmarshal the +// Detail into a strongly-typed message. Typically, clients use Go type +// assertions to cast from the proto.Message interface to concrete types. +func (d *ErrorDetail) Value() (proto.Message, error) { + if d.pbInner != nil { + // We clone it so that if the caller mutates the returned value, + // they don't inadvertently corrupt this error detail value. + return proto.Clone(d.pbInner), nil + } + return d.pbAny.UnmarshalNew() +} + +// An Error captures four key pieces of information: a [Code], an underlying Go +// error, a map of metadata, and an optional collection of arbitrary Protobuf +// messages called "details" (more on those below). Servers send the code, the +// underlying error's Error() output, the metadata, and details over the wire +// to clients. Remember that the underlying error's message will be sent to +// clients - take care not to leak sensitive information from public APIs! +// +// Service implementations and interceptors should return errors that can be +// cast to an [*Error] (using the standard library's [errors.As]). If the returned +// error can't be cast to an [*Error], connect will use [CodeUnknown] and the +// returned error's message. +// +// Error details are an optional mechanism for servers, interceptors, and +// proxies to attach arbitrary Protobuf messages to the error code and message. +// They're a clearer and more performant alternative to HTTP header +// microformats. See [the documentation on errors] for more details. +// +// [the documentation on errors]: https://connectrpc.com/docs/go/errors +type Error struct { + code Code + err error + details []*ErrorDetail + meta http.Header + wireErr bool +} + +// NewError annotates any Go error with a status code. +func NewError(c Code, underlying error) *Error { + return &Error{code: c, err: underlying} +} + +// NewWireError is similar to [NewError], but the resulting *Error returns true +// when tested with [IsWireError]. +// +// This is useful for clients trying to propagate partial failures from +// streaming RPCs. Often, these RPCs include error information in their +// response messages (for example, [gRPC server reflection] and +// OpenTelemetry's [OTLP]). Clients propagating these errors up the stack +// should use NewWireError to clarify that the error code, message, and details +// (if any) were explicitly sent by the server rather than inferred from a +// lower-level networking error or timeout. +// +// [gRPC server reflection]: https://github.com/grpc/grpc/blob/v1.49.2/src/proto/grpc/reflection/v1alpha/reflection.proto#L132-L136 +// [OTLP]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#partial-success +func NewWireError(c Code, underlying error) *Error { + err := NewError(c, underlying) + err.wireErr = true + return err +} + +// IsWireError checks whether the error was returned by the server, as opposed +// to being synthesized by the client. +// +// Clients may find this useful when deciding how to propagate errors. For +// example, an RPC-to-HTTP proxy might expose a server-sent CodeUnknown as an +// HTTP 500 but a client-synthesized CodeUnknown as a 503. +// +// Handlers will strip [Error.Meta] headers propagated from wire errors to avoid +// leaking response headers. To propagate headers recreate the error as a +// non-wire error. +func IsWireError(err error) bool { + connectErr, ok := asError(err) + return ok && connectErr.wireErr +} + +// NewNotModifiedError indicates that the requested resource hasn't changed. It +// should be used only when handlers wish to respond to conditional HTTP GET +// requests with a 304 Not Modified. In all other circumstances, including all +// RPCs using the gRPC or gRPC-Web protocols, it's equivalent to sending an +// error with [CodeUnknown]. The supplied headers should include Etag, +// Cache-Control, or any other headers required by [RFC 9110 § 15.4.5]. +// +// Clients should check for this error using [IsNotModifiedError]. +// +// [RFC 9110 § 15.4.5]: https://httpwg.org/specs/rfc9110.html#status.304 +func NewNotModifiedError(headers http.Header) *Error { + err := NewError(CodeUnknown, errNotModified) + if headers != nil { + err.meta = headers + } + return err +} + +func (e *Error) Error() string { + code := e.Code() + message := e.Message() + if message == "" { + return code.String() + } + return code.String() + ": " + message +} + +// Message returns the underlying error message. It may be empty if the +// original error was created with a status code and a nil error. +func (e *Error) Message() string { + if e != nil && e.err != nil { + return e.err.Error() + } + return "" +} + +// Unwrap allows [errors.Is] and [errors.As] access to the underlying error. +func (e *Error) Unwrap() error { + if e == nil { + return nil + } + return e.err +} + +// Code returns the error's status code. +func (e *Error) Code() Code { + if e == nil { + return CodeUnknown + } + return e.code +} + +// Details returns the error's details. +func (e *Error) Details() []*ErrorDetail { + return e.details +} + +// AddDetail appends to the error's details. +func (e *Error) AddDetail(d *ErrorDetail) { + e.details = append(e.details, d) +} + +// Meta allows the error to carry additional information as key-value pairs. +// +// Protocol-specific headers and trailers may be removed to avoid breaking +// protocol semantics. For example, Content-Length and Content-Type headers +// won't be propagated. See the documentation for each protocol for more +// datails. +// +// When clients receive errors, the metadata contains the union of the HTTP +// headers and the protocol-specific trailers (either HTTP trailers or in-body +// metadata). +func (e *Error) Meta() http.Header { + if e.meta == nil { + e.meta = make(http.Header) + } + return e.meta +} + +func (e *Error) detailsAsAny() []*anypb.Any { + anys := make([]*anypb.Any, 0, len(e.details)) + for _, detail := range e.details { + anys = append(anys, detail.pbAny) + } + return anys +} + +// IsNotModifiedError checks whether the supplied error indicates that the +// requested resource hasn't changed. It only returns true if the server used +// [NewNotModifiedError] in response to a Connect-protocol RPC made with an +// HTTP GET. +func IsNotModifiedError(err error) bool { + return errors.Is(err, errNotModified) +} + +// errorf calls fmt.Errorf with the supplied template and arguments, then wraps +// the resulting error. +func errorf(c Code, template string, args ...any) *Error { + return NewError(c, fmt.Errorf(template, args...)) +} + +// asError uses errors.As to unwrap any error and look for a non-nil connect *Error. +func asError(err error) (*Error, bool) { + var connectErr *Error + ok := errors.As(err, &connectErr) + return connectErr, ok && connectErr != nil // Protect against typed nils (*Error)(nil). +} + +// wrapIfUncoded ensures that all errors are wrapped. It leaves already-wrapped +// errors unchanged, uses wrapIfContextError to apply codes to context.Canceled +// and context.DeadlineExceeded, and falls back to wrapping other errors with +// CodeUnknown. +func wrapIfUncoded(err error) error { + if err == nil { + return nil + } + maybeCodedErr := wrapIfContextError(err) + if _, ok := asError(maybeCodedErr); ok { + return maybeCodedErr + } + return NewError(CodeUnknown, maybeCodedErr) +} + +// wrapIfContextError applies CodeCanceled or CodeDeadlineExceeded to Go's +// context.Canceled and context.DeadlineExceeded errors, but only if they +// haven't already been wrapped. +func wrapIfContextError(err error) error { + if err == nil { + return nil + } + if _, ok := asError(err); ok { + return err + } + if errors.Is(err, context.Canceled) { + return NewError(CodeCanceled, err) + } + if errors.Is(err, context.DeadlineExceeded) { + return NewError(CodeDeadlineExceeded, err) + } + // Ick, some dial errors can be returned as os.ErrDeadlineExceeded + // instead of context.DeadlineExceeded :( + // https://github.com/golang/go/issues/64449 + if errors.Is(err, os.ErrDeadlineExceeded) { + return NewError(CodeDeadlineExceeded, err) + } + // The request context is cancelled from a different goroutine than the one + // failing the write, so a write can fail while ctx.Err() is still nil. + // https://github.com/golang/go/issues/52183 + if isClientDisconnected(err) { + return NewError(CodeCanceled, err) + } + return err +} + +// isClientDisconnected reports whether err is a write failure caused by the +// client going away. HTTP/2 has its own errors for this, other transports +// surface the connection's error. +func isClientDisconnected(err error) bool { + if errors.Is(err, syscall.EPIPE) || errors.Is(err, syscall.ECONNRESET) { + return true + } + msg := err.Error() + return msg == clientDisconnectedMessage || msg == streamClosedMessage +} + +// wrapIfContextDone wraps errors with CodeCanceled or CodeDeadlineExceeded +// if the context is done. It leaves already-wrapped errors unchanged. +func wrapIfContextDone(ctx context.Context, err error) error { + if err == nil { + return nil + } + err = wrapIfContextError(err) + if _, ok := asError(err); ok { + return err + } + ctxErr := ctx.Err() + if errors.Is(ctxErr, context.Canceled) { + return NewError(CodeCanceled, err) + } else if errors.Is(ctxErr, context.DeadlineExceeded) { + return NewError(CodeDeadlineExceeded, err) + } + return err +} + +// wrapIfLikelyH2CNotConfiguredError adds a wrapping error that has a message +// telling the caller that they likely need to use h2c but are using a raw http.Client{}. +// +// This happens when running a gRPC-only server. +// This is fragile and may break over time, and this should be considered a best-effort. +func wrapIfLikelyH2CNotConfiguredError(request *http.Request, err error) error { + if err == nil { + return nil + } + if _, ok := asError(err); ok { + return err + } + if url := request.URL; url != nil && url.Scheme != "http" { + // If the scheme is not http, we definitely do not have an h2c error, so just return. + return err + } + // net/http code has been investigated and there is no typing of any of these errors + // they are all created with fmt.Errorf + // grpc-go returns the first error 2/3-3/4 of the time, and the second error 1/4-1/3 of the time + if errString := err.Error(); strings.HasPrefix(errString, `Post "`) && + (strings.Contains(errString, `net/http: HTTP/1.x transport connection broken: malformed HTTP response`) || + strings.HasSuffix(errString, `write: broken pipe`)) { + return fmt.Errorf("possible h2c configuration issue when talking to gRPC server, see %s: %w", commonErrorsURL, err) + } + return err +} + +// wrapIfLikelyWithGRPCNotUsedError adds a wrapping error that has a message +// telling the caller that they likely forgot to use connect.WithGRPC(). +// +// This happens when running a gRPC-only server. +// This is fragile and may break over time, and this should be considered a best-effort. +func wrapIfLikelyWithGRPCNotUsedError(err error) error { + if err == nil { + return nil + } + if _, ok := asError(err); ok { + return err + } + // golang.org/x/net code has been investigated and there is no typing of this error + // it is created with fmt.Errorf + // http2/transport.go:573: return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) + if errString := err.Error(); strings.HasPrefix(errString, `Post "`) && + strings.Contains(errString, `http2: Transport: cannot retry err`) && + strings.HasSuffix(errString, `after Request.Body was written; define Request.GetBody to avoid this error`) { + return fmt.Errorf("possible missing connect.WithGRPC() client option when talking to gRPC server, see %s: %w", commonErrorsURL, err) + } + return err +} + +// HTTP/2 has its own set of error codes, which it sends in RST_STREAM frames. +// When the server sends one of these errors, we should map it back into our +// RPC error codes following +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#http2-transport-mapping. +// +// This would be vastly simpler if we were using x/net/http2 directly, since +// the StreamError type is exported. When x/net/http2 gets vendored into +// net/http, though, all these types become unexported...so we're left with +// string munging. +func wrapIfRSTError(ctx context.Context, err error) error { + const ( + streamErrPrefix = "stream error: " + fromPeerSuffix = "; received from peer" + ) + if err == nil { + return nil + } + if _, ok := asError(err); ok { + return err + } + if urlErr := new(url.Error); errors.As(err, &urlErr) { + // If we get an RST_STREAM error from http.Client.Do, it's wrapped in a + // *url.Error. + err = urlErr.Unwrap() + } + msg := err.Error() + if !strings.HasPrefix(msg, streamErrPrefix) { + return err + } + if !strings.HasSuffix(msg, fromPeerSuffix) { + return err + } + msg = strings.TrimSuffix(msg, fromPeerSuffix) + i := strings.LastIndex(msg, ";") + if i < 0 || i >= len(msg)-1 { + return err + } + msg = msg[i+1:] + msg = strings.TrimSpace(msg) + switch msg { + case "NO_ERROR", "PROTOCOL_ERROR", "INTERNAL_ERROR", "FLOW_CONTROL_ERROR", + "SETTINGS_TIMEOUT", "FRAME_SIZE_ERROR", "COMPRESSION_ERROR", "CONNECT_ERROR": + return NewError(CodeInternal, err) + case "REFUSED_STREAM": + return NewError(CodeUnavailable, err) + case "CANCEL": + if deadline, ok := ctx.Deadline(); ok && time.Now().After(deadline) { + // Some server implementations will cancel the HTTP/2 stream with + // a RST_STREAM frame when they observe that the client's deadline + // has elapsed. + // We don't inspect ctx.Err() because we could be racing with the + // timer goroutine that is setting it. But there is no race when + // directly inspecting the context's deadline. In fact, if we get + // here, we have likely already examined ctx.Err() in a prior call + // to wrapIfContextError but observed a nil error and then fell + // through to here. + return NewError(CodeDeadlineExceeded, err) + } + return NewError(CodeCanceled, err) + case "ENHANCE_YOUR_CALM": + return NewError(CodeResourceExhausted, fmt.Errorf("bandwidth exhausted: %w", err)) + case "INADEQUATE_SECURITY": + return NewError(CodePermissionDenied, fmt.Errorf("transport protocol insecure: %w", err)) + default: + return err + } +} + +// wrapIfMaxBytesError wraps errors returned reading from a http.MaxBytesHandler +// whose limit has been exceeded. +func wrapIfMaxBytesError(err error, tmpl string, args ...any) error { + if err == nil { + return nil + } + if _, ok := asError(err); ok { + return err + } + var maxBytesErr *http.MaxBytesError + if ok := errors.As(err, &maxBytesErr); !ok { + return err + } + prefix := fmt.Sprintf(tmpl, args...) + return errorf(CodeResourceExhausted, "%s: exceeded %d byte http.MaxBytesReader limit", prefix, maxBytesErr.Limit) +} + +func typeNameForURL(url string) string { + return url[strings.LastIndexByte(url, '/')+1:] +} diff --git a/vendor/connectrpc.com/connect/error_writer.go b/vendor/connectrpc.com/connect/error_writer.go new file mode 100644 index 000000000..92aeed660 --- /dev/null +++ b/vendor/connectrpc.com/connect/error_writer.go @@ -0,0 +1,179 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" +) + +// protocolType is one of the supported RPC protocols. +type protocolType uint8 + +const ( + unknownProtocol protocolType = iota + connectUnaryProtocol + connectStreamProtocol + grpcProtocol + grpcWebProtocol +) + +// An ErrorWriter writes errors to an [http.ResponseWriter] in the format +// expected by an RPC client. This is especially useful in server-side net/http +// middleware, where you may wish to handle requests from RPC and non-RPC +// clients with the same code. +// +// ErrorWriters are safe to use concurrently. +type ErrorWriter struct { + bufferPool *bufferPool + protobuf Codec + requireConnectProtocolHeader bool +} + +// NewErrorWriter constructs an ErrorWriter. Handler options may be passed to +// configure the error writer behaviour to match the handlers. +// [WithRequireConnectProtocolHeader] will assert that Connect protocol +// requests include the version header allowing the error writer to correctly +// classify the request. +// Options supplied via [WithConditionalHandlerOptions] are ignored. +func NewErrorWriter(opts ...HandlerOption) *ErrorWriter { + config := newHandlerConfig("", StreamTypeUnary, opts) + codecs := newReadOnlyCodecs(config.Codecs) + return &ErrorWriter{ + bufferPool: config.BufferPool, + protobuf: codecs.Protobuf(), + requireConnectProtocolHeader: config.RequireConnectProtocolHeader, + } +} + +func (w *ErrorWriter) classifyRequest(request *http.Request) protocolType { + ctype := canonicalizeContentType(getHeaderCanonical(request.Header, headerContentType)) + isPost := request.Method == http.MethodPost + isGet := request.Method == http.MethodGet + switch { + case isPost && (ctype == grpcContentTypeDefault || strings.HasPrefix(ctype, grpcContentTypePrefix)): + return grpcProtocol + case isPost && (ctype == grpcWebContentTypeDefault || strings.HasPrefix(ctype, grpcWebContentTypePrefix)): + return grpcWebProtocol + case isPost && strings.HasPrefix(ctype, connectStreamingContentTypePrefix): + // Streaming ignores the requireConnectProtocolHeader option as the + // Content-Type is enough to determine the protocol. + if err := connectCheckProtocolVersion(request, false /* required */); err != nil { + return unknownProtocol + } + return connectStreamProtocol + case isPost && strings.HasPrefix(ctype, connectUnaryContentTypePrefix): + if err := connectCheckProtocolVersion(request, w.requireConnectProtocolHeader); err != nil { + return unknownProtocol + } + return connectUnaryProtocol + case isGet: + if err := connectCheckProtocolVersion(request, w.requireConnectProtocolHeader); err != nil { + return unknownProtocol + } + return connectUnaryProtocol + default: + return unknownProtocol + } +} + +// IsSupported checks whether a request is using one of the ErrorWriter's +// supported RPC protocols. +func (w *ErrorWriter) IsSupported(request *http.Request) bool { + return w.classifyRequest(request) != unknownProtocol +} + +// Write an error, using the format appropriate for the RPC protocol in use. +// Callers should first use IsSupported to verify that the request is using one +// of the ErrorWriter's supported RPC protocols. If the protocol is unknown, +// Write will send the error as unprefixed, Connect-formatted JSON. +// +// Write does not read or close the request body. +func (w *ErrorWriter) Write(response http.ResponseWriter, request *http.Request, err error) error { + ctype := canonicalizeContentType(getHeaderCanonical(request.Header, headerContentType)) + switch protocolType := w.classifyRequest(request); protocolType { + case connectStreamProtocol: + setHeaderCanonical(response.Header(), headerContentType, ctype) + return w.writeConnectStreaming(response, err) + case grpcProtocol: + setHeaderCanonical(response.Header(), headerContentType, ctype) + return w.writeGRPC(response, err) + case grpcWebProtocol: + setHeaderCanonical(response.Header(), headerContentType, ctype) + return w.writeGRPCWeb(response, err) + case unknownProtocol, connectUnaryProtocol: + fallthrough + default: + // Unary errors are always JSON. Unknown protocols are treated as unary + // because they are likely to be Connect clients and will still be able to + // parse the error as it's in a human-readable format. + setHeaderCanonical(response.Header(), headerContentType, connectUnaryContentTypeJSON) + return w.writeConnectUnary(response, err) + } +} + +func (w *ErrorWriter) writeConnectUnary(response http.ResponseWriter, err error) error { + if connectErr, ok := asError(err); ok && !connectErr.wireErr { + mergeNonProtocolHeaders(response.Header(), connectErr.meta) + } + response.WriteHeader(connectCodeToHTTP(CodeOf(err))) + data, marshalErr := json.Marshal(newConnectWireError(err)) + if marshalErr != nil { + return fmt.Errorf("marshal error: %w", marshalErr) + } + _, writeErr := response.Write(data) + return writeErr +} + +func (w *ErrorWriter) writeConnectStreaming(response http.ResponseWriter, err error) error { + response.WriteHeader(http.StatusOK) + marshaler := &connectStreamingMarshaler{ + envelopeWriter: envelopeWriter{ + sender: writeSender{writer: response}, + bufferPool: w.bufferPool, + }, + } + // MarshalEndStream returns *Error: check return value to avoid typed nils. + if marshalErr := marshaler.MarshalEndStream(err, make(http.Header)); marshalErr != nil { + return marshalErr + } + return nil +} + +func (w *ErrorWriter) writeGRPC(response http.ResponseWriter, err error) error { + trailers := make(http.Header, 2) // need space for at least code & message + grpcErrorToTrailer(trailers, w.protobuf, err) + // To make net/http reliably send trailers without a body, we must set the + // Trailers header rather than using http.TrailerPrefix. See + // https://github.com/golang/go/issues/54723. + keys := make([]string, 0, len(trailers)) + for k := range trailers { + keys = append(keys, k) + } + setHeaderCanonical(response.Header(), headerTrailer, strings.Join(keys, ",")) + response.WriteHeader(http.StatusOK) + mergeHeaders(response.Header(), trailers) + return nil +} + +func (w *ErrorWriter) writeGRPCWeb(response http.ResponseWriter, err error) error { + // This is a trailers-only response. To match the behavior of Envoy and + // protocol_grpc.go, put the trailers in the HTTP headers. + grpcErrorToTrailer(response.Header(), w.protobuf, err) + response.WriteHeader(http.StatusOK) + return nil +} diff --git a/vendor/connectrpc.com/connect/handler.go b/vendor/connectrpc.com/connect/handler.go new file mode 100644 index 000000000..1e9cfa3c5 --- /dev/null +++ b/vendor/connectrpc.com/connect/handler.go @@ -0,0 +1,443 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "net/http" +) + +// A Handler is the server-side implementation of a single RPC defined by a +// service schema. +// +// By default, Handlers support the Connect, gRPC, and gRPC-Web protocols with +// the binary Protobuf and JSON codecs. They support gzip compression using the +// standard library's [compress/gzip]. +type Handler struct { + spec Spec + implementation StreamingHandlerFunc + requestGates []RequestGateFunc + protocolHandlers map[string][]protocolHandler // Method to protocol handlers + allowMethod string // Allow header + acceptPost string // Accept-Post header +} + +// NewUnaryHandler constructs a [Handler] for a request-response procedure. +func NewUnaryHandler[Req, Res any]( + procedure string, + unary func(context.Context, *Request[Req]) (*Response[Res], error), + options ...HandlerOption, +) *Handler { + // Wrap the strongly-typed implementation so we can apply interceptors. + untyped := UnaryFunc(func(ctx context.Context, request AnyRequest) (AnyResponse, error) { + if err := ctx.Err(); err != nil { + return nil, err + } + typed, ok := request.(*Request[Req]) + if !ok { + return nil, errorf(CodeInternal, "unexpected handler request type %T", request) + } + res, err := unary(ctx, typed) + if res == nil && err == nil { + // This is going to panic during serialization. Debugging is much easier + // if we panic here instead, so we can include the procedure name. + panic(procedure + " returned nil *connect.Response and nil error") //nolint: forbidigo + } + if res == nil { + // Avoid returning a typed nil (*Response[Res]) as an AnyResponse interface value. + return nil, err + } + return res, err + }) + config := newHandlerConfig(procedure, StreamTypeUnary, options) + if interceptor := config.Interceptor; interceptor != nil { + untyped = interceptor.WrapUnary(untyped) + } + // Given a stream, how should we call the unary function? + implementation := func(ctx context.Context, conn StreamingHandlerConn) error { + request, err := receiveUnaryRequest[Req](conn, config.Initializer) + if err != nil { + return err + } + // Add the request header to the context, and store the response header + // and trailer to propagate back to the caller. + info := &handlerCallInfo{ + peer: request.Peer(), + spec: request.Spec(), + method: request.HTTPMethod(), + requestHeader: request.Header(), + } + ctx = newHandlerContext(ctx, info) + response, err := untyped(ctx, request) + // Add response headers/trailers from the context callinfo into the conn if they exist + if info.responseHeader != nil { + mergeNonProtocolHeaders(conn.ResponseHeader(), info.responseHeader) + } + if info.responseTrailer != nil { + mergeNonProtocolHeaders(conn.ResponseTrailer(), info.responseTrailer) + } + if err != nil { + return err + } + + // Add response headers/trailers from the response into the conn if they exist + if len(response.Header()) != 0 { + mergeNonProtocolHeaders(conn.ResponseHeader(), response.Header()) + } + if len(response.Trailer()) != 0 { + mergeNonProtocolHeaders(conn.ResponseTrailer(), response.Trailer()) + } + return conn.Send(response.Any()) + } + + protocolHandlers := config.newProtocolHandlers() + return &Handler{ + spec: config.newSpec(), + implementation: implementation, + requestGates: config.RequestGates, + protocolHandlers: mappedMethodHandlers(protocolHandlers), + allowMethod: sortedAllowMethodValue(protocolHandlers), + acceptPost: sortedAcceptPostValue(protocolHandlers), + } +} + +// NewUnaryHandlerSimple constructs a [Handler] for a request-response procedure using the +// function signature associated with the "simple" generation option. +// +// This option eliminates the [Request] and [Response] wrappers, and instead uses the +// context.Context to propagate information such as headers. +func NewUnaryHandlerSimple[Req, Res any]( + procedure string, + unary func(context.Context, *Req) (*Res, error), + options ...HandlerOption, +) *Handler { + return NewUnaryHandler( + procedure, + func(ctx context.Context, request *Request[Req]) (*Response[Res], error) { + responseMsg, err := unary(ctx, request.Msg) + if err != nil { + return nil, err + } + return NewResponse(responseMsg), nil + }, + options..., + ) +} + +// NewClientStreamHandler constructs a [Handler] for a client streaming procedure. +func NewClientStreamHandler[Req, Res any]( + procedure string, + implementation func(context.Context, *ClientStream[Req]) (*Response[Res], error), + options ...HandlerOption, +) *Handler { + config := newHandlerConfig(procedure, StreamTypeClient, options) + return newStreamHandler( + config, + func(ctx context.Context, conn StreamingHandlerConn) error { + stream := &ClientStream[Req]{ + conn: conn, + initializer: config.Initializer, + } + ctx = newHandlerContext(ctx, &streamingHandlerCallInfo{ + conn: conn, + }) + res, err := implementation(ctx, stream) + if err != nil { + return err + } + if res == nil { + // This is going to panic during serialization. Debugging is much easier + // if we panic here instead, so we can include the procedure name. + panic(procedure + " returned nil *connect.Response and nil error") //nolint: forbidigo + } + mergeHeaders(conn.ResponseHeader(), res.header) + mergeHeaders(conn.ResponseTrailer(), res.trailer) + return conn.Send(res.Msg) + }, + ) +} + +// NewClientStreamHandlerSimple constructs a [Handler] for a request-streaming procedure +// using the function signature associated with the "simple" generation option. +// +// This option eliminates the [Response] wrapper, and instead uses the context.Context +// to propagate information such as headers. +func NewClientStreamHandlerSimple[Req, Res any]( + procedure string, + implementation func(context.Context, *ClientStream[Req]) (*Res, error), + options ...HandlerOption, +) *Handler { + return NewClientStreamHandler( + procedure, + func(ctx context.Context, stream *ClientStream[Req]) (*Response[Res], error) { + responseMsg, err := implementation(ctx, stream) + if err != nil { + return nil, err + } + return NewResponse(responseMsg), nil + }, + options..., + ) +} + +// NewServerStreamHandler constructs a [Handler] for a server streaming procedure. +func NewServerStreamHandler[Req, Res any]( + procedure string, + implementation func(context.Context, *Request[Req], *ServerStream[Res]) error, + options ...HandlerOption, +) *Handler { + config := newHandlerConfig(procedure, StreamTypeServer, options) + return newStreamHandler( + config, + func(ctx context.Context, conn StreamingHandlerConn) error { + req, err := receiveUnaryRequest[Req](conn, config.Initializer) + if err != nil { + return err + } + ctx = newHandlerContext(ctx, &streamingHandlerCallInfo{ + conn: conn, + }) + return implementation(ctx, req, &ServerStream[Res]{conn: conn}) + }, + ) +} + +// NewServerStreamHandlerSimple constructs a [Handler] a server streaming procedure using the function +// signature associated with the "simple" generation option. +// +// This option eliminates the [Request] wrapper, and instead uses the context.Context to +// propagate information such as headers. +func NewServerStreamHandlerSimple[Req, Res any]( + procedure string, + implementation func(context.Context, *Req, *ServerStream[Res]) error, + options ...HandlerOption, +) *Handler { + return NewServerStreamHandler( + procedure, + func(ctx context.Context, request *Request[Req], serverStream *ServerStream[Res]) error { + return implementation(ctx, request.Msg, serverStream) + }, + options..., + ) +} + +// NewBidiStreamHandler constructs a [Handler] for a bidirectional streaming procedure. +func NewBidiStreamHandler[Req, Res any]( + procedure string, + implementation func(context.Context, *BidiStream[Req, Res]) error, + options ...HandlerOption, +) *Handler { + config := newHandlerConfig(procedure, StreamTypeBidi, options) + return newStreamHandler( + config, + func(ctx context.Context, conn StreamingHandlerConn) error { + ctx = newHandlerContext(ctx, &streamingHandlerCallInfo{ + conn: conn, + }) + return implementation( + ctx, + &BidiStream[Req, Res]{ + conn: conn, + initializer: config.Initializer, + }, + ) + }, + ) +} + +// ServeHTTP implements [http.Handler]. +func (h *Handler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { + // We don't need to defer functions to close the request body or read to + // EOF: the stream we construct later on already does that, and we only + // return early when dealing with misbehaving clients. In those cases, it's + // okay if we can't re-use the connection. + isBidi := (h.spec.StreamType & StreamTypeBidi) == StreamTypeBidi + if isBidi && request.ProtoMajor < 2 { + // Clients coded to expect full-duplex connections may hang if they've + // mistakenly negotiated HTTP/1.1. To unblock them, we must close the + // underlying TCP connection. + responseWriter.Header().Set("Connection", "close") + responseWriter.WriteHeader(http.StatusHTTPVersionNotSupported) + return + } + + protocolHandlers := h.protocolHandlers[request.Method] + if len(protocolHandlers) == 0 { + responseWriter.Header().Set("Allow", h.allowMethod) + responseWriter.WriteHeader(http.StatusMethodNotAllowed) + return + } + + contentType := canonicalizeContentType(getHeaderCanonical(request.Header, headerContentType)) + + // Find our implementation of the RPC protocol in use. + var protocolHandler protocolHandler + for _, handler := range protocolHandlers { + if handler.CanHandlePayload(request, contentType) { + protocolHandler = handler + break + } + } + if protocolHandler == nil { + responseWriter.Header().Set("Accept-Post", h.acceptPost) + responseWriter.WriteHeader(http.StatusUnsupportedMediaType) + return + } + + if request.Method == http.MethodGet { + // A body must not be present. + hasBody := request.ContentLength > 0 + if request.ContentLength < 0 { + // No content-length header. + // Test if body is empty by trying to read a single byte. + var b [1]byte + n, _ := request.Body.Read(b[:]) + hasBody = n > 0 + } + if hasBody { + responseWriter.WriteHeader(http.StatusUnsupportedMediaType) + return + } + _ = request.Body.Close() + } + + // Establish a stream and serve the RPC. + setHeaderCanonical(request.Header, headerContentType, contentType) + setHeaderCanonical(request.Header, headerHost, request.Host) + ctx, cancel, timeoutErr := protocolHandler.SetTimeout(request) //nolint: contextcheck + if timeoutErr != nil { + ctx = request.Context() + } + if cancel != nil { + defer cancel() + } + connCloser, ok := protocolHandler.NewConn( + responseWriter, + request.WithContext(ctx), + ) + if !ok { + // Failed to create stream, usually because client used an unknown + // compression algorithm. Nothing further to do. + return + } + if timeoutErr != nil { + _ = connCloser.Close(timeoutErr) + return + } + // Gates run before the implementation, so before the interceptor chain and + // before any message is received. + for _, gate := range h.requestGates { + gateCtx, err := gate(ctx, h.spec, connCloser.Peer(), connCloser.RequestHeader()) + if err != nil { + _ = connCloser.Close(err) + return + } + if gateCtx != nil { + ctx = gateCtx //nolint:fatcontext // Chaining is intended: each gate sees the previous gate's context. + } + } + _ = connCloser.Close(h.implementation(ctx, connCloser)) +} + +type handlerConfig struct { + CompressionPools map[string]*compressionPool + CompressionNames []string + Codecs map[string]Codec + CompressMinBytes int + Interceptor Interceptor + Procedure string + Schema any + Initializer maybeInitializer + RequireConnectProtocolHeader bool + IdempotencyLevel IdempotencyLevel + BufferPool *bufferPool + ReadMaxBytes int + SendMaxBytes int + StreamType StreamType + RequestGates []RequestGateFunc +} + +func newHandlerConfig(procedure string, streamType StreamType, options []HandlerOption) *handlerConfig { + protoPath := extractProtoPath(procedure) + config := handlerConfig{ + Procedure: protoPath, + CompressionPools: make(map[string]*compressionPool), + Codecs: make(map[string]Codec), + BufferPool: newBufferPool(), + StreamType: streamType, + } + withProtoBinaryCodec().applyToHandler(&config) + withProtoJSONCodecs().applyToHandler(&config) + withGzip().applyToHandler(&config) + for _, opt := range options { + opt.applyToHandler(&config) + } + return &config +} + +func (c *handlerConfig) newSpec() Spec { + return Spec{ + Procedure: c.Procedure, + Schema: c.Schema, + StreamType: c.StreamType, + IdempotencyLevel: c.IdempotencyLevel, + } +} + +func (c *handlerConfig) newProtocolHandlers() []protocolHandler { + protocols := []protocol{ + &protocolConnect{}, + &protocolGRPC{web: false}, + &protocolGRPC{web: true}, + } + handlers := make([]protocolHandler, 0, len(protocols)) + codecs := newReadOnlyCodecs(c.Codecs) + compressors := newReadOnlyCompressionPools( + c.CompressionPools, + c.CompressionNames, + ) + for _, protocol := range protocols { + handlers = append(handlers, protocol.NewHandler(&protocolHandlerParams{ + Spec: c.newSpec(), + Codecs: codecs, + CompressionPools: compressors, + CompressMinBytes: c.CompressMinBytes, + BufferPool: c.BufferPool, + ReadMaxBytes: c.ReadMaxBytes, + SendMaxBytes: c.SendMaxBytes, + RequireConnectProtocolHeader: c.RequireConnectProtocolHeader, + IdempotencyLevel: c.IdempotencyLevel, + })) + } + return handlers +} + +func newStreamHandler( + config *handlerConfig, + implementation StreamingHandlerFunc, +) *Handler { + if ic := config.Interceptor; ic != nil { + implementation = ic.WrapStreamingHandler(implementation) + } + protocolHandlers := config.newProtocolHandlers() + return &Handler{ + spec: config.newSpec(), + implementation: implementation, + requestGates: config.RequestGates, + protocolHandlers: mappedMethodHandlers(protocolHandlers), + allowMethod: sortedAllowMethodValue(protocolHandlers), + acceptPost: sortedAcceptPostValue(protocolHandlers), + } +} diff --git a/vendor/connectrpc.com/connect/handler_stream.go b/vendor/connectrpc.com/connect/handler_stream.go new file mode 100644 index 000000000..9fe9e20bd --- /dev/null +++ b/vendor/connectrpc.com/connect/handler_stream.go @@ -0,0 +1,205 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "errors" + "io" + "net/http" +) + +// ClientStream is the handler's view of a client streaming RPC. +// +// It's constructed as part of [Handler] invocation, but doesn't currently have +// an exported constructor. +// +// Receive is not safe to call concurrently. +type ClientStream[Req any] struct { + conn StreamingHandlerConn + initializer maybeInitializer + msg *Req + err error +} + +// Spec returns the specification for the RPC. +func (c *ClientStream[_]) Spec() Spec { + return c.conn.Spec() +} + +// Peer describes the client for this RPC. +func (c *ClientStream[_]) Peer() Peer { + return c.conn.Peer() +} + +// RequestHeader returns the headers received from the client. +func (c *ClientStream[Req]) RequestHeader() http.Header { + return c.conn.RequestHeader() +} + +// Receive advances the stream to the next message, which will then be +// available through the Msg method. It returns false when the stream stops, +// either by reaching the end or by encountering an unexpected error. After +// Receive returns false, the Err method will return any unexpected error +// encountered. +func (c *ClientStream[Req]) Receive() bool { + if c.err != nil { + return false + } + c.msg = new(Req) + if err := c.initializer.maybe(c.Spec(), c.msg); err != nil { + c.err = err + return false + } + c.err = c.conn.Receive(c.msg) + return c.err == nil +} + +// Msg returns the most recent message unmarshaled by a call to Receive. +func (c *ClientStream[Req]) Msg() *Req { + if c.msg == nil { + c.msg = new(Req) + } + return c.msg +} + +// Err returns the first non-EOF error that was encountered by Receive. +func (c *ClientStream[Req]) Err() error { + if c.err == nil || errors.Is(c.err, io.EOF) { + return nil + } + return c.err +} + +// Conn exposes the underlying StreamingHandlerConn. This may be useful if +// you'd prefer to wrap the connection in a different high-level API. +func (c *ClientStream[Req]) Conn() StreamingHandlerConn { + return c.conn +} + +// ServerStream is the handler's view of a server streaming RPC. +// +// It's constructed as part of [Handler] invocation, but doesn't currently have +// an exported constructor. +// +// Send is not safe to call concurrently. +type ServerStream[Res any] struct { + conn StreamingHandlerConn +} + +// ResponseHeader returns the response headers. Headers are sent with the first +// call to Send. +// +// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols. Applications shouldn't write them. +func (s *ServerStream[Res]) ResponseHeader() http.Header { + return s.conn.ResponseHeader() +} + +// ResponseTrailer returns the response trailers. Handlers may write to the +// response trailers at any time before returning. +// +// Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols. Applications shouldn't write them. +func (s *ServerStream[Res]) ResponseTrailer() http.Header { + return s.conn.ResponseTrailer() +} + +// Send a message to the client. The first call to Send also sends the response +// headers. +func (s *ServerStream[Res]) Send(msg *Res) error { + if msg == nil { + return s.conn.Send(nil) + } + return s.conn.Send(msg) +} + +// Conn exposes the underlying StreamingHandlerConn. This may be useful if +// you'd prefer to wrap the connection in a different high-level API. +func (s *ServerStream[Res]) Conn() StreamingHandlerConn { + return s.conn +} + +// BidiStream is the handler's view of a bidirectional streaming RPC. +// +// It's constructed as part of [Handler] invocation, but doesn't currently have +// an exported constructor. +// +// Send and Receive may be called from separate goroutines concurrently, but +// neither may be called concurrently with itself. +type BidiStream[Req, Res any] struct { + conn StreamingHandlerConn + initializer maybeInitializer +} + +// Spec returns the specification for the RPC. +func (b *BidiStream[_, _]) Spec() Spec { + return b.conn.Spec() +} + +// Peer describes the client for this RPC. +func (b *BidiStream[_, _]) Peer() Peer { + return b.conn.Peer() +} + +// RequestHeader returns the headers received from the client. +func (b *BidiStream[Req, Res]) RequestHeader() http.Header { + return b.conn.RequestHeader() +} + +// Receive a message. When the client is done sending messages, Receive will +// return an error that wraps [io.EOF]. +func (b *BidiStream[Req, Res]) Receive() (*Req, error) { + var req Req + if err := b.initializer.maybe(b.Spec(), &req); err != nil { + return nil, err + } + if err := b.conn.Receive(&req); err != nil { + return nil, err + } + return &req, nil +} + +// ResponseHeader returns the response headers. Headers are sent with the first +// call to Send. +// +// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols. Applications shouldn't write them. +func (b *BidiStream[Req, Res]) ResponseHeader() http.Header { + return b.conn.ResponseHeader() +} + +// ResponseTrailer returns the response trailers. Handlers may write to the +// response trailers at any time before returning. +// +// Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the +// Connect and gRPC protocols. Applications shouldn't write them. +func (b *BidiStream[Req, Res]) ResponseTrailer() http.Header { + return b.conn.ResponseTrailer() +} + +// Send a message to the client. The first call to Send also sends the response +// headers. +func (b *BidiStream[Req, Res]) Send(msg *Res) error { + if msg == nil { + return b.conn.Send(nil) + } + return b.conn.Send(msg) +} + +// Conn exposes the underlying StreamingHandlerConn. This may be useful if +// you'd prefer to wrap the connection in a different high-level API. +func (b *BidiStream[Req, Res]) Conn() StreamingHandlerConn { + return b.conn +} diff --git a/vendor/connectrpc.com/connect/header.go b/vendor/connectrpc.com/connect/header.go new file mode 100644 index 000000000..35dbcebc8 --- /dev/null +++ b/vendor/connectrpc.com/connect/header.go @@ -0,0 +1,141 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "encoding/base64" + "net/http" +) + +//nolint:gochecknoglobals +var protocolHeaders = map[string]struct{}{ + // HTTP headers. + headerContentType: {}, + headerContentLength: {}, + headerContentEncoding: {}, + headerHost: {}, + headerUserAgent: {}, + headerTrailer: {}, + headerDate: {}, + // Connect headers. + connectUnaryHeaderAcceptCompression: {}, + connectUnaryTrailerPrefix: {}, + connectStreamingHeaderCompression: {}, + connectStreamingHeaderAcceptCompression: {}, + connectHeaderTimeout: {}, + connectHeaderProtocolVersion: {}, + // gRPC headers. + grpcHeaderCompression: {}, + grpcHeaderAcceptCompression: {}, + grpcHeaderTimeout: {}, + grpcHeaderStatus: {}, + grpcHeaderMessage: {}, + grpcHeaderDetails: {}, +} + +// EncodeBinaryHeader base64-encodes the data. It always emits unpadded values. +// +// In the Connect, gRPC, and gRPC-Web protocols, binary headers must have keys +// ending in "-Bin". +func EncodeBinaryHeader(data []byte) string { + // gRPC specification says that implementations should emit unpadded values. + return base64.RawStdEncoding.EncodeToString(data) +} + +// DecodeBinaryHeader base64-decodes the data. It can decode padded or unpadded +// values. Following usual HTTP semantics, multiple base64-encoded values may +// be joined with a comma. When receiving such comma-separated values, split +// them with [strings.Split] before calling DecodeBinaryHeader. +// +// Binary headers sent using the Connect, gRPC, and gRPC-Web protocols have +// keys ending in "-Bin". +func DecodeBinaryHeader(data string) ([]byte, error) { + if len(data)%4 != 0 { + // Data definitely isn't padded. + return base64.RawStdEncoding.DecodeString(data) + } + // Either the data was padded, or padding wasn't necessary. In both cases, + // the padding-aware decoder works. + return base64.StdEncoding.DecodeString(data) +} + +func mergeHeaders(into, from http.Header) { + for key, vals := range from { + if len(vals) == 0 { + // For response trailers, net/http will pre-populate entries + // with nil values based on the "Trailer" header. But if there + // are no actual values for those keys, we skip them. + continue + } + into[key] = append(into[key], vals...) + } +} + +// mergeNonProtocolHeaders merges headers excluding protocol headers defined in +// protocolHeaders. +func mergeNonProtocolHeaders(into, from http.Header) { + for key, vals := range from { + if len(vals) == 0 { + // For response trailers, net/http will pre-populate entries + // with nil values based on the "Trailer" header. But if there + // are no actual values for those keys, we skip them. + continue + } + if _, isProtocolHeader := protocolHeaders[key]; !isProtocolHeader { + into[key] = append(into[key], vals...) + } + } +} + +// getHeaderCanonical is a shortcut for Header.Get() which +// bypasses the CanonicalMIMEHeaderKey operation when we +// know the key is already in canonical form. +func getHeaderCanonical(h http.Header, key string) string { + if h == nil { + return "" + } + v := h[key] + if len(v) == 0 { + return "" + } + return v[0] +} + +// setUserAgentIfAbsent sets the User-Agent header to the given value, but +// only if the caller has not already provided one. We check for the key's +// presence rather than comparing getHeaderCanonical(...) to "" so that a +// caller can suppress the default entirely by explicitly setting a nil/empty +// slice of values or an empty value. +func setUserAgentIfAbsent(header http.Header, value string) { + // headerUserAgent is already in canonical form, so we can index the map + // directly and bypass the checks in Header.Get and Header.Set. + if _, ok := header[headerUserAgent]; !ok { + header[headerUserAgent] = []string{value} + } +} + +// setHeaderCanonical is a shortcut for Header.Set() which +// bypasses the CanonicalMIMEHeaderKey operation when we +// know the key is already in canonical form. +func setHeaderCanonical(h http.Header, key, value string) { + h[key] = []string{value} +} + +// delHeaderCanonical is a shortcut for Header.Del() which +// bypasses the CanonicalMIMEHeaderKey operation when we +// know the key is already in canonical form. +func delHeaderCanonical(h http.Header, key string) { + delete(h, key) +} diff --git a/vendor/connectrpc.com/connect/idempotency_level.go b/vendor/connectrpc.com/connect/idempotency_level.go new file mode 100644 index 000000000..316ef12a8 --- /dev/null +++ b/vendor/connectrpc.com/connect/idempotency_level.go @@ -0,0 +1,68 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import "fmt" + +// An IdempotencyLevel is a value that declares how "idempotent" an RPC is. This +// value can affect RPC behaviors, such as determining whether it is safe to +// retry a request, or what kinds of request modalities are allowed for a given +// procedure. +type IdempotencyLevel int + +// NOTE: For simplicity, these should be kept in sync with the values of the +// google.protobuf.MethodOptions.IdempotencyLevel enumeration. + +const ( + // IdempotencyUnknown is the default idempotency level. A procedure with + // this idempotency level may not be idempotent. This is appropriate for + // any kind of procedure. + IdempotencyUnknown IdempotencyLevel = 0 + + // IdempotencyNoSideEffects is the idempotency level that specifies that a + // given call has no side-effects. This is equivalent to [RFC 9110 § 9.2.1] + // "safe" methods in terms of semantics. This procedure should not mutate + // any state. This idempotency level is appropriate for queries, or anything + // that would be suitable for an HTTP GET request. In addition, due to the + // lack of side-effects, such a procedure would be suitable to retry and + // expect that the results will not be altered by preceding attempts. + // + // [RFC 9110 § 9.2.1]: https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.1 + IdempotencyNoSideEffects IdempotencyLevel = 1 + + // IdempotencyIdempotent is the idempotency level that specifies that a + // given call is "idempotent", such that multiple instances of the same + // request to this procedure would have the same side-effects as a single + // request. This is equivalent to [RFC 9110 § 9.2.2] "idempotent" methods. + // This level is a subset of the previous level. This idempotency level is + // appropriate for any procedure that is safe to retry multiple times + // and be guaranteed that the response and side-effects will not be altered + // as a result of multiple attempts, for example, entity deletion requests. + // + // [RFC 9110 § 9.2.2]: https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2 + IdempotencyIdempotent IdempotencyLevel = 2 +) + +func (i IdempotencyLevel) String() string { + switch i { + case IdempotencyUnknown: + return "idempotency_unknown" + case IdempotencyNoSideEffects: + return "no_side_effects" + case IdempotencyIdempotent: + return "idempotent" + } + return fmt.Sprintf("idempotency_%d", i) +} diff --git a/vendor/connectrpc.com/connect/interceptor.go b/vendor/connectrpc.com/connect/interceptor.go new file mode 100644 index 000000000..2d7c8090d --- /dev/null +++ b/vendor/connectrpc.com/connect/interceptor.go @@ -0,0 +1,141 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "errors" + "slices" +) + +var ( + // errNewClientContextProhibited signals that a new client context was created + // in an interceptor, which is prohibited. + errNewClientContextProhibited = errors.New("creating a new context in an interceptor is prohibited") +) + +// UnaryFunc is the generic signature of a unary RPC. Interceptors may wrap +// Funcs. +// +// The type of the request and response structs depend on the codec being used. +// When using Protobuf, request.Any() and response.Any() will always be +// [proto.Message] implementations. +// +// On return, response is non-nil if and only if err is nil. +type UnaryFunc func(context.Context, AnyRequest) (AnyResponse, error) + +// StreamingClientFunc is the generic signature of a streaming RPC from the client's +// perspective. Interceptors may wrap StreamingClientFuncs. +type StreamingClientFunc func(context.Context, Spec) StreamingClientConn + +// StreamingHandlerFunc is the generic signature of a streaming RPC from the +// handler's perspective. Interceptors may wrap StreamingHandlerFuncs. +type StreamingHandlerFunc func(context.Context, StreamingHandlerConn) error + +// An Interceptor adds logic to a generated handler or client, like the +// decorators or middleware you may have seen in other libraries. Interceptors +// may mutate requests and responses, handle errors, retry, recover from panics, +// emit logs and metrics, or do nearly anything else. +// +// The returned functions must be safe to call concurrently. +type Interceptor interface { + WrapUnary(UnaryFunc) UnaryFunc + WrapStreamingClient(StreamingClientFunc) StreamingClientFunc + WrapStreamingHandler(StreamingHandlerFunc) StreamingHandlerFunc +} + +// UnaryInterceptorFunc is a simple Interceptor implementation that only +// wraps unary RPCs. It has no effect on streaming RPCs. +type UnaryInterceptorFunc func(UnaryFunc) UnaryFunc + +// WrapUnary implements [Interceptor] by applying the interceptor function. +func (f UnaryInterceptorFunc) WrapUnary(next UnaryFunc) UnaryFunc { return f(next) } + +// WrapStreamingClient implements [Interceptor] with a no-op. +func (f UnaryInterceptorFunc) WrapStreamingClient(next StreamingClientFunc) StreamingClientFunc { + return next +} + +// WrapStreamingHandler implements [Interceptor] with a no-op. +func (f UnaryInterceptorFunc) WrapStreamingHandler(next StreamingHandlerFunc) StreamingHandlerFunc { + return next +} + +// A chain composes multiple interceptors into one. +type chain struct { + interceptors []Interceptor +} + +// newChain composes multiple interceptors into one. +func newChain(interceptors []Interceptor) *chain { + // We usually wrap in reverse order to have the first interceptor from + // the slice act first. Rather than doing this dance repeatedly, reverse the + // interceptor order now. + var chain chain + for _, interceptor := range slices.Backward(interceptors) { + if interceptor != nil { + chain.interceptors = append(chain.interceptors, interceptor) + } + } + return &chain +} + +func (c *chain) WrapUnary(next UnaryFunc) UnaryFunc { + for _, interceptor := range c.interceptors { + next = unaryThunk(next) + next = interceptor.WrapUnary(next) + } + return next +} + +func (c *chain) WrapStreamingClient(next StreamingClientFunc) StreamingClientFunc { + for _, interceptor := range c.interceptors { + next = streamingClientThunk(next) + next = interceptor.WrapStreamingClient(next) + } + return next +} + +func (c *chain) WrapStreamingHandler(next StreamingHandlerFunc) StreamingHandlerFunc { + for _, interceptor := range c.interceptors { + next = interceptor.WrapStreamingHandler(next) + } + return next +} + +func unaryThunk(next UnaryFunc) UnaryFunc { + return func(ctx context.Context, req AnyRequest) (AnyResponse, error) { + if err := checkSentinel(ctx); err != nil { + return nil, err + } + return next(ctx, req) + } +} + +func streamingClientThunk(next StreamingClientFunc) StreamingClientFunc { + return func(ctx context.Context, spec Spec) StreamingClientConn { + if err := checkSentinel(ctx); err != nil { + return newErrStreamingClientConn(err) + } + return next(ctx, spec) + } +} + +func checkSentinel(ctx context.Context) error { + if ctx.Value(clientCallInfoContextKey{}) != ctx.Value(sentinelContextKey{}) { + return errNewClientContextProhibited + } + return nil +} diff --git a/vendor/connectrpc.com/connect/internal/gen/connectext/grpc/status/v1/status.pb.go b/vendor/connectrpc.com/connect/internal/gen/connectext/grpc/status/v1/status.pb.go new file mode 100644 index 000000000..d7bf60def --- /dev/null +++ b/vendor/connectrpc.com/connect/internal/gen/connectext/grpc/status/v1/status.pb.go @@ -0,0 +1,165 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: connectext/grpc/status/v1/status.proto + +// This package is for internal use by Connect, and provides no backward +// compatibility guarantees whatsoever. + +package statusv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// See https://cloud.google.com/apis/design/errors. +// +// This struct must remain binary-compatible with +// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto. +type Status struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // a google.rpc.Code + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // developer-facing, English (localize in details or client-side) + Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Status) Reset() { + *x = Status{} + mi := &file_connectext_grpc_status_v1_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_connectext_grpc_status_v1_status_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_connectext_grpc_status_v1_status_proto_rawDescGZIP(), []int{0} +} + +func (x *Status) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Status) GetDetails() []*anypb.Any { + if x != nil { + return x.Details + } + return nil +} + +var File_connectext_grpc_status_v1_status_proto protoreflect.FileDescriptor + +const file_connectext_grpc_status_v1_status_proto_rawDesc = "" + + "\n" + + "&connectext/grpc/status/v1/status.proto\x12\x0egrpc.status.v1\x1a\x19google/protobuf/any.proto\"f\n" + + "\x06Status\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12.\n" + + "\adetails\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\adetailsB\xc3\x01\n" + + "\x12com.grpc.status.v1B\vStatusProtoP\x01ZFconnectrpc.com/connect/internal/gen/connectext/grpc/status/v1;statusv1\xa2\x02\x03GSX\xaa\x02\x0eGrpc.Status.V1\xca\x02\x0eGrpc\\Status\\V1\xe2\x02\x1aGrpc\\Status\\V1\\GPBMetadata\xea\x02\x10Grpc::Status::V1b\x06proto3" + +var ( + file_connectext_grpc_status_v1_status_proto_rawDescOnce sync.Once + file_connectext_grpc_status_v1_status_proto_rawDescData []byte +) + +func file_connectext_grpc_status_v1_status_proto_rawDescGZIP() []byte { + file_connectext_grpc_status_v1_status_proto_rawDescOnce.Do(func() { + file_connectext_grpc_status_v1_status_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_connectext_grpc_status_v1_status_proto_rawDesc), len(file_connectext_grpc_status_v1_status_proto_rawDesc))) + }) + return file_connectext_grpc_status_v1_status_proto_rawDescData +} + +var file_connectext_grpc_status_v1_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_connectext_grpc_status_v1_status_proto_goTypes = []any{ + (*Status)(nil), // 0: grpc.status.v1.Status + (*anypb.Any)(nil), // 1: google.protobuf.Any +} +var file_connectext_grpc_status_v1_status_proto_depIdxs = []int32{ + 1, // 0: grpc.status.v1.Status.details:type_name -> google.protobuf.Any + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_connectext_grpc_status_v1_status_proto_init() } +func file_connectext_grpc_status_v1_status_proto_init() { + if File_connectext_grpc_status_v1_status_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_connectext_grpc_status_v1_status_proto_rawDesc), len(file_connectext_grpc_status_v1_status_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_connectext_grpc_status_v1_status_proto_goTypes, + DependencyIndexes: file_connectext_grpc_status_v1_status_proto_depIdxs, + MessageInfos: file_connectext_grpc_status_v1_status_proto_msgTypes, + }.Build() + File_connectext_grpc_status_v1_status_proto = out.File + file_connectext_grpc_status_v1_status_proto_goTypes = nil + file_connectext_grpc_status_v1_status_proto_depIdxs = nil +} diff --git a/vendor/connectrpc.com/connect/option.go b/vendor/connectrpc.com/connect/option.go new file mode 100644 index 000000000..bbcc4d24d --- /dev/null +++ b/vendor/connectrpc.com/connect/option.go @@ -0,0 +1,688 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "compress/gzip" + "context" + "io" + "net/http" +) + +// A ClientOption configures a [Client]. +// +// In addition to any options grouped in the documentation below, remember that +// any [Option] is also a valid ClientOption. +type ClientOption interface { + applyToClient(*clientConfig) +} + +// WithAcceptCompression makes a compression algorithm available to a client. +// Clients ask servers to compress responses using any of the registered +// algorithms. The first registered algorithm is treated as the least +// preferred, and the last registered algorithm is the most preferred. +// +// It's safe to use this option liberally: servers will ignore any +// compression algorithms they don't support. To compress requests, pair this +// option with [WithSendCompression]. To remove support for a +// previously-registered compression algorithm, use WithAcceptCompression with +// nil decompressor and compressor constructors. +// +// Clients accept gzipped responses by default, using a compressor backed by the +// standard library's [gzip] package with the default compression level. Use +// [WithSendGzip] to compress requests with gzip. +// +// Calling WithAcceptCompression with an empty name is a no-op. +func WithAcceptCompression( + name string, + newDecompressor func() Decompressor, + newCompressor func() Compressor, +) ClientOption { + return &compressionOption{ + Name: name, + CompressionPool: newCompressionPool(newDecompressor, newCompressor), + } +} + +// WithClientOptions composes multiple ClientOptions into one. +func WithClientOptions(options ...ClientOption) ClientOption { + return &clientOptionsOption{options} +} + +// WithGRPC configures clients to use the HTTP/2 gRPC protocol. +func WithGRPC() ClientOption { + return &grpcOption{web: false} +} + +// WithGRPCWeb configures clients to use the gRPC-Web protocol. +func WithGRPCWeb() ClientOption { + return &grpcOption{web: true} +} + +// WithProtoJSON configures a client to send JSON-encoded data instead of +// binary Protobuf. It uses the standard Protobuf JSON mapping as implemented +// by [google.golang.org/protobuf/encoding/protojson]: fields are named using +// lowerCamelCase, zero values are omitted, missing required fields are errors, +// enums are emitted as strings, etc. +func WithProtoJSON() ClientOption { + return WithCodec(&protoJSONCodec{codecNameJSON}) +} + +// WithSendCompression configures the client to use the specified algorithm to +// compress request messages. If the algorithm has not been registered using +// [WithAcceptCompression], the client will return errors at runtime. +// +// Because some servers don't support compression, clients default to sending +// uncompressed requests. +func WithSendCompression(name string) ClientOption { + return &sendCompressionOption{Name: name} +} + +// WithSendGzip configures the client to gzip requests. Since clients have +// access to a gzip compressor by default, WithSendGzip doesn't require +// [WithSendCompression]. +// +// Some servers don't support gzip, so clients default to sending uncompressed +// requests. +func WithSendGzip() ClientOption { + return WithSendCompression(compressionGzip) +} + +// A HandlerOption configures a [Handler]. +// +// In addition to any options grouped in the documentation below, remember that +// any [Option] is also a HandlerOption. +type HandlerOption interface { + applyToHandler(*handlerConfig) +} + +// WithCompression configures handlers to support a compression algorithm. +// Clients may send messages compressed with that algorithm and/or request +// compressed responses. The [Compressor] and [Decompressor] produced by the +// supplied constructors must use the same algorithm. Internally, Connect pools +// compressors and decompressors. +// +// By default, handlers support gzip using the standard library's +// [compress/gzip] package at the default compression level. To remove support for +// a previously-registered compression algorithm, use WithCompression with nil +// decompressor and compressor constructors. +// +// Calling WithCompression with an empty name is a no-op. +func WithCompression( + name string, + newDecompressor func() Decompressor, + newCompressor func() Compressor, +) HandlerOption { + return &compressionOption{ + Name: name, + CompressionPool: newCompressionPool(newDecompressor, newCompressor), + } +} + +// WithHandlerOptions composes multiple HandlerOptions into one. +func WithHandlerOptions(options ...HandlerOption) HandlerOption { + return &handlerOptionsOption{options} +} + +// WithRecover adds an interceptor that recovers from panics. The supplied +// function receives the context, [Spec], request headers, and the recovered +// value (which may be nil). It must return an error to send back to the +// client. It may also log the panic, emit metrics, or execute other +// error-handling logic. Handler functions must be safe to call concurrently. +// +// To preserve compatibility with [net/http]'s semantics, this interceptor +// doesn't handle panics with [http.ErrAbortHandler]. +// +// By default, handlers don't recover from panics. Because the standard +// library's [http.Server] recovers from panics by default, this option isn't +// usually necessary to prevent crashes. Instead, it helps servers collect +// RPC-specific data during panics and send a more detailed error to +// clients. +func WithRecover(handle func(context.Context, Spec, http.Header, any) error) HandlerOption { + return WithInterceptors(&recoverHandlerInterceptor{handle: handle}) +} + +// A RequestGateFunc runs before an RPC reaches the interceptor chain and the +// handler. See [WithRequestGate]. +type RequestGateFunc func(ctx context.Context, spec Spec, peer Peer, header http.Header) (context.Context, error) + +// WithRequestGate registers a function that runs once the request headers are +// available, but before any message is received or decoded. +// +// If the gate returns an error, the RPC is rejected immediately. The error is +// sent to the client and neither the interceptor chain nor the handler runs. +// A gate may return a non-nil context to update the context. It must be derived +// from the passed context. +// +// Gates are ideal for authentication. Rejecting an unauthenticated call inside +// an [Interceptor] is inefficient because the request message has already been +// decoded. By using a gate, you avoid this cost. Because rejected RPCs never +// reach the interceptor chain, logging or metrics interceptors will not observe +// them. For even earlier rejection, use standard net/http middleware. +// +// Multiple WithRequestGate options accumulate and run in the order they were +// applied. Gates must be safe to call concurrently. Panics inside a gate are +// not recovered by [WithRecover], which only wraps interceptors and handlers. +// +// WithRequestGate panics if the provided gate is nil. +func WithRequestGate(gate RequestGateFunc) HandlerOption { + if gate == nil { + panic("connect: WithRequestGate called with nil gate") //nolint:forbidigo + } + return &requestGateOption{gate: gate} +} + +// WithRequireConnectProtocolHeader configures the Handler to require requests +// using the Connect RPC protocol to include the Connect-Protocol-Version +// header. This ensures that HTTP proxies and net/http middleware can easily +// identify valid Connect requests, even if they use a common Content-Type like +// application/json. However, it makes ad-hoc requests with tools like cURL +// more laborious. Streaming requests are not affected by this option. +// +// This option has no effect if the client uses the gRPC or gRPC-Web protocols. +func WithRequireConnectProtocolHeader() HandlerOption { + return &requireConnectProtocolHeaderOption{} +} + +// WithConditionalHandlerOptions allows procedures in the same service to have +// different configurations: for example, one procedure may need a much larger +// WithReadMaxBytes setting than the others. +// +// WithConditionalHandlerOptions takes a function which may inspect each +// procedure's Spec before deciding which options to apply. Returning a nil +// slice is safe. +func WithConditionalHandlerOptions(conditional func(spec Spec) []HandlerOption) HandlerOption { + return &conditionalHandlerOptions{conditional: conditional} +} + +// Option implements both [ClientOption] and [HandlerOption], so it can be +// applied both client-side and server-side. +type Option interface { + ClientOption + HandlerOption +} + +// WithSchema provides a parsed representation of the schema for an RPC to a +// client or handler. The supplied schema is exposed as [Spec].Schema. This +// option is typically added by generated code. +// +// For services using protobuf schemas, the supplied schema should be a +// [google.golang.org/protobuf/reflect/protoreflect.MethodDescriptor]. +func WithSchema(schema any) Option { + return &schemaOption{Schema: schema} +} + +// WithRequestInitializer provides a function that initializes a new message. +// It may be used to dynamically construct request messages. It is called on +// server receives to construct the message to be unmarshaled into. The message +// will be a non nil pointer to the type created by the handler. Use the Schema +// field of the [Spec] to determine the type of the message. +func WithRequestInitializer(initializer func(spec Spec, message any) error) HandlerOption { + return &initializerOption{Initializer: initializer} +} + +// WithResponseInitializer provides a function that initializes a new message. +// It may be used to dynamically construct response messages. It is called on +// client receives to construct the message to be unmarshaled into. The message +// will be a non nil pointer to the type created by the client. Use the Schema +// field of the [Spec] to determine the type of the message. +func WithResponseInitializer(initializer func(spec Spec, message any) error) ClientOption { + return &initializerOption{Initializer: initializer} +} + +// WithCodec registers a serialization method with a client or handler. +// Handlers may have multiple codecs registered, and use whichever the client +// chooses. Clients may only have a single codec. +// +// By default, handlers and clients support binary Protocol Buffer data using +// [google.golang.org/protobuf/proto]. Handlers also support JSON by default, +// using the standard Protobuf JSON mapping. Users with more specialized needs +// may override the default codecs by registering a new codec under the "proto" +// or "json" names. When supplying a custom "proto" codec, keep in mind that +// some unexported, protocol-specific messages are serialized using Protobuf - +// take care to fall back to the standard Protobuf implementation if +// necessary. +// +// Registering a codec with an empty name is a no-op. +func WithCodec(codec Codec) Option { + return &codecOption{Codec: codec} +} + +// WithCompressMinBytes sets a minimum size threshold for compression: +// regardless of compressor configuration, messages smaller than the configured +// minimum are sent uncompressed. +// +// The default minimum is zero. Setting a minimum compression threshold may +// improve overall performance, because the CPU cost of compressing very small +// messages usually isn't worth the small reduction in network I/O. +func WithCompressMinBytes(minBytes int) Option { + return &compressMinBytesOption{Min: minBytes} +} + +// WithReadMaxBytes limits the performance impact of pathologically large +// messages sent by the other party. For handlers, WithReadMaxBytes limits the size +// of a message that the client can send. For clients, WithReadMaxBytes limits the +// size of a message that the server can respond with. Limits apply to each Protobuf +// message, not to the stream as a whole. +// +// Setting WithReadMaxBytes to zero allows any message size. Both clients and +// handlers default to allowing any request size. +// +// Handlers may also use [http.MaxBytesHandler] to limit the total size of the +// HTTP request stream (rather than the per-message size). Connect handles +// [http.MaxBytesError] specially, so clients still receive errors with the +// appropriate error code and informative messages. +func WithReadMaxBytes(maxBytes int) Option { + return &readMaxBytesOption{Max: maxBytes} +} + +// WithSendMaxBytes prevents sending messages too large for the client/handler +// to handle without significant performance overhead. For handlers, WithSendMaxBytes +// limits the size of a message that the handler can respond with. For clients, +// WithSendMaxBytes limits the size of a message that the client can send. Limits +// apply to each message, not to the stream as a whole. +// +// Handler errors are always sent. If an error exceeds the limit, the handler +// sends a minimal error with only the code and message. +// +// Setting WithSendMaxBytes to zero allows any message size. Both clients and +// handlers default to allowing any message size. +func WithSendMaxBytes(maxBytes int) Option { + return &sendMaxBytesOption{Max: maxBytes} +} + +// WithIdempotency declares the idempotency of the procedure. This can determine +// whether a procedure call can safely be retried, and may affect which request +// modalities are allowed for a given procedure call. +// +// In most cases, you should not need to manually set this. It is normally set +// by the code generator for your schema. For protobuf schemas, it can be set like this: +// +// rpc Ping(PingRequest) returns (PingResponse) { +// option idempotency_level = NO_SIDE_EFFECTS; +// } +func WithIdempotency(idempotencyLevel IdempotencyLevel) Option { + return &idempotencyOption{idempotencyLevel: idempotencyLevel} +} + +// WithHTTPGet allows Connect-protocol clients to use HTTP GET requests for +// side-effect free unary RPC calls. Typically, the service schema indicates +// which procedures are idempotent (see [WithIdempotency] for an example +// protobuf schema). The gRPC and gRPC-Web protocols are POST-only, so this +// option has no effect when combined with [WithGRPC] or [WithGRPCWeb]. +// +// Using HTTP GET requests makes it easier to take advantage of CDNs, caching +// reverse proxies, and browsers' built-in caching. Note, however, that servers +// don't automatically set any cache headers; you can set cache headers using +// interceptors or by adding headers in individual procedure implementations. +// +// By default, all requests are made as HTTP POSTs. +func WithHTTPGet() ClientOption { + return &enableGet{} +} + +// WithInterceptors configures a client or handler's interceptor stack. Repeated +// WithInterceptors options are applied in order, so +// +// WithInterceptors(A) + WithInterceptors(B, C) == WithInterceptors(A, B, C) +// +// Unary interceptors compose like an onion. The first interceptor provided is +// the outermost layer of the onion: it acts first on the context and request, +// and last on the response and error. +// +// Stream interceptors also behave like an onion: the first interceptor +// provided is the outermost wrapper for the [StreamingClientConn] or +// [StreamingHandlerConn]. It's the first to see sent messages and the last to +// see received messages. +// +// Applied to client and handler, WithInterceptors(A, B, ..., Y, Z) produces: +// +// client.Send() client.Receive() +// | ^ +// v | +// A --- --- A +// B --- --- B +// : ... ... : +// Y --- --- Y +// Z --- --- Z +// | ^ +// v | +// = = = = = = = = = = = = = = = = +// network +// = = = = = = = = = = = = = = = = +// | ^ +// v | +// A --- --- A +// B --- --- B +// : ... ... : +// Y --- --- Y +// Z --- --- Z +// | ^ +// v | +// handler.Receive() handler.Send() +// | ^ +// | | +// '-> handler logic >-' +// +// Note that in clients, Send handles the request message(s) and Receive +// handles the response message(s). For handlers, it's the reverse. Depending +// on your interceptor's logic, you may need to wrap one method in clients and +// the other in handlers. +func WithInterceptors(interceptors ...Interceptor) Option { + return &interceptorsOption{interceptors} +} + +// WithOptions composes multiple Options into one. +func WithOptions(options ...Option) Option { + return &optionsOption{options} +} + +type schemaOption struct { + Schema any +} + +func (o *schemaOption) applyToClient(config *clientConfig) { + config.Schema = o.Schema +} + +func (o *schemaOption) applyToHandler(config *handlerConfig) { + config.Schema = o.Schema +} + +type initializerOption struct { + Initializer func(spec Spec, message any) error +} + +func (o *initializerOption) applyToHandler(config *handlerConfig) { + config.Initializer = maybeInitializer{initializer: o.Initializer} +} + +func (o *initializerOption) applyToClient(config *clientConfig) { + config.Initializer = maybeInitializer{initializer: o.Initializer} +} + +type maybeInitializer struct { + initializer func(spec Spec, message any) error +} + +func (o maybeInitializer) maybe(spec Spec, message any) error { + if o.initializer != nil { + return o.initializer(spec, message) + } + return nil +} + +type clientOptionsOption struct { + options []ClientOption +} + +func (o *clientOptionsOption) applyToClient(config *clientConfig) { + for _, option := range o.options { + option.applyToClient(config) + } +} + +type codecOption struct { + Codec Codec +} + +func (o *codecOption) applyToClient(config *clientConfig) { + if o.Codec == nil || o.Codec.Name() == "" { + return + } + config.Codec = o.Codec +} + +func (o *codecOption) applyToHandler(config *handlerConfig) { + if o.Codec == nil || o.Codec.Name() == "" { + return + } + config.Codecs[o.Codec.Name()] = o.Codec +} + +type compressionOption struct { + Name string + CompressionPool *compressionPool +} + +func (o *compressionOption) applyToClient(config *clientConfig) { + o.apply(&config.CompressionNames, config.CompressionPools) +} + +func (o *compressionOption) applyToHandler(config *handlerConfig) { + o.apply(&config.CompressionNames, config.CompressionPools) +} + +func (o *compressionOption) apply(configuredNames *[]string, configuredPools map[string]*compressionPool) { + if o.Name == "" { + return + } + if o.CompressionPool == nil { + delete(configuredPools, o.Name) + var names []string + for _, name := range *configuredNames { + if name == o.Name { + continue + } + names = append(names, name) + } + *configuredNames = names + return + } + configuredPools[o.Name] = o.CompressionPool + *configuredNames = append(*configuredNames, o.Name) +} + +type compressMinBytesOption struct { + Min int +} + +func (o *compressMinBytesOption) applyToClient(config *clientConfig) { + config.CompressMinBytes = o.Min +} + +func (o *compressMinBytesOption) applyToHandler(config *handlerConfig) { + config.CompressMinBytes = o.Min +} + +type readMaxBytesOption struct { + Max int +} + +func (o *readMaxBytesOption) applyToClient(config *clientConfig) { + config.ReadMaxBytes = o.Max +} + +func (o *readMaxBytesOption) applyToHandler(config *handlerConfig) { + config.ReadMaxBytes = o.Max +} + +type sendMaxBytesOption struct { + Max int +} + +func (o *sendMaxBytesOption) applyToClient(config *clientConfig) { + config.SendMaxBytes = o.Max +} + +func (o *sendMaxBytesOption) applyToHandler(config *handlerConfig) { + config.SendMaxBytes = o.Max +} + +type handlerOptionsOption struct { + options []HandlerOption +} + +func (o *handlerOptionsOption) applyToHandler(config *handlerConfig) { + for _, option := range o.options { + option.applyToHandler(config) + } +} + +type requestGateOption struct { + gate RequestGateFunc +} + +func (o *requestGateOption) applyToHandler(config *handlerConfig) { + config.RequestGates = append(config.RequestGates, o.gate) +} + +type requireConnectProtocolHeaderOption struct{} + +func (o *requireConnectProtocolHeaderOption) applyToHandler(config *handlerConfig) { + config.RequireConnectProtocolHeader = true +} + +type idempotencyOption struct { + idempotencyLevel IdempotencyLevel +} + +func (o *idempotencyOption) applyToClient(config *clientConfig) { + config.IdempotencyLevel = o.idempotencyLevel +} + +func (o *idempotencyOption) applyToHandler(config *handlerConfig) { + config.IdempotencyLevel = o.idempotencyLevel +} + +type grpcOption struct { + web bool +} + +func (o *grpcOption) applyToClient(config *clientConfig) { + config.Protocol = &protocolGRPC{web: o.web} +} + +type enableGet struct{} + +func (o *enableGet) applyToClient(config *clientConfig) { + config.EnableGet = true +} + +// WithHTTPGetMaxURLSize sets the maximum allowable URL length for GET requests +// made using the Connect protocol. It has no effect on gRPC or gRPC-Web +// clients, since those protocols are POST-only. +// +// Limiting the URL size is useful as most user agents, proxies, and servers +// have limits on the allowable length of a URL. For example, Apache and Nginx +// limit the size of a request line to around 8 KiB, meaning that maximum +// length of a URL is a bit smaller than this. If you run into URL size +// limitations imposed by your network infrastructure and don't know the +// maximum allowable size, or if you'd prefer to be cautious from the start, a +// 4096 byte (4 KiB) limit works with most common proxies and CDNs. +// +// If fallback is set to true and the URL would be longer than the configured +// maximum value, the request will be sent as an HTTP POST instead. If fallback +// is set to false, the request will fail with [CodeResourceExhausted]. +// +// By default, Connect-protocol clients with GET requests enabled may send a +// URL of any size. +func WithHTTPGetMaxURLSize(bytes int, fallback bool) ClientOption { + return &getURLMaxBytes{Max: bytes, Fallback: fallback} +} + +type getURLMaxBytes struct { + Max int + Fallback bool +} + +func (o *getURLMaxBytes) applyToClient(config *clientConfig) { + config.GetURLMaxBytes = o.Max + config.GetUseFallback = o.Fallback +} + +type interceptorsOption struct { + Interceptors []Interceptor +} + +func (o *interceptorsOption) applyToClient(config *clientConfig) { + config.Interceptor = o.chainWith(config.Interceptor) +} + +func (o *interceptorsOption) applyToHandler(config *handlerConfig) { + config.Interceptor = o.chainWith(config.Interceptor) +} + +func (o *interceptorsOption) chainWith(current Interceptor) Interceptor { + if len(o.Interceptors) == 0 { + return current + } + if current == nil && len(o.Interceptors) == 1 { + return o.Interceptors[0] + } + if current == nil && len(o.Interceptors) > 1 { + return newChain(o.Interceptors) + } + return newChain(append([]Interceptor{current}, o.Interceptors...)) +} + +type optionsOption struct { + options []Option +} + +func (o *optionsOption) applyToClient(config *clientConfig) { + for _, option := range o.options { + option.applyToClient(config) + } +} + +func (o *optionsOption) applyToHandler(config *handlerConfig) { + for _, option := range o.options { + option.applyToHandler(config) + } +} + +type sendCompressionOption struct { + Name string +} + +func (o *sendCompressionOption) applyToClient(config *clientConfig) { + config.RequestCompressionName = o.Name +} + +func withGzip() Option { + return &compressionOption{ + Name: compressionGzip, + CompressionPool: newCompressionPool( + func() Decompressor { return &gzip.Reader{} }, + func() Compressor { return gzip.NewWriter(io.Discard) }, + ), + } +} + +func withProtoBinaryCodec() Option { + return WithCodec(&protoBinaryCodec{}) +} + +func withProtoJSONCodecs() HandlerOption { + return WithHandlerOptions( + WithCodec(&protoJSONCodec{codecNameJSON}), + WithCodec(&protoJSONCodec{codecNameJSONCharsetUTF8}), + ) +} + +type conditionalHandlerOptions struct { + conditional func(spec Spec) []HandlerOption +} + +func (o *conditionalHandlerOptions) applyToHandler(config *handlerConfig) { + spec := config.newSpec() + if spec.Procedure == "" { + return // ignore empty specs + } + for _, option := range o.conditional(spec) { + option.applyToHandler(config) + } +} diff --git a/vendor/connectrpc.com/connect/protobuf_util.go b/vendor/connectrpc.com/connect/protobuf_util.go new file mode 100644 index 000000000..d2563b6d7 --- /dev/null +++ b/vendor/connectrpc.com/connect/protobuf_util.go @@ -0,0 +1,42 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "strings" +) + +// extractProtoPath returns the trailing portion of the URL's path, +// corresponding to the Protobuf package, service, and method. It always starts +// with a slash. Within connect, we use this as (1) Spec.Procedure and (2) the +// path when mounting handlers on muxes. +func extractProtoPath(path string) string { + segments := strings.Split(path, "/") + var pkg, method string + if len(segments) > 0 { + pkg = segments[0] + } + if len(segments) > 1 { + pkg = segments[len(segments)-2] + method = segments[len(segments)-1] + } + if pkg == "" { + return "/" + } + if method == "" { + return "/" + pkg + } + return "/" + pkg + "/" + method +} diff --git a/vendor/connectrpc.com/connect/protocol.go b/vendor/connectrpc.com/connect/protocol.go new file mode 100644 index 000000000..4e98b2b1a --- /dev/null +++ b/vendor/connectrpc.com/connect/protocol.go @@ -0,0 +1,424 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "errors" + "fmt" + "io" + "mime" + "net/http" + "net/url" + "sort" + "strings" +) + +// The names of the Connect, gRPC, and gRPC-Web protocols (as exposed by +// [Peer].Protocol). Additional protocols may be added in the future. +const ( + ProtocolConnect = "connect" + ProtocolGRPC = "grpc" + ProtocolGRPCWeb = "grpcweb" +) + +const ( + headerContentType = "Content-Type" + headerContentEncoding = "Content-Encoding" + headerContentLength = "Content-Length" + headerHost = "Host" + headerUserAgent = "User-Agent" + headerTrailer = "Trailer" + headerDate = "Date" + + discardLimit = 1024 * 1024 * 4 // 4MiB +) + +var errNoTimeout = errors.New("no timeout") + +// A Protocol defines the HTTP semantics to use when sending and receiving +// messages. It ties together codecs, compressors, and net/http to produce +// Senders and Receivers. +// +// For example, connect supports the gRPC protocol using this abstraction. Among +// many other things, the protocol implementation is responsible for +// translating timeouts from Go contexts to HTTP and vice versa. For gRPC, it +// converts timeouts to and from strings (for example, 10*time.Second <-> +// "10S"), and puts those strings into the "Grpc-Timeout" HTTP header. Other +// protocols might encode durations differently, put them into a different HTTP +// header, or ignore them entirely. +// +// We don't have any short-term plans to export this interface; it's just here +// to separate the protocol-specific portions of connect from the +// protocol-agnostic plumbing. +type protocol interface { + NewHandler(*protocolHandlerParams) protocolHandler + NewClient(*protocolClientParams) (protocolClient, error) +} + +// HandlerParams are the arguments provided to a Protocol's NewHandler +// method, bundled into a struct to allow backward-compatible argument +// additions. Protocol implementations should take care to use the supplied +// Spec rather than constructing their own, since new fields may have been +// added. +type protocolHandlerParams struct { + Spec Spec + Codecs readOnlyCodecs + CompressionPools readOnlyCompressionPools + CompressMinBytes int + BufferPool *bufferPool + ReadMaxBytes int + SendMaxBytes int + RequireConnectProtocolHeader bool + IdempotencyLevel IdempotencyLevel +} + +// Handler is the server side of a protocol. HTTP handlers typically support +// multiple protocols, codecs, and compressors. +type protocolHandler interface { + // Methods is the set of HTTP methods the protocol can handle. + Methods() map[string]struct{} + + // ContentTypes is the set of HTTP Content-Types that the protocol can + // handle. + ContentTypes() map[string]struct{} + + // SetTimeout runs before NewStream. Implementations may inspect the HTTP + // request, parse any timeout set by the client, and return a modified + // context and cancellation function. + // + // If the client didn't send a timeout, SetTimeout should return the + // request's context, a nil cancellation function, and a nil error. + SetTimeout(*http.Request) (context.Context, context.CancelFunc, error) + + // CanHandlePayload returns true if the protocol can handle an HTTP request. + // This is called after the request method is validated, so we only need to + // be concerned with the content type/payload specifically. + CanHandlePayload(*http.Request, string) bool + + // NewConn constructs a HandlerConn for the message exchange. + NewConn(http.ResponseWriter, *http.Request) (handlerConnCloser, bool) +} + +// ClientParams are the arguments provided to a Protocol's NewClient method, +// bundled into a struct to allow backward-compatible argument additions. +// Protocol implementations should take care to use the supplied Spec rather +// than constructing their own, since new fields may have been added. +type protocolClientParams struct { + CompressionName string + CompressionPools readOnlyCompressionPools + Codec Codec + CompressMinBytes int + HTTPClient HTTPClient + URL *url.URL + BufferPool *bufferPool + ReadMaxBytes int + SendMaxBytes int + EnableGet bool + GetURLMaxBytes int + GetUseFallback bool + // The gRPC family of protocols always needs access to a Protobuf codec to + // marshal and unmarshal errors. + Protobuf Codec +} + +// Client is the client side of a protocol. HTTP clients typically use a single +// protocol, codec, and compressor to send requests. +type protocolClient interface { + // Peer describes the server for the RPC. + Peer() Peer + + // WriteRequestHeader writes any protocol-specific request headers. + WriteRequestHeader(StreamType, http.Header) + + // NewConn constructs a StreamingClientConn for the message exchange. + // + // Implementations should assume that the supplied HTTP headers have already + // been populated by WriteRequestHeader. When constructing a stream for a + // unary call, implementations may assume that the Sender's Send and Close + // methods return before the Receiver's Receive or Close methods are called. + NewConn(context.Context, Spec, http.Header) streamingClientConn +} + +// streamingClientConn extends StreamingClientConn with a method for registering +// a hook when the HTTP request is actually sent. +type streamingClientConn interface { + StreamingClientConn + + onRequestSend(fn func(*http.Request)) +} + +// errorTranslatingHandlerConnCloser wraps a handlerConnCloser to ensure that +// we always return coded errors to users and write coded errors to the +// network. +// +// It's used in protocol implementations. +type errorTranslatingHandlerConnCloser struct { + handlerConnCloser + + toWire func(error) error + fromWire func(error) error +} + +func (hc *errorTranslatingHandlerConnCloser) Send(msg any) error { + return hc.fromWire(hc.handlerConnCloser.Send(msg)) +} + +func (hc *errorTranslatingHandlerConnCloser) Receive(msg any) error { + return hc.fromWire(hc.handlerConnCloser.Receive(msg)) +} + +func (hc *errorTranslatingHandlerConnCloser) Close(err error) error { + closeErr := hc.handlerConnCloser.Close(hc.toWire(err)) + return hc.fromWire(closeErr) +} + +func (hc *errorTranslatingHandlerConnCloser) getHTTPMethod() string { + if methoder, ok := hc.handlerConnCloser.(interface{ getHTTPMethod() string }); ok { + return methoder.getHTTPMethod() + } + return http.MethodPost +} + +// errorTranslatingClientConn wraps a StreamingClientConn to make sure that we always +// return coded errors from clients. +// +// It's used in protocol implementations. +type errorTranslatingClientConn struct { + streamingClientConn + + fromWire func(error) error +} + +func (cc *errorTranslatingClientConn) Send(msg any) error { + return cc.fromWire(cc.streamingClientConn.Send(msg)) +} + +func (cc *errorTranslatingClientConn) Receive(msg any) error { + return cc.fromWire(cc.streamingClientConn.Receive(msg)) +} + +func (cc *errorTranslatingClientConn) CloseRequest() error { + return cc.fromWire(cc.streamingClientConn.CloseRequest()) +} + +func (cc *errorTranslatingClientConn) CloseResponse() error { + return cc.fromWire(cc.streamingClientConn.CloseResponse()) +} + +func (cc *errorTranslatingClientConn) onRequestSend(fn func(*http.Request)) { + cc.streamingClientConn.onRequestSend(fn) +} + +// wrapHandlerConnWithCodedErrors ensures that we (1) automatically code +// context-related errors correctly when writing them to the network, and (2) +// return *Errors from all exported APIs. +func wrapHandlerConnWithCodedErrors(conn handlerConnCloser) handlerConnCloser { + return &errorTranslatingHandlerConnCloser{ + handlerConnCloser: conn, + toWire: wrapIfContextError, + fromWire: wrapIfUncoded, + } +} + +// wrapClientConnWithCodedErrors ensures that we always return *Errors from +// public APIs. +func wrapClientConnWithCodedErrors(conn streamingClientConn) streamingClientConn { + return &errorTranslatingClientConn{ + streamingClientConn: conn, + fromWire: wrapIfUncoded, + } +} + +func mappedMethodHandlers(handlers []protocolHandler) map[string][]protocolHandler { + methodHandlers := make(map[string][]protocolHandler) + for _, handler := range handlers { + for method := range handler.Methods() { + methodHandlers[method] = append(methodHandlers[method], handler) + } + } + return methodHandlers +} + +func sortedAcceptPostValue(handlers []protocolHandler) string { + contentTypes := make(map[string]struct{}) + for _, handler := range handlers { + for contentType := range handler.ContentTypes() { + contentTypes[contentType] = struct{}{} + } + } + accept := make([]string, 0, len(contentTypes)) + for ct := range contentTypes { + accept = append(accept, ct) + } + sort.Strings(accept) + return strings.Join(accept, ", ") +} + +func sortedAllowMethodValue(handlers []protocolHandler) string { + methods := make(map[string]struct{}) + for _, handler := range handlers { + for method := range handler.Methods() { + methods[method] = struct{}{} + } + } + allow := make([]string, 0, len(methods)) + for ct := range methods { + allow = append(allow, ct) + } + sort.Strings(allow) + return strings.Join(allow, ", ") +} + +func isCommaOrSpace(c rune) bool { + return c == ',' || c == ' ' +} + +func discard(reader io.Reader) (int64, error) { + if lr, ok := reader.(*io.LimitedReader); ok { + return io.Copy(io.Discard, lr) + } + // We don't want to get stuck throwing data away forever, so limit how much + // we're willing to do here. + lr := &io.LimitedReader{R: reader, N: discardLimit} + return io.Copy(io.Discard, lr) +} + +// negotiateCompression determines and validates the request compression and +// response compression using the available compressors and protocol-specific +// Content-Encoding and Accept-Encoding headers. +func negotiateCompression( //nolint:nonamedreturns + availableCompressors readOnlyCompressionPools, + sent, accept string, +) (requestCompression, responseCompression string, clientVisibleErr *Error) { + requestCompression = compressionIdentity + if sent != "" && sent != compressionIdentity { + // We default to identity, so we only care if the client sends something + // other than the empty string or compressIdentity. + if availableCompressors.Contains(sent) { + requestCompression = sent + } else { + // To comply with + // https://github.com/grpc/grpc/blob/master/doc/compression.md and the + // Connect protocol, we should return CodeUnimplemented and specify + // acceptable compression(s) (in addition to setting the a + // protocol-specific accept-encoding header). + return "", "", errorf( + CodeUnimplemented, + "unknown compression %q: supported encodings are %v", + sent, availableCompressors.CommaSeparatedNames(), + ) + } + } + // Support asymmetric compression. This logic follows + // https://github.com/grpc/grpc/blob/master/doc/compression.md and common + // sense. + responseCompression = requestCompression + // If we're not already planning to compress the response, check whether the + // client requested a compression algorithm we support. + if responseCompression == compressionIdentity && accept != "" { + for _, name := range strings.FieldsFunc(accept, isCommaOrSpace) { + if availableCompressors.Contains(name) { + // We found a mutually supported compression algorithm. Unlike standard + // HTTP, there's no preference weighting, so can bail out immediately. + responseCompression = name + break + } + } + } + return requestCompression, responseCompression, nil +} + +// checkServerStreamsCanFlush ensures that bidi and server streaming handlers +// have received an http.ResponseWriter that implements http.Flusher, since +// they must flush data after sending each message. +func checkServerStreamsCanFlush(spec Spec, responseWriter http.ResponseWriter) *Error { + requiresFlusher := (spec.StreamType & StreamTypeServer) == StreamTypeServer + if _, flushable := responseWriter.(http.Flusher); requiresFlusher && !flushable { + return NewError(CodeInternal, fmt.Errorf("%T does not implement http.Flusher", responseWriter)) + } + return nil +} + +func flushResponseWriter(w http.ResponseWriter) { + if f, ok := w.(http.Flusher); ok { + f.Flush() + } +} + +func canonicalizeContentType(contentType string) string { + // Typically, clients send Content-Type in canonical form, without + // parameters. In those cases, we'd like to avoid parsing and + // canonicalization overhead. + // + // See https://www.rfc-editor.org/rfc/rfc2045.html#section-5.1 for a full + // grammar. + var slashes int + for _, r := range contentType { + switch { + case r >= 'a' && r <= 'z': + case r == '.' || r == '+' || r == '-': + case r == '/': + slashes++ + default: + return canonicalizeContentTypeSlow(contentType) + } + } + if slashes == 1 { + return contentType + } + return canonicalizeContentTypeSlow(contentType) +} + +func canonicalizeContentTypeSlow(contentType string) string { + base, params, err := mime.ParseMediaType(contentType) + if err != nil { + return contentType + } + // According to RFC 9110 Section 8.3.2, the charset parameter value should be treated as case-insensitive. + // mime.FormatMediaType canonicalizes parameter names, but not parameter values, + // because the case sensitivity of a parameter value depends on its semantics. + // Therefore, the charset parameter value should be canonicalized here. + // ref.) https://httpwg.org/specs/rfc9110.html#rfc.section.8.3.2 + if charset, ok := params["charset"]; ok { + params["charset"] = strings.ToLower(charset) + } + return mime.FormatMediaType(base, params) +} + +func httpToCode(httpCode int) Code { + // https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md + // Note that this is NOT the inverse of the gRPC-to-HTTP or Connect-to-HTTP + // mappings. + + // Literals are easier to compare to the specification (vs named + // constants). + switch httpCode { + case 400: + return CodeInternal + case 401: + return CodeUnauthenticated + case 403: + return CodePermissionDenied + case 404: + return CodeUnimplemented + case 429: + return CodeUnavailable + case 502, 503, 504: + return CodeUnavailable + default: + return CodeUnknown + } +} diff --git a/vendor/connectrpc.com/connect/protocol_connect.go b/vendor/connectrpc.com/connect/protocol_connect.go new file mode 100644 index 000000000..aac8b597a --- /dev/null +++ b/vendor/connectrpc.com/connect/protocol_connect.go @@ -0,0 +1,1506 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "math" + "net/http" + "net/url" + "runtime" + "strconv" + "strings" + "time" + + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" +) + +const ( + connectUnaryHeaderCompression = "Content-Encoding" + connectUnaryHeaderAcceptCompression = "Accept-Encoding" + connectUnaryTrailerPrefix = "Trailer-" + connectStreamingHeaderCompression = "Connect-Content-Encoding" + connectStreamingHeaderAcceptCompression = "Connect-Accept-Encoding" + connectHeaderTimeout = "Connect-Timeout-Ms" + connectHeaderProtocolVersion = "Connect-Protocol-Version" + connectProtocolVersion = "1" + headerVary = "Vary" + + connectFlagEnvelopeEndStream = 0b00000010 + + connectUnaryContentTypePrefix = "application/" + connectUnaryContentTypeJSON = connectUnaryContentTypePrefix + codecNameJSON + connectStreamingContentTypePrefix = "application/connect+" + + connectUnaryEncodingQueryParameter = "encoding" + connectUnaryMessageQueryParameter = "message" + connectUnaryBase64QueryParameter = "base64" + connectUnaryCompressionQueryParameter = "compression" + connectUnaryConnectQueryParameter = "connect" + connectUnaryConnectQueryValue = "v" + connectProtocolVersion +) + +// defaultConnectUserAgent returns a User-Agent string similar to those used in gRPC. +// +//nolint:gochecknoglobals +var defaultConnectUserAgent = fmt.Sprintf("connect-go/%s (%s)", Version, runtime.Version()) + +type protocolConnect struct{} + +// NewHandler implements protocol, so it must return an interface. +func (*protocolConnect) NewHandler(params *protocolHandlerParams) protocolHandler { + methods := make(map[string]struct{}) + methods[http.MethodPost] = struct{}{} + + if params.Spec.StreamType == StreamTypeUnary && params.IdempotencyLevel == IdempotencyNoSideEffects { + methods[http.MethodGet] = struct{}{} + } + + contentTypes := make(map[string]struct{}) + for _, name := range params.Codecs.Names() { + if params.Spec.StreamType == StreamTypeUnary { + contentTypes[canonicalizeContentType(connectUnaryContentTypePrefix+name)] = struct{}{} + continue + } + contentTypes[canonicalizeContentType(connectStreamingContentTypePrefix+name)] = struct{}{} + } + + return &connectHandler{ + protocolHandlerParams: *params, + methods: methods, + accept: contentTypes, + } +} + +// NewClient implements protocol, so it must return an interface. +func (*protocolConnect) NewClient(params *protocolClientParams) (protocolClient, error) { + return &connectClient{ + protocolClientParams: *params, + peer: newPeerForURL(params.URL, ProtocolConnect), + }, nil +} + +type connectHandler struct { + protocolHandlerParams + + methods map[string]struct{} + accept map[string]struct{} +} + +func (h *connectHandler) Methods() map[string]struct{} { + return h.methods +} + +func (h *connectHandler) ContentTypes() map[string]struct{} { + return h.accept +} + +func (*connectHandler) SetTimeout(request *http.Request) (context.Context, context.CancelFunc, error) { + timeout := getHeaderCanonical(request.Header, connectHeaderTimeout) + if timeout == "" { + return request.Context(), nil, nil + } + if len(timeout) > 10 { + return nil, nil, errorf(CodeInvalidArgument, "parse timeout: %q has >10 digits", timeout) + } + millis, err := strconv.ParseInt(timeout, 10 /* base */, 64 /* bitsize */) + if err != nil { + return nil, nil, errorf(CodeInvalidArgument, "parse timeout: %w", err) + } + if millis < 0 { + return nil, nil, errorf(CodeInvalidArgument, "parse timeout: %q is negative", timeout) + } + ctx, cancel := context.WithTimeout( + request.Context(), + time.Duration(millis)*time.Millisecond, + ) + return ctx, cancel, nil +} + +func (h *connectHandler) CanHandlePayload(request *http.Request, contentType string) bool { + if request.Method == http.MethodGet { + query := request.URL.Query() + codecName := query.Get(connectUnaryEncodingQueryParameter) + contentType = connectContentTypeForCodecName( + h.Spec.StreamType, + codecName, + ) + } + _, ok := h.accept[contentType] + return ok +} + +func (h *connectHandler) NewConn( + responseWriter http.ResponseWriter, + request *http.Request, +) (handlerConnCloser, bool) { + ctx := request.Context() + query := request.URL.Query() + // We need to parse metadata before entering the interceptor stack; we'll + // send the error to the client later on. + var contentEncoding, acceptEncoding string + if h.Spec.StreamType == StreamTypeUnary { + if request.Method == http.MethodGet { + contentEncoding = query.Get(connectUnaryCompressionQueryParameter) + } else { + contentEncoding = getHeaderCanonical(request.Header, connectUnaryHeaderCompression) + } + acceptEncoding = getHeaderCanonical(request.Header, connectUnaryHeaderAcceptCompression) + } else { + contentEncoding = getHeaderCanonical(request.Header, connectStreamingHeaderCompression) + acceptEncoding = getHeaderCanonical(request.Header, connectStreamingHeaderAcceptCompression) + } + requestCompression, responseCompression, failed := negotiateCompression( + h.CompressionPools, + contentEncoding, + acceptEncoding, + ) + if failed == nil { + failed = checkServerStreamsCanFlush(h.Spec, responseWriter) + } + if failed == nil { + required := h.RequireConnectProtocolHeader && (h.Spec.StreamType == StreamTypeUnary) + failed = connectCheckProtocolVersion(request, required) + } + + var requestBody io.ReadCloser + var contentType, codecName string + if request.Method == http.MethodGet { + if failed == nil && !query.Has(connectUnaryEncodingQueryParameter) { + failed = errorf(CodeInvalidArgument, "missing %s parameter", connectUnaryEncodingQueryParameter) + } else if failed == nil && !query.Has(connectUnaryMessageQueryParameter) { + failed = errorf(CodeInvalidArgument, "missing %s parameter", connectUnaryMessageQueryParameter) + } + msg := query.Get(connectUnaryMessageQueryParameter) + msgReader := queryValueReader(msg, query.Get(connectUnaryBase64QueryParameter) == "1") + requestBody = io.NopCloser(msgReader) + codecName = query.Get(connectUnaryEncodingQueryParameter) + contentType = connectContentTypeForCodecName( + h.Spec.StreamType, + codecName, + ) + } else { + requestBody = request.Body + contentType = getHeaderCanonical(request.Header, headerContentType) + codecName = connectCodecForContentType( + h.Spec.StreamType, + contentType, + ) + } + + codec := h.Codecs.Get(codecName) + // The codec can be nil in the GET request case; that's okay: when failed + // is non-nil, codec is never used. + if failed == nil && codec == nil { + failed = errorf(CodeInvalidArgument, "invalid message encoding: %q", codecName) + } + + // Write any remaining headers here: + // (1) any writes to the stream will implicitly send the headers, so we + // should get all of gRPC's required response headers ready. + // (2) interceptors should be able to see these headers. + // + // Since we know that these header keys are already in canonical form, we can + // skip the normalization in Header.Set. + header := responseWriter.Header() + header[headerContentType] = []string{contentType} + acceptCompressionHeader := connectUnaryHeaderAcceptCompression + if h.Spec.StreamType != StreamTypeUnary { + acceptCompressionHeader = connectStreamingHeaderAcceptCompression + // We only write the request encoding header here for streaming calls, + // since the streaming envelope lets us choose whether to compress each + // message individually. For unary, we won't know whether we're compressing + // the request until we see how large the payload is. + if responseCompression != compressionIdentity { + header[connectStreamingHeaderCompression] = []string{responseCompression} + } + } + header[acceptCompressionHeader] = []string{h.CompressionPools.CommaSeparatedNames()} + + var conn handlerConnCloser + peer := Peer{ + Addr: request.RemoteAddr, + Protocol: ProtocolConnect, + Query: query, + } + if h.Spec.StreamType == StreamTypeUnary { + conn = &connectUnaryHandlerConn{ + spec: h.Spec, + peer: peer, + request: request, + responseWriter: responseWriter, + marshaler: connectUnaryMarshaler{ + ctx: ctx, + sender: writeSender{writer: responseWriter}, + codec: codec, + compressMinBytes: h.CompressMinBytes, + compressionName: responseCompression, + compressionPool: h.CompressionPools.Get(responseCompression), + bufferPool: h.BufferPool, + header: responseWriter.Header(), + sendMaxBytes: h.SendMaxBytes, + }, + unmarshaler: connectUnaryUnmarshaler{ + ctx: ctx, + reader: requestBody, + codec: codec, + compressionPool: h.CompressionPools.Get(requestCompression), + bufferPool: h.BufferPool, + readMaxBytes: h.ReadMaxBytes, + }, + responseTrailer: make(http.Header), + } + } else { + conn = &connectStreamingHandlerConn{ + spec: h.Spec, + peer: peer, + request: request, + responseWriter: responseWriter, + marshaler: connectStreamingMarshaler{ + envelopeWriter: envelopeWriter{ + ctx: ctx, + sender: writeSender{responseWriter}, + codec: codec, + compressMinBytes: h.CompressMinBytes, + compressionPool: h.CompressionPools.Get(responseCompression), + bufferPool: h.BufferPool, + sendMaxBytes: h.SendMaxBytes, + }, + }, + unmarshaler: connectStreamingUnmarshaler{ + envelopeReader: envelopeReader{ + ctx: ctx, + reader: requestBody, + codec: codec, + compressionPool: h.CompressionPools.Get(requestCompression), + bufferPool: h.BufferPool, + readMaxBytes: h.ReadMaxBytes, + }, + }, + responseTrailer: make(http.Header), + } + } + conn = wrapHandlerConnWithCodedErrors(conn) + + if failed != nil { + // Negotiation failed, so we can't establish a stream. + _ = conn.Close(failed) + return nil, false + } + return conn, true +} + +type connectClient struct { + protocolClientParams + + peer Peer +} + +func (c *connectClient) Peer() Peer { + return c.peer +} + +func (c *connectClient) WriteRequestHeader(streamType StreamType, header http.Header) { + setUserAgentIfAbsent(header, defaultConnectUserAgent) + // We know these header keys are in canonical form, so we can bypass all the + // checks in Header.Set. + header[connectHeaderProtocolVersion] = []string{connectProtocolVersion} + header[headerContentType] = []string{ + connectContentTypeForCodecName(streamType, c.Codec.Name()), + } + // Always set Accept-Encoding. If left unset, http.Client will set a default + // gzip and transparently decode the response. This applies to both unary and + // streaming RPCs. For streaming calls it stays "identity" as compression is + // applied per message. + header[connectUnaryHeaderAcceptCompression] = []string{compressionIdentity} + acceptCompressionHeader := connectUnaryHeaderAcceptCompression + if streamType != StreamTypeUnary { + acceptCompressionHeader = connectStreamingHeaderAcceptCompression + // We only write the request encoding header here for streaming calls, + // since the streaming envelope lets us choose whether to compress each + // message individually. For unary, we won't know whether we're compressing + // the request until we see how large the payload is. + if c.CompressionName != "" && c.CompressionName != compressionIdentity { + header[connectStreamingHeaderCompression] = []string{c.CompressionName} + } + } + if acceptCompression := c.CompressionPools.CommaSeparatedNames(); acceptCompression != "" { + header[acceptCompressionHeader] = []string{acceptCompression} + } +} + +func (c *connectClient) NewConn( + ctx context.Context, + spec Spec, + header http.Header, +) streamingClientConn { + if deadline, ok := ctx.Deadline(); ok { + if encoded := connectEncodeTimeout(time.Until(deadline)); encoded != "" { + header[connectHeaderTimeout] = []string{encoded} + } // else effectively unbounded + } + duplexCall := newDuplexHTTPCall(ctx, c.HTTPClient, c.URL, spec, header) + var conn streamingClientConn + if spec.StreamType == StreamTypeUnary { + unaryConn := &connectUnaryClientConn{ + spec: spec, + peer: c.Peer(), + duplexCall: duplexCall, + compressionPools: c.CompressionPools, + bufferPool: c.BufferPool, + marshaler: connectUnaryRequestMarshaler{ + connectUnaryMarshaler: connectUnaryMarshaler{ + ctx: ctx, + sender: duplexCall, + codec: c.Codec, + compressMinBytes: c.CompressMinBytes, + compressionName: c.CompressionName, + compressionPool: c.CompressionPools.Get(c.CompressionName), + bufferPool: c.BufferPool, + header: duplexCall.Header(), + sendMaxBytes: c.SendMaxBytes, + }, + }, + unmarshaler: connectUnaryUnmarshaler{ + ctx: ctx, + reader: duplexCall, + codec: c.Codec, + bufferPool: c.BufferPool, + readMaxBytes: c.ReadMaxBytes, + }, + responseHeader: make(http.Header), + responseTrailer: make(http.Header), + } + if spec.IdempotencyLevel == IdempotencyNoSideEffects { + unaryConn.marshaler.enableGet = c.EnableGet + unaryConn.marshaler.getURLMaxBytes = c.GetURLMaxBytes + unaryConn.marshaler.getUseFallback = c.GetUseFallback + unaryConn.marshaler.duplexCall = duplexCall + if stableCodec, ok := c.Codec.(stableCodec); ok { + unaryConn.marshaler.stableCodec = stableCodec + } + } + conn = unaryConn + duplexCall.SetValidateResponse(unaryConn.validateResponse) + } else { + streamingConn := &connectStreamingClientConn{ + spec: spec, + peer: c.Peer(), + duplexCall: duplexCall, + compressionPools: c.CompressionPools, + bufferPool: c.BufferPool, + codec: c.Codec, + marshaler: connectStreamingMarshaler{ + envelopeWriter: envelopeWriter{ + ctx: ctx, + sender: duplexCall, + codec: c.Codec, + compressMinBytes: c.CompressMinBytes, + compressionPool: c.CompressionPools.Get(c.CompressionName), + bufferPool: c.BufferPool, + sendMaxBytes: c.SendMaxBytes, + }, + }, + unmarshaler: connectStreamingUnmarshaler{ + envelopeReader: envelopeReader{ + ctx: ctx, + reader: duplexCall, + codec: c.Codec, + bufferPool: c.BufferPool, + readMaxBytes: c.ReadMaxBytes, + }, + }, + responseHeader: make(http.Header), + responseTrailer: make(http.Header), + } + conn = streamingConn + duplexCall.SetValidateResponse(streamingConn.validateResponse) + } + return wrapClientConnWithCodedErrors(conn) +} + +type connectUnaryClientConn struct { + spec Spec + peer Peer + duplexCall *duplexHTTPCall + compressionPools readOnlyCompressionPools + bufferPool *bufferPool + marshaler connectUnaryRequestMarshaler + unmarshaler connectUnaryUnmarshaler + responseHeader http.Header + responseTrailer http.Header +} + +func (cc *connectUnaryClientConn) Spec() Spec { + return cc.spec +} + +func (cc *connectUnaryClientConn) Peer() Peer { + return cc.peer +} + +func (cc *connectUnaryClientConn) Send(msg any) error { + if err := cc.marshaler.Marshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (cc *connectUnaryClientConn) RequestHeader() http.Header { + return cc.duplexCall.Header() +} + +func (cc *connectUnaryClientConn) CloseRequest() error { + return cc.duplexCall.CloseWrite() +} + +func (cc *connectUnaryClientConn) Receive(msg any) error { + if _, err := cc.duplexCall.blockUntilResponseReady(); err != nil { + return err + } + if err := cc.unmarshaler.Unmarshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (cc *connectUnaryClientConn) ResponseHeader() http.Header { + _, _ = cc.duplexCall.blockUntilResponseReady() + return cc.responseHeader +} + +func (cc *connectUnaryClientConn) ResponseTrailer() http.Header { + _, _ = cc.duplexCall.blockUntilResponseReady() + return cc.responseTrailer +} + +func (cc *connectUnaryClientConn) CloseResponse() error { + return cc.duplexCall.CloseRead() +} + +func (cc *connectUnaryClientConn) onRequestSend(fn func(*http.Request)) { + cc.duplexCall.onRequestSend = fn +} + +func (cc *connectUnaryClientConn) validateResponse(response *http.Response) *Error { + for k, v := range response.Header { + if !strings.HasPrefix(k, connectUnaryTrailerPrefix) { + cc.responseHeader[k] = v + continue + } + cc.responseTrailer[k[len(connectUnaryTrailerPrefix):]] = v + } + if err := connectValidateUnaryResponseContentType( + cc.marshaler.codec.Name(), + cc.duplexCall.Method(), + response.StatusCode, + response.Status, + getHeaderCanonical(response.Header, headerContentType), + ); err != nil { + if IsNotModifiedError(err) { + // Allow access to response headers for this kind of error. + // RFC 9110 doesn't allow trailers on 304s, so we only need to include headers. + err.meta = cc.responseHeader.Clone() + } + return err + } + compression := getHeaderCanonical(response.Header, connectUnaryHeaderCompression) + if compression != "" && + compression != compressionIdentity && + !cc.compressionPools.Contains(compression) { + return errorf( + CodeInternal, + "unknown encoding %q: accepted encodings are %v", + compression, + cc.compressionPools.CommaSeparatedNames(), + ) + } + cc.unmarshaler.compressionPool = cc.compressionPools.Get(compression) + if response.StatusCode != http.StatusOK { + return cc.unmarshalResponseError(response) + } + return nil +} + +// unmarshalResponseError reads the JSON error body of a non-200 response. +func (cc *connectUnaryClientConn) unmarshalResponseError(response *http.Response) *Error { + unmarshaler := connectUnaryUnmarshaler{ + ctx: cc.unmarshaler.ctx, + reader: response.Body, + compressionPool: cc.unmarshaler.compressionPool, + bufferPool: cc.bufferPool, + readMaxBytes: cc.unmarshaler.readMaxBytes, + } + var wireErr connectWireError + if err := unmarshaler.UnmarshalFunc(&wireErr, json.Unmarshal); err != nil { + if err.Code() == CodeResourceExhausted { + return err // error body exceeds readMaxBytes + } + return NewError( + httpToCode(response.StatusCode), + errors.New(response.Status), + ) + } + if wireErr.Code == 0 { + // code not set? default to one implied by HTTP status + wireErr.Code = httpToCode(response.StatusCode) + } + serverErr := wireErr.asError() + if serverErr == nil { + return nil + } + serverErr.meta = cc.responseHeader.Clone() + mergeHeaders(serverErr.meta, cc.responseTrailer) + return serverErr +} + +type connectStreamingClientConn struct { + spec Spec + peer Peer + duplexCall *duplexHTTPCall + compressionPools readOnlyCompressionPools + bufferPool *bufferPool + codec Codec + marshaler connectStreamingMarshaler + unmarshaler connectStreamingUnmarshaler + responseHeader http.Header + responseTrailer http.Header +} + +func (cc *connectStreamingClientConn) Spec() Spec { + return cc.spec +} + +func (cc *connectStreamingClientConn) Peer() Peer { + return cc.peer +} + +func (cc *connectStreamingClientConn) Send(msg any) error { + if err := cc.marshaler.Marshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (cc *connectStreamingClientConn) RequestHeader() http.Header { + return cc.duplexCall.Header() +} + +func (cc *connectStreamingClientConn) CloseRequest() error { + return cc.duplexCall.CloseWrite() +} + +func (cc *connectStreamingClientConn) Receive(msg any) error { + if _, err := cc.duplexCall.blockUntilResponseReady(); err != nil { + return err + } + err := cc.unmarshaler.Unmarshal(msg) + if err == nil { + return nil + } + // See if the server sent an explicit error in the end-of-stream message. + mergeHeaders(cc.responseTrailer, cc.unmarshaler.Trailer()) + if serverErr := cc.unmarshaler.EndStreamError(); serverErr != nil { + // This is expected from a protocol perspective, but receiving an + // end-of-stream message means that we're _not_ getting a regular message. + // For users to realize that the stream has ended, Receive must return an + // error. + serverErr.meta = cc.responseHeader.Clone() + mergeHeaders(serverErr.meta, cc.responseTrailer) + _ = cc.duplexCall.CloseWrite() + return serverErr + } + // If the error is EOF but not from a last message, we want to return + // io.ErrUnexpectedEOF instead. + if errors.Is(err, io.EOF) && !errors.Is(err, errSpecialEnvelope) { + err = errorf(CodeInternal, "protocol error: %w", io.ErrUnexpectedEOF) + } + // There's no error in the trailers, so this was probably an error + // converting the bytes to a message, an error reading from the network, or + // just an EOF. We're going to return it to the user, but we also want to + // close the writer so Send errors out. + _ = cc.duplexCall.CloseWrite() + return err +} + +func (cc *connectStreamingClientConn) ResponseHeader() http.Header { + _, _ = cc.duplexCall.blockUntilResponseReady() + return cc.responseHeader +} + +func (cc *connectStreamingClientConn) ResponseTrailer() http.Header { + _, _ = cc.duplexCall.blockUntilResponseReady() + return cc.responseTrailer +} + +func (cc *connectStreamingClientConn) CloseResponse() error { + return cc.duplexCall.CloseRead() +} + +func (cc *connectStreamingClientConn) onRequestSend(fn func(*http.Request)) { + cc.duplexCall.onRequestSend = fn +} + +func (cc *connectStreamingClientConn) validateResponse(response *http.Response) *Error { + if response.StatusCode != http.StatusOK { + return errorf(httpToCode(response.StatusCode), "HTTP status %v", response.Status) + } + if err := connectValidateStreamResponseContentType( + cc.codec.Name(), + cc.spec.StreamType, + getHeaderCanonical(response.Header, headerContentType), + ); err != nil { + return err + } + compression := getHeaderCanonical(response.Header, connectStreamingHeaderCompression) + if compression != "" && + compression != compressionIdentity && + !cc.compressionPools.Contains(compression) { + return errorf( + CodeInternal, + "unknown encoding %q: accepted encodings are %v", + compression, + cc.compressionPools.CommaSeparatedNames(), + ) + } + cc.unmarshaler.compressionPool = cc.compressionPools.Get(compression) + mergeHeaders(cc.responseHeader, response.Header) + return nil +} + +type connectUnaryHandlerConn struct { + spec Spec + peer Peer + request *http.Request + responseWriter http.ResponseWriter + marshaler connectUnaryMarshaler + unmarshaler connectUnaryUnmarshaler + responseTrailer http.Header +} + +func (hc *connectUnaryHandlerConn) Spec() Spec { + return hc.spec +} + +func (hc *connectUnaryHandlerConn) Peer() Peer { + return hc.peer +} + +func (hc *connectUnaryHandlerConn) Receive(msg any) error { + if err := hc.unmarshaler.Unmarshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (hc *connectUnaryHandlerConn) RequestHeader() http.Header { + return hc.request.Header +} + +func (hc *connectUnaryHandlerConn) Send(msg any) error { + hc.mergeResponseHeader(nil /* error */) + if err := hc.marshaler.Marshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (hc *connectUnaryHandlerConn) ResponseHeader() http.Header { + return hc.responseWriter.Header() +} + +func (hc *connectUnaryHandlerConn) ResponseTrailer() http.Header { + return hc.responseTrailer +} + +func (hc *connectUnaryHandlerConn) Close(err error) error { + if !hc.marshaler.wroteHeader { + hc.mergeResponseHeader(err) + // If the handler received a GET request and the resource hasn't changed, + // return a 304. + if hc.request.Method == http.MethodGet && IsNotModifiedError(err) { + hc.responseWriter.WriteHeader(http.StatusNotModified) + return hc.request.Body.Close() + } + } + if err == nil || hc.marshaler.wroteHeader { + return hc.request.Body.Close() + } + // In unary Connect, errors always use application/json. + setHeaderCanonical(hc.responseWriter.Header(), headerContentType, connectUnaryContentTypeJSON) + hc.responseWriter.WriteHeader(connectCodeToHTTP(CodeOf(err))) + wireErr := newConnectWireError(err) + data, marshalErr := json.Marshal(wireErr) + if marshalErr == nil && hc.marshaler.sendMaxBytes > 0 && len(data) > hc.marshaler.sendMaxBytes { + // The error exceeds sendMaxBytes. Rather than drop it, send only the + // code and message. + wireErr.Details = nil + data, marshalErr = json.Marshal(wireErr) + } + if marshalErr != nil { + _ = hc.request.Body.Close() + return errorf(CodeInternal, "marshal error: %w", err) + } + if _, writeErr := hc.responseWriter.Write(data); writeErr != nil { + _ = hc.request.Body.Close() + return writeErr + } + return hc.request.Body.Close() +} + +func (hc *connectUnaryHandlerConn) getHTTPMethod() string { + return hc.request.Method +} + +func (hc *connectUnaryHandlerConn) mergeResponseHeader(err error) { + header := hc.responseWriter.Header() + if hc.request.Method == http.MethodGet { + // The response content varies depending on the compression that the client + // requested (if any). GETs are potentially cacheable, so we should ensure + // that the Vary header includes at least Accept-Encoding (and not overwrite any values already set). + header[headerVary] = append(header[headerVary], connectUnaryHeaderAcceptCompression) + } + if err != nil { + if connectErr, ok := asError(err); ok && !connectErr.wireErr { + mergeNonProtocolHeaders(header, connectErr.meta) + } + } + for k, v := range hc.responseTrailer { + header[connectUnaryTrailerPrefix+k] = v + } +} + +type connectStreamingHandlerConn struct { + spec Spec + peer Peer + request *http.Request + responseWriter http.ResponseWriter + marshaler connectStreamingMarshaler + unmarshaler connectStreamingUnmarshaler + responseTrailer http.Header +} + +func (hc *connectStreamingHandlerConn) Spec() Spec { + return hc.spec +} + +func (hc *connectStreamingHandlerConn) Peer() Peer { + return hc.peer +} + +func (hc *connectStreamingHandlerConn) Receive(msg any) error { + if err := hc.unmarshaler.Unmarshal(msg); err != nil { + // Clients may not send end-of-stream metadata, so we don't need to handle + // errSpecialEnvelope. + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (hc *connectStreamingHandlerConn) RequestHeader() http.Header { + return hc.request.Header +} + +func (hc *connectStreamingHandlerConn) Send(msg any) error { + defer flushResponseWriter(hc.responseWriter) + if err := hc.marshaler.Marshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (hc *connectStreamingHandlerConn) ResponseHeader() http.Header { + return hc.responseWriter.Header() +} + +func (hc *connectStreamingHandlerConn) ResponseTrailer() http.Header { + return hc.responseTrailer +} + +func (hc *connectStreamingHandlerConn) Close(err error) error { + defer flushResponseWriter(hc.responseWriter) + if err := hc.marshaler.MarshalEndStream(err, hc.responseTrailer); err != nil { + _ = hc.request.Body.Close() + return err + } + // We don't want to copy unread portions of the body to /dev/null here: if + // the client hasn't closed the request body, we'll block until the server + // timeout kicks in. This could happen because the client is malicious, but + // a well-intentioned client may just not expect the server to be returning + // an error for a streaming RPC. Better to accept that we can't always reuse + // TCP connections. + if err := hc.request.Body.Close(); err != nil { + if connectErr, ok := asError(err); ok { + return connectErr + } + return NewError(CodeUnknown, err) + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +type connectStreamingMarshaler struct { + envelopeWriter +} + +func (m *connectStreamingMarshaler) MarshalEndStream(err error, trailer http.Header) *Error { + end := &connectEndStreamMessage{Trailer: trailer} + if err != nil { + end.Error = newConnectWireError(err) + if connectErr, ok := asError(err); ok && !connectErr.wireErr { + mergeNonProtocolHeaders(end.Trailer, connectErr.meta) + } + } + data, marshalErr := json.Marshal(end) + if marshalErr != nil { + return errorf(CodeInternal, "marshal end stream: %w", marshalErr) + } + raw := bytes.NewBuffer(data) + defer m.bufferPool.Put(raw) + writeErr := m.Write(&envelope{ + Data: raw, + Flags: connectFlagEnvelopeEndStream, + }) + if writeErr == nil || writeErr.Code() != CodeResourceExhausted { + return writeErr + } + // The end of stream exceeds sendMaxBytes. Rather than drop it, send only + // the error code and message, reporting the limit if there's no error. + if err == nil { + err = writeErr + } + end = &connectEndStreamMessage{Error: newConnectWireError(err)} + end.Error.Details = nil + data, marshalErr = json.Marshal(end) + if marshalErr != nil { + return errorf(CodeInternal, "marshal end stream: %w", marshalErr) + } + raw.Reset() + _, _ = raw.Write(data) + return m.write(&envelope{ + Data: raw, + Flags: connectFlagEnvelopeEndStream, + }) +} + +type connectStreamingUnmarshaler struct { + envelopeReader + + endStreamErr *Error + trailer http.Header +} + +func (u *connectStreamingUnmarshaler) Unmarshal(message any) *Error { + err := u.envelopeReader.Unmarshal(message) + if err == nil { + return nil + } + if !errors.Is(err, errSpecialEnvelope) { + return err + } + env := u.last + data := env.Data + u.last.Data = nil // don't keep a reference to it + defer u.bufferPool.Put(data) + if !env.IsSet(connectFlagEnvelopeEndStream) { + return errorf(CodeInternal, "protocol error: invalid envelope flags %d", env.Flags) + } + var end connectEndStreamMessage + if err := json.Unmarshal(data.Bytes(), &end); err != nil { + return errorf(CodeInternal, "unmarshal end stream message: %w", err) + } + for name, value := range end.Trailer { + canonical := http.CanonicalHeaderKey(name) + if name != canonical { + delHeaderCanonical(end.Trailer, name) + end.Trailer[canonical] = append(end.Trailer[canonical], value...) + } + } + u.trailer = end.Trailer + u.endStreamErr = end.Error.asError() + return errSpecialEnvelope +} + +func (u *connectStreamingUnmarshaler) Trailer() http.Header { + return u.trailer +} + +func (u *connectStreamingUnmarshaler) EndStreamError() *Error { + return u.endStreamErr +} + +type connectUnaryMarshaler struct { + ctx context.Context //nolint:containedctx + sender messageSender + codec Codec + compressMinBytes int + compressionName string + compressionPool *compressionPool + bufferPool *bufferPool + header http.Header + sendMaxBytes int + wroteHeader bool +} + +func (m *connectUnaryMarshaler) Marshal(message any) *Error { + if message == nil { + return m.write(nil) + } + var data []byte + var err error + if appender, ok := m.codec.(marshalAppender); ok { + data, err = appender.MarshalAppend(m.bufferPool.Get().Bytes(), message) + } else { + // Can't avoid allocating the slice, but we'll reuse it. + data, err = m.codec.Marshal(message) + } + if err != nil { + return errorf(CodeInternal, "marshal message: %w", err) + } + uncompressed := bytes.NewBuffer(data) + defer m.bufferPool.Put(uncompressed) + if len(data) < m.compressMinBytes || m.compressionPool == nil { + if m.sendMaxBytes > 0 && len(data) > m.sendMaxBytes { + return NewError(CodeResourceExhausted, fmt.Errorf("message size %d exceeds sendMaxBytes %d", len(data), m.sendMaxBytes)) + } + return m.write(data) + } + compressed := m.bufferPool.Get() + defer m.bufferPool.Put(compressed) + if err := m.compressionPool.Compress(compressed, uncompressed); err != nil { + return err + } + if m.sendMaxBytes > 0 && compressed.Len() > m.sendMaxBytes { + return NewError(CodeResourceExhausted, fmt.Errorf("compressed message size %d exceeds sendMaxBytes %d", compressed.Len(), m.sendMaxBytes)) + } + setHeaderCanonical(m.header, connectUnaryHeaderCompression, m.compressionName) + return m.write(compressed.Bytes()) +} + +func (m *connectUnaryMarshaler) write(data []byte) *Error { + m.wroteHeader = true + payload := bytes.NewReader(data) + if _, err := m.sender.Send(payload); err != nil { + err = wrapIfContextError(err) + if connectErr, ok := asError(err); ok { + return connectErr + } + return errorf(CodeUnknown, "write message: %w", err) + } + return nil +} + +type connectUnaryRequestMarshaler struct { + connectUnaryMarshaler + + enableGet bool + getURLMaxBytes int + getUseFallback bool + stableCodec stableCodec + duplexCall *duplexHTTPCall +} + +func (m *connectUnaryRequestMarshaler) Marshal(message any) *Error { + if m.enableGet { + if m.stableCodec == nil && !m.getUseFallback { + return errorf(CodeInternal, "codec %s doesn't support stable marshal; can't use get", m.codec.Name()) + } + if m.stableCodec != nil { + return m.marshalWithGet(message) + } + } + return m.connectUnaryMarshaler.Marshal(message) +} + +func (m *connectUnaryRequestMarshaler) marshalWithGet(message any) *Error { + // TODO(jchadwick-buf): This function is mostly a superset of + // connectUnaryMarshaler.Marshal. This should be reconciled at some point. + var data []byte + var err error + if message != nil { + data, err = m.stableCodec.MarshalStable(message) + if err != nil { + return errorf(CodeInternal, "marshal message stable: %w", err) + } + } + isTooBig := m.sendMaxBytes > 0 && len(data) > m.sendMaxBytes + if isTooBig && m.compressionPool == nil { + return NewError(CodeResourceExhausted, fmt.Errorf( + "message size %d exceeds sendMaxBytes %d: enabling request compression may help", + len(data), + m.sendMaxBytes, + )) + } + if !isTooBig { + url := m.buildGetURL(data, false /* compressed */) + if m.getURLMaxBytes <= 0 || len(url.String()) <= m.getURLMaxBytes { + m.writeWithGet(url) + return nil + } + if m.compressionPool == nil { + if m.getUseFallback { + return m.write(data) + } + return NewError(CodeResourceExhausted, fmt.Errorf( + "url size %d exceeds getURLMaxBytes %d: enabling request compression may help", + len(url.String()), + m.getURLMaxBytes, + )) + } + } + // Compress message to try to make it fit in the URL. + uncompressed := bytes.NewBuffer(data) + defer m.bufferPool.Put(uncompressed) + compressed := m.bufferPool.Get() + defer m.bufferPool.Put(compressed) + if err := m.compressionPool.Compress(compressed, uncompressed); err != nil { + return err + } + if m.sendMaxBytes > 0 && compressed.Len() > m.sendMaxBytes { + return NewError(CodeResourceExhausted, fmt.Errorf("compressed message size %d exceeds sendMaxBytes %d", compressed.Len(), m.sendMaxBytes)) + } + url := m.buildGetURL(compressed.Bytes(), true /* compressed */) + if m.getURLMaxBytes <= 0 || len(url.String()) <= m.getURLMaxBytes { + m.writeWithGet(url) + return nil + } + if m.getUseFallback { + setHeaderCanonical(m.header, connectUnaryHeaderCompression, m.compressionName) + return m.write(compressed.Bytes()) + } + return NewError(CodeResourceExhausted, fmt.Errorf("compressed url size %d exceeds getURLMaxBytes %d", len(url.String()), m.getURLMaxBytes)) +} + +func (m *connectUnaryRequestMarshaler) buildGetURL(data []byte, compressed bool) *url.URL { + var query strings.Builder + appendQueryParam(&query, false, connectUnaryConnectQueryParameter, connectUnaryConnectQueryValue) + binary := m.stableCodec.IsBinary() || compressed + if binary { + appendQueryParam(&query, true, connectUnaryBase64QueryParameter, "1") + } + if compressed { + appendQueryParam(&query, true, connectUnaryCompressionQueryParameter, url.QueryEscape(m.compressionName)) + } + appendQueryParam(&query, true, connectUnaryEncodingQueryParameter, url.QueryEscape(m.codec.Name())) + if binary { + appendQueryParam(&query, true, connectUnaryMessageQueryParameter, encodeBinaryQueryValue(data)) + } else { + appendQueryParam(&query, true, connectUnaryMessageQueryParameter, url.QueryEscape(string(data))) + } + target := *m.duplexCall.URL() + target.RawQuery = query.String() + return &target +} + +func appendQueryParam(query *strings.Builder, withSeparator bool, key, escapedValue string) { + if withSeparator { + query.WriteByte('&') + } + query.WriteString(key) + query.WriteByte('=') + query.WriteString(escapedValue) +} + +func (m *connectUnaryRequestMarshaler) writeWithGet(url *url.URL) { + delHeaderCanonical(m.header, connectHeaderProtocolVersion) + delHeaderCanonical(m.header, headerContentType) + delHeaderCanonical(m.header, headerContentEncoding) + delHeaderCanonical(m.header, headerContentLength) + m.duplexCall.SetMethod(http.MethodGet) + *m.duplexCall.URL() = *url +} + +type connectUnaryUnmarshaler struct { + ctx context.Context //nolint:containedctx + reader io.Reader + codec Codec + compressionPool *compressionPool + bufferPool *bufferPool + alreadyRead bool + readMaxBytes int +} + +func (u *connectUnaryUnmarshaler) Unmarshal(message any) *Error { + return u.UnmarshalFunc(message, u.codec.Unmarshal) +} + +func (u *connectUnaryUnmarshaler) UnmarshalFunc(message any, unmarshal func([]byte, any) error) *Error { + if u.alreadyRead { + return NewError(CodeInternal, io.EOF) + } + u.alreadyRead = true + data := u.bufferPool.Get() + defer u.bufferPool.Put(data) + reader := u.reader + if u.readMaxBytes > 0 && int64(u.readMaxBytes) < math.MaxInt64 { + reader = io.LimitReader(u.reader, int64(u.readMaxBytes)+1) + } + // ReadFor ignores io.EOF, so any error here is real. + bytesRead, err := data.ReadFrom(reader) + if err != nil { + err = wrapIfMaxBytesError(err, "read first %d bytes of message", bytesRead) + err = wrapIfContextDone(u.ctx, err) + if connectErr, ok := asError(err); ok { + return connectErr + } + return errorf(CodeUnknown, "read message: %w", err) + } + if u.readMaxBytes > 0 && bytesRead > int64(u.readMaxBytes) { + // Attempt to read to end in order to allow connection re-use + discardedBytes, err := io.Copy(io.Discard, u.reader) + if err != nil { + return errorf(CodeResourceExhausted, "message is larger than configured max %d - unable to determine message size: %w", u.readMaxBytes, err) + } + return errorf(CodeResourceExhausted, "message size %d is larger than configured max %d", bytesRead+discardedBytes, u.readMaxBytes) + } + if data.Len() > 0 && u.compressionPool != nil { + decompressed := u.bufferPool.Get() + defer u.bufferPool.Put(decompressed) + if err := u.compressionPool.Decompress(decompressed, data, int64(u.readMaxBytes)); err != nil { + return err + } + data = decompressed + } + if err := unmarshal(data.Bytes(), message); err != nil { + return errorf(CodeInvalidArgument, "unmarshal message: %w", err) + } + return nil +} + +type connectWireDetail ErrorDetail + +func (d *connectWireDetail) MarshalJSON() ([]byte, error) { + if d.wireJSON != "" { + // If we unmarshaled this detail from JSON, return the original data. This + // lets proxies w/o protobuf descriptors preserve human-readable details. + return []byte(d.wireJSON), nil + } + wire := struct { + Type string `json:"type"` + Value string `json:"value"` + Debug json.RawMessage `json:"debug,omitempty"` + }{ + Type: typeNameForURL(d.pbAny.GetTypeUrl()), + Value: base64.RawStdEncoding.EncodeToString(d.pbAny.GetValue()), + } + // Try to produce debug info, but expect failure when we don't have + // descriptors. + msg, err := d.getInner() + if err == nil { + var codec protoJSONCodec + debug, err := codec.Marshal(msg) + if err == nil { + wire.Debug = debug + } + } + return json.Marshal(wire) +} + +func (d *connectWireDetail) UnmarshalJSON(data []byte) error { + var wire struct { + Type string `json:"type"` + Value string `json:"value"` + } + if err := json.Unmarshal(data, &wire); err != nil { + return err + } + if !strings.Contains(wire.Type, "/") { + wire.Type = defaultAnyResolverPrefix + wire.Type + } + decoded, err := DecodeBinaryHeader(wire.Value) + if err != nil { + return fmt.Errorf("decode base64: %w", err) + } + *d = connectWireDetail{ + pbAny: &anypb.Any{ + TypeUrl: wire.Type, + Value: decoded, + }, + wireJSON: string(data), + } + return nil +} + +func (d *connectWireDetail) getInner() (proto.Message, error) { + if d.pbInner != nil { + return d.pbInner, nil + } + return d.pbAny.UnmarshalNew() +} + +type connectWireError struct { + Code Code `json:"code"` + Message string `json:"message,omitempty"` + Details []*connectWireDetail `json:"details,omitempty"` +} + +func newConnectWireError(err error) *connectWireError { + wire := &connectWireError{ + Code: CodeUnknown, + Message: err.Error(), + } + if connectErr, ok := asError(err); ok { + wire.Code = connectErr.Code() + wire.Message = connectErr.Message() + if len(connectErr.details) > 0 { + wire.Details = make([]*connectWireDetail, len(connectErr.details)) + for i, detail := range connectErr.details { + wire.Details[i] = (*connectWireDetail)(detail) + } + } + } + return wire +} + +func (e *connectWireError) asError() *Error { + if e == nil { + return nil + } + if e.Code < minCode || e.Code > maxCode { + e.Code = CodeUnknown + } + err := NewWireError(e.Code, errors.New(e.Message)) + if len(e.Details) > 0 { + err.details = make([]*ErrorDetail, len(e.Details)) + for i, detail := range e.Details { + err.details[i] = (*ErrorDetail)(detail) + } + } + return err +} + +func (e *connectWireError) UnmarshalJSON(data []byte) error { + // We want to be lenient if the JSON has an unrecognized or invalid code. + // So if that occurs, we leave the code unset but can still de-serialize + // the other fields from the input JSON. + var wireError struct { + Code string `json:"code"` + Message string `json:"message"` + Details []*connectWireDetail `json:"details"` + } + err := json.Unmarshal(data, &wireError) + if err != nil { + return err + } + e.Message = wireError.Message + e.Details = wireError.Details + // This will leave e.Code unset if we can't unmarshal the given string. + _ = e.Code.UnmarshalText([]byte(wireError.Code)) + return nil +} + +type connectEndStreamMessage struct { + Error *connectWireError `json:"error,omitempty"` + Trailer http.Header `json:"metadata,omitempty"` +} + +func connectCodeToHTTP(code Code) int { + // Return literals rather than named constants from the HTTP package to make + // it easier to compare this function to the Connect specification. + switch code { + case CodeCanceled: + return 499 + case CodeUnknown: + return 500 + case CodeInvalidArgument: + return 400 + case CodeDeadlineExceeded: + return 504 + case CodeNotFound: + return 404 + case CodeAlreadyExists: + return 409 + case CodePermissionDenied: + return 403 + case CodeResourceExhausted: + return 429 + case CodeFailedPrecondition: + return 400 + case CodeAborted: + return 409 + case CodeOutOfRange: + return 400 + case CodeUnimplemented: + return 501 + case CodeInternal: + return 500 + case CodeUnavailable: + return 503 + case CodeDataLoss: + return 500 + case CodeUnauthenticated: + return 401 + default: + return 500 // same as CodeUnknown + } +} + +// connectEncodeTimeout encodes timeout as a positive number of milliseconds. +// Returns an empty string for timeouts over the protocol's ten-digit limit. +func connectEncodeTimeout(timeout time.Duration) string { + millis := max(int64(timeout/time.Millisecond), 1) + encoded := strconv.FormatInt(millis, 10 /* base */) + if len(encoded) > 10 { + return "" + } + return encoded +} + +func connectCodecForContentType(streamType StreamType, contentType string) string { + if streamType == StreamTypeUnary { + return strings.TrimPrefix(contentType, connectUnaryContentTypePrefix) + } + return strings.TrimPrefix(contentType, connectStreamingContentTypePrefix) +} + +func connectContentTypeForCodecName(streamType StreamType, name string) string { + if streamType == StreamTypeUnary { + return connectUnaryContentTypePrefix + name + } + return connectStreamingContentTypePrefix + name +} + +// encodeBinaryQueryValue URL-safe base64-encodes data, without padding. +func encodeBinaryQueryValue(data []byte) string { + return base64.RawURLEncoding.EncodeToString(data) +} + +// binaryQueryValueReader creates a reader that can read either padded or +// unpadded URL-safe base64 from a string. +func binaryQueryValueReader(data string) io.Reader { + stringReader := strings.NewReader(data) + if len(data)%4 != 0 { + // Data definitely isn't padded. + return base64.NewDecoder(base64.RawURLEncoding, stringReader) + } + // Data is padded, or no padding was necessary. + return base64.NewDecoder(base64.URLEncoding, stringReader) +} + +// queryValueReader creates a reader for a string that may be URL-safe base64 +// encoded. +func queryValueReader(data string, base64Encoded bool) io.Reader { + if base64Encoded { + return binaryQueryValueReader(data) + } + return strings.NewReader(data) +} + +func connectValidateUnaryResponseContentType( + requestCodecName string, + httpMethod string, + statusCode int, + statusMsg string, + responseContentType string, +) *Error { + if statusCode != http.StatusOK { + if statusCode == http.StatusNotModified && httpMethod == http.MethodGet { + return NewWireError(CodeUnknown, errNotModifiedClient) + } + // Error responses must be JSON-encoded. + if responseContentType == connectUnaryContentTypePrefix+codecNameJSON || + responseContentType == connectUnaryContentTypePrefix+codecNameJSONCharsetUTF8 { + return nil + } + return NewError( + httpToCode(statusCode), + errors.New(statusMsg), + ) + } + // Normal responses must have valid content-type that indicates same codec as the request. + if !strings.HasPrefix(responseContentType, connectUnaryContentTypePrefix) { + // Doesn't even look like a Connect response? Use code "unknown". + return errorf( + CodeUnknown, + "invalid content-type: %q; expecting %q", + responseContentType, + connectUnaryContentTypePrefix+requestCodecName, + ) + } + responseCodecName := connectCodecForContentType( + StreamTypeUnary, + responseContentType, + ) + if responseCodecName == requestCodecName { + return nil + } + // HACK: We likely want a better way to handle the optional "charset" parameter + // for application/json, instead of hard-coding. But this suffices for now. + if (responseCodecName == codecNameJSON && requestCodecName == codecNameJSONCharsetUTF8) || + (responseCodecName == codecNameJSONCharsetUTF8 && requestCodecName == codecNameJSON) { + // Both are JSON + return nil + } + return errorf( + CodeInternal, + "invalid content-type: %q; expecting %q", + responseContentType, + connectUnaryContentTypePrefix+requestCodecName, + ) +} + +func connectValidateStreamResponseContentType(requestCodecName string, streamType StreamType, responseContentType string) *Error { + // Responses must have valid content-type that indicates same codec as the request. + if !strings.HasPrefix(responseContentType, connectStreamingContentTypePrefix) { + // Doesn't even look like a Connect response? Use code "unknown". + return errorf( + CodeUnknown, + "invalid content-type: %q; expecting %q", + responseContentType, + connectStreamingContentTypePrefix+requestCodecName, + ) + } + responseCodecName := connectCodecForContentType( + streamType, + responseContentType, + ) + if responseCodecName != requestCodecName { + return errorf( + CodeInternal, + "invalid content-type: %q; expecting %q", + responseContentType, + connectStreamingContentTypePrefix+requestCodecName, + ) + } + return nil +} + +func connectCheckProtocolVersion(request *http.Request, required bool) *Error { + switch request.Method { + case http.MethodGet: + version := request.URL.Query().Get(connectUnaryConnectQueryParameter) + if version == "" && required { + return errorf(CodeInvalidArgument, "missing required query parameter: set %s to %q", connectUnaryConnectQueryParameter, connectUnaryConnectQueryValue) + } else if version != "" && version != connectUnaryConnectQueryValue { + return errorf(CodeInvalidArgument, "%s must be %q: got %q", connectUnaryConnectQueryParameter, connectUnaryConnectQueryValue, version) + } + case http.MethodPost: + version := getHeaderCanonical(request.Header, connectHeaderProtocolVersion) + if version == "" && required { + return errorf(CodeInvalidArgument, "missing required header: set %s to %q", connectHeaderProtocolVersion, connectProtocolVersion) + } else if version != "" && version != connectProtocolVersion { + return errorf(CodeInvalidArgument, "%s must be %q: got %q", connectHeaderProtocolVersion, connectProtocolVersion, version) + } + default: + return errorf(CodeInvalidArgument, "unsupported method: %q", request.Method) + } + return nil +} diff --git a/vendor/connectrpc.com/connect/protocol_grpc.go b/vendor/connectrpc.com/connect/protocol_grpc.go new file mode 100644 index 000000000..b084b7a78 --- /dev/null +++ b/vendor/connectrpc.com/connect/protocol_grpc.go @@ -0,0 +1,1036 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "bufio" + "context" + "errors" + "fmt" + "io" + "math" + "net/http" + "net/textproto" + "runtime" + "strconv" + "strings" + "time" + + statusv1 "connectrpc.com/connect/internal/gen/connectext/grpc/status/v1" +) + +const ( + grpcHeaderCompression = "Grpc-Encoding" + grpcHeaderAcceptCompression = "Grpc-Accept-Encoding" + grpcHeaderTimeout = "Grpc-Timeout" + grpcHeaderStatus = "Grpc-Status" + grpcHeaderMessage = "Grpc-Message" + grpcHeaderDetails = "Grpc-Status-Details-Bin" + + grpcFlagEnvelopeTrailer = 0b10000000 + + grpcContentTypeDefault = "application/grpc" + grpcWebContentTypeDefault = "application/grpc-web" + grpcContentTypePrefix = grpcContentTypeDefault + "+" + grpcWebContentTypePrefix = grpcWebContentTypeDefault + "+" + + headerXUserAgent = "X-User-Agent" + + upperhex = "0123456789ABCDEF" +) + +var ( + errTrailersWithoutGRPCStatus = fmt.Errorf("protocol error: no %s trailer: %w", grpcHeaderStatus, io.ErrUnexpectedEOF) + + // defaultGrpcUserAgent follows + // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#user-agents: + // + // While the protocol does not require a user-agent to function it is recommended + // that clients provide a structured user-agent string that provides a basic + // description of the calling library, version & platform to facilitate issue diagnosis + // in heterogeneous environments. The following structure is recommended to library developers: + // + // User-Agent → "grpc-" Language ?("-" Variant) "/" Version ?( " (" *(AdditionalProperty ";") ")" ) + // + //nolint:gochecknoglobals + defaultGrpcUserAgent = fmt.Sprintf("grpc-go-connect/%s (%s)", Version, runtime.Version()) + //nolint:gochecknoglobals + grpcAllowedMethods = map[string]struct{}{ + http.MethodPost: {}, + } +) + +type protocolGRPC struct { + web bool +} + +// NewHandler implements protocol, so it must return an interface. +func (g *protocolGRPC) NewHandler(params *protocolHandlerParams) protocolHandler { + bare, prefix := grpcContentTypeDefault, grpcContentTypePrefix + if g.web { + bare, prefix = grpcWebContentTypeDefault, grpcWebContentTypePrefix + } + contentTypes := make(map[string]struct{}) + for _, name := range params.Codecs.Names() { + contentTypes[canonicalizeContentType(prefix+name)] = struct{}{} + } + if params.Codecs.Get(codecNameProto) != nil { + contentTypes[bare] = struct{}{} + } + return &grpcHandler{ + protocolHandlerParams: *params, + web: g.web, + accept: contentTypes, + } +} + +// NewClient implements protocol, so it must return an interface. +func (g *protocolGRPC) NewClient(params *protocolClientParams) (protocolClient, error) { + peer := newPeerForURL(params.URL, ProtocolGRPC) + if g.web { + peer = newPeerForURL(params.URL, ProtocolGRPCWeb) + } + return &grpcClient{ + protocolClientParams: *params, + web: g.web, + peer: peer, + }, nil +} + +type grpcHandler struct { + protocolHandlerParams + + web bool + accept map[string]struct{} +} + +func (g *grpcHandler) Methods() map[string]struct{} { + return grpcAllowedMethods +} + +func (g *grpcHandler) ContentTypes() map[string]struct{} { + return g.accept +} + +func (*grpcHandler) SetTimeout(request *http.Request) (context.Context, context.CancelFunc, error) { + timeout, err := grpcParseTimeout(getHeaderCanonical(request.Header, grpcHeaderTimeout)) + if err != nil && !errors.Is(err, errNoTimeout) { + // Errors here indicate that the client sent an invalid timeout header, so + // the error text is safe to send back. + return nil, nil, NewError(CodeInvalidArgument, err) + } else if err != nil { + // err wraps errNoTimeout, nothing to do. + return request.Context(), nil, nil //nolint:nilerr + } + ctx, cancel := context.WithTimeout(request.Context(), timeout) + return ctx, cancel, nil +} + +func (g *grpcHandler) CanHandlePayload(_ *http.Request, contentType string) bool { + _, ok := g.accept[contentType] + return ok +} + +func (g *grpcHandler) NewConn( + responseWriter http.ResponseWriter, + request *http.Request, +) (handlerConnCloser, bool) { + ctx := request.Context() + // We need to parse metadata before entering the interceptor stack; we'll + // send the error to the client later on. + requestCompression, responseCompression, failed := negotiateCompression( + g.CompressionPools, + getHeaderCanonical(request.Header, grpcHeaderCompression), + getHeaderCanonical(request.Header, grpcHeaderAcceptCompression), + ) + if failed == nil { + failed = checkServerStreamsCanFlush(g.Spec, responseWriter) + } + + // Write any remaining headers here: + // (1) any writes to the stream will implicitly send the headers, so we + // should get all of gRPC's required response headers ready. + // (2) interceptors should be able to see these headers. + // + // Since we know that these header keys are already in canonical form, we can + // skip the normalization in Header.Set. + header := responseWriter.Header() + header[headerContentType] = []string{getHeaderCanonical(request.Header, headerContentType)} + header[grpcHeaderAcceptCompression] = []string{g.CompressionPools.CommaSeparatedNames()} + if responseCompression != compressionIdentity { + header[grpcHeaderCompression] = []string{responseCompression} + } + + codecName := grpcCodecForContentType(g.web, getHeaderCanonical(request.Header, headerContentType)) + codec := g.Codecs.Get(codecName) // handler.go guarantees this is not nil + protocolName := ProtocolGRPC + if g.web { + protocolName = ProtocolGRPCWeb + } + conn := wrapHandlerConnWithCodedErrors(&grpcHandlerConn{ + spec: g.Spec, + peer: Peer{ + Addr: request.RemoteAddr, + Protocol: protocolName, + }, + web: g.web, + bufferPool: g.BufferPool, + protobuf: g.Codecs.Protobuf(), // for errors + marshaler: grpcMarshaler{ + envelopeWriter: envelopeWriter{ + ctx: ctx, + sender: writeSender{writer: responseWriter}, + compressionPool: g.CompressionPools.Get(responseCompression), + codec: codec, + compressMinBytes: g.CompressMinBytes, + bufferPool: g.BufferPool, + sendMaxBytes: g.SendMaxBytes, + }, + }, + responseWriter: responseWriter, + responseHeader: make(http.Header), + responseTrailer: make(http.Header), + request: request, + unmarshaler: grpcUnmarshaler{ + envelopeReader: envelopeReader{ + ctx: ctx, + reader: request.Body, + codec: codec, + compressionPool: g.CompressionPools.Get(requestCompression), + bufferPool: g.BufferPool, + readMaxBytes: g.ReadMaxBytes, + }, + web: g.web, + }, + }) + if failed != nil { + // Negotiation failed, so we can't establish a stream. + _ = conn.Close(failed) + return nil, false + } + return conn, true +} + +type grpcClient struct { + protocolClientParams + + web bool + peer Peer +} + +func (g *grpcClient) Peer() Peer { + return g.peer +} + +func (g *grpcClient) WriteRequestHeader(_ StreamType, header http.Header) { + setUserAgentIfAbsent(header, defaultGrpcUserAgent) + // We know these header keys are in canonical form, so we can bypass all the + // checks in Header.Set. + if g.web && getHeaderCanonical(header, headerXUserAgent) == "" { + // The gRPC-Web pseudo-specification seems to require X-User-Agent rather + // than User-Agent for all clients, even if they're not browser-based. This + // is very odd for a backend client, so we'll split the difference and set + // both. + header[headerXUserAgent] = []string{defaultGrpcUserAgent} + } + header[headerContentType] = []string{grpcContentTypeForCodecName(g.web, g.Codec.Name())} + // gRPC handles compression on a per-message basis, so we don't want to + // compress the whole stream. By default, http.Client will ask the server + // to gzip the stream if we don't set Accept-Encoding. + header["Accept-Encoding"] = []string{compressionIdentity} + if g.CompressionName != "" && g.CompressionName != compressionIdentity { + header[grpcHeaderCompression] = []string{g.CompressionName} + } + if acceptCompression := g.CompressionPools.CommaSeparatedNames(); acceptCompression != "" { + header[grpcHeaderAcceptCompression] = []string{acceptCompression} + } + if !g.web { + // The gRPC-HTTP2 specification requires this - it flushes out proxies that + // don't support HTTP trailers. + header["Te"] = []string{"trailers"} + } +} + +func (g *grpcClient) NewConn( + ctx context.Context, + spec Spec, + header http.Header, +) streamingClientConn { + if deadline, ok := ctx.Deadline(); ok { + encodedDeadline := grpcEncodeTimeout(time.Until(deadline)) + header[grpcHeaderTimeout] = []string{encodedDeadline} + } + duplexCall := newDuplexHTTPCall( + ctx, + g.HTTPClient, + g.URL, + spec, + header, + ) + conn := &grpcClientConn{ + spec: spec, + peer: g.Peer(), + duplexCall: duplexCall, + compressionPools: g.CompressionPools, + bufferPool: g.BufferPool, + protobuf: g.Protobuf, + marshaler: grpcMarshaler{ + envelopeWriter: envelopeWriter{ + ctx: ctx, + sender: duplexCall, + compressionPool: g.CompressionPools.Get(g.CompressionName), + codec: g.Codec, + compressMinBytes: g.CompressMinBytes, + bufferPool: g.BufferPool, + sendMaxBytes: g.SendMaxBytes, + }, + }, + unmarshaler: grpcUnmarshaler{ + envelopeReader: envelopeReader{ + ctx: ctx, + reader: duplexCall, + codec: g.Codec, + bufferPool: g.BufferPool, + readMaxBytes: g.ReadMaxBytes, + }, + }, + responseHeader: make(http.Header), + responseTrailer: make(http.Header), + } + duplexCall.SetValidateResponse(conn.validateResponse) + if g.web { + conn.unmarshaler.web = true + conn.readTrailers = func(unmarshaler *grpcUnmarshaler, _ *duplexHTTPCall) http.Header { + return unmarshaler.WebTrailer() + } + } else { + conn.readTrailers = func(_ *grpcUnmarshaler, call *duplexHTTPCall) http.Header { + // To access HTTP trailers, we need to read the body to EOF. + _, _ = discard(call) + return call.ResponseTrailer() + } + } + return wrapClientConnWithCodedErrors(conn) +} + +// grpcClientConn works for both gRPC and gRPC-Web. +type grpcClientConn struct { + spec Spec + peer Peer + duplexCall *duplexHTTPCall + compressionPools readOnlyCompressionPools + bufferPool *bufferPool + protobuf Codec // for errors + marshaler grpcMarshaler + unmarshaler grpcUnmarshaler + responseHeader http.Header + responseTrailer http.Header + readTrailers func(*grpcUnmarshaler, *duplexHTTPCall) http.Header +} + +func (cc *grpcClientConn) Spec() Spec { + return cc.spec +} + +func (cc *grpcClientConn) Peer() Peer { + return cc.peer +} + +func (cc *grpcClientConn) Send(msg any) error { + if err := cc.marshaler.Marshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (cc *grpcClientConn) RequestHeader() http.Header { + return cc.duplexCall.Header() +} + +func (cc *grpcClientConn) CloseRequest() error { + return cc.duplexCall.CloseWrite() +} + +func (cc *grpcClientConn) Receive(msg any) error { + if _, err := cc.duplexCall.blockUntilResponseReady(); err != nil { + return err + } + err := cc.unmarshaler.Unmarshal(msg) + if err == nil { + return nil + } + if !errors.Is(err, io.EOF) { + // The body may still be open, for example after rejecting a message + // larger than the read limit. Close it so reading the trailers doesn't + // wait for the server, which in a full-duplex stream may be waiting on + // the client. Trailers already received at EOF are kept. + _ = cc.duplexCall.CloseRead() + } + mergeHeaders( + cc.responseTrailer, + cc.readTrailers(&cc.unmarshaler, cc.duplexCall), + ) + if errors.Is(err, io.EOF) && cc.unmarshaler.bytesRead == 0 && len(cc.responseTrailer) == 0 { + // No body and no trailers means a trailers-only response. + // Note: per the specification, only the HTTP status code and Content-Type + // should be treated as headers. The rest should be treated as trailing + // metadata. But it would be unsafe to mutate cc.responseHeader at this + // point. So we'll leave cc.responseHeader alone but copy the relevant + // metadata into cc.responseTrailer. + mergeHeaders(cc.responseTrailer, cc.responseHeader) + delHeaderCanonical(cc.responseTrailer, headerContentType) + + // Try to read the status out of the headers. + serverErr := grpcErrorForTrailer(cc.protobuf, cc.responseHeader) + if serverErr == nil { + // Status says "OK". So return original error (io.EOF). + return err + } + serverErr.meta = cc.responseHeader.Clone() + return serverErr + } + + // See if the server sent an explicit error in the HTTP or gRPC-Web trailers. + serverErr := grpcErrorForTrailer(cc.protobuf, cc.responseTrailer) + if serverErr != nil && (errors.Is(err, io.EOF) || !errors.Is(serverErr, errTrailersWithoutGRPCStatus)) { + // We've either: + // - Cleanly read until the end of the response body and *not* received + // gRPC status trailers, which is a protocol error, or + // - Received an explicit error from the server. + // + // This is expected from a protocol perspective, but receiving trailers + // means that we're _not_ getting a message. For users to realize that + // the stream has ended, Receive must return an error. + serverErr.meta = cc.responseHeader.Clone() + mergeHeaders(serverErr.meta, cc.responseTrailer) + _ = cc.duplexCall.CloseWrite() + return serverErr + } + // This was probably an error converting the bytes to a message or an error + // reading from the network. We're going to return it to the + // user, but we also want to close writes so Send errors out. + _ = cc.duplexCall.CloseWrite() + return err +} + +func (cc *grpcClientConn) ResponseHeader() http.Header { + _, _ = cc.duplexCall.blockUntilResponseReady() + return cc.responseHeader +} + +func (cc *grpcClientConn) ResponseTrailer() http.Header { + _, _ = cc.duplexCall.blockUntilResponseReady() + return cc.responseTrailer +} + +func (cc *grpcClientConn) CloseResponse() error { + return cc.duplexCall.CloseRead() +} + +func (cc *grpcClientConn) onRequestSend(fn func(*http.Request)) { + cc.duplexCall.onRequestSend = fn +} + +func (cc *grpcClientConn) validateResponse(response *http.Response) *Error { + if err := grpcValidateResponse( + response, + cc.responseHeader, + cc.compressionPools, + cc.unmarshaler.web, + cc.marshaler.codec.Name(), + ); err != nil { + return err + } + compression := getHeaderCanonical(response.Header, grpcHeaderCompression) + cc.unmarshaler.compressionPool = cc.compressionPools.Get(compression) + return nil +} + +type grpcHandlerConn struct { + spec Spec + peer Peer + web bool + bufferPool *bufferPool + protobuf Codec // for errors + marshaler grpcMarshaler + responseWriter http.ResponseWriter + responseHeader http.Header + responseTrailer http.Header + wroteToBody bool + request *http.Request + unmarshaler grpcUnmarshaler +} + +func (hc *grpcHandlerConn) Spec() Spec { + return hc.spec +} + +func (hc *grpcHandlerConn) Peer() Peer { + return hc.peer +} + +func (hc *grpcHandlerConn) Receive(msg any) error { + if err := hc.unmarshaler.Unmarshal(msg); err != nil { + return err // already coded + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (hc *grpcHandlerConn) RequestHeader() http.Header { + return hc.request.Header +} + +func (hc *grpcHandlerConn) Send(msg any) error { + defer flushResponseWriter(hc.responseWriter) + if !hc.wroteToBody { + mergeHeaders(hc.responseWriter.Header(), hc.responseHeader) + hc.wroteToBody = true + } + if err := hc.marshaler.Marshal(msg); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error +} + +func (hc *grpcHandlerConn) ResponseHeader() http.Header { + return hc.responseHeader +} + +func (hc *grpcHandlerConn) ResponseTrailer() http.Header { + return hc.responseTrailer +} + +func (hc *grpcHandlerConn) Close(err error) (retErr error) { + defer func() { + // We don't want to copy unread portions of the body to /dev/null here: if + // the client hasn't closed the request body, we'll block until the server + // timeout kicks in. This could happen because the client is malicious, but + // a well-intentioned client may just not expect the server to be returning + // an error for a streaming RPC. Better to accept that we can't always reuse + // TCP connections. + closeErr := hc.request.Body.Close() + if retErr == nil { + retErr = closeErr + } + }() + defer flushResponseWriter(hc.responseWriter) + // If we haven't written the headers yet, do so. + if !hc.wroteToBody { + mergeHeaders(hc.responseWriter.Header(), hc.responseHeader) + } + // gRPC always sends the error's code, message, details, and metadata as + // trailing metadata. The Connect protocol doesn't do this, so we don't want + // to mutate the trailers map that the user sees. + mergedTrailers := make( + http.Header, + len(hc.responseTrailer)+2, // always make space for status & message + ) + mergeHeaders(mergedTrailers, hc.responseTrailer) + grpcErrorToTrailer(mergedTrailers, hc.protobuf, err) + if hc.web && !hc.wroteToBody && len(hc.responseHeader) == 0 { + // We're using gRPC-Web, we haven't yet written to the body, and there are no + // custom headers. That means we can send a "trailers-only" response and send + // trailing metadata as HTTP headers (instead of as trailers). + mergeHeaders(hc.responseWriter.Header(), mergedTrailers) + return nil + } + if hc.web { + // We're using gRPC-Web and we've already sent the headers, so we write + // trailing metadata to the HTTP body. + if err := hc.marshaler.MarshalWebTrailers(mergedTrailers); err != nil { + return err + } + return nil // must be a literal nil: nil *Error is a non-nil error + } + // We're using standard gRPC. Even if we haven't written to the body and + // we're sending a "trailers-only" response, we must send trailing metadata + // as HTTP trailers. (If we had frame-level control of the HTTP/2 layer, we + // could send trailers-only responses as a single HEADER frame and no DATA + // frames, but net/http doesn't expose APIs that low-level.) + // + // In net/http's ResponseWriter API, we send HTTP trailers by writing to the + // headers map with a special prefix. This prefixing is an implementation + // detail, so we should hide it and _not_ mutate the user-visible headers. + // + // Note that this is _very_ finicky and difficult to test with net/http, + // since correctness depends on low-level framing details. Breaking this + // logic breaks Envoy's gRPC-Web translation. + for key, values := range mergedTrailers { + for _, value := range values { + // These are potentially user-supplied, so we can't assume they're in + // canonical form. + hc.responseWriter.Header().Add(http.TrailerPrefix+key, value) + } + } + return nil +} + +type grpcMarshaler struct { + envelopeWriter +} + +func (m *grpcMarshaler) MarshalWebTrailers(trailer http.Header) *Error { + raw := m.bufferPool.Get() + defer m.bufferPool.Put(raw) + for key, values := range trailer { + // Per the Go specification, keys inserted during iteration may be produced + // later in the iteration or may be skipped. For safety, avoid mutating the + // map if the key is already lower-cased. + lower := strings.ToLower(key) + if key == lower { + continue + } + delete(trailer, key) + trailer[lower] = values + } + if err := trailer.Write(raw); err != nil { + return errorf(CodeInternal, "format trailers: %w", err) + } + writeErr := m.Write(&envelope{ + Data: raw, + Flags: grpcFlagEnvelopeTrailer, + }) + if writeErr == nil || writeErr.Code() != CodeResourceExhausted { + return writeErr + } + // The trailers exceed sendMaxBytes. Rather than drop them, send only the + // status and message, reporting the limit if there's no error. + status, message := strings.ToLower(grpcHeaderStatus), strings.ToLower(grpcHeaderMessage) + minimal := http.Header{status: trailer[status], message: trailer[message]} + if code := trailer[status]; len(code) == 0 || code[0] == "0" { + minimal = http.Header{ + status: {strconv.Itoa(int(writeErr.Code()))}, + message: {grpcPercentEncode(writeErr.Message())}, + } + } + raw.Reset() + if err := minimal.Write(raw); err != nil { + return errorf(CodeInternal, "format trailers: %w", err) + } + return m.write(&envelope{ + Data: raw, + Flags: grpcFlagEnvelopeTrailer, + }) +} + +type grpcUnmarshaler struct { + envelopeReader + + web bool + webTrailer http.Header +} + +func (u *grpcUnmarshaler) Unmarshal(message any) *Error { + err := u.envelopeReader.Unmarshal(message) + if err == nil { + return nil + } + if !errors.Is(err, errSpecialEnvelope) { + return err + } + env := u.last + data := env.Data + u.last.Data = nil // don't keep a reference to it + defer u.bufferPool.Put(data) + if !u.web || !env.IsSet(grpcFlagEnvelopeTrailer) { + return errorf(CodeInternal, "protocol error: invalid envelope flags %d", env.Flags) + } + + // Per the gRPC-Web specification, trailers should be encoded as an HTTP/1 + // headers block _without_ the terminating newline. To make the headers + // parseable by net/textproto, we need to add the newline. + if err := data.WriteByte('\n'); err != nil { + return errorf(CodeInternal, "unmarshal web trailers: %w", err) + } + bufferedReader := bufio.NewReader(data) + mimeReader := textproto.NewReader(bufferedReader) + mimeHeader, mimeErr := mimeReader.ReadMIMEHeader() + if mimeErr != nil { + return errorf( + CodeInternal, + "gRPC-Web protocol error: trailers invalid: %w", + mimeErr, + ) + } + u.webTrailer = http.Header(mimeHeader) + return errSpecialEnvelope +} + +func (u *grpcUnmarshaler) WebTrailer() http.Header { + return u.webTrailer +} + +func grpcValidateResponse( + response *http.Response, + header http.Header, + availableCompressors readOnlyCompressionPools, + web bool, + codecName string, +) *Error { + if response.StatusCode != http.StatusOK { + return errorf(httpToCode(response.StatusCode), "HTTP status %v", response.Status) + } + if err := grpcValidateResponseContentType( + web, + codecName, + getHeaderCanonical(response.Header, headerContentType), + ); err != nil { + return err + } + if compression := getHeaderCanonical(response.Header, grpcHeaderCompression); compression != "" && + compression != compressionIdentity && + !availableCompressors.Contains(compression) { + // Per https://github.com/grpc/grpc/blob/master/doc/compression.md, we + // should return CodeInternal and specify acceptable compression(s) (in + // addition to setting the Grpc-Accept-Encoding header). + return errorf( + CodeInternal, + "unknown encoding %q: accepted encodings are %v", + compression, + availableCompressors.CommaSeparatedNames(), + ) + } + // The response is valid, so we should expose the headers. + mergeHeaders(header, response.Header) + return nil +} + +// The gRPC wire protocol specifies that errors should be serialized using the +// binary Protobuf format, even if the messages in the request/response stream +// use a different codec. Consequently, this function needs a Protobuf codec to +// unmarshal error information in the headers. +// +// A nil error is only returned when a grpc-status key IS present, but it +// indicates a code of zero (no error). If no grpc-status key is present, this +// returns a non-nil *Error that wraps errTrailersWithoutGRPCStatus. +func grpcErrorForTrailer(protobuf Codec, trailer http.Header) *Error { + codeHeader := getHeaderCanonical(trailer, grpcHeaderStatus) + if codeHeader == "" { + // If there are no trailers at all, that's an internal error. + // But if it's an error determining the status code from the + // trailers, it's unknown. + code := CodeUnknown + if len(trailer) == 0 { + code = CodeInternal + } + return NewError(code, errTrailersWithoutGRPCStatus) + } + if codeHeader == "0" { + return nil + } + + code, err := strconv.ParseUint(codeHeader, 10 /* base */, 32 /* bitsize */) + if err != nil { + return errorf(CodeUnknown, "protocol error: invalid error code %q", codeHeader) + } + message, err := grpcPercentDecode(getHeaderCanonical(trailer, grpcHeaderMessage)) + if err != nil { + return errorf(CodeInternal, "protocol error: invalid error message %q", message) + } + retErr := NewWireError(Code(code), errors.New(message)) + + detailsBinaryEncoded := getHeaderCanonical(trailer, grpcHeaderDetails) + if len(detailsBinaryEncoded) > 0 { + detailsBinary, err := DecodeBinaryHeader(detailsBinaryEncoded) + if err != nil { + return errorf(CodeInternal, "server returned invalid grpc-status-details-bin trailer: %w", err) + } + var status statusv1.Status + if err := protobuf.Unmarshal(detailsBinary, &status); err != nil { + return errorf(CodeInternal, "server returned invalid protobuf for error details: %w", err) + } + for _, d := range status.GetDetails() { + retErr.details = append(retErr.details, &ErrorDetail{pbAny: d}) + } + // Prefer the Protobuf-encoded data to the headers (grpc-go does this too). + retErr.code = Code(status.GetCode()) //nolint:gosec // No information loss + retErr.err = errors.New(status.GetMessage()) + } + + return retErr +} + +func grpcParseTimeout(timeout string) (time.Duration, error) { + if timeout == "" { + return 0, errNoTimeout + } + unit, err := grpcTimeoutUnitLookup(timeout[len(timeout)-1]) + if err != nil { + return 0, err + } + num, err := strconv.ParseInt(timeout[:len(timeout)-1], 10 /* base */, 64 /* bitsize */) + if err != nil || num < 0 { + return 0, fmt.Errorf("protocol error: invalid timeout %q", timeout) + } + if num > 99999999 { // timeout must be ASCII string of at most 8 digits + return 0, fmt.Errorf("protocol error: timeout %q is too long", timeout) + } + const grpcTimeoutMaxHours = math.MaxInt64 / int64(time.Hour) // how many hours fit into a time.Duration? + if unit == time.Hour && num > grpcTimeoutMaxHours { + // Timeout is effectively unbounded, so ignore it. The grpc-go + // implementation does the same thing. + return 0, errNoTimeout + } + return time.Duration(num) * unit, nil +} + +func grpcEncodeTimeout(timeout time.Duration) string { + if timeout <= 0 { + return "0n" + } + // The gRPC protocol limits timeouts to 8 characters (not counting the unit), + // so timeouts must be strictly less than 1e8 of the appropriate unit. + const grpcTimeoutMaxValue = 1e8 + var ( + size time.Duration + unit byte + ) + switch { + case timeout < time.Nanosecond*grpcTimeoutMaxValue: + size, unit = time.Nanosecond, 'n' + case timeout < time.Microsecond*grpcTimeoutMaxValue: + size, unit = time.Microsecond, 'u' + case timeout < time.Millisecond*grpcTimeoutMaxValue: + size, unit = time.Millisecond, 'm' + case timeout < time.Second*grpcTimeoutMaxValue: + size, unit = time.Second, 'S' + case timeout < time.Minute*grpcTimeoutMaxValue: + size, unit = time.Minute, 'M' + default: + // time.Duration is an int64 number of nanoseconds, so the largest + // expressible duration is less than 1e8 hours. + size, unit = time.Hour, 'H' + } + buf := make([]byte, 0, 9) + buf = strconv.AppendInt(buf, int64(timeout/size), 10 /* base */) + buf = append(buf, unit) + return string(buf) +} + +func grpcTimeoutUnitLookup(unit byte) (time.Duration, error) { + switch unit { + case 'n': + return time.Nanosecond, nil + case 'u': + return time.Microsecond, nil + case 'm': + return time.Millisecond, nil + case 'S': + return time.Second, nil + case 'M': + return time.Minute, nil + case 'H': + return time.Hour, nil + default: + return 0, fmt.Errorf("protocol error: timeout has invalid unit %q", unit) + } +} + +func grpcCodecForContentType(web bool, contentType string) string { + if (!web && contentType == grpcContentTypeDefault) || (web && contentType == grpcWebContentTypeDefault) { + // implicitly protobuf + return codecNameProto + } + prefix := grpcContentTypePrefix + if web { + prefix = grpcWebContentTypePrefix + } + return strings.TrimPrefix(contentType, prefix) +} + +func grpcContentTypeForCodecName(web bool, name string) string { + if web { + return grpcWebContentTypePrefix + name + } + if name == codecNameProto { + // For compatibility with Google Cloud Platform's frontends, prefer an + // implicit default codec. See + // https://github.com/connectrpc/connect-go/pull/655#issuecomment-1915754523 + // for details. + return grpcContentTypeDefault + } + return grpcContentTypePrefix + name +} + +func grpcErrorToTrailer(trailer http.Header, protobuf Codec, err error) { + if err == nil { + setHeaderCanonical(trailer, grpcHeaderStatus, "0") // zero is the gRPC OK status + return + } + if connectErr, ok := asError(err); ok && !connectErr.wireErr { + mergeNonProtocolHeaders(trailer, connectErr.meta) + } + var ( + status = grpcStatusForError(err) + code = status.GetCode() + message = status.GetMessage() + bin []byte + ) + if len(status.Details) > 0 { + var binErr error + bin, binErr = protobuf.Marshal(status) + if binErr != nil { + code = int32(CodeInternal) + message = fmt.Sprintf("marshal protobuf status: %v", binErr) + } + } + setHeaderCanonical(trailer, grpcHeaderStatus, strconv.Itoa(int(code))) + setHeaderCanonical(trailer, grpcHeaderMessage, grpcPercentEncode(message)) + if len(bin) > 0 { + setHeaderCanonical(trailer, grpcHeaderDetails, EncodeBinaryHeader(bin)) + } +} + +func grpcStatusForError(err error) *statusv1.Status { + status := &statusv1.Status{ + Code: int32(CodeUnknown), + Message: err.Error(), + } + if connectErr, ok := asError(err); ok { + status.Code = int32(connectErr.Code()) //nolint:gosec // No information loss + status.Message = connectErr.Message() + status.Details = connectErr.detailsAsAny() + } + return status +} + +// grpcPercentEncode follows RFC 3986 Section 2.1 and the gRPC HTTP/2 spec. +// It's a variant of URL-encoding with fewer reserved characters. It's intended +// to take UTF-8 encoded text and escape non-ASCII bytes so that they're valid +// HTTP/1 headers, while still maximizing readability of the data on the wire. +// +// The grpc-message trailer (used for human-readable error messages) should be +// percent-encoded. +// +// References: +// +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses +// https://datatracker.ietf.org/doc/html/rfc3986#section-2.1 +func grpcPercentEncode(msg string) string { + var hexCount int + for i := range len(msg) { + if grpcShouldEscape(msg[i]) { + hexCount++ + } + } + if hexCount == 0 { + return msg + } + // We need to escape some characters, so we'll need to allocate a new string. + var out strings.Builder + out.Grow(len(msg) + 2*hexCount) + for i := range len(msg) { + switch char := msg[i]; { + case grpcShouldEscape(char): + out.WriteByte('%') + out.WriteByte(upperhex[char>>4]) + out.WriteByte(upperhex[char&15]) + default: + out.WriteByte(char) + } + } + return out.String() +} + +func grpcPercentDecode(input string) (string, error) { + percentCount := 0 + for i := 0; i < len(input); { + switch input[i] { + case '%': + percentCount++ + if err := validateHex(input[i:]); err != nil { + return "", err + } + i += 3 + default: + i++ + } + } + if percentCount == 0 { + return input, nil + } + // We need to unescape some characters, so we'll need to allocate a new string. + var out strings.Builder + out.Grow(len(input) - 2*percentCount) + for i := 0; i < len(input); i++ { + switch input[i] { + case '%': + out.WriteByte(unhex(input[i+1])<<4 | unhex(input[i+2])) + i += 2 + default: + out.WriteByte(input[i]) + } + } + return out.String(), nil +} + +// Characters that need to be escaped are defined in gRPC's HTTP/2 spec. +// They're different from the generic set defined in RFC 3986. +func grpcShouldEscape(char byte) bool { + return char < ' ' || char > '~' || char == '%' +} + +func unhex(char byte) byte { + switch { + case '0' <= char && char <= '9': + return char - '0' + case 'a' <= char && char <= 'f': + return char - 'a' + 10 + case 'A' <= char && char <= 'F': + return char - 'A' + 10 + } + return 0 +} + +func isHex(char byte) bool { + return ('0' <= char && char <= '9') || ('a' <= char && char <= 'f') || ('A' <= char && char <= 'F') +} + +func validateHex(input string) error { + if len(input) < 3 || input[0] != '%' || !isHex(input[1]) || !isHex(input[2]) { + if len(input) > 3 { + input = input[:3] + } + return fmt.Errorf("invalid percent-encoded string %q", input) + } + return nil +} + +func grpcValidateResponseContentType(web bool, requestCodecName string, responseContentType string) *Error { + // Responses must have valid content-type that indicates same codec as the request. + bare, prefix := grpcContentTypeDefault, grpcContentTypePrefix + if web { + bare, prefix = grpcWebContentTypeDefault, grpcWebContentTypePrefix + } + if responseContentType == prefix+requestCodecName || + (requestCodecName == codecNameProto && responseContentType == bare) { + return nil + } + expectedContentType := bare + if requestCodecName != codecNameProto { + expectedContentType = prefix + requestCodecName + } + code := CodeInternal + if responseContentType != bare && !strings.HasPrefix(responseContentType, prefix) { + // Doesn't even look like a gRPC response? Use code "unknown". + code = CodeUnknown + } + return errorf( + code, + "invalid content-type: %q; expecting %q", + responseContentType, + expectedContentType, + ) +} diff --git a/vendor/connectrpc.com/connect/recover.go b/vendor/connectrpc.com/connect/recover.go new file mode 100644 index 000000000..d59705d4a --- /dev/null +++ b/vendor/connectrpc.com/connect/recover.go @@ -0,0 +1,64 @@ +// Copyright 2021-2026 The Connect Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package connect + +import ( + "context" + "net/http" +) + +// recoverHandlerInterceptor lets handlers trap panics, perform side effects +// (like emitting logs or metrics), and present a friendlier error message to +// clients. +type recoverHandlerInterceptor struct { + Interceptor + + handle func(context.Context, Spec, http.Header, any) error +} + +func (i *recoverHandlerInterceptor) WrapUnary(next UnaryFunc) UnaryFunc { + return func(ctx context.Context, req AnyRequest) (_ AnyResponse, retErr error) { + if req.Spec().IsClient { + return next(ctx, req) + } + defer func() { + if r := recover(); r != nil { + // net/http checks for ErrAbortHandler with ==, so we should too. + if r == http.ErrAbortHandler { //nolint:errorlint,err113 + panic(r) //nolint:forbidigo + } + retErr = i.handle(ctx, req.Spec(), req.Header(), r) + } + }() + res, err := next(ctx, req) + return res, err + } +} + +func (i *recoverHandlerInterceptor) WrapStreamingHandler(next StreamingHandlerFunc) StreamingHandlerFunc { + return func(ctx context.Context, conn StreamingHandlerConn) (retErr error) { + defer func() { + if r := recover(); r != nil { + // net/http checks for ErrAbortHandler with ==, so we should too. + if r == http.ErrAbortHandler { //nolint:errorlint,err113 + panic(r) //nolint:forbidigo + } + retErr = i.handle(ctx, conn.Spec(), conn.RequestHeader(), r) + } + }() + err := next(ctx, conn) + return err + } +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/cluster.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/cluster.pb.go new file mode 100644 index 000000000..ed7e6636e --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/cluster.pb.go @@ -0,0 +1,3128 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/cluster/v2/cluster.proto + +package clusterv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ClusterRef names a cluster: the account that owns it and its name there. +type ClusterRef struct { + state protoimpl.MessageState `protogen:"open.v1"` + // owner is the user or organization name. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // provider narrows the lookup to one hosting provider, e.g. "EKS". + Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterRef) Reset() { + *x = ClusterRef{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterRef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterRef) ProtoMessage() {} + +func (x *ClusterRef) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterRef.ProtoReflect.Descriptor instead. +func (*ClusterRef) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{0} +} + +func (x *ClusterRef) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ClusterRef) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterRef) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +type Cluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"` + OwnerId string `protobuf:"bytes,5,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + OwnerName string `protobuf:"bytes,6,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` + // manager_id is the account whose hub manages the cluster, if any. + ManagerId string `protobuf:"bytes,7,opt,name=manager_id,json=managerId,proto3" json:"manager_id,omitempty"` + ExternalId string `protobuf:"bytes,8,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` + HubClusterName string `protobuf:"bytes,9,opt,name=hub_cluster_name,json=hubClusterName,proto3" json:"hub_cluster_name,omitempty"` + HubClusterUid string `protobuf:"bytes,10,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + HubClusterOwnerName string `protobuf:"bytes,11,opt,name=hub_cluster_owner_name,json=hubClusterOwnerName,proto3" json:"hub_cluster_owner_name,omitempty"` + Provider string `protobuf:"bytes,12,opt,name=provider,proto3" json:"provider,omitempty"` + Vendor string `protobuf:"bytes,13,opt,name=vendor,proto3" json:"vendor,omitempty"` + InfraNamespace string `protobuf:"bytes,14,opt,name=infra_namespace,json=infraNamespace,proto3" json:"infra_namespace,omitempty"` + IsMonitoringCluster bool `protobuf:"varint,15,opt,name=is_monitoring_cluster,json=isMonitoringCluster,proto3" json:"is_monitoring_cluster,omitempty"` + Endpoint string `protobuf:"bytes,16,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + Location string `protobuf:"bytes,17,opt,name=location,proto3" json:"location,omitempty"` + Project string `protobuf:"bytes,18,opt,name=project,proto3" json:"project,omitempty"` + KubernetesVersion string `protobuf:"bytes,19,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` + NodeCount int32 `protobuf:"varint,20,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + ClusterManagers []string `protobuf:"bytes,22,rep,name=cluster_managers,json=clusterManagers,proto3" json:"cluster_managers,omitempty"` + Status *ClusterStatus `protobuf:"bytes,23,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Cluster) Reset() { + *x = Cluster{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Cluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cluster) ProtoMessage() {} + +func (x *Cluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cluster.ProtoReflect.Descriptor instead. +func (*Cluster) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{1} +} + +func (x *Cluster) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Cluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Cluster) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Cluster) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *Cluster) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *Cluster) GetOwnerName() string { + if x != nil { + return x.OwnerName + } + return "" +} + +func (x *Cluster) GetManagerId() string { + if x != nil { + return x.ManagerId + } + return "" +} + +func (x *Cluster) GetExternalId() string { + if x != nil { + return x.ExternalId + } + return "" +} + +func (x *Cluster) GetHubClusterName() string { + if x != nil { + return x.HubClusterName + } + return "" +} + +func (x *Cluster) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *Cluster) GetHubClusterOwnerName() string { + if x != nil { + return x.HubClusterOwnerName + } + return "" +} + +func (x *Cluster) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *Cluster) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *Cluster) GetInfraNamespace() string { + if x != nil { + return x.InfraNamespace + } + return "" +} + +func (x *Cluster) GetIsMonitoringCluster() bool { + if x != nil { + return x.IsMonitoringCluster + } + return false +} + +func (x *Cluster) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Cluster) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *Cluster) GetProject() string { + if x != nil { + return x.Project + } + return "" +} + +func (x *Cluster) GetKubernetesVersion() string { + if x != nil { + return x.KubernetesVersion + } + return "" +} + +func (x *Cluster) GetNodeCount() int32 { + if x != nil { + return x.NodeCount + } + return 0 +} + +func (x *Cluster) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Cluster) GetClusterManagers() []string { + if x != nil { + return x.ClusterManagers + } + return nil +} + +func (x *Cluster) GetStatus() *ClusterStatus { + if x != nil { + return x.Status + } + return nil +} + +type ClusterStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + // phase is e.g. "Active", "NotConnected", "Inactive" or "Registered". + Phase string `protobuf:"bytes,1,opt,name=phase,proto3" json:"phase,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterStatus) Reset() { + *x = ClusterStatus{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterStatus) ProtoMessage() {} + +func (x *ClusterStatus) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterStatus.ProtoReflect.Descriptor instead. +func (*ClusterStatus) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{2} +} + +func (x *ClusterStatus) GetPhase() string { + if x != nil { + return x.Phase + } + return "" +} + +func (x *ClusterStatus) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *ClusterStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type GetClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterRequest) Reset() { + *x = GetClusterRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterRequest) ProtoMessage() {} + +func (x *GetClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterRequest.ProtoReflect.Descriptor instead. +func (*GetClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{3} +} + +func (x *GetClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type GetClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterResponse) Reset() { + *x = GetClusterResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterResponse) ProtoMessage() {} + +func (x *GetClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterResponse.ProtoReflect.Descriptor instead. +func (*GetClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{4} +} + +func (x *GetClusterResponse) GetCluster() *Cluster { + if x != nil { + return x.Cluster + } + return nil +} + +type UpdateClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateClusterRequest) Reset() { + *x = UpdateClusterRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateClusterRequest) ProtoMessage() {} + +func (x *UpdateClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateClusterRequest.ProtoReflect.Descriptor instead. +func (*UpdateClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpdateClusterRequest) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +type UpdateClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateClusterResponse) Reset() { + *x = UpdateClusterResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateClusterResponse) ProtoMessage() {} + +func (x *UpdateClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateClusterResponse.ProtoReflect.Descriptor instead. +func (*UpdateClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateClusterResponse) GetCluster() *Cluster { + if x != nil { + return x.Cluster + } + return nil +} + +type GetKubeconfigRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetKubeconfigRequest) Reset() { + *x = GetKubeconfigRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetKubeconfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKubeconfigRequest) ProtoMessage() {} + +func (x *GetKubeconfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetKubeconfigRequest.ProtoReflect.Descriptor instead. +func (*GetKubeconfigRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{7} +} + +func (x *GetKubeconfigRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type GetKubeconfigResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Kubeconfig string `protobuf:"bytes,1,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetKubeconfigResponse) Reset() { + *x = GetKubeconfigResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetKubeconfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetKubeconfigResponse) ProtoMessage() {} + +func (x *GetKubeconfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetKubeconfigResponse.ProtoReflect.Descriptor instead. +func (*GetKubeconfigResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{8} +} + +func (x *GetKubeconfigResponse) GetKubeconfig() string { + if x != nil { + return x.Kubeconfig + } + return "" +} + +type ListClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // owner is the user or organization name. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClustersRequest) Reset() { + *x = ListClustersRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClustersRequest) ProtoMessage() {} + +func (x *ListClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClustersRequest.ProtoReflect.Descriptor instead. +func (*ListClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{9} +} + +func (x *ListClustersRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +type ListClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClustersResponse) Reset() { + *x = ListClustersResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClustersResponse) ProtoMessage() {} + +func (x *ListClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClustersResponse.ProtoReflect.Descriptor instead. +func (*ListClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{10} +} + +func (x *ListClustersResponse) GetClusters() []*Cluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ListAccountClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAccountClustersRequest) Reset() { + *x = ListAccountClustersRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAccountClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccountClustersRequest) ProtoMessage() {} + +func (x *ListAccountClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccountClustersRequest.ProtoReflect.Descriptor instead. +func (*ListAccountClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{11} +} + +func (x *ListAccountClustersRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +type ListAccountClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAccountClustersResponse) Reset() { + *x = ListAccountClustersResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAccountClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccountClustersResponse) ProtoMessage() {} + +func (x *ListAccountClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccountClustersResponse.ProtoReflect.Descriptor instead. +func (*ListAccountClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{12} +} + +func (x *ListAccountClustersResponse) GetClusters() []*Cluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ClusterExistsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterExistsRequest) Reset() { + *x = ClusterExistsRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterExistsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterExistsRequest) ProtoMessage() {} + +func (x *ClusterExistsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterExistsRequest.ProtoReflect.Descriptor instead. +func (*ClusterExistsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{13} +} + +func (x *ClusterExistsRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ClusterExistsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ClusterExistsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterExistsResponse) Reset() { + *x = ClusterExistsResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterExistsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterExistsResponse) ProtoMessage() {} + +func (x *ClusterExistsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterExistsResponse.ProtoReflect.Descriptor instead. +func (*ClusterExistsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{14} +} + +func (x *ClusterExistsResponse) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +type GetClusterIdentityRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterUid string `protobuf:"bytes,1,opt,name=cluster_uid,json=clusterUid,proto3" json:"cluster_uid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterIdentityRequest) Reset() { + *x = GetClusterIdentityRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterIdentityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterIdentityRequest) ProtoMessage() {} + +func (x *GetClusterIdentityRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterIdentityRequest.ProtoReflect.Descriptor instead. +func (*GetClusterIdentityRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{15} +} + +func (x *GetClusterIdentityRequest) GetClusterUid() string { + if x != nil { + return x.ClusterUid + } + return "" +} + +type GetClusterIdentityResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Identity *ClusterIdentity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterIdentityResponse) Reset() { + *x = GetClusterIdentityResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterIdentityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterIdentityResponse) ProtoMessage() {} + +func (x *GetClusterIdentityResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterIdentityResponse.ProtoReflect.Descriptor instead. +func (*GetClusterIdentityResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{16} +} + +func (x *GetClusterIdentityResponse) GetIdentity() *ClusterIdentity { + if x != nil { + return x.Identity + } + return nil +} + +type ClusterIdentity struct { + state protoimpl.MessageState `protogen:"open.v1"` + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Provider string `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"` + OwnerId string `protobuf:"bytes,5,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + OwnerType string `protobuf:"bytes,6,opt,name=owner_type,json=ownerType,proto3" json:"owner_type,omitempty"` + ManagerId string `protobuf:"bytes,7,opt,name=manager_id,json=managerId,proto3" json:"manager_id,omitempty"` + HubClusterId string `protobuf:"bytes,8,opt,name=hub_cluster_id,json=hubClusterId,proto3" json:"hub_cluster_id,omitempty"` + CloudServiceAuthMode string `protobuf:"bytes,9,opt,name=cloud_service_auth_mode,json=cloudServiceAuthMode,proto3" json:"cloud_service_auth_mode,omitempty"` + // license is where the cluster gets licenses from; unset when AKP is hosted by AppsCode. + License *LicenseSource `protobuf:"bytes,10,opt,name=license,proto3" json:"license,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterIdentity) Reset() { + *x = ClusterIdentity{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterIdentity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterIdentity) ProtoMessage() {} + +func (x *ClusterIdentity) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterIdentity.ProtoReflect.Descriptor instead. +func (*ClusterIdentity) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{17} +} + +func (x *ClusterIdentity) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *ClusterIdentity) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterIdentity) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ClusterIdentity) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *ClusterIdentity) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *ClusterIdentity) GetOwnerType() string { + if x != nil { + return x.OwnerType + } + return "" +} + +func (x *ClusterIdentity) GetManagerId() string { + if x != nil { + return x.ManagerId + } + return "" +} + +func (x *ClusterIdentity) GetHubClusterId() string { + if x != nil { + return x.HubClusterId + } + return "" +} + +func (x *ClusterIdentity) GetCloudServiceAuthMode() string { + if x != nil { + return x.CloudServiceAuthMode + } + return "" +} + +func (x *ClusterIdentity) GetLicense() *LicenseSource { + if x != nil { + return x.License + } + return nil +} + +type LicenseSource struct { + state protoimpl.MessageState `protogen:"open.v1"` + // distributor is "appscode" or "selfhosted". + Distributor string `protobuf:"bytes,1,opt,name=distributor,proto3" json:"distributor,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + OrgId string `protobuf:"bytes,3,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LicenseSource) Reset() { + *x = LicenseSource{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LicenseSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LicenseSource) ProtoMessage() {} + +func (x *LicenseSource) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LicenseSource.ProtoReflect.Descriptor instead. +func (*LicenseSource) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{18} +} + +func (x *LicenseSource) GetDistributor() string { + if x != nil { + return x.Distributor + } + return "" +} + +func (x *LicenseSource) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *LicenseSource) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +type HasHubClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HasHubClusterRequest) Reset() { + *x = HasHubClusterRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HasHubClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HasHubClusterRequest) ProtoMessage() {} + +func (x *HasHubClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HasHubClusterRequest.ProtoReflect.Descriptor instead. +func (*HasHubClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{19} +} + +func (x *HasHubClusterRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +type HasHubClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + HasHub bool `protobuf:"varint,1,opt,name=has_hub,json=hasHub,proto3" json:"has_hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HasHubClusterResponse) Reset() { + *x = HasHubClusterResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HasHubClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HasHubClusterResponse) ProtoMessage() {} + +func (x *HasHubClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HasHubClusterResponse.ProtoReflect.Descriptor instead. +func (*HasHubClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{20} +} + +func (x *HasHubClusterResponse) GetHasHub() bool { + if x != nil { + return x.HasHub + } + return false +} + +type ListAvailableTypesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // groups narrows the list to these API groups; "core" is the core group. Empty is every group. + Groups []string `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAvailableTypesRequest) Reset() { + *x = ListAvailableTypesRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAvailableTypesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAvailableTypesRequest) ProtoMessage() {} + +func (x *ListAvailableTypesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAvailableTypesRequest.ProtoReflect.Descriptor instead. +func (*ListAvailableTypesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{21} +} + +func (x *ListAvailableTypesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ListAvailableTypesRequest) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +type ListAvailableTypesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // types are sorted by group and version. + Types []*GroupVersionTypes `protobuf:"bytes,1,rep,name=types,proto3" json:"types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAvailableTypesResponse) Reset() { + *x = ListAvailableTypesResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAvailableTypesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAvailableTypesResponse) ProtoMessage() {} + +func (x *ListAvailableTypesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAvailableTypesResponse.ProtoReflect.Descriptor instead. +func (*ListAvailableTypesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{22} +} + +func (x *ListAvailableTypesResponse) GetTypes() []*GroupVersionTypes { + if x != nil { + return x.Types + } + return nil +} + +type GroupVersionTypes struct { + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Resources []*AvailableResource `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupVersionTypes) Reset() { + *x = GroupVersionTypes{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupVersionTypes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupVersionTypes) ProtoMessage() {} + +func (x *GroupVersionTypes) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupVersionTypes.ProtoReflect.Descriptor instead. +func (*GroupVersionTypes) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{23} +} + +func (x *GroupVersionTypes) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *GroupVersionTypes) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *GroupVersionTypes) GetResources() []*AvailableResource { + if x != nil { + return x.Resources + } + return nil +} + +// AvailableResource is a resource a cluster serves, with its kind. +type AvailableResource struct { + state protoimpl.MessageState `protogen:"open.v1"` + Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` + Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AvailableResource) Reset() { + *x = AvailableResource{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AvailableResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AvailableResource) ProtoMessage() {} + +func (x *AvailableResource) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AvailableResource.ProtoReflect.Descriptor instead. +func (*AvailableResource) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{24} +} + +func (x *AvailableResource) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *AvailableResource) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +type ListNamespaceObjectsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + // groups are the API groups to list; "core" is the core group. + Groups []string `protobuf:"bytes,3,rep,name=groups,proto3" json:"groups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListNamespaceObjectsRequest) Reset() { + *x = ListNamespaceObjectsRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListNamespaceObjectsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNamespaceObjectsRequest) ProtoMessage() {} + +func (x *ListNamespaceObjectsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNamespaceObjectsRequest.ProtoReflect.Descriptor instead. +func (*ListNamespaceObjectsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{25} +} + +func (x *ListNamespaceObjectsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ListNamespaceObjectsRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListNamespaceObjectsRequest) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +type ListNamespaceObjectsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Objects []*NamespaceObject `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListNamespaceObjectsResponse) Reset() { + *x = ListNamespaceObjectsResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListNamespaceObjectsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNamespaceObjectsResponse) ProtoMessage() {} + +func (x *ListNamespaceObjectsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNamespaceObjectsResponse.ProtoReflect.Descriptor instead. +func (*ListNamespaceObjectsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{26} +} + +func (x *ListNamespaceObjectsResponse) GetObjects() []*NamespaceObject { + if x != nil { + return x.Objects + } + return nil +} + +type NamespaceObject struct { + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` + Kind string `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,6,opt,name=namespace,proto3" json:"namespace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NamespaceObject) Reset() { + *x = NamespaceObject{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NamespaceObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceObject) ProtoMessage() {} + +func (x *NamespaceObject) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceObject.ProtoReflect.Descriptor instead. +func (*NamespaceObject) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{27} +} + +func (x *NamespaceObject) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *NamespaceObject) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *NamespaceObject) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *NamespaceObject) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *NamespaceObject) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NamespaceObject) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type ListVersionUpdatesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListVersionUpdatesRequest) Reset() { + *x = ListVersionUpdatesRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListVersionUpdatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListVersionUpdatesRequest) ProtoMessage() {} + +func (x *ListVersionUpdatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListVersionUpdatesRequest.ProtoReflect.Descriptor instead. +func (*ListVersionUpdatesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{28} +} + +func (x *ListVersionUpdatesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type ListVersionUpdatesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Updates []*VersionUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListVersionUpdatesResponse) Reset() { + *x = ListVersionUpdatesResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListVersionUpdatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListVersionUpdatesResponse) ProtoMessage() {} + +func (x *ListVersionUpdatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListVersionUpdatesResponse.ProtoReflect.Descriptor instead. +func (*ListVersionUpdatesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{29} +} + +func (x *ListVersionUpdatesResponse) GetUpdates() []*VersionUpdate { + if x != nil { + return x.Updates + } + return nil +} + +// VersionUpdate is a Kubernetes version update of a Cluster API cluster, as recorded in it. +type VersionUpdate struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Data map[string]string `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VersionUpdate) Reset() { + *x = VersionUpdate{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VersionUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionUpdate) ProtoMessage() {} + +func (x *VersionUpdate) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VersionUpdate.ProtoReflect.Descriptor instead. +func (*VersionUpdate) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{30} +} + +func (x *VersionUpdate) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *VersionUpdate) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *VersionUpdate) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *VersionUpdate) GetData() map[string]string { + if x != nil { + return x.Data + } + return nil +} + +type GetDatabaseFeatureGatesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // cluster_set is a cluster set of the hub cluster, whose profile's gates to answer. + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDatabaseFeatureGatesRequest) Reset() { + *x = GetDatabaseFeatureGatesRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDatabaseFeatureGatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDatabaseFeatureGatesRequest) ProtoMessage() {} + +func (x *GetDatabaseFeatureGatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDatabaseFeatureGatesRequest.ProtoReflect.Descriptor instead. +func (*GetDatabaseFeatureGatesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{31} +} + +func (x *GetDatabaseFeatureGatesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetDatabaseFeatureGatesRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type GetDatabaseFeatureGatesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // feature_gates maps a database (e.g. "Postgres") to whether KubeDB serves it. + FeatureGates *structpb.Struct `protobuf:"bytes,1,opt,name=feature_gates,json=featureGates,proto3" json:"feature_gates,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDatabaseFeatureGatesResponse) Reset() { + *x = GetDatabaseFeatureGatesResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDatabaseFeatureGatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDatabaseFeatureGatesResponse) ProtoMessage() {} + +func (x *GetDatabaseFeatureGatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDatabaseFeatureGatesResponse.ProtoReflect.Descriptor instead. +func (*GetDatabaseFeatureGatesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{32} +} + +func (x *GetDatabaseFeatureGatesResponse) GetFeatureGates() *structpb.Struct { + if x != nil { + return x.FeatureGates + } + return nil +} + +type GetFeatureValuesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Features []string `protobuf:"bytes,2,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeatureValuesRequest) Reset() { + *x = GetFeatureValuesRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeatureValuesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeatureValuesRequest) ProtoMessage() {} + +func (x *GetFeatureValuesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFeatureValuesRequest.ProtoReflect.Descriptor instead. +func (*GetFeatureValuesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{33} +} + +func (x *GetFeatureValuesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetFeatureValuesRequest) GetFeatures() []string { + if x != nil { + return x.Features + } + return nil +} + +type GetFeatureValuesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // values maps a feature name to its values. + Values map[string]*structpb.Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeatureValuesResponse) Reset() { + *x = GetFeatureValuesResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeatureValuesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeatureValuesResponse) ProtoMessage() {} + +func (x *GetFeatureValuesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFeatureValuesResponse.ProtoReflect.Descriptor instead. +func (*GetFeatureValuesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{34} +} + +func (x *GetFeatureValuesResponse) GetValues() map[string]*structpb.Value { + if x != nil { + return x.Values + } + return nil +} + +type ListProvisionedProfilesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProvisionedProfilesRequest) Reset() { + *x = ListProvisionedProfilesRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProvisionedProfilesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProvisionedProfilesRequest) ProtoMessage() {} + +func (x *ListProvisionedProfilesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProvisionedProfilesRequest.ProtoReflect.Descriptor instead. +func (*ListProvisionedProfilesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{35} +} + +func (x *ListProvisionedProfilesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type ListProvisionedProfilesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Profiles []string `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListProvisionedProfilesResponse) Reset() { + *x = ListProvisionedProfilesResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListProvisionedProfilesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProvisionedProfilesResponse) ProtoMessage() {} + +func (x *ListProvisionedProfilesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProvisionedProfilesResponse.ProtoReflect.Descriptor instead. +func (*ListProvisionedProfilesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{36} +} + +func (x *ListProvisionedProfilesResponse) GetProfiles() []string { + if x != nil { + return x.Profiles + } + return nil +} + +type GatewayConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + PresetName string `protobuf:"bytes,1,opt,name=preset_name,json=presetName,proto3" json:"preset_name,omitempty"` + PresetNamespace string `protobuf:"bytes,2,opt,name=preset_namespace,json=presetNamespace,proto3" json:"preset_namespace,omitempty"` + ConfigName string `protobuf:"bytes,3,opt,name=config_name,json=configName,proto3" json:"config_name,omitempty"` + ConfigNamespace string `protobuf:"bytes,4,opt,name=config_namespace,json=configNamespace,proto3" json:"config_namespace,omitempty"` + Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` + Host string `protobuf:"bytes,6,opt,name=host,proto3" json:"host,omitempty"` + HostType string `protobuf:"bytes,7,opt,name=host_type,json=hostType,proto3" json:"host_type,omitempty"` + // is_default is set for the default ("ace") configuration. + IsDefault bool `protobuf:"varint,8,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` + // update_available is set where the version differs from the default configuration's. + UpdateAvailable bool `protobuf:"varint,9,opt,name=update_available,json=updateAvailable,proto3" json:"update_available,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GatewayConfig) Reset() { + *x = GatewayConfig{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GatewayConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GatewayConfig) ProtoMessage() {} + +func (x *GatewayConfig) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GatewayConfig.ProtoReflect.Descriptor instead. +func (*GatewayConfig) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{37} +} + +func (x *GatewayConfig) GetPresetName() string { + if x != nil { + return x.PresetName + } + return "" +} + +func (x *GatewayConfig) GetPresetNamespace() string { + if x != nil { + return x.PresetNamespace + } + return "" +} + +func (x *GatewayConfig) GetConfigName() string { + if x != nil { + return x.ConfigName + } + return "" +} + +func (x *GatewayConfig) GetConfigNamespace() string { + if x != nil { + return x.ConfigNamespace + } + return "" +} + +func (x *GatewayConfig) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *GatewayConfig) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *GatewayConfig) GetHostType() string { + if x != nil { + return x.HostType + } + return "" +} + +func (x *GatewayConfig) GetIsDefault() bool { + if x != nil { + return x.IsDefault + } + return false +} + +func (x *GatewayConfig) GetUpdateAvailable() bool { + if x != nil { + return x.UpdateAvailable + } + return false +} + +type ListGatewayConfigsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGatewayConfigsRequest) Reset() { + *x = ListGatewayConfigsRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGatewayConfigsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGatewayConfigsRequest) ProtoMessage() {} + +func (x *ListGatewayConfigsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGatewayConfigsRequest.ProtoReflect.Descriptor instead. +func (*ListGatewayConfigsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{38} +} + +func (x *ListGatewayConfigsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type ListGatewayConfigsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Configs []*GatewayConfig `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGatewayConfigsResponse) Reset() { + *x = ListGatewayConfigsResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGatewayConfigsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGatewayConfigsResponse) ProtoMessage() {} + +func (x *ListGatewayConfigsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGatewayConfigsResponse.ProtoReflect.Descriptor instead. +func (*ListGatewayConfigsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{39} +} + +func (x *ListGatewayConfigsResponse) GetConfigs() []*GatewayConfig { + if x != nil { + return x.Configs + } + return nil +} + +type UpdateGatewayConfigRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateGatewayConfigRequest) Reset() { + *x = UpdateGatewayConfigRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateGatewayConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGatewayConfigRequest) ProtoMessage() {} + +func (x *UpdateGatewayConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateGatewayConfigRequest.ProtoReflect.Descriptor instead. +func (*UpdateGatewayConfigRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{40} +} + +func (x *UpdateGatewayConfigRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpdateGatewayConfigRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *UpdateGatewayConfigRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type UpdateGatewayConfigResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateGatewayConfigResponse) Reset() { + *x = UpdateGatewayConfigResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateGatewayConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGatewayConfigResponse) ProtoMessage() {} + +func (x *UpdateGatewayConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateGatewayConfigResponse.ProtoReflect.Descriptor instead. +func (*UpdateGatewayConfigResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{41} +} + +type UpdateAllGatewayConfigsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAllGatewayConfigsRequest) Reset() { + *x = UpdateAllGatewayConfigsRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAllGatewayConfigsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAllGatewayConfigsRequest) ProtoMessage() {} + +func (x *UpdateAllGatewayConfigsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAllGatewayConfigsRequest.ProtoReflect.Descriptor instead. +func (*UpdateAllGatewayConfigsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{42} +} + +func (x *UpdateAllGatewayConfigsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type UpdateAllGatewayConfigsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAllGatewayConfigsResponse) Reset() { + *x = UpdateAllGatewayConfigsResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAllGatewayConfigsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAllGatewayConfigsResponse) ProtoMessage() {} + +func (x *UpdateAllGatewayConfigsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAllGatewayConfigsResponse.ProtoReflect.Descriptor instead. +func (*UpdateAllGatewayConfigsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{43} +} + +type GetDatabaseBundleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // parts are what to answer: "features", "versions" and "common" (placement). + Parts []string `protobuf:"bytes,2,rep,name=parts,proto3" json:"parts,omitempty"` + // database is the singular resource name of the database whose versions to list, e.g. "postgres". + Database string `protobuf:"bytes,3,opt,name=database,proto3" json:"database,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDatabaseBundleRequest) Reset() { + *x = GetDatabaseBundleRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDatabaseBundleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDatabaseBundleRequest) ProtoMessage() {} + +func (x *GetDatabaseBundleRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDatabaseBundleRequest.ProtoReflect.Descriptor instead. +func (*GetDatabaseBundleRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{44} +} + +func (x *GetDatabaseBundleRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetDatabaseBundleRequest) GetParts() []string { + if x != nil { + return x.Parts + } + return nil +} + +func (x *GetDatabaseBundleRequest) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +type GetDatabaseBundleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // features are the database features the cluster has: "backup", "tls", "monitoring", "binding". + Features []string `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"` + Versions []string `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` + DedicatedNodeTopologies []string `protobuf:"bytes,3,rep,name=dedicated_node_topologies,json=dedicatedNodeTopologies,proto3" json:"dedicated_node_topologies,omitempty"` + SharedNodeTopologies []string `protobuf:"bytes,4,rep,name=shared_node_topologies,json=sharedNodeTopologies,proto3" json:"shared_node_topologies,omitempty"` + PlacementPolicies []string `protobuf:"bytes,5,rep,name=placement_policies,json=placementPolicies,proto3" json:"placement_policies,omitempty"` + StorageClasses []string `protobuf:"bytes,6,rep,name=storage_classes,json=storageClasses,proto3" json:"storage_classes,omitempty"` + ClusterIssuers []string `protobuf:"bytes,7,rep,name=cluster_issuers,json=clusterIssuers,proto3" json:"cluster_issuers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDatabaseBundleResponse) Reset() { + *x = GetDatabaseBundleResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDatabaseBundleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDatabaseBundleResponse) ProtoMessage() {} + +func (x *GetDatabaseBundleResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDatabaseBundleResponse.ProtoReflect.Descriptor instead. +func (*GetDatabaseBundleResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{45} +} + +func (x *GetDatabaseBundleResponse) GetFeatures() []string { + if x != nil { + return x.Features + } + return nil +} + +func (x *GetDatabaseBundleResponse) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +func (x *GetDatabaseBundleResponse) GetDedicatedNodeTopologies() []string { + if x != nil { + return x.DedicatedNodeTopologies + } + return nil +} + +func (x *GetDatabaseBundleResponse) GetSharedNodeTopologies() []string { + if x != nil { + return x.SharedNodeTopologies + } + return nil +} + +func (x *GetDatabaseBundleResponse) GetPlacementPolicies() []string { + if x != nil { + return x.PlacementPolicies + } + return nil +} + +func (x *GetDatabaseBundleResponse) GetStorageClasses() []string { + if x != nil { + return x.StorageClasses + } + return nil +} + +func (x *GetDatabaseBundleResponse) GetClusterIssuers() []string { + if x != nil { + return x.ClusterIssuers + } + return nil +} + +type IsServerClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IsServerClusterRequest) Reset() { + *x = IsServerClusterRequest{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IsServerClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsServerClusterRequest) ProtoMessage() {} + +func (x *IsServerClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsServerClusterRequest.ProtoReflect.Descriptor instead. +func (*IsServerClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{46} +} + +func (x *IsServerClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type IsServerClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + IsServer bool `protobuf:"varint,1,opt,name=is_server,json=isServer,proto3" json:"is_server,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IsServerClusterResponse) Reset() { + *x = IsServerClusterResponse{} + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IsServerClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsServerClusterResponse) ProtoMessage() {} + +func (x *IsServerClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_cluster_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsServerClusterResponse.ProtoReflect.Descriptor instead. +func (*IsServerClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_cluster_proto_rawDescGZIP(), []int{47} +} + +func (x *IsServerClusterResponse) GetIsServer() bool { + if x != nil { + return x.IsServer + } + return false +} + +var File_akp_cluster_v2_cluster_proto protoreflect.FileDescriptor + +const file_akp_cluster_v2_cluster_proto_rawDesc = "" + + "\n" + + "\x1cakp/cluster/v2/cluster.proto\x12\x0eakp.cluster.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"d\n" + + "\n" + + "ClusterRef\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x1a\n" + + "\bprovider\x18\x03 \x01(\tR\bprovider\"\xb3\x06\n" + + "\aCluster\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12\x10\n" + + "\x03uid\x18\x04 \x01(\tR\x03uid\x12\x19\n" + + "\bowner_id\x18\x05 \x01(\tR\aownerId\x12\x1d\n" + + "\n" + + "owner_name\x18\x06 \x01(\tR\townerName\x12\x1d\n" + + "\n" + + "manager_id\x18\a \x01(\tR\tmanagerId\x12\x1f\n" + + "\vexternal_id\x18\b \x01(\tR\n" + + "externalId\x12(\n" + + "\x10hub_cluster_name\x18\t \x01(\tR\x0ehubClusterName\x12&\n" + + "\x0fhub_cluster_uid\x18\n" + + " \x01(\tR\rhubClusterUid\x123\n" + + "\x16hub_cluster_owner_name\x18\v \x01(\tR\x13hubClusterOwnerName\x12\x1a\n" + + "\bprovider\x18\f \x01(\tR\bprovider\x12\x16\n" + + "\x06vendor\x18\r \x01(\tR\x06vendor\x12'\n" + + "\x0finfra_namespace\x18\x0e \x01(\tR\x0einfraNamespace\x122\n" + + "\x15is_monitoring_cluster\x18\x0f \x01(\bR\x13isMonitoringCluster\x12\x1a\n" + + "\bendpoint\x18\x10 \x01(\tR\bendpoint\x12\x1a\n" + + "\blocation\x18\x11 \x01(\tR\blocation\x12\x18\n" + + "\aproject\x18\x12 \x01(\tR\aproject\x12-\n" + + "\x12kubernetes_version\x18\x13 \x01(\tR\x11kubernetesVersion\x12\x1d\n" + + "\n" + + "node_count\x18\x14 \x01(\x05R\tnodeCount\x12;\n" + + "\vcreate_time\x18\x15 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\x12)\n" + + "\x10cluster_managers\x18\x16 \x03(\tR\x0fclusterManagers\x125\n" + + "\x06status\x18\x17 \x01(\v2\x1d.akp.cluster.v2.ClusterStatusR\x06status\"W\n" + + "\rClusterStatus\x12\x14\n" + + "\x05phase\x18\x01 \x01(\tR\x05phase\x12\x16\n" + + "\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"Q\n" + + "\x11GetClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"G\n" + + "\x12GetClusterResponse\x121\n" + + "\acluster\x18\x01 \x01(\v2\x17.akp.cluster.v2.ClusterR\acluster\"\x80\x01\n" + + "\x14UpdateClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12*\n" + + "\fdisplay_name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\vdisplayName\"J\n" + + "\x15UpdateClusterResponse\x121\n" + + "\acluster\x18\x01 \x01(\v2\x17.akp.cluster.v2.ClusterR\acluster\"T\n" + + "\x14GetKubeconfigRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"7\n" + + "\x15GetKubeconfigResponse\x12\x1e\n" + + "\n" + + "kubeconfig\x18\x01 \x01(\tR\n" + + "kubeconfig\"4\n" + + "\x13ListClustersRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\"K\n" + + "\x14ListClustersResponse\x123\n" + + "\bclusters\x18\x01 \x03(\v2\x17.akp.cluster.v2.ClusterR\bclusters\";\n" + + "\x1aListAccountClustersRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\"R\n" + + "\x1bListAccountClustersResponse\x123\n" + + "\bclusters\x18\x01 \x03(\v2\x17.akp.cluster.v2.ClusterR\bclusters\"R\n" + + "\x14ClusterExistsRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"/\n" + + "\x15ClusterExistsResponse\x12\x16\n" + + "\x06exists\x18\x01 \x01(\bR\x06exists\"E\n" + + "\x19GetClusterIdentityRequest\x12(\n" + + "\vcluster_uid\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterUid\"Y\n" + + "\x1aGetClusterIdentityResponse\x12;\n" + + "\bidentity\x18\x01 \x01(\v2\x1f.akp.cluster.v2.ClusterIdentityR\bidentity\"\xe5\x02\n" + + "\x0fClusterIdentity\x12\x10\n" + + "\x03uid\x18\x01 \x01(\tR\x03uid\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12\x1a\n" + + "\bprovider\x18\x04 \x01(\tR\bprovider\x12\x19\n" + + "\bowner_id\x18\x05 \x01(\tR\aownerId\x12\x1d\n" + + "\n" + + "owner_type\x18\x06 \x01(\tR\townerType\x12\x1d\n" + + "\n" + + "manager_id\x18\a \x01(\tR\tmanagerId\x12$\n" + + "\x0ehub_cluster_id\x18\b \x01(\tR\fhubClusterId\x125\n" + + "\x17cloud_service_auth_mode\x18\t \x01(\tR\x14cloudServiceAuthMode\x127\n" + + "\alicense\x18\n" + + " \x01(\v2\x1d.akp.cluster.v2.LicenseSourceR\alicense\"d\n" + + "\rLicenseSource\x12 \n" + + "\vdistributor\x18\x01 \x01(\tR\vdistributor\x12\x1a\n" + + "\bendpoint\x18\x02 \x01(\tR\bendpoint\x12\x15\n" + + "\x06org_id\x18\x03 \x01(\tR\x05orgId\"5\n" + + "\x14HasHubClusterRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\"0\n" + + "\x15HasHubClusterResponse\x12\x17\n" + + "\ahas_hub\x18\x01 \x01(\bR\x06hasHub\"q\n" + + "\x19ListAvailableTypesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x16\n" + + "\x06groups\x18\x02 \x03(\tR\x06groups\"U\n" + + "\x1aListAvailableTypesResponse\x127\n" + + "\x05types\x18\x01 \x03(\v2!.akp.cluster.v2.GroupVersionTypesR\x05types\"\x84\x01\n" + + "\x11GroupVersionTypes\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12?\n" + + "\tresources\x18\x03 \x03(\v2!.akp.cluster.v2.AvailableResourceR\tresources\"C\n" + + "\x11AvailableResource\x12\x12\n" + + "\x04kind\x18\x01 \x01(\tR\x04kind\x12\x1a\n" + + "\bresource\x18\x02 \x01(\tR\bresource\"\xa4\x01\n" + + "\x1bListNamespaceObjectsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12%\n" + + "\tnamespace\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12 \n" + + "\x06groups\x18\x03 \x03(\tB\b\xbaH\x05\x92\x01\x02\b\x01R\x06groups\"Y\n" + + "\x1cListNamespaceObjectsResponse\x129\n" + + "\aobjects\x18\x01 \x03(\v2\x1f.akp.cluster.v2.NamespaceObjectR\aobjects\"\xa3\x01\n" + + "\x0fNamespaceObject\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x1a\n" + + "\bresource\x18\x03 \x01(\tR\bresource\x12\x12\n" + + "\x04kind\x18\x04 \x01(\tR\x04kind\x12\x12\n" + + "\x04name\x18\x05 \x01(\tR\x04name\x12\x1c\n" + + "\tnamespace\x18\x06 \x01(\tR\tnamespace\"Y\n" + + "\x19ListVersionUpdatesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"U\n" + + "\x1aListVersionUpdatesResponse\x127\n" + + "\aupdates\x18\x01 \x03(\v2\x1d.akp.cluster.v2.VersionUpdateR\aupdates\"\xd4\x02\n" + + "\rVersionUpdate\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12;\n" + + "\vcreate_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\x12A\n" + + "\x06labels\x18\x03 \x03(\v2).akp.cluster.v2.VersionUpdate.LabelsEntryR\x06labels\x12;\n" + + "\x04data\x18\x04 \x03(\v2'.akp.cluster.v2.VersionUpdate.DataEntryR\x04data\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a7\n" + + "\tDataEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x7f\n" + + "\x1eGetDatabaseFeatureGatesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x1f\n" + + "\vcluster_set\x18\x02 \x01(\tR\n" + + "clusterSet\"_\n" + + "\x1fGetDatabaseFeatureGatesResponse\x12<\n" + + "\rfeature_gates\x18\x01 \x01(\v2\x17.google.protobuf.StructR\ffeatureGates\"}\n" + + "\x17GetFeatureValuesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12$\n" + + "\bfeatures\x18\x02 \x03(\tB\b\xbaH\x05\x92\x01\x02\b\x01R\bfeatures\"\xbb\x01\n" + + "\x18GetFeatureValuesResponse\x12L\n" + + "\x06values\x18\x01 \x03(\v24.akp.cluster.v2.GetFeatureValuesResponse.ValuesEntryR\x06values\x1aQ\n" + + "\vValuesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12,\n" + + "\x05value\x18\x02 \x01(\v2\x16.google.protobuf.ValueR\x05value:\x028\x01\"^\n" + + "\x1eListProvisionedProfilesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"=\n" + + "\x1fListProvisionedProfilesResponse\x12\x1a\n" + + "\bprofiles\x18\x01 \x03(\tR\bprofiles\"\xbc\x02\n" + + "\rGatewayConfig\x12\x1f\n" + + "\vpreset_name\x18\x01 \x01(\tR\n" + + "presetName\x12)\n" + + "\x10preset_namespace\x18\x02 \x01(\tR\x0fpresetNamespace\x12\x1f\n" + + "\vconfig_name\x18\x03 \x01(\tR\n" + + "configName\x12)\n" + + "\x10config_namespace\x18\x04 \x01(\tR\x0fconfigNamespace\x12\x18\n" + + "\aversion\x18\x05 \x01(\tR\aversion\x12\x12\n" + + "\x04host\x18\x06 \x01(\tR\x04host\x12\x1b\n" + + "\thost_type\x18\a \x01(\tR\bhostType\x12\x1d\n" + + "\n" + + "is_default\x18\b \x01(\bR\tisDefault\x12)\n" + + "\x10update_available\x18\t \x01(\bR\x0fupdateAvailable\"Y\n" + + "\x19ListGatewayConfigsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"U\n" + + "\x1aListGatewayConfigsResponse\x127\n" + + "\aconfigs\x18\x01 \x03(\v2\x1d.akp.cluster.v2.GatewayConfigR\aconfigs\"\x9e\x01\n" + + "\x1aUpdateGatewayConfigRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12%\n" + + "\tnamespace\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"\x1d\n" + + "\x1bUpdateGatewayConfigResponse\"^\n" + + "\x1eUpdateAllGatewayConfigsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"!\n" + + "\x1fUpdateAllGatewayConfigsResponse\"\x8a\x01\n" + + "\x18GetDatabaseBundleRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x14\n" + + "\x05parts\x18\x02 \x03(\tR\x05parts\x12\x1a\n" + + "\bdatabase\x18\x03 \x01(\tR\bdatabase\"\xc6\x02\n" + + "\x19GetDatabaseBundleResponse\x12\x1a\n" + + "\bfeatures\x18\x01 \x03(\tR\bfeatures\x12\x1a\n" + + "\bversions\x18\x02 \x03(\tR\bversions\x12:\n" + + "\x19dedicated_node_topologies\x18\x03 \x03(\tR\x17dedicatedNodeTopologies\x124\n" + + "\x16shared_node_topologies\x18\x04 \x03(\tR\x14sharedNodeTopologies\x12-\n" + + "\x12placement_policies\x18\x05 \x03(\tR\x11placementPolicies\x12'\n" + + "\x0fstorage_classes\x18\x06 \x03(\tR\x0estorageClasses\x12'\n" + + "\x0fcluster_issuers\x18\a \x03(\tR\x0eclusterIssuers\"V\n" + + "\x16IsServerClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"6\n" + + "\x17IsServerClusterResponse\x12\x1b\n" + + "\tis_server\x18\x01 \x01(\bR\bisServer2\x8e\x10\n" + + "\x0eClusterService\x12U\n" + + "\n" + + "GetCluster\x12!.akp.cluster.v2.GetClusterRequest\x1a\".akp.cluster.v2.GetClusterResponse\"\x00\x12^\n" + + "\rUpdateCluster\x12$.akp.cluster.v2.UpdateClusterRequest\x1a%.akp.cluster.v2.UpdateClusterResponse\"\x00\x12^\n" + + "\rGetKubeconfig\x12$.akp.cluster.v2.GetKubeconfigRequest\x1a%.akp.cluster.v2.GetKubeconfigResponse\"\x00\x12[\n" + + "\fListClusters\x12#.akp.cluster.v2.ListClustersRequest\x1a$.akp.cluster.v2.ListClustersResponse\"\x00\x12p\n" + + "\x13ListAccountClusters\x12*.akp.cluster.v2.ListAccountClustersRequest\x1a+.akp.cluster.v2.ListAccountClustersResponse\"\x00\x12^\n" + + "\rClusterExists\x12$.akp.cluster.v2.ClusterExistsRequest\x1a%.akp.cluster.v2.ClusterExistsResponse\"\x00\x12m\n" + + "\x12GetClusterIdentity\x12).akp.cluster.v2.GetClusterIdentityRequest\x1a*.akp.cluster.v2.GetClusterIdentityResponse\"\x00\x12^\n" + + "\rHasHubCluster\x12$.akp.cluster.v2.HasHubClusterRequest\x1a%.akp.cluster.v2.HasHubClusterResponse\"\x00\x12m\n" + + "\x12ListAvailableTypes\x12).akp.cluster.v2.ListAvailableTypesRequest\x1a*.akp.cluster.v2.ListAvailableTypesResponse\"\x00\x12s\n" + + "\x14ListNamespaceObjects\x12+.akp.cluster.v2.ListNamespaceObjectsRequest\x1a,.akp.cluster.v2.ListNamespaceObjectsResponse\"\x00\x12m\n" + + "\x12ListVersionUpdates\x12).akp.cluster.v2.ListVersionUpdatesRequest\x1a*.akp.cluster.v2.ListVersionUpdatesResponse\"\x00\x12|\n" + + "\x17GetDatabaseFeatureGates\x12..akp.cluster.v2.GetDatabaseFeatureGatesRequest\x1a/.akp.cluster.v2.GetDatabaseFeatureGatesResponse\"\x00\x12g\n" + + "\x10GetFeatureValues\x12'.akp.cluster.v2.GetFeatureValuesRequest\x1a(.akp.cluster.v2.GetFeatureValuesResponse\"\x00\x12|\n" + + "\x17ListProvisionedProfiles\x12..akp.cluster.v2.ListProvisionedProfilesRequest\x1a/.akp.cluster.v2.ListProvisionedProfilesResponse\"\x00\x12m\n" + + "\x12ListGatewayConfigs\x12).akp.cluster.v2.ListGatewayConfigsRequest\x1a*.akp.cluster.v2.ListGatewayConfigsResponse\"\x00\x12p\n" + + "\x13UpdateGatewayConfig\x12*.akp.cluster.v2.UpdateGatewayConfigRequest\x1a+.akp.cluster.v2.UpdateGatewayConfigResponse\"\x00\x12|\n" + + "\x17UpdateAllGatewayConfigs\x12..akp.cluster.v2.UpdateAllGatewayConfigsRequest\x1a/.akp.cluster.v2.UpdateAllGatewayConfigsResponse\"\x00\x12j\n" + + "\x11GetDatabaseBundle\x12(.akp.cluster.v2.GetDatabaseBundleRequest\x1a).akp.cluster.v2.GetDatabaseBundleResponse\"\x00\x12d\n" + + "\x0fIsServerCluster\x12&.akp.cluster.v2.IsServerClusterRequest\x1a'.akp.cluster.v2.IsServerClusterResponse\"\x00B\xb9\x01\n" + + "\x12com.akp.cluster.v2B\fClusterProtoP\x01Z;go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2;clusterv2\xa2\x02\x03ACX\xaa\x02\x0eAkp.Cluster.V2\xca\x02\x0eAkp\\Cluster\\V2\xe2\x02\x1aAkp\\Cluster\\V2\\GPBMetadata\xea\x02\x10Akp::Cluster::V2b\x06proto3" + +var ( + file_akp_cluster_v2_cluster_proto_rawDescOnce sync.Once + file_akp_cluster_v2_cluster_proto_rawDescData []byte +) + +func file_akp_cluster_v2_cluster_proto_rawDescGZIP() []byte { + file_akp_cluster_v2_cluster_proto_rawDescOnce.Do(func() { + file_akp_cluster_v2_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_cluster_proto_rawDesc), len(file_akp_cluster_v2_cluster_proto_rawDesc))) + }) + return file_akp_cluster_v2_cluster_proto_rawDescData +} + +var file_akp_cluster_v2_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 51) +var file_akp_cluster_v2_cluster_proto_goTypes = []any{ + (*ClusterRef)(nil), // 0: akp.cluster.v2.ClusterRef + (*Cluster)(nil), // 1: akp.cluster.v2.Cluster + (*ClusterStatus)(nil), // 2: akp.cluster.v2.ClusterStatus + (*GetClusterRequest)(nil), // 3: akp.cluster.v2.GetClusterRequest + (*GetClusterResponse)(nil), // 4: akp.cluster.v2.GetClusterResponse + (*UpdateClusterRequest)(nil), // 5: akp.cluster.v2.UpdateClusterRequest + (*UpdateClusterResponse)(nil), // 6: akp.cluster.v2.UpdateClusterResponse + (*GetKubeconfigRequest)(nil), // 7: akp.cluster.v2.GetKubeconfigRequest + (*GetKubeconfigResponse)(nil), // 8: akp.cluster.v2.GetKubeconfigResponse + (*ListClustersRequest)(nil), // 9: akp.cluster.v2.ListClustersRequest + (*ListClustersResponse)(nil), // 10: akp.cluster.v2.ListClustersResponse + (*ListAccountClustersRequest)(nil), // 11: akp.cluster.v2.ListAccountClustersRequest + (*ListAccountClustersResponse)(nil), // 12: akp.cluster.v2.ListAccountClustersResponse + (*ClusterExistsRequest)(nil), // 13: akp.cluster.v2.ClusterExistsRequest + (*ClusterExistsResponse)(nil), // 14: akp.cluster.v2.ClusterExistsResponse + (*GetClusterIdentityRequest)(nil), // 15: akp.cluster.v2.GetClusterIdentityRequest + (*GetClusterIdentityResponse)(nil), // 16: akp.cluster.v2.GetClusterIdentityResponse + (*ClusterIdentity)(nil), // 17: akp.cluster.v2.ClusterIdentity + (*LicenseSource)(nil), // 18: akp.cluster.v2.LicenseSource + (*HasHubClusterRequest)(nil), // 19: akp.cluster.v2.HasHubClusterRequest + (*HasHubClusterResponse)(nil), // 20: akp.cluster.v2.HasHubClusterResponse + (*ListAvailableTypesRequest)(nil), // 21: akp.cluster.v2.ListAvailableTypesRequest + (*ListAvailableTypesResponse)(nil), // 22: akp.cluster.v2.ListAvailableTypesResponse + (*GroupVersionTypes)(nil), // 23: akp.cluster.v2.GroupVersionTypes + (*AvailableResource)(nil), // 24: akp.cluster.v2.AvailableResource + (*ListNamespaceObjectsRequest)(nil), // 25: akp.cluster.v2.ListNamespaceObjectsRequest + (*ListNamespaceObjectsResponse)(nil), // 26: akp.cluster.v2.ListNamespaceObjectsResponse + (*NamespaceObject)(nil), // 27: akp.cluster.v2.NamespaceObject + (*ListVersionUpdatesRequest)(nil), // 28: akp.cluster.v2.ListVersionUpdatesRequest + (*ListVersionUpdatesResponse)(nil), // 29: akp.cluster.v2.ListVersionUpdatesResponse + (*VersionUpdate)(nil), // 30: akp.cluster.v2.VersionUpdate + (*GetDatabaseFeatureGatesRequest)(nil), // 31: akp.cluster.v2.GetDatabaseFeatureGatesRequest + (*GetDatabaseFeatureGatesResponse)(nil), // 32: akp.cluster.v2.GetDatabaseFeatureGatesResponse + (*GetFeatureValuesRequest)(nil), // 33: akp.cluster.v2.GetFeatureValuesRequest + (*GetFeatureValuesResponse)(nil), // 34: akp.cluster.v2.GetFeatureValuesResponse + (*ListProvisionedProfilesRequest)(nil), // 35: akp.cluster.v2.ListProvisionedProfilesRequest + (*ListProvisionedProfilesResponse)(nil), // 36: akp.cluster.v2.ListProvisionedProfilesResponse + (*GatewayConfig)(nil), // 37: akp.cluster.v2.GatewayConfig + (*ListGatewayConfigsRequest)(nil), // 38: akp.cluster.v2.ListGatewayConfigsRequest + (*ListGatewayConfigsResponse)(nil), // 39: akp.cluster.v2.ListGatewayConfigsResponse + (*UpdateGatewayConfigRequest)(nil), // 40: akp.cluster.v2.UpdateGatewayConfigRequest + (*UpdateGatewayConfigResponse)(nil), // 41: akp.cluster.v2.UpdateGatewayConfigResponse + (*UpdateAllGatewayConfigsRequest)(nil), // 42: akp.cluster.v2.UpdateAllGatewayConfigsRequest + (*UpdateAllGatewayConfigsResponse)(nil), // 43: akp.cluster.v2.UpdateAllGatewayConfigsResponse + (*GetDatabaseBundleRequest)(nil), // 44: akp.cluster.v2.GetDatabaseBundleRequest + (*GetDatabaseBundleResponse)(nil), // 45: akp.cluster.v2.GetDatabaseBundleResponse + (*IsServerClusterRequest)(nil), // 46: akp.cluster.v2.IsServerClusterRequest + (*IsServerClusterResponse)(nil), // 47: akp.cluster.v2.IsServerClusterResponse + nil, // 48: akp.cluster.v2.VersionUpdate.LabelsEntry + nil, // 49: akp.cluster.v2.VersionUpdate.DataEntry + nil, // 50: akp.cluster.v2.GetFeatureValuesResponse.ValuesEntry + (*timestamppb.Timestamp)(nil), // 51: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 52: google.protobuf.Struct + (*structpb.Value)(nil), // 53: google.protobuf.Value +} +var file_akp_cluster_v2_cluster_proto_depIdxs = []int32{ + 51, // 0: akp.cluster.v2.Cluster.create_time:type_name -> google.protobuf.Timestamp + 2, // 1: akp.cluster.v2.Cluster.status:type_name -> akp.cluster.v2.ClusterStatus + 0, // 2: akp.cluster.v2.GetClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 3: akp.cluster.v2.GetClusterResponse.cluster:type_name -> akp.cluster.v2.Cluster + 0, // 4: akp.cluster.v2.UpdateClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 5: akp.cluster.v2.UpdateClusterResponse.cluster:type_name -> akp.cluster.v2.Cluster + 0, // 6: akp.cluster.v2.GetKubeconfigRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 7: akp.cluster.v2.ListClustersResponse.clusters:type_name -> akp.cluster.v2.Cluster + 1, // 8: akp.cluster.v2.ListAccountClustersResponse.clusters:type_name -> akp.cluster.v2.Cluster + 17, // 9: akp.cluster.v2.GetClusterIdentityResponse.identity:type_name -> akp.cluster.v2.ClusterIdentity + 18, // 10: akp.cluster.v2.ClusterIdentity.license:type_name -> akp.cluster.v2.LicenseSource + 0, // 11: akp.cluster.v2.ListAvailableTypesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 23, // 12: akp.cluster.v2.ListAvailableTypesResponse.types:type_name -> akp.cluster.v2.GroupVersionTypes + 24, // 13: akp.cluster.v2.GroupVersionTypes.resources:type_name -> akp.cluster.v2.AvailableResource + 0, // 14: akp.cluster.v2.ListNamespaceObjectsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 27, // 15: akp.cluster.v2.ListNamespaceObjectsResponse.objects:type_name -> akp.cluster.v2.NamespaceObject + 0, // 16: akp.cluster.v2.ListVersionUpdatesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 30, // 17: akp.cluster.v2.ListVersionUpdatesResponse.updates:type_name -> akp.cluster.v2.VersionUpdate + 51, // 18: akp.cluster.v2.VersionUpdate.create_time:type_name -> google.protobuf.Timestamp + 48, // 19: akp.cluster.v2.VersionUpdate.labels:type_name -> akp.cluster.v2.VersionUpdate.LabelsEntry + 49, // 20: akp.cluster.v2.VersionUpdate.data:type_name -> akp.cluster.v2.VersionUpdate.DataEntry + 0, // 21: akp.cluster.v2.GetDatabaseFeatureGatesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 52, // 22: akp.cluster.v2.GetDatabaseFeatureGatesResponse.feature_gates:type_name -> google.protobuf.Struct + 0, // 23: akp.cluster.v2.GetFeatureValuesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 50, // 24: akp.cluster.v2.GetFeatureValuesResponse.values:type_name -> akp.cluster.v2.GetFeatureValuesResponse.ValuesEntry + 0, // 25: akp.cluster.v2.ListProvisionedProfilesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 0, // 26: akp.cluster.v2.ListGatewayConfigsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 37, // 27: akp.cluster.v2.ListGatewayConfigsResponse.configs:type_name -> akp.cluster.v2.GatewayConfig + 0, // 28: akp.cluster.v2.UpdateGatewayConfigRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 0, // 29: akp.cluster.v2.UpdateAllGatewayConfigsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 0, // 30: akp.cluster.v2.GetDatabaseBundleRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 0, // 31: akp.cluster.v2.IsServerClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 53, // 32: akp.cluster.v2.GetFeatureValuesResponse.ValuesEntry.value:type_name -> google.protobuf.Value + 3, // 33: akp.cluster.v2.ClusterService.GetCluster:input_type -> akp.cluster.v2.GetClusterRequest + 5, // 34: akp.cluster.v2.ClusterService.UpdateCluster:input_type -> akp.cluster.v2.UpdateClusterRequest + 7, // 35: akp.cluster.v2.ClusterService.GetKubeconfig:input_type -> akp.cluster.v2.GetKubeconfigRequest + 9, // 36: akp.cluster.v2.ClusterService.ListClusters:input_type -> akp.cluster.v2.ListClustersRequest + 11, // 37: akp.cluster.v2.ClusterService.ListAccountClusters:input_type -> akp.cluster.v2.ListAccountClustersRequest + 13, // 38: akp.cluster.v2.ClusterService.ClusterExists:input_type -> akp.cluster.v2.ClusterExistsRequest + 15, // 39: akp.cluster.v2.ClusterService.GetClusterIdentity:input_type -> akp.cluster.v2.GetClusterIdentityRequest + 19, // 40: akp.cluster.v2.ClusterService.HasHubCluster:input_type -> akp.cluster.v2.HasHubClusterRequest + 21, // 41: akp.cluster.v2.ClusterService.ListAvailableTypes:input_type -> akp.cluster.v2.ListAvailableTypesRequest + 25, // 42: akp.cluster.v2.ClusterService.ListNamespaceObjects:input_type -> akp.cluster.v2.ListNamespaceObjectsRequest + 28, // 43: akp.cluster.v2.ClusterService.ListVersionUpdates:input_type -> akp.cluster.v2.ListVersionUpdatesRequest + 31, // 44: akp.cluster.v2.ClusterService.GetDatabaseFeatureGates:input_type -> akp.cluster.v2.GetDatabaseFeatureGatesRequest + 33, // 45: akp.cluster.v2.ClusterService.GetFeatureValues:input_type -> akp.cluster.v2.GetFeatureValuesRequest + 35, // 46: akp.cluster.v2.ClusterService.ListProvisionedProfiles:input_type -> akp.cluster.v2.ListProvisionedProfilesRequest + 38, // 47: akp.cluster.v2.ClusterService.ListGatewayConfigs:input_type -> akp.cluster.v2.ListGatewayConfigsRequest + 40, // 48: akp.cluster.v2.ClusterService.UpdateGatewayConfig:input_type -> akp.cluster.v2.UpdateGatewayConfigRequest + 42, // 49: akp.cluster.v2.ClusterService.UpdateAllGatewayConfigs:input_type -> akp.cluster.v2.UpdateAllGatewayConfigsRequest + 44, // 50: akp.cluster.v2.ClusterService.GetDatabaseBundle:input_type -> akp.cluster.v2.GetDatabaseBundleRequest + 46, // 51: akp.cluster.v2.ClusterService.IsServerCluster:input_type -> akp.cluster.v2.IsServerClusterRequest + 4, // 52: akp.cluster.v2.ClusterService.GetCluster:output_type -> akp.cluster.v2.GetClusterResponse + 6, // 53: akp.cluster.v2.ClusterService.UpdateCluster:output_type -> akp.cluster.v2.UpdateClusterResponse + 8, // 54: akp.cluster.v2.ClusterService.GetKubeconfig:output_type -> akp.cluster.v2.GetKubeconfigResponse + 10, // 55: akp.cluster.v2.ClusterService.ListClusters:output_type -> akp.cluster.v2.ListClustersResponse + 12, // 56: akp.cluster.v2.ClusterService.ListAccountClusters:output_type -> akp.cluster.v2.ListAccountClustersResponse + 14, // 57: akp.cluster.v2.ClusterService.ClusterExists:output_type -> akp.cluster.v2.ClusterExistsResponse + 16, // 58: akp.cluster.v2.ClusterService.GetClusterIdentity:output_type -> akp.cluster.v2.GetClusterIdentityResponse + 20, // 59: akp.cluster.v2.ClusterService.HasHubCluster:output_type -> akp.cluster.v2.HasHubClusterResponse + 22, // 60: akp.cluster.v2.ClusterService.ListAvailableTypes:output_type -> akp.cluster.v2.ListAvailableTypesResponse + 26, // 61: akp.cluster.v2.ClusterService.ListNamespaceObjects:output_type -> akp.cluster.v2.ListNamespaceObjectsResponse + 29, // 62: akp.cluster.v2.ClusterService.ListVersionUpdates:output_type -> akp.cluster.v2.ListVersionUpdatesResponse + 32, // 63: akp.cluster.v2.ClusterService.GetDatabaseFeatureGates:output_type -> akp.cluster.v2.GetDatabaseFeatureGatesResponse + 34, // 64: akp.cluster.v2.ClusterService.GetFeatureValues:output_type -> akp.cluster.v2.GetFeatureValuesResponse + 36, // 65: akp.cluster.v2.ClusterService.ListProvisionedProfiles:output_type -> akp.cluster.v2.ListProvisionedProfilesResponse + 39, // 66: akp.cluster.v2.ClusterService.ListGatewayConfigs:output_type -> akp.cluster.v2.ListGatewayConfigsResponse + 41, // 67: akp.cluster.v2.ClusterService.UpdateGatewayConfig:output_type -> akp.cluster.v2.UpdateGatewayConfigResponse + 43, // 68: akp.cluster.v2.ClusterService.UpdateAllGatewayConfigs:output_type -> akp.cluster.v2.UpdateAllGatewayConfigsResponse + 45, // 69: akp.cluster.v2.ClusterService.GetDatabaseBundle:output_type -> akp.cluster.v2.GetDatabaseBundleResponse + 47, // 70: akp.cluster.v2.ClusterService.IsServerCluster:output_type -> akp.cluster.v2.IsServerClusterResponse + 52, // [52:71] is the sub-list for method output_type + 33, // [33:52] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name +} + +func init() { file_akp_cluster_v2_cluster_proto_init() } +func file_akp_cluster_v2_cluster_proto_init() { + if File_akp_cluster_v2_cluster_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_cluster_proto_rawDesc), len(file_akp_cluster_v2_cluster_proto_rawDesc)), + NumEnums: 0, + NumMessages: 51, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_cluster_v2_cluster_proto_goTypes, + DependencyIndexes: file_akp_cluster_v2_cluster_proto_depIdxs, + MessageInfos: file_akp_cluster_v2_cluster_proto_msgTypes, + }.Build() + File_akp_cluster_v2_cluster_proto = out.File + file_akp_cluster_v2_cluster_proto_goTypes = nil + file_akp_cluster_v2_cluster_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/cluster.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/cluster.connect.go new file mode 100644 index 000000000..75a41db53 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/cluster.connect.go @@ -0,0 +1,699 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/cluster/v2/cluster.proto + +package clusterv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + 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 ( + // ClusterServiceName is the fully-qualified name of the ClusterService service. + ClusterServiceName = "akp.cluster.v2.ClusterService" +) + +// 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 ( + // ClusterServiceGetClusterProcedure is the fully-qualified name of the ClusterService's GetCluster + // RPC. + ClusterServiceGetClusterProcedure = "/akp.cluster.v2.ClusterService/GetCluster" + // ClusterServiceUpdateClusterProcedure is the fully-qualified name of the ClusterService's + // UpdateCluster RPC. + ClusterServiceUpdateClusterProcedure = "/akp.cluster.v2.ClusterService/UpdateCluster" + // ClusterServiceGetKubeconfigProcedure is the fully-qualified name of the ClusterService's + // GetKubeconfig RPC. + ClusterServiceGetKubeconfigProcedure = "/akp.cluster.v2.ClusterService/GetKubeconfig" + // ClusterServiceListClustersProcedure is the fully-qualified name of the ClusterService's + // ListClusters RPC. + ClusterServiceListClustersProcedure = "/akp.cluster.v2.ClusterService/ListClusters" + // ClusterServiceListAccountClustersProcedure is the fully-qualified name of the ClusterService's + // ListAccountClusters RPC. + ClusterServiceListAccountClustersProcedure = "/akp.cluster.v2.ClusterService/ListAccountClusters" + // ClusterServiceClusterExistsProcedure is the fully-qualified name of the ClusterService's + // ClusterExists RPC. + ClusterServiceClusterExistsProcedure = "/akp.cluster.v2.ClusterService/ClusterExists" + // ClusterServiceGetClusterIdentityProcedure is the fully-qualified name of the ClusterService's + // GetClusterIdentity RPC. + ClusterServiceGetClusterIdentityProcedure = "/akp.cluster.v2.ClusterService/GetClusterIdentity" + // ClusterServiceHasHubClusterProcedure is the fully-qualified name of the ClusterService's + // HasHubCluster RPC. + ClusterServiceHasHubClusterProcedure = "/akp.cluster.v2.ClusterService/HasHubCluster" + // ClusterServiceListAvailableTypesProcedure is the fully-qualified name of the ClusterService's + // ListAvailableTypes RPC. + ClusterServiceListAvailableTypesProcedure = "/akp.cluster.v2.ClusterService/ListAvailableTypes" + // ClusterServiceListNamespaceObjectsProcedure is the fully-qualified name of the ClusterService's + // ListNamespaceObjects RPC. + ClusterServiceListNamespaceObjectsProcedure = "/akp.cluster.v2.ClusterService/ListNamespaceObjects" + // ClusterServiceListVersionUpdatesProcedure is the fully-qualified name of the ClusterService's + // ListVersionUpdates RPC. + ClusterServiceListVersionUpdatesProcedure = "/akp.cluster.v2.ClusterService/ListVersionUpdates" + // ClusterServiceGetDatabaseFeatureGatesProcedure is the fully-qualified name of the + // ClusterService's GetDatabaseFeatureGates RPC. + ClusterServiceGetDatabaseFeatureGatesProcedure = "/akp.cluster.v2.ClusterService/GetDatabaseFeatureGates" + // ClusterServiceGetFeatureValuesProcedure is the fully-qualified name of the ClusterService's + // GetFeatureValues RPC. + ClusterServiceGetFeatureValuesProcedure = "/akp.cluster.v2.ClusterService/GetFeatureValues" + // ClusterServiceListProvisionedProfilesProcedure is the fully-qualified name of the + // ClusterService's ListProvisionedProfiles RPC. + ClusterServiceListProvisionedProfilesProcedure = "/akp.cluster.v2.ClusterService/ListProvisionedProfiles" + // ClusterServiceListGatewayConfigsProcedure is the fully-qualified name of the ClusterService's + // ListGatewayConfigs RPC. + ClusterServiceListGatewayConfigsProcedure = "/akp.cluster.v2.ClusterService/ListGatewayConfigs" + // ClusterServiceUpdateGatewayConfigProcedure is the fully-qualified name of the ClusterService's + // UpdateGatewayConfig RPC. + ClusterServiceUpdateGatewayConfigProcedure = "/akp.cluster.v2.ClusterService/UpdateGatewayConfig" + // ClusterServiceUpdateAllGatewayConfigsProcedure is the fully-qualified name of the + // ClusterService's UpdateAllGatewayConfigs RPC. + ClusterServiceUpdateAllGatewayConfigsProcedure = "/akp.cluster.v2.ClusterService/UpdateAllGatewayConfigs" + // ClusterServiceGetDatabaseBundleProcedure is the fully-qualified name of the ClusterService's + // GetDatabaseBundle RPC. + ClusterServiceGetDatabaseBundleProcedure = "/akp.cluster.v2.ClusterService/GetDatabaseBundle" + // ClusterServiceIsServerClusterProcedure is the fully-qualified name of the ClusterService's + // IsServerCluster RPC. + ClusterServiceIsServerClusterProcedure = "/akp.cluster.v2.ClusterService/IsServerCluster" +) + +// ClusterServiceClient is a client for the akp.cluster.v2.ClusterService service. +type ClusterServiceClient interface { + // GetCluster is a cluster the caller can see, with the caller's connection status. + GetCluster(context.Context, *connect.Request[v2.GetClusterRequest]) (*connect.Response[v2.GetClusterResponse], error) + // UpdateCluster renames a cluster the caller has connected. Needs the cluster's editor. + UpdateCluster(context.Context, *connect.Request[v2.UpdateClusterRequest]) (*connect.Response[v2.UpdateClusterResponse], error) + // GetKubeconfig is the caller's kubeconfig for a cluster they have connected. + GetKubeconfig(context.Context, *connect.Request[v2.GetKubeconfigRequest]) (*connect.Response[v2.GetKubeconfigResponse], error) + // ListClusters lists an account's clusters by display name, marked not connected where the + // caller has not connected them. Needs the organization's viewer. + ListClusters(context.Context, *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) + // ListAccountClusters lists every cluster of an account by name, without the caller's + // connection status. + ListAccountClusters(context.Context, *connect.Request[v2.ListAccountClustersRequest]) (*connect.Response[v2.ListAccountClustersResponse], error) + // ClusterExists reports whether an account has a cluster of a name. + ClusterExists(context.Context, *connect.Request[v2.ClusterExistsRequest]) (*connect.Response[v2.ClusterExistsResponse], error) + // GetClusterIdentity is the metadata a cluster of the caller's (or of the organization the + // caller is the system user of) signs itself with. + GetClusterIdentity(context.Context, *connect.Request[v2.GetClusterIdentityRequest]) (*connect.Response[v2.GetClusterIdentityResponse], error) + // HasHubCluster reports whether an account has an Open Cluster Management hub cluster. + HasHubCluster(context.Context, *connect.Request[v2.HasHubClusterRequest]) (*connect.Response[v2.HasHubClusterResponse], error) + // ListAvailableTypes lists the resources a cluster serves, by group and version. + ListAvailableTypes(context.Context, *connect.Request[v2.ListAvailableTypesRequest]) (*connect.Response[v2.ListAvailableTypesResponse], error) + // ListNamespaceObjects lists the objects in a namespace of a cluster, of the listable + // resources of the given groups. Resources the caller may not list are left out. + ListNamespaceObjects(context.Context, *connect.Request[v2.ListNamespaceObjectsRequest]) (*connect.Response[v2.ListNamespaceObjectsResponse], error) + // ListVersionUpdates lists the Kubernetes version updates of a Cluster API cluster, newest + // first. Needs the cluster's editor. + ListVersionUpdates(context.Context, *connect.Request[v2.ListVersionUpdatesRequest]) (*connect.Response[v2.ListVersionUpdatesResponse], error) + // GetDatabaseFeatureGates is the KubeDB feature gates of a cluster, or of a cluster set the + // cluster is the hub of. + GetDatabaseFeatureGates(context.Context, *connect.Request[v2.GetDatabaseFeatureGatesRequest]) (*connect.Response[v2.GetDatabaseFeatureGatesResponse], error) + // GetFeatureValues is the default values of features installed in a cluster. + GetFeatureValues(context.Context, *connect.Request[v2.GetFeatureValuesRequest]) (*connect.Response[v2.GetFeatureValuesResponse], error) + // ListProvisionedProfiles lists the cluster profiles a hub cluster has provisioned to its + // cluster sets, which can no longer be edited. + ListProvisionedProfiles(context.Context, *connect.Request[v2.ListProvisionedProfilesRequest]) (*connect.Response[v2.ListProvisionedProfilesResponse], error) + // ListGatewayConfigs lists a cluster's gateway presets with the gateway configuration each + // uses. Needs the cluster's viewer. + ListGatewayConfigs(context.Context, *connect.Request[v2.ListGatewayConfigsRequest]) (*connect.Response[v2.ListGatewayConfigsResponse], error) + // UpdateGatewayConfig brings a gateway configuration up to the version of the default ("ace") + // one, which itself cannot be updated. Needs the cluster's editor. + UpdateGatewayConfig(context.Context, *connect.Request[v2.UpdateGatewayConfigRequest]) (*connect.Response[v2.UpdateGatewayConfigResponse], error) + // UpdateAllGatewayConfigs brings every gateway configuration a preset uses up to the version of + // the default one. Needs the cluster's editor. + UpdateAllGatewayConfigs(context.Context, *connect.Request[v2.UpdateAllGatewayConfigsRequest]) (*connect.Response[v2.UpdateAllGatewayConfigsResponse], error) + // GetDatabaseBundle is what a database form offers in a cluster: database features, the + // versions of a database, and where databases can be placed. + GetDatabaseBundle(context.Context, *connect.Request[v2.GetDatabaseBundleRequest]) (*connect.Response[v2.GetDatabaseBundleResponse], error) + // IsServerCluster reports whether a cluster is the one AKP runs in. + IsServerCluster(context.Context, *connect.Request[v2.IsServerClusterRequest]) (*connect.Response[v2.IsServerClusterResponse], error) +} + +// NewClusterServiceClient constructs a client for the akp.cluster.v2.ClusterService 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 NewClusterServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ClusterServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + clusterServiceMethods := v2.File_akp_cluster_v2_cluster_proto.Services().ByName("ClusterService").Methods() + return &clusterServiceClient{ + getCluster: connect.NewClient[v2.GetClusterRequest, v2.GetClusterResponse]( + httpClient, + baseURL+ClusterServiceGetClusterProcedure, + connect.WithSchema(clusterServiceMethods.ByName("GetCluster")), + connect.WithClientOptions(opts...), + ), + updateCluster: connect.NewClient[v2.UpdateClusterRequest, v2.UpdateClusterResponse]( + httpClient, + baseURL+ClusterServiceUpdateClusterProcedure, + connect.WithSchema(clusterServiceMethods.ByName("UpdateCluster")), + connect.WithClientOptions(opts...), + ), + getKubeconfig: connect.NewClient[v2.GetKubeconfigRequest, v2.GetKubeconfigResponse]( + httpClient, + baseURL+ClusterServiceGetKubeconfigProcedure, + connect.WithSchema(clusterServiceMethods.ByName("GetKubeconfig")), + connect.WithClientOptions(opts...), + ), + listClusters: connect.NewClient[v2.ListClustersRequest, v2.ListClustersResponse]( + httpClient, + baseURL+ClusterServiceListClustersProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListClusters")), + connect.WithClientOptions(opts...), + ), + listAccountClusters: connect.NewClient[v2.ListAccountClustersRequest, v2.ListAccountClustersResponse]( + httpClient, + baseURL+ClusterServiceListAccountClustersProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListAccountClusters")), + connect.WithClientOptions(opts...), + ), + clusterExists: connect.NewClient[v2.ClusterExistsRequest, v2.ClusterExistsResponse]( + httpClient, + baseURL+ClusterServiceClusterExistsProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ClusterExists")), + connect.WithClientOptions(opts...), + ), + getClusterIdentity: connect.NewClient[v2.GetClusterIdentityRequest, v2.GetClusterIdentityResponse]( + httpClient, + baseURL+ClusterServiceGetClusterIdentityProcedure, + connect.WithSchema(clusterServiceMethods.ByName("GetClusterIdentity")), + connect.WithClientOptions(opts...), + ), + hasHubCluster: connect.NewClient[v2.HasHubClusterRequest, v2.HasHubClusterResponse]( + httpClient, + baseURL+ClusterServiceHasHubClusterProcedure, + connect.WithSchema(clusterServiceMethods.ByName("HasHubCluster")), + connect.WithClientOptions(opts...), + ), + listAvailableTypes: connect.NewClient[v2.ListAvailableTypesRequest, v2.ListAvailableTypesResponse]( + httpClient, + baseURL+ClusterServiceListAvailableTypesProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListAvailableTypes")), + connect.WithClientOptions(opts...), + ), + listNamespaceObjects: connect.NewClient[v2.ListNamespaceObjectsRequest, v2.ListNamespaceObjectsResponse]( + httpClient, + baseURL+ClusterServiceListNamespaceObjectsProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListNamespaceObjects")), + connect.WithClientOptions(opts...), + ), + listVersionUpdates: connect.NewClient[v2.ListVersionUpdatesRequest, v2.ListVersionUpdatesResponse]( + httpClient, + baseURL+ClusterServiceListVersionUpdatesProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListVersionUpdates")), + connect.WithClientOptions(opts...), + ), + getDatabaseFeatureGates: connect.NewClient[v2.GetDatabaseFeatureGatesRequest, v2.GetDatabaseFeatureGatesResponse]( + httpClient, + baseURL+ClusterServiceGetDatabaseFeatureGatesProcedure, + connect.WithSchema(clusterServiceMethods.ByName("GetDatabaseFeatureGates")), + connect.WithClientOptions(opts...), + ), + getFeatureValues: connect.NewClient[v2.GetFeatureValuesRequest, v2.GetFeatureValuesResponse]( + httpClient, + baseURL+ClusterServiceGetFeatureValuesProcedure, + connect.WithSchema(clusterServiceMethods.ByName("GetFeatureValues")), + connect.WithClientOptions(opts...), + ), + listProvisionedProfiles: connect.NewClient[v2.ListProvisionedProfilesRequest, v2.ListProvisionedProfilesResponse]( + httpClient, + baseURL+ClusterServiceListProvisionedProfilesProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListProvisionedProfiles")), + connect.WithClientOptions(opts...), + ), + listGatewayConfigs: connect.NewClient[v2.ListGatewayConfigsRequest, v2.ListGatewayConfigsResponse]( + httpClient, + baseURL+ClusterServiceListGatewayConfigsProcedure, + connect.WithSchema(clusterServiceMethods.ByName("ListGatewayConfigs")), + connect.WithClientOptions(opts...), + ), + updateGatewayConfig: connect.NewClient[v2.UpdateGatewayConfigRequest, v2.UpdateGatewayConfigResponse]( + httpClient, + baseURL+ClusterServiceUpdateGatewayConfigProcedure, + connect.WithSchema(clusterServiceMethods.ByName("UpdateGatewayConfig")), + connect.WithClientOptions(opts...), + ), + updateAllGatewayConfigs: connect.NewClient[v2.UpdateAllGatewayConfigsRequest, v2.UpdateAllGatewayConfigsResponse]( + httpClient, + baseURL+ClusterServiceUpdateAllGatewayConfigsProcedure, + connect.WithSchema(clusterServiceMethods.ByName("UpdateAllGatewayConfigs")), + connect.WithClientOptions(opts...), + ), + getDatabaseBundle: connect.NewClient[v2.GetDatabaseBundleRequest, v2.GetDatabaseBundleResponse]( + httpClient, + baseURL+ClusterServiceGetDatabaseBundleProcedure, + connect.WithSchema(clusterServiceMethods.ByName("GetDatabaseBundle")), + connect.WithClientOptions(opts...), + ), + isServerCluster: connect.NewClient[v2.IsServerClusterRequest, v2.IsServerClusterResponse]( + httpClient, + baseURL+ClusterServiceIsServerClusterProcedure, + connect.WithSchema(clusterServiceMethods.ByName("IsServerCluster")), + connect.WithClientOptions(opts...), + ), + } +} + +// clusterServiceClient implements ClusterServiceClient. +type clusterServiceClient struct { + getCluster *connect.Client[v2.GetClusterRequest, v2.GetClusterResponse] + updateCluster *connect.Client[v2.UpdateClusterRequest, v2.UpdateClusterResponse] + getKubeconfig *connect.Client[v2.GetKubeconfigRequest, v2.GetKubeconfigResponse] + listClusters *connect.Client[v2.ListClustersRequest, v2.ListClustersResponse] + listAccountClusters *connect.Client[v2.ListAccountClustersRequest, v2.ListAccountClustersResponse] + clusterExists *connect.Client[v2.ClusterExistsRequest, v2.ClusterExistsResponse] + getClusterIdentity *connect.Client[v2.GetClusterIdentityRequest, v2.GetClusterIdentityResponse] + hasHubCluster *connect.Client[v2.HasHubClusterRequest, v2.HasHubClusterResponse] + listAvailableTypes *connect.Client[v2.ListAvailableTypesRequest, v2.ListAvailableTypesResponse] + listNamespaceObjects *connect.Client[v2.ListNamespaceObjectsRequest, v2.ListNamespaceObjectsResponse] + listVersionUpdates *connect.Client[v2.ListVersionUpdatesRequest, v2.ListVersionUpdatesResponse] + getDatabaseFeatureGates *connect.Client[v2.GetDatabaseFeatureGatesRequest, v2.GetDatabaseFeatureGatesResponse] + getFeatureValues *connect.Client[v2.GetFeatureValuesRequest, v2.GetFeatureValuesResponse] + listProvisionedProfiles *connect.Client[v2.ListProvisionedProfilesRequest, v2.ListProvisionedProfilesResponse] + listGatewayConfigs *connect.Client[v2.ListGatewayConfigsRequest, v2.ListGatewayConfigsResponse] + updateGatewayConfig *connect.Client[v2.UpdateGatewayConfigRequest, v2.UpdateGatewayConfigResponse] + updateAllGatewayConfigs *connect.Client[v2.UpdateAllGatewayConfigsRequest, v2.UpdateAllGatewayConfigsResponse] + getDatabaseBundle *connect.Client[v2.GetDatabaseBundleRequest, v2.GetDatabaseBundleResponse] + isServerCluster *connect.Client[v2.IsServerClusterRequest, v2.IsServerClusterResponse] +} + +// GetCluster calls akp.cluster.v2.ClusterService.GetCluster. +func (c *clusterServiceClient) GetCluster(ctx context.Context, req *connect.Request[v2.GetClusterRequest]) (*connect.Response[v2.GetClusterResponse], error) { + return c.getCluster.CallUnary(ctx, req) +} + +// UpdateCluster calls akp.cluster.v2.ClusterService.UpdateCluster. +func (c *clusterServiceClient) UpdateCluster(ctx context.Context, req *connect.Request[v2.UpdateClusterRequest]) (*connect.Response[v2.UpdateClusterResponse], error) { + return c.updateCluster.CallUnary(ctx, req) +} + +// GetKubeconfig calls akp.cluster.v2.ClusterService.GetKubeconfig. +func (c *clusterServiceClient) GetKubeconfig(ctx context.Context, req *connect.Request[v2.GetKubeconfigRequest]) (*connect.Response[v2.GetKubeconfigResponse], error) { + return c.getKubeconfig.CallUnary(ctx, req) +} + +// ListClusters calls akp.cluster.v2.ClusterService.ListClusters. +func (c *clusterServiceClient) ListClusters(ctx context.Context, req *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) { + return c.listClusters.CallUnary(ctx, req) +} + +// ListAccountClusters calls akp.cluster.v2.ClusterService.ListAccountClusters. +func (c *clusterServiceClient) ListAccountClusters(ctx context.Context, req *connect.Request[v2.ListAccountClustersRequest]) (*connect.Response[v2.ListAccountClustersResponse], error) { + return c.listAccountClusters.CallUnary(ctx, req) +} + +// ClusterExists calls akp.cluster.v2.ClusterService.ClusterExists. +func (c *clusterServiceClient) ClusterExists(ctx context.Context, req *connect.Request[v2.ClusterExistsRequest]) (*connect.Response[v2.ClusterExistsResponse], error) { + return c.clusterExists.CallUnary(ctx, req) +} + +// GetClusterIdentity calls akp.cluster.v2.ClusterService.GetClusterIdentity. +func (c *clusterServiceClient) GetClusterIdentity(ctx context.Context, req *connect.Request[v2.GetClusterIdentityRequest]) (*connect.Response[v2.GetClusterIdentityResponse], error) { + return c.getClusterIdentity.CallUnary(ctx, req) +} + +// HasHubCluster calls akp.cluster.v2.ClusterService.HasHubCluster. +func (c *clusterServiceClient) HasHubCluster(ctx context.Context, req *connect.Request[v2.HasHubClusterRequest]) (*connect.Response[v2.HasHubClusterResponse], error) { + return c.hasHubCluster.CallUnary(ctx, req) +} + +// ListAvailableTypes calls akp.cluster.v2.ClusterService.ListAvailableTypes. +func (c *clusterServiceClient) ListAvailableTypes(ctx context.Context, req *connect.Request[v2.ListAvailableTypesRequest]) (*connect.Response[v2.ListAvailableTypesResponse], error) { + return c.listAvailableTypes.CallUnary(ctx, req) +} + +// ListNamespaceObjects calls akp.cluster.v2.ClusterService.ListNamespaceObjects. +func (c *clusterServiceClient) ListNamespaceObjects(ctx context.Context, req *connect.Request[v2.ListNamespaceObjectsRequest]) (*connect.Response[v2.ListNamespaceObjectsResponse], error) { + return c.listNamespaceObjects.CallUnary(ctx, req) +} + +// ListVersionUpdates calls akp.cluster.v2.ClusterService.ListVersionUpdates. +func (c *clusterServiceClient) ListVersionUpdates(ctx context.Context, req *connect.Request[v2.ListVersionUpdatesRequest]) (*connect.Response[v2.ListVersionUpdatesResponse], error) { + return c.listVersionUpdates.CallUnary(ctx, req) +} + +// GetDatabaseFeatureGates calls akp.cluster.v2.ClusterService.GetDatabaseFeatureGates. +func (c *clusterServiceClient) GetDatabaseFeatureGates(ctx context.Context, req *connect.Request[v2.GetDatabaseFeatureGatesRequest]) (*connect.Response[v2.GetDatabaseFeatureGatesResponse], error) { + return c.getDatabaseFeatureGates.CallUnary(ctx, req) +} + +// GetFeatureValues calls akp.cluster.v2.ClusterService.GetFeatureValues. +func (c *clusterServiceClient) GetFeatureValues(ctx context.Context, req *connect.Request[v2.GetFeatureValuesRequest]) (*connect.Response[v2.GetFeatureValuesResponse], error) { + return c.getFeatureValues.CallUnary(ctx, req) +} + +// ListProvisionedProfiles calls akp.cluster.v2.ClusterService.ListProvisionedProfiles. +func (c *clusterServiceClient) ListProvisionedProfiles(ctx context.Context, req *connect.Request[v2.ListProvisionedProfilesRequest]) (*connect.Response[v2.ListProvisionedProfilesResponse], error) { + return c.listProvisionedProfiles.CallUnary(ctx, req) +} + +// ListGatewayConfigs calls akp.cluster.v2.ClusterService.ListGatewayConfigs. +func (c *clusterServiceClient) ListGatewayConfigs(ctx context.Context, req *connect.Request[v2.ListGatewayConfigsRequest]) (*connect.Response[v2.ListGatewayConfigsResponse], error) { + return c.listGatewayConfigs.CallUnary(ctx, req) +} + +// UpdateGatewayConfig calls akp.cluster.v2.ClusterService.UpdateGatewayConfig. +func (c *clusterServiceClient) UpdateGatewayConfig(ctx context.Context, req *connect.Request[v2.UpdateGatewayConfigRequest]) (*connect.Response[v2.UpdateGatewayConfigResponse], error) { + return c.updateGatewayConfig.CallUnary(ctx, req) +} + +// UpdateAllGatewayConfigs calls akp.cluster.v2.ClusterService.UpdateAllGatewayConfigs. +func (c *clusterServiceClient) UpdateAllGatewayConfigs(ctx context.Context, req *connect.Request[v2.UpdateAllGatewayConfigsRequest]) (*connect.Response[v2.UpdateAllGatewayConfigsResponse], error) { + return c.updateAllGatewayConfigs.CallUnary(ctx, req) +} + +// GetDatabaseBundle calls akp.cluster.v2.ClusterService.GetDatabaseBundle. +func (c *clusterServiceClient) GetDatabaseBundle(ctx context.Context, req *connect.Request[v2.GetDatabaseBundleRequest]) (*connect.Response[v2.GetDatabaseBundleResponse], error) { + return c.getDatabaseBundle.CallUnary(ctx, req) +} + +// IsServerCluster calls akp.cluster.v2.ClusterService.IsServerCluster. +func (c *clusterServiceClient) IsServerCluster(ctx context.Context, req *connect.Request[v2.IsServerClusterRequest]) (*connect.Response[v2.IsServerClusterResponse], error) { + return c.isServerCluster.CallUnary(ctx, req) +} + +// ClusterServiceHandler is an implementation of the akp.cluster.v2.ClusterService service. +type ClusterServiceHandler interface { + // GetCluster is a cluster the caller can see, with the caller's connection status. + GetCluster(context.Context, *connect.Request[v2.GetClusterRequest]) (*connect.Response[v2.GetClusterResponse], error) + // UpdateCluster renames a cluster the caller has connected. Needs the cluster's editor. + UpdateCluster(context.Context, *connect.Request[v2.UpdateClusterRequest]) (*connect.Response[v2.UpdateClusterResponse], error) + // GetKubeconfig is the caller's kubeconfig for a cluster they have connected. + GetKubeconfig(context.Context, *connect.Request[v2.GetKubeconfigRequest]) (*connect.Response[v2.GetKubeconfigResponse], error) + // ListClusters lists an account's clusters by display name, marked not connected where the + // caller has not connected them. Needs the organization's viewer. + ListClusters(context.Context, *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) + // ListAccountClusters lists every cluster of an account by name, without the caller's + // connection status. + ListAccountClusters(context.Context, *connect.Request[v2.ListAccountClustersRequest]) (*connect.Response[v2.ListAccountClustersResponse], error) + // ClusterExists reports whether an account has a cluster of a name. + ClusterExists(context.Context, *connect.Request[v2.ClusterExistsRequest]) (*connect.Response[v2.ClusterExistsResponse], error) + // GetClusterIdentity is the metadata a cluster of the caller's (or of the organization the + // caller is the system user of) signs itself with. + GetClusterIdentity(context.Context, *connect.Request[v2.GetClusterIdentityRequest]) (*connect.Response[v2.GetClusterIdentityResponse], error) + // HasHubCluster reports whether an account has an Open Cluster Management hub cluster. + HasHubCluster(context.Context, *connect.Request[v2.HasHubClusterRequest]) (*connect.Response[v2.HasHubClusterResponse], error) + // ListAvailableTypes lists the resources a cluster serves, by group and version. + ListAvailableTypes(context.Context, *connect.Request[v2.ListAvailableTypesRequest]) (*connect.Response[v2.ListAvailableTypesResponse], error) + // ListNamespaceObjects lists the objects in a namespace of a cluster, of the listable + // resources of the given groups. Resources the caller may not list are left out. + ListNamespaceObjects(context.Context, *connect.Request[v2.ListNamespaceObjectsRequest]) (*connect.Response[v2.ListNamespaceObjectsResponse], error) + // ListVersionUpdates lists the Kubernetes version updates of a Cluster API cluster, newest + // first. Needs the cluster's editor. + ListVersionUpdates(context.Context, *connect.Request[v2.ListVersionUpdatesRequest]) (*connect.Response[v2.ListVersionUpdatesResponse], error) + // GetDatabaseFeatureGates is the KubeDB feature gates of a cluster, or of a cluster set the + // cluster is the hub of. + GetDatabaseFeatureGates(context.Context, *connect.Request[v2.GetDatabaseFeatureGatesRequest]) (*connect.Response[v2.GetDatabaseFeatureGatesResponse], error) + // GetFeatureValues is the default values of features installed in a cluster. + GetFeatureValues(context.Context, *connect.Request[v2.GetFeatureValuesRequest]) (*connect.Response[v2.GetFeatureValuesResponse], error) + // ListProvisionedProfiles lists the cluster profiles a hub cluster has provisioned to its + // cluster sets, which can no longer be edited. + ListProvisionedProfiles(context.Context, *connect.Request[v2.ListProvisionedProfilesRequest]) (*connect.Response[v2.ListProvisionedProfilesResponse], error) + // ListGatewayConfigs lists a cluster's gateway presets with the gateway configuration each + // uses. Needs the cluster's viewer. + ListGatewayConfigs(context.Context, *connect.Request[v2.ListGatewayConfigsRequest]) (*connect.Response[v2.ListGatewayConfigsResponse], error) + // UpdateGatewayConfig brings a gateway configuration up to the version of the default ("ace") + // one, which itself cannot be updated. Needs the cluster's editor. + UpdateGatewayConfig(context.Context, *connect.Request[v2.UpdateGatewayConfigRequest]) (*connect.Response[v2.UpdateGatewayConfigResponse], error) + // UpdateAllGatewayConfigs brings every gateway configuration a preset uses up to the version of + // the default one. Needs the cluster's editor. + UpdateAllGatewayConfigs(context.Context, *connect.Request[v2.UpdateAllGatewayConfigsRequest]) (*connect.Response[v2.UpdateAllGatewayConfigsResponse], error) + // GetDatabaseBundle is what a database form offers in a cluster: database features, the + // versions of a database, and where databases can be placed. + GetDatabaseBundle(context.Context, *connect.Request[v2.GetDatabaseBundleRequest]) (*connect.Response[v2.GetDatabaseBundleResponse], error) + // IsServerCluster reports whether a cluster is the one AKP runs in. + IsServerCluster(context.Context, *connect.Request[v2.IsServerClusterRequest]) (*connect.Response[v2.IsServerClusterResponse], error) +} + +// NewClusterServiceHandler 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 NewClusterServiceHandler(svc ClusterServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + clusterServiceMethods := v2.File_akp_cluster_v2_cluster_proto.Services().ByName("ClusterService").Methods() + clusterServiceGetClusterHandler := connect.NewUnaryHandler( + ClusterServiceGetClusterProcedure, + svc.GetCluster, + connect.WithSchema(clusterServiceMethods.ByName("GetCluster")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceUpdateClusterHandler := connect.NewUnaryHandler( + ClusterServiceUpdateClusterProcedure, + svc.UpdateCluster, + connect.WithSchema(clusterServiceMethods.ByName("UpdateCluster")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceGetKubeconfigHandler := connect.NewUnaryHandler( + ClusterServiceGetKubeconfigProcedure, + svc.GetKubeconfig, + connect.WithSchema(clusterServiceMethods.ByName("GetKubeconfig")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListClustersHandler := connect.NewUnaryHandler( + ClusterServiceListClustersProcedure, + svc.ListClusters, + connect.WithSchema(clusterServiceMethods.ByName("ListClusters")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListAccountClustersHandler := connect.NewUnaryHandler( + ClusterServiceListAccountClustersProcedure, + svc.ListAccountClusters, + connect.WithSchema(clusterServiceMethods.ByName("ListAccountClusters")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceClusterExistsHandler := connect.NewUnaryHandler( + ClusterServiceClusterExistsProcedure, + svc.ClusterExists, + connect.WithSchema(clusterServiceMethods.ByName("ClusterExists")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceGetClusterIdentityHandler := connect.NewUnaryHandler( + ClusterServiceGetClusterIdentityProcedure, + svc.GetClusterIdentity, + connect.WithSchema(clusterServiceMethods.ByName("GetClusterIdentity")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceHasHubClusterHandler := connect.NewUnaryHandler( + ClusterServiceHasHubClusterProcedure, + svc.HasHubCluster, + connect.WithSchema(clusterServiceMethods.ByName("HasHubCluster")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListAvailableTypesHandler := connect.NewUnaryHandler( + ClusterServiceListAvailableTypesProcedure, + svc.ListAvailableTypes, + connect.WithSchema(clusterServiceMethods.ByName("ListAvailableTypes")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListNamespaceObjectsHandler := connect.NewUnaryHandler( + ClusterServiceListNamespaceObjectsProcedure, + svc.ListNamespaceObjects, + connect.WithSchema(clusterServiceMethods.ByName("ListNamespaceObjects")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListVersionUpdatesHandler := connect.NewUnaryHandler( + ClusterServiceListVersionUpdatesProcedure, + svc.ListVersionUpdates, + connect.WithSchema(clusterServiceMethods.ByName("ListVersionUpdates")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceGetDatabaseFeatureGatesHandler := connect.NewUnaryHandler( + ClusterServiceGetDatabaseFeatureGatesProcedure, + svc.GetDatabaseFeatureGates, + connect.WithSchema(clusterServiceMethods.ByName("GetDatabaseFeatureGates")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceGetFeatureValuesHandler := connect.NewUnaryHandler( + ClusterServiceGetFeatureValuesProcedure, + svc.GetFeatureValues, + connect.WithSchema(clusterServiceMethods.ByName("GetFeatureValues")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListProvisionedProfilesHandler := connect.NewUnaryHandler( + ClusterServiceListProvisionedProfilesProcedure, + svc.ListProvisionedProfiles, + connect.WithSchema(clusterServiceMethods.ByName("ListProvisionedProfiles")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceListGatewayConfigsHandler := connect.NewUnaryHandler( + ClusterServiceListGatewayConfigsProcedure, + svc.ListGatewayConfigs, + connect.WithSchema(clusterServiceMethods.ByName("ListGatewayConfigs")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceUpdateGatewayConfigHandler := connect.NewUnaryHandler( + ClusterServiceUpdateGatewayConfigProcedure, + svc.UpdateGatewayConfig, + connect.WithSchema(clusterServiceMethods.ByName("UpdateGatewayConfig")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceUpdateAllGatewayConfigsHandler := connect.NewUnaryHandler( + ClusterServiceUpdateAllGatewayConfigsProcedure, + svc.UpdateAllGatewayConfigs, + connect.WithSchema(clusterServiceMethods.ByName("UpdateAllGatewayConfigs")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceGetDatabaseBundleHandler := connect.NewUnaryHandler( + ClusterServiceGetDatabaseBundleProcedure, + svc.GetDatabaseBundle, + connect.WithSchema(clusterServiceMethods.ByName("GetDatabaseBundle")), + connect.WithHandlerOptions(opts...), + ) + clusterServiceIsServerClusterHandler := connect.NewUnaryHandler( + ClusterServiceIsServerClusterProcedure, + svc.IsServerCluster, + connect.WithSchema(clusterServiceMethods.ByName("IsServerCluster")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.ClusterService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ClusterServiceGetClusterProcedure: + clusterServiceGetClusterHandler.ServeHTTP(w, r) + case ClusterServiceUpdateClusterProcedure: + clusterServiceUpdateClusterHandler.ServeHTTP(w, r) + case ClusterServiceGetKubeconfigProcedure: + clusterServiceGetKubeconfigHandler.ServeHTTP(w, r) + case ClusterServiceListClustersProcedure: + clusterServiceListClustersHandler.ServeHTTP(w, r) + case ClusterServiceListAccountClustersProcedure: + clusterServiceListAccountClustersHandler.ServeHTTP(w, r) + case ClusterServiceClusterExistsProcedure: + clusterServiceClusterExistsHandler.ServeHTTP(w, r) + case ClusterServiceGetClusterIdentityProcedure: + clusterServiceGetClusterIdentityHandler.ServeHTTP(w, r) + case ClusterServiceHasHubClusterProcedure: + clusterServiceHasHubClusterHandler.ServeHTTP(w, r) + case ClusterServiceListAvailableTypesProcedure: + clusterServiceListAvailableTypesHandler.ServeHTTP(w, r) + case ClusterServiceListNamespaceObjectsProcedure: + clusterServiceListNamespaceObjectsHandler.ServeHTTP(w, r) + case ClusterServiceListVersionUpdatesProcedure: + clusterServiceListVersionUpdatesHandler.ServeHTTP(w, r) + case ClusterServiceGetDatabaseFeatureGatesProcedure: + clusterServiceGetDatabaseFeatureGatesHandler.ServeHTTP(w, r) + case ClusterServiceGetFeatureValuesProcedure: + clusterServiceGetFeatureValuesHandler.ServeHTTP(w, r) + case ClusterServiceListProvisionedProfilesProcedure: + clusterServiceListProvisionedProfilesHandler.ServeHTTP(w, r) + case ClusterServiceListGatewayConfigsProcedure: + clusterServiceListGatewayConfigsHandler.ServeHTTP(w, r) + case ClusterServiceUpdateGatewayConfigProcedure: + clusterServiceUpdateGatewayConfigHandler.ServeHTTP(w, r) + case ClusterServiceUpdateAllGatewayConfigsProcedure: + clusterServiceUpdateAllGatewayConfigsHandler.ServeHTTP(w, r) + case ClusterServiceGetDatabaseBundleProcedure: + clusterServiceGetDatabaseBundleHandler.ServeHTTP(w, r) + case ClusterServiceIsServerClusterProcedure: + clusterServiceIsServerClusterHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedClusterServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedClusterServiceHandler struct{} + +func (UnimplementedClusterServiceHandler) GetCluster(context.Context, *connect.Request[v2.GetClusterRequest]) (*connect.Response[v2.GetClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.GetCluster is not implemented")) +} + +func (UnimplementedClusterServiceHandler) UpdateCluster(context.Context, *connect.Request[v2.UpdateClusterRequest]) (*connect.Response[v2.UpdateClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.UpdateCluster is not implemented")) +} + +func (UnimplementedClusterServiceHandler) GetKubeconfig(context.Context, *connect.Request[v2.GetKubeconfigRequest]) (*connect.Response[v2.GetKubeconfigResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.GetKubeconfig is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListClusters(context.Context, *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListClusters is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListAccountClusters(context.Context, *connect.Request[v2.ListAccountClustersRequest]) (*connect.Response[v2.ListAccountClustersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListAccountClusters is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ClusterExists(context.Context, *connect.Request[v2.ClusterExistsRequest]) (*connect.Response[v2.ClusterExistsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ClusterExists is not implemented")) +} + +func (UnimplementedClusterServiceHandler) GetClusterIdentity(context.Context, *connect.Request[v2.GetClusterIdentityRequest]) (*connect.Response[v2.GetClusterIdentityResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.GetClusterIdentity is not implemented")) +} + +func (UnimplementedClusterServiceHandler) HasHubCluster(context.Context, *connect.Request[v2.HasHubClusterRequest]) (*connect.Response[v2.HasHubClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.HasHubCluster is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListAvailableTypes(context.Context, *connect.Request[v2.ListAvailableTypesRequest]) (*connect.Response[v2.ListAvailableTypesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListAvailableTypes is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListNamespaceObjects(context.Context, *connect.Request[v2.ListNamespaceObjectsRequest]) (*connect.Response[v2.ListNamespaceObjectsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListNamespaceObjects is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListVersionUpdates(context.Context, *connect.Request[v2.ListVersionUpdatesRequest]) (*connect.Response[v2.ListVersionUpdatesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListVersionUpdates is not implemented")) +} + +func (UnimplementedClusterServiceHandler) GetDatabaseFeatureGates(context.Context, *connect.Request[v2.GetDatabaseFeatureGatesRequest]) (*connect.Response[v2.GetDatabaseFeatureGatesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.GetDatabaseFeatureGates is not implemented")) +} + +func (UnimplementedClusterServiceHandler) GetFeatureValues(context.Context, *connect.Request[v2.GetFeatureValuesRequest]) (*connect.Response[v2.GetFeatureValuesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.GetFeatureValues is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListProvisionedProfiles(context.Context, *connect.Request[v2.ListProvisionedProfilesRequest]) (*connect.Response[v2.ListProvisionedProfilesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListProvisionedProfiles is not implemented")) +} + +func (UnimplementedClusterServiceHandler) ListGatewayConfigs(context.Context, *connect.Request[v2.ListGatewayConfigsRequest]) (*connect.Response[v2.ListGatewayConfigsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.ListGatewayConfigs is not implemented")) +} + +func (UnimplementedClusterServiceHandler) UpdateGatewayConfig(context.Context, *connect.Request[v2.UpdateGatewayConfigRequest]) (*connect.Response[v2.UpdateGatewayConfigResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.UpdateGatewayConfig is not implemented")) +} + +func (UnimplementedClusterServiceHandler) UpdateAllGatewayConfigs(context.Context, *connect.Request[v2.UpdateAllGatewayConfigsRequest]) (*connect.Response[v2.UpdateAllGatewayConfigsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.UpdateAllGatewayConfigs is not implemented")) +} + +func (UnimplementedClusterServiceHandler) GetDatabaseBundle(context.Context, *connect.Request[v2.GetDatabaseBundleRequest]) (*connect.Response[v2.GetDatabaseBundleResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.GetDatabaseBundle is not implemented")) +} + +func (UnimplementedClusterServiceHandler) IsServerCluster(context.Context, *connect.Request[v2.IsServerClusterRequest]) (*connect.Response[v2.IsServerClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ClusterService.IsServerCluster is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/command.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/command.connect.go new file mode 100644 index 000000000..1d5c623c5 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/command.connect.go @@ -0,0 +1,125 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/cluster/v2/command.proto + +package clusterv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + 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 ( + // CommandServiceName is the fully-qualified name of the CommandService service. + CommandServiceName = "akp.cluster.v2.CommandService" +) + +// 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 ( + // CommandServiceExecuteCommandProcedure is the fully-qualified name of the CommandService's + // ExecuteCommand RPC. + CommandServiceExecuteCommandProcedure = "/akp.cluster.v2.CommandService/ExecuteCommand" +) + +// CommandServiceClient is a client for the akp.cluster.v2.CommandService service. +type CommandServiceClient interface { + // ExecuteCommand runs a kubectl plugin (kubectl-dba, kubectl-kubestash, kubectl-stash or + // kubectl-vault) against a cluster with the caller's credentials. A flag that changes how the + // plugin reaches the cluster (--server, --token, --as, ...) is refused. Needs the cluster's + // editor. + ExecuteCommand(context.Context, *connect.Request[v2.ExecuteCommandRequest]) (*connect.Response[v2.ExecuteCommandResponse], error) +} + +// NewCommandServiceClient constructs a client for the akp.cluster.v2.CommandService 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 NewCommandServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CommandServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + commandServiceMethods := v2.File_akp_cluster_v2_command_proto.Services().ByName("CommandService").Methods() + return &commandServiceClient{ + executeCommand: connect.NewClient[v2.ExecuteCommandRequest, v2.ExecuteCommandResponse]( + httpClient, + baseURL+CommandServiceExecuteCommandProcedure, + connect.WithSchema(commandServiceMethods.ByName("ExecuteCommand")), + connect.WithClientOptions(opts...), + ), + } +} + +// commandServiceClient implements CommandServiceClient. +type commandServiceClient struct { + executeCommand *connect.Client[v2.ExecuteCommandRequest, v2.ExecuteCommandResponse] +} + +// ExecuteCommand calls akp.cluster.v2.CommandService.ExecuteCommand. +func (c *commandServiceClient) ExecuteCommand(ctx context.Context, req *connect.Request[v2.ExecuteCommandRequest]) (*connect.Response[v2.ExecuteCommandResponse], error) { + return c.executeCommand.CallUnary(ctx, req) +} + +// CommandServiceHandler is an implementation of the akp.cluster.v2.CommandService service. +type CommandServiceHandler interface { + // ExecuteCommand runs a kubectl plugin (kubectl-dba, kubectl-kubestash, kubectl-stash or + // kubectl-vault) against a cluster with the caller's credentials. A flag that changes how the + // plugin reaches the cluster (--server, --token, --as, ...) is refused. Needs the cluster's + // editor. + ExecuteCommand(context.Context, *connect.Request[v2.ExecuteCommandRequest]) (*connect.Response[v2.ExecuteCommandResponse], error) +} + +// NewCommandServiceHandler 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 NewCommandServiceHandler(svc CommandServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + commandServiceMethods := v2.File_akp_cluster_v2_command_proto.Services().ByName("CommandService").Methods() + commandServiceExecuteCommandHandler := connect.NewUnaryHandler( + CommandServiceExecuteCommandProcedure, + svc.ExecuteCommand, + connect.WithSchema(commandServiceMethods.ByName("ExecuteCommand")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.CommandService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case CommandServiceExecuteCommandProcedure: + commandServiceExecuteCommandHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedCommandServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedCommandServiceHandler struct{} + +func (UnimplementedCommandServiceHandler) ExecuteCommand(context.Context, *connect.Request[v2.ExecuteCommandRequest]) (*connect.Response[v2.ExecuteCommandResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.CommandService.ExecuteCommand is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/lifecycle.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/lifecycle.connect.go new file mode 100644 index 000000000..7d81236d5 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/lifecycle.connect.go @@ -0,0 +1,894 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/cluster/v2/lifecycle.proto + +package clusterv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + 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 ( + // LifecycleServiceName is the fully-qualified name of the LifecycleService service. + LifecycleServiceName = "akp.cluster.v2.LifecycleService" + // OperationServiceName is the fully-qualified name of the OperationService service. + OperationServiceName = "akp.cluster.v2.OperationService" + // HubServiceName is the fully-qualified name of the HubService service. + HubServiceName = "akp.cluster.v2.HubService" + // VirtualClusterServiceName is the fully-qualified name of the VirtualClusterService service. + VirtualClusterServiceName = "akp.cluster.v2.VirtualClusterService" +) + +// 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 ( + // LifecycleServiceRemoveClusterProcedure is the fully-qualified name of the LifecycleService's + // RemoveCluster RPC. + LifecycleServiceRemoveClusterProcedure = "/akp.cluster.v2.LifecycleService/RemoveCluster" + // LifecycleServiceForgetClusterProcedure is the fully-qualified name of the LifecycleService's + // ForgetCluster RPC. + LifecycleServiceForgetClusterProcedure = "/akp.cluster.v2.LifecycleService/ForgetCluster" + // LifecycleServiceGetClusterStatusProcedure is the fully-qualified name of the LifecycleService's + // GetClusterStatus RPC. + LifecycleServiceGetClusterStatusProcedure = "/akp.cluster.v2.LifecycleService/GetClusterStatus" + // LifecycleServiceListUpgradeableVersionsProcedure is the fully-qualified name of the + // LifecycleService's ListUpgradeableVersions RPC. + LifecycleServiceListUpgradeableVersionsProcedure = "/akp.cluster.v2.LifecycleService/ListUpgradeableVersions" + // LifecycleServiceListArgoCDClustersProcedure is the fully-qualified name of the LifecycleService's + // ListArgoCDClusters RPC. + LifecycleServiceListArgoCDClustersProcedure = "/akp.cluster.v2.LifecycleService/ListArgoCDClusters" + // LifecycleServiceReconcileFeaturesProcedure is the fully-qualified name of the LifecycleService's + // ReconcileFeatures RPC. + LifecycleServiceReconcileFeaturesProcedure = "/akp.cluster.v2.LifecycleService/ReconcileFeatures" + // LifecycleServiceCheckSkipCredentialsProcedure is the fully-qualified name of the + // LifecycleService's CheckSkipCredentials RPC. + LifecycleServiceCheckSkipCredentialsProcedure = "/akp.cluster.v2.LifecycleService/CheckSkipCredentials" + // LifecycleServiceCheckClusterProcedure is the fully-qualified name of the LifecycleService's + // CheckCluster RPC. + LifecycleServiceCheckClusterProcedure = "/akp.cluster.v2.LifecycleService/CheckCluster" + // LifecycleServiceValidateImportProcedure is the fully-qualified name of the LifecycleService's + // ValidateImport RPC. + LifecycleServiceValidateImportProcedure = "/akp.cluster.v2.LifecycleService/ValidateImport" + // LifecycleServiceImportClusterProcedure is the fully-qualified name of the LifecycleService's + // ImportCluster RPC. + LifecycleServiceImportClusterProcedure = "/akp.cluster.v2.LifecycleService/ImportCluster" + // LifecycleServiceConnectClusterProcedure is the fully-qualified name of the LifecycleService's + // ConnectCluster RPC. + LifecycleServiceConnectClusterProcedure = "/akp.cluster.v2.LifecycleService/ConnectCluster" + // LifecycleServiceReconfigureClusterProcedure is the fully-qualified name of the LifecycleService's + // ReconfigureCluster RPC. + LifecycleServiceReconfigureClusterProcedure = "/akp.cluster.v2.LifecycleService/ReconfigureCluster" + // LifecycleServiceConvertFeatureProcedure is the fully-qualified name of the LifecycleService's + // ConvertFeature RPC. + LifecycleServiceConvertFeatureProcedure = "/akp.cluster.v2.LifecycleService/ConvertFeature" + // LifecycleServiceUpgradeKubernetesVersionProcedure is the fully-qualified name of the + // LifecycleService's UpgradeKubernetesVersion RPC. + LifecycleServiceUpgradeKubernetesVersionProcedure = "/akp.cluster.v2.LifecycleService/UpgradeKubernetesVersion" + // LifecycleServiceDeleteClusterProcedure is the fully-qualified name of the LifecycleService's + // DeleteCluster RPC. + LifecycleServiceDeleteClusterProcedure = "/akp.cluster.v2.LifecycleService/DeleteCluster" + // OperationServiceGetOperationProcedure is the fully-qualified name of the OperationService's + // GetOperation RPC. + OperationServiceGetOperationProcedure = "/akp.cluster.v2.OperationService/GetOperation" + // HubServiceGetHubInfoProcedure is the fully-qualified name of the HubService's GetHubInfo RPC. + HubServiceGetHubInfoProcedure = "/akp.cluster.v2.HubService/GetHubInfo" + // HubServiceListAllHubClustersProcedure is the fully-qualified name of the HubService's + // ListAllHubClusters RPC. + HubServiceListAllHubClustersProcedure = "/akp.cluster.v2.HubService/ListAllHubClusters" + // VirtualClusterServiceCreateVirtualClusterProcedure is the fully-qualified name of the + // VirtualClusterService's CreateVirtualCluster RPC. + VirtualClusterServiceCreateVirtualClusterProcedure = "/akp.cluster.v2.VirtualClusterService/CreateVirtualCluster" + // VirtualClusterServiceImportVirtualClusterProcedure is the fully-qualified name of the + // VirtualClusterService's ImportVirtualCluster RPC. + VirtualClusterServiceImportVirtualClusterProcedure = "/akp.cluster.v2.VirtualClusterService/ImportVirtualCluster" +) + +// LifecycleServiceClient is a client for the akp.cluster.v2.LifecycleService service. +type LifecycleServiceClient interface { + // RemoveCluster starts removing AKP's components from a cluster and, for its last user, the + // cluster's records. Needs the cluster's editor. + RemoveCluster(context.Context, *connect.Request[v2.RemoveClusterRequest]) (*connect.Response[v2.RemoveClusterResponse], error) + // ForgetCluster removes a cluster from AKP and leaves the cluster as it is: its inbox + // subscriptions, every user's credentials for it, its record and the caller's console + // settings for it. Needs the cluster's editor. + ForgetCluster(context.Context, *connect.Request[v2.ForgetClusterRequest]) (*connect.Response[v2.ForgetClusterResponse], error) + // GetClusterStatus asks a cluster the caller has connected for its status, and updates its + // record with the cluster managers it reports. + GetClusterStatus(context.Context, *connect.Request[v2.GetClusterStatusRequest]) (*connect.Response[v2.GetClusterStatusResponse], error) + // ListUpgradeableVersions lists the Kubernetes versions the cloud provider can upgrade a + // cluster to. Needs the cluster's editor. + ListUpgradeableVersions(context.Context, *connect.Request[v2.ListUpgradeableVersionsRequest]) (*connect.Response[v2.ListUpgradeableVersionsResponse], error) + // ListArgoCDClusters lists an account's clusters that run a ready Argo CD principal, which a + // cluster being imported can join. Needs the organization's viewer. + ListArgoCDClusters(context.Context, *connect.Request[v2.ListArgoCDClustersRequest]) (*connect.Response[v2.ListArgoCDClustersResponse], error) + // ReconcileFeatures makes Flux reconcile the releases of features in a cluster. Needs the + // cluster's editor. + ReconcileFeatures(context.Context, *connect.Request[v2.ReconcileFeaturesRequest]) (*connect.Response[v2.ReconcileFeaturesResponse], error) + // CheckSkipCredentials reports whether an EKS cluster can be imported with the credentials of + // the environment AKP runs in. Needs the administrative organization's admin. + CheckSkipCredentials(context.Context, *connect.Request[v2.CheckSkipCredentialsRequest]) (*connect.Response[v2.CheckSkipCredentialsResponse], error) + // CheckCluster is the cluster import options name, as the account knows it: its record, with + // its status if the caller has connected it, or a sample of the record importing it would make. + // Needs the organization's cluster importer. + CheckCluster(context.Context, *connect.Request[v2.CheckClusterRequest]) (*connect.Response[v2.CheckClusterResponse], error) + // ValidateImport reports how a cluster would import: whether its names are free and it is + // imported already, the monitoring clusters it can use and, unless for connecting, its Flux CD, + // the feature sets it can install and its Cluster API and AKP metadata. Needs the + // organization's cluster importer. + ValidateImport(context.Context, *connect.Request[v2.ValidateImportRequest]) (*connect.Response[v2.ValidateImportResponse], error) + // ImportCluster imports a cluster into an account, or finds it imported, and starts installing + // AKP's components in it: as a spoke of a hub cluster, if one is named. Needs the + // organization's cluster importer. + ImportCluster(context.Context, *connect.Request[v2.ImportClusterRequest]) (*connect.Response[v2.ImportClusterResponse], error) + // ConnectCluster connects the caller to an imported cluster with their own credentials, or + // renews the credentials they connected it with, once the credentials are found to reach that + // very cluster. Needs the cluster's editor. + ConnectCluster(context.Context, *connect.Request[v2.ConnectClusterRequest]) (*connect.Response[v2.ConnectClusterResponse], error) + // ReconfigureCluster starts installing components in a cluster: joining it to a hub cluster, + // if one is named and it is not a spoke yet. Needs the cluster's editor. + ReconfigureCluster(context.Context, *connect.Request[v2.ReconfigureClusterRequest]) (*connect.Response[v2.ReconfigureClusterResponse], error) + // ConvertFeature starts making AKP manage a feature that is enabled in a cluster but was + // installed outside AKP. Needs the cluster's editor. + ConvertFeature(context.Context, *connect.Request[v2.ConvertFeatureRequest]) (*connect.Response[v2.ConvertFeatureResponse], error) + // UpgradeKubernetesVersion starts upgrading a Cluster API cluster of EKS or AKS to a Kubernetes + // version. Needs the cluster's editor. + UpgradeKubernetesVersion(context.Context, *connect.Request[v2.UpgradeKubernetesVersionRequest]) (*connect.Response[v2.UpgradeKubernetesVersionResponse], error) + // DeleteCluster starts deleting a cluster AKP created through Cluster API from its cloud + // provider. Needs the cluster's editor. + DeleteCluster(context.Context, *connect.Request[v2.DeleteClusterRequest]) (*connect.Response[v2.DeleteClusterResponse], error) +} + +// NewLifecycleServiceClient constructs a client for the akp.cluster.v2.LifecycleService 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 NewLifecycleServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) LifecycleServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + lifecycleServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("LifecycleService").Methods() + return &lifecycleServiceClient{ + removeCluster: connect.NewClient[v2.RemoveClusterRequest, v2.RemoveClusterResponse]( + httpClient, + baseURL+LifecycleServiceRemoveClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("RemoveCluster")), + connect.WithClientOptions(opts...), + ), + forgetCluster: connect.NewClient[v2.ForgetClusterRequest, v2.ForgetClusterResponse]( + httpClient, + baseURL+LifecycleServiceForgetClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ForgetCluster")), + connect.WithClientOptions(opts...), + ), + getClusterStatus: connect.NewClient[v2.GetClusterStatusRequest, v2.GetClusterStatusResponse]( + httpClient, + baseURL+LifecycleServiceGetClusterStatusProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("GetClusterStatus")), + connect.WithClientOptions(opts...), + ), + listUpgradeableVersions: connect.NewClient[v2.ListUpgradeableVersionsRequest, v2.ListUpgradeableVersionsResponse]( + httpClient, + baseURL+LifecycleServiceListUpgradeableVersionsProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ListUpgradeableVersions")), + connect.WithClientOptions(opts...), + ), + listArgoCDClusters: connect.NewClient[v2.ListArgoCDClustersRequest, v2.ListArgoCDClustersResponse]( + httpClient, + baseURL+LifecycleServiceListArgoCDClustersProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ListArgoCDClusters")), + connect.WithClientOptions(opts...), + ), + reconcileFeatures: connect.NewClient[v2.ReconcileFeaturesRequest, v2.ReconcileFeaturesResponse]( + httpClient, + baseURL+LifecycleServiceReconcileFeaturesProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ReconcileFeatures")), + connect.WithClientOptions(opts...), + ), + checkSkipCredentials: connect.NewClient[v2.CheckSkipCredentialsRequest, v2.CheckSkipCredentialsResponse]( + httpClient, + baseURL+LifecycleServiceCheckSkipCredentialsProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("CheckSkipCredentials")), + connect.WithClientOptions(opts...), + ), + checkCluster: connect.NewClient[v2.CheckClusterRequest, v2.CheckClusterResponse]( + httpClient, + baseURL+LifecycleServiceCheckClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("CheckCluster")), + connect.WithClientOptions(opts...), + ), + validateImport: connect.NewClient[v2.ValidateImportRequest, v2.ValidateImportResponse]( + httpClient, + baseURL+LifecycleServiceValidateImportProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ValidateImport")), + connect.WithClientOptions(opts...), + ), + importCluster: connect.NewClient[v2.ImportClusterRequest, v2.ImportClusterResponse]( + httpClient, + baseURL+LifecycleServiceImportClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ImportCluster")), + connect.WithClientOptions(opts...), + ), + connectCluster: connect.NewClient[v2.ConnectClusterRequest, v2.ConnectClusterResponse]( + httpClient, + baseURL+LifecycleServiceConnectClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ConnectCluster")), + connect.WithClientOptions(opts...), + ), + reconfigureCluster: connect.NewClient[v2.ReconfigureClusterRequest, v2.ReconfigureClusterResponse]( + httpClient, + baseURL+LifecycleServiceReconfigureClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ReconfigureCluster")), + connect.WithClientOptions(opts...), + ), + convertFeature: connect.NewClient[v2.ConvertFeatureRequest, v2.ConvertFeatureResponse]( + httpClient, + baseURL+LifecycleServiceConvertFeatureProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("ConvertFeature")), + connect.WithClientOptions(opts...), + ), + upgradeKubernetesVersion: connect.NewClient[v2.UpgradeKubernetesVersionRequest, v2.UpgradeKubernetesVersionResponse]( + httpClient, + baseURL+LifecycleServiceUpgradeKubernetesVersionProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("UpgradeKubernetesVersion")), + connect.WithClientOptions(opts...), + ), + deleteCluster: connect.NewClient[v2.DeleteClusterRequest, v2.DeleteClusterResponse]( + httpClient, + baseURL+LifecycleServiceDeleteClusterProcedure, + connect.WithSchema(lifecycleServiceMethods.ByName("DeleteCluster")), + connect.WithClientOptions(opts...), + ), + } +} + +// lifecycleServiceClient implements LifecycleServiceClient. +type lifecycleServiceClient struct { + removeCluster *connect.Client[v2.RemoveClusterRequest, v2.RemoveClusterResponse] + forgetCluster *connect.Client[v2.ForgetClusterRequest, v2.ForgetClusterResponse] + getClusterStatus *connect.Client[v2.GetClusterStatusRequest, v2.GetClusterStatusResponse] + listUpgradeableVersions *connect.Client[v2.ListUpgradeableVersionsRequest, v2.ListUpgradeableVersionsResponse] + listArgoCDClusters *connect.Client[v2.ListArgoCDClustersRequest, v2.ListArgoCDClustersResponse] + reconcileFeatures *connect.Client[v2.ReconcileFeaturesRequest, v2.ReconcileFeaturesResponse] + checkSkipCredentials *connect.Client[v2.CheckSkipCredentialsRequest, v2.CheckSkipCredentialsResponse] + checkCluster *connect.Client[v2.CheckClusterRequest, v2.CheckClusterResponse] + validateImport *connect.Client[v2.ValidateImportRequest, v2.ValidateImportResponse] + importCluster *connect.Client[v2.ImportClusterRequest, v2.ImportClusterResponse] + connectCluster *connect.Client[v2.ConnectClusterRequest, v2.ConnectClusterResponse] + reconfigureCluster *connect.Client[v2.ReconfigureClusterRequest, v2.ReconfigureClusterResponse] + convertFeature *connect.Client[v2.ConvertFeatureRequest, v2.ConvertFeatureResponse] + upgradeKubernetesVersion *connect.Client[v2.UpgradeKubernetesVersionRequest, v2.UpgradeKubernetesVersionResponse] + deleteCluster *connect.Client[v2.DeleteClusterRequest, v2.DeleteClusterResponse] +} + +// RemoveCluster calls akp.cluster.v2.LifecycleService.RemoveCluster. +func (c *lifecycleServiceClient) RemoveCluster(ctx context.Context, req *connect.Request[v2.RemoveClusterRequest]) (*connect.Response[v2.RemoveClusterResponse], error) { + return c.removeCluster.CallUnary(ctx, req) +} + +// ForgetCluster calls akp.cluster.v2.LifecycleService.ForgetCluster. +func (c *lifecycleServiceClient) ForgetCluster(ctx context.Context, req *connect.Request[v2.ForgetClusterRequest]) (*connect.Response[v2.ForgetClusterResponse], error) { + return c.forgetCluster.CallUnary(ctx, req) +} + +// GetClusterStatus calls akp.cluster.v2.LifecycleService.GetClusterStatus. +func (c *lifecycleServiceClient) GetClusterStatus(ctx context.Context, req *connect.Request[v2.GetClusterStatusRequest]) (*connect.Response[v2.GetClusterStatusResponse], error) { + return c.getClusterStatus.CallUnary(ctx, req) +} + +// ListUpgradeableVersions calls akp.cluster.v2.LifecycleService.ListUpgradeableVersions. +func (c *lifecycleServiceClient) ListUpgradeableVersions(ctx context.Context, req *connect.Request[v2.ListUpgradeableVersionsRequest]) (*connect.Response[v2.ListUpgradeableVersionsResponse], error) { + return c.listUpgradeableVersions.CallUnary(ctx, req) +} + +// ListArgoCDClusters calls akp.cluster.v2.LifecycleService.ListArgoCDClusters. +func (c *lifecycleServiceClient) ListArgoCDClusters(ctx context.Context, req *connect.Request[v2.ListArgoCDClustersRequest]) (*connect.Response[v2.ListArgoCDClustersResponse], error) { + return c.listArgoCDClusters.CallUnary(ctx, req) +} + +// ReconcileFeatures calls akp.cluster.v2.LifecycleService.ReconcileFeatures. +func (c *lifecycleServiceClient) ReconcileFeatures(ctx context.Context, req *connect.Request[v2.ReconcileFeaturesRequest]) (*connect.Response[v2.ReconcileFeaturesResponse], error) { + return c.reconcileFeatures.CallUnary(ctx, req) +} + +// CheckSkipCredentials calls akp.cluster.v2.LifecycleService.CheckSkipCredentials. +func (c *lifecycleServiceClient) CheckSkipCredentials(ctx context.Context, req *connect.Request[v2.CheckSkipCredentialsRequest]) (*connect.Response[v2.CheckSkipCredentialsResponse], error) { + return c.checkSkipCredentials.CallUnary(ctx, req) +} + +// CheckCluster calls akp.cluster.v2.LifecycleService.CheckCluster. +func (c *lifecycleServiceClient) CheckCluster(ctx context.Context, req *connect.Request[v2.CheckClusterRequest]) (*connect.Response[v2.CheckClusterResponse], error) { + return c.checkCluster.CallUnary(ctx, req) +} + +// ValidateImport calls akp.cluster.v2.LifecycleService.ValidateImport. +func (c *lifecycleServiceClient) ValidateImport(ctx context.Context, req *connect.Request[v2.ValidateImportRequest]) (*connect.Response[v2.ValidateImportResponse], error) { + return c.validateImport.CallUnary(ctx, req) +} + +// ImportCluster calls akp.cluster.v2.LifecycleService.ImportCluster. +func (c *lifecycleServiceClient) ImportCluster(ctx context.Context, req *connect.Request[v2.ImportClusterRequest]) (*connect.Response[v2.ImportClusterResponse], error) { + return c.importCluster.CallUnary(ctx, req) +} + +// ConnectCluster calls akp.cluster.v2.LifecycleService.ConnectCluster. +func (c *lifecycleServiceClient) ConnectCluster(ctx context.Context, req *connect.Request[v2.ConnectClusterRequest]) (*connect.Response[v2.ConnectClusterResponse], error) { + return c.connectCluster.CallUnary(ctx, req) +} + +// ReconfigureCluster calls akp.cluster.v2.LifecycleService.ReconfigureCluster. +func (c *lifecycleServiceClient) ReconfigureCluster(ctx context.Context, req *connect.Request[v2.ReconfigureClusterRequest]) (*connect.Response[v2.ReconfigureClusterResponse], error) { + return c.reconfigureCluster.CallUnary(ctx, req) +} + +// ConvertFeature calls akp.cluster.v2.LifecycleService.ConvertFeature. +func (c *lifecycleServiceClient) ConvertFeature(ctx context.Context, req *connect.Request[v2.ConvertFeatureRequest]) (*connect.Response[v2.ConvertFeatureResponse], error) { + return c.convertFeature.CallUnary(ctx, req) +} + +// UpgradeKubernetesVersion calls akp.cluster.v2.LifecycleService.UpgradeKubernetesVersion. +func (c *lifecycleServiceClient) UpgradeKubernetesVersion(ctx context.Context, req *connect.Request[v2.UpgradeKubernetesVersionRequest]) (*connect.Response[v2.UpgradeKubernetesVersionResponse], error) { + return c.upgradeKubernetesVersion.CallUnary(ctx, req) +} + +// DeleteCluster calls akp.cluster.v2.LifecycleService.DeleteCluster. +func (c *lifecycleServiceClient) DeleteCluster(ctx context.Context, req *connect.Request[v2.DeleteClusterRequest]) (*connect.Response[v2.DeleteClusterResponse], error) { + return c.deleteCluster.CallUnary(ctx, req) +} + +// LifecycleServiceHandler is an implementation of the akp.cluster.v2.LifecycleService service. +type LifecycleServiceHandler interface { + // RemoveCluster starts removing AKP's components from a cluster and, for its last user, the + // cluster's records. Needs the cluster's editor. + RemoveCluster(context.Context, *connect.Request[v2.RemoveClusterRequest]) (*connect.Response[v2.RemoveClusterResponse], error) + // ForgetCluster removes a cluster from AKP and leaves the cluster as it is: its inbox + // subscriptions, every user's credentials for it, its record and the caller's console + // settings for it. Needs the cluster's editor. + ForgetCluster(context.Context, *connect.Request[v2.ForgetClusterRequest]) (*connect.Response[v2.ForgetClusterResponse], error) + // GetClusterStatus asks a cluster the caller has connected for its status, and updates its + // record with the cluster managers it reports. + GetClusterStatus(context.Context, *connect.Request[v2.GetClusterStatusRequest]) (*connect.Response[v2.GetClusterStatusResponse], error) + // ListUpgradeableVersions lists the Kubernetes versions the cloud provider can upgrade a + // cluster to. Needs the cluster's editor. + ListUpgradeableVersions(context.Context, *connect.Request[v2.ListUpgradeableVersionsRequest]) (*connect.Response[v2.ListUpgradeableVersionsResponse], error) + // ListArgoCDClusters lists an account's clusters that run a ready Argo CD principal, which a + // cluster being imported can join. Needs the organization's viewer. + ListArgoCDClusters(context.Context, *connect.Request[v2.ListArgoCDClustersRequest]) (*connect.Response[v2.ListArgoCDClustersResponse], error) + // ReconcileFeatures makes Flux reconcile the releases of features in a cluster. Needs the + // cluster's editor. + ReconcileFeatures(context.Context, *connect.Request[v2.ReconcileFeaturesRequest]) (*connect.Response[v2.ReconcileFeaturesResponse], error) + // CheckSkipCredentials reports whether an EKS cluster can be imported with the credentials of + // the environment AKP runs in. Needs the administrative organization's admin. + CheckSkipCredentials(context.Context, *connect.Request[v2.CheckSkipCredentialsRequest]) (*connect.Response[v2.CheckSkipCredentialsResponse], error) + // CheckCluster is the cluster import options name, as the account knows it: its record, with + // its status if the caller has connected it, or a sample of the record importing it would make. + // Needs the organization's cluster importer. + CheckCluster(context.Context, *connect.Request[v2.CheckClusterRequest]) (*connect.Response[v2.CheckClusterResponse], error) + // ValidateImport reports how a cluster would import: whether its names are free and it is + // imported already, the monitoring clusters it can use and, unless for connecting, its Flux CD, + // the feature sets it can install and its Cluster API and AKP metadata. Needs the + // organization's cluster importer. + ValidateImport(context.Context, *connect.Request[v2.ValidateImportRequest]) (*connect.Response[v2.ValidateImportResponse], error) + // ImportCluster imports a cluster into an account, or finds it imported, and starts installing + // AKP's components in it: as a spoke of a hub cluster, if one is named. Needs the + // organization's cluster importer. + ImportCluster(context.Context, *connect.Request[v2.ImportClusterRequest]) (*connect.Response[v2.ImportClusterResponse], error) + // ConnectCluster connects the caller to an imported cluster with their own credentials, or + // renews the credentials they connected it with, once the credentials are found to reach that + // very cluster. Needs the cluster's editor. + ConnectCluster(context.Context, *connect.Request[v2.ConnectClusterRequest]) (*connect.Response[v2.ConnectClusterResponse], error) + // ReconfigureCluster starts installing components in a cluster: joining it to a hub cluster, + // if one is named and it is not a spoke yet. Needs the cluster's editor. + ReconfigureCluster(context.Context, *connect.Request[v2.ReconfigureClusterRequest]) (*connect.Response[v2.ReconfigureClusterResponse], error) + // ConvertFeature starts making AKP manage a feature that is enabled in a cluster but was + // installed outside AKP. Needs the cluster's editor. + ConvertFeature(context.Context, *connect.Request[v2.ConvertFeatureRequest]) (*connect.Response[v2.ConvertFeatureResponse], error) + // UpgradeKubernetesVersion starts upgrading a Cluster API cluster of EKS or AKS to a Kubernetes + // version. Needs the cluster's editor. + UpgradeKubernetesVersion(context.Context, *connect.Request[v2.UpgradeKubernetesVersionRequest]) (*connect.Response[v2.UpgradeKubernetesVersionResponse], error) + // DeleteCluster starts deleting a cluster AKP created through Cluster API from its cloud + // provider. Needs the cluster's editor. + DeleteCluster(context.Context, *connect.Request[v2.DeleteClusterRequest]) (*connect.Response[v2.DeleteClusterResponse], error) +} + +// NewLifecycleServiceHandler 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 NewLifecycleServiceHandler(svc LifecycleServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + lifecycleServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("LifecycleService").Methods() + lifecycleServiceRemoveClusterHandler := connect.NewUnaryHandler( + LifecycleServiceRemoveClusterProcedure, + svc.RemoveCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("RemoveCluster")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceForgetClusterHandler := connect.NewUnaryHandler( + LifecycleServiceForgetClusterProcedure, + svc.ForgetCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("ForgetCluster")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceGetClusterStatusHandler := connect.NewUnaryHandler( + LifecycleServiceGetClusterStatusProcedure, + svc.GetClusterStatus, + connect.WithSchema(lifecycleServiceMethods.ByName("GetClusterStatus")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceListUpgradeableVersionsHandler := connect.NewUnaryHandler( + LifecycleServiceListUpgradeableVersionsProcedure, + svc.ListUpgradeableVersions, + connect.WithSchema(lifecycleServiceMethods.ByName("ListUpgradeableVersions")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceListArgoCDClustersHandler := connect.NewUnaryHandler( + LifecycleServiceListArgoCDClustersProcedure, + svc.ListArgoCDClusters, + connect.WithSchema(lifecycleServiceMethods.ByName("ListArgoCDClusters")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceReconcileFeaturesHandler := connect.NewUnaryHandler( + LifecycleServiceReconcileFeaturesProcedure, + svc.ReconcileFeatures, + connect.WithSchema(lifecycleServiceMethods.ByName("ReconcileFeatures")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceCheckSkipCredentialsHandler := connect.NewUnaryHandler( + LifecycleServiceCheckSkipCredentialsProcedure, + svc.CheckSkipCredentials, + connect.WithSchema(lifecycleServiceMethods.ByName("CheckSkipCredentials")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceCheckClusterHandler := connect.NewUnaryHandler( + LifecycleServiceCheckClusterProcedure, + svc.CheckCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("CheckCluster")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceValidateImportHandler := connect.NewUnaryHandler( + LifecycleServiceValidateImportProcedure, + svc.ValidateImport, + connect.WithSchema(lifecycleServiceMethods.ByName("ValidateImport")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceImportClusterHandler := connect.NewUnaryHandler( + LifecycleServiceImportClusterProcedure, + svc.ImportCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("ImportCluster")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceConnectClusterHandler := connect.NewUnaryHandler( + LifecycleServiceConnectClusterProcedure, + svc.ConnectCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("ConnectCluster")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceReconfigureClusterHandler := connect.NewUnaryHandler( + LifecycleServiceReconfigureClusterProcedure, + svc.ReconfigureCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("ReconfigureCluster")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceConvertFeatureHandler := connect.NewUnaryHandler( + LifecycleServiceConvertFeatureProcedure, + svc.ConvertFeature, + connect.WithSchema(lifecycleServiceMethods.ByName("ConvertFeature")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceUpgradeKubernetesVersionHandler := connect.NewUnaryHandler( + LifecycleServiceUpgradeKubernetesVersionProcedure, + svc.UpgradeKubernetesVersion, + connect.WithSchema(lifecycleServiceMethods.ByName("UpgradeKubernetesVersion")), + connect.WithHandlerOptions(opts...), + ) + lifecycleServiceDeleteClusterHandler := connect.NewUnaryHandler( + LifecycleServiceDeleteClusterProcedure, + svc.DeleteCluster, + connect.WithSchema(lifecycleServiceMethods.ByName("DeleteCluster")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.LifecycleService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case LifecycleServiceRemoveClusterProcedure: + lifecycleServiceRemoveClusterHandler.ServeHTTP(w, r) + case LifecycleServiceForgetClusterProcedure: + lifecycleServiceForgetClusterHandler.ServeHTTP(w, r) + case LifecycleServiceGetClusterStatusProcedure: + lifecycleServiceGetClusterStatusHandler.ServeHTTP(w, r) + case LifecycleServiceListUpgradeableVersionsProcedure: + lifecycleServiceListUpgradeableVersionsHandler.ServeHTTP(w, r) + case LifecycleServiceListArgoCDClustersProcedure: + lifecycleServiceListArgoCDClustersHandler.ServeHTTP(w, r) + case LifecycleServiceReconcileFeaturesProcedure: + lifecycleServiceReconcileFeaturesHandler.ServeHTTP(w, r) + case LifecycleServiceCheckSkipCredentialsProcedure: + lifecycleServiceCheckSkipCredentialsHandler.ServeHTTP(w, r) + case LifecycleServiceCheckClusterProcedure: + lifecycleServiceCheckClusterHandler.ServeHTTP(w, r) + case LifecycleServiceValidateImportProcedure: + lifecycleServiceValidateImportHandler.ServeHTTP(w, r) + case LifecycleServiceImportClusterProcedure: + lifecycleServiceImportClusterHandler.ServeHTTP(w, r) + case LifecycleServiceConnectClusterProcedure: + lifecycleServiceConnectClusterHandler.ServeHTTP(w, r) + case LifecycleServiceReconfigureClusterProcedure: + lifecycleServiceReconfigureClusterHandler.ServeHTTP(w, r) + case LifecycleServiceConvertFeatureProcedure: + lifecycleServiceConvertFeatureHandler.ServeHTTP(w, r) + case LifecycleServiceUpgradeKubernetesVersionProcedure: + lifecycleServiceUpgradeKubernetesVersionHandler.ServeHTTP(w, r) + case LifecycleServiceDeleteClusterProcedure: + lifecycleServiceDeleteClusterHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedLifecycleServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedLifecycleServiceHandler struct{} + +func (UnimplementedLifecycleServiceHandler) RemoveCluster(context.Context, *connect.Request[v2.RemoveClusterRequest]) (*connect.Response[v2.RemoveClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.RemoveCluster is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ForgetCluster(context.Context, *connect.Request[v2.ForgetClusterRequest]) (*connect.Response[v2.ForgetClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ForgetCluster is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) GetClusterStatus(context.Context, *connect.Request[v2.GetClusterStatusRequest]) (*connect.Response[v2.GetClusterStatusResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.GetClusterStatus is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ListUpgradeableVersions(context.Context, *connect.Request[v2.ListUpgradeableVersionsRequest]) (*connect.Response[v2.ListUpgradeableVersionsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ListUpgradeableVersions is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ListArgoCDClusters(context.Context, *connect.Request[v2.ListArgoCDClustersRequest]) (*connect.Response[v2.ListArgoCDClustersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ListArgoCDClusters is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ReconcileFeatures(context.Context, *connect.Request[v2.ReconcileFeaturesRequest]) (*connect.Response[v2.ReconcileFeaturesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ReconcileFeatures is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) CheckSkipCredentials(context.Context, *connect.Request[v2.CheckSkipCredentialsRequest]) (*connect.Response[v2.CheckSkipCredentialsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.CheckSkipCredentials is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) CheckCluster(context.Context, *connect.Request[v2.CheckClusterRequest]) (*connect.Response[v2.CheckClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.CheckCluster is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ValidateImport(context.Context, *connect.Request[v2.ValidateImportRequest]) (*connect.Response[v2.ValidateImportResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ValidateImport is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ImportCluster(context.Context, *connect.Request[v2.ImportClusterRequest]) (*connect.Response[v2.ImportClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ImportCluster is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ConnectCluster(context.Context, *connect.Request[v2.ConnectClusterRequest]) (*connect.Response[v2.ConnectClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ConnectCluster is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ReconfigureCluster(context.Context, *connect.Request[v2.ReconfigureClusterRequest]) (*connect.Response[v2.ReconfigureClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ReconfigureCluster is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) ConvertFeature(context.Context, *connect.Request[v2.ConvertFeatureRequest]) (*connect.Response[v2.ConvertFeatureResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.ConvertFeature is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) UpgradeKubernetesVersion(context.Context, *connect.Request[v2.UpgradeKubernetesVersionRequest]) (*connect.Response[v2.UpgradeKubernetesVersionResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.UpgradeKubernetesVersion is not implemented")) +} + +func (UnimplementedLifecycleServiceHandler) DeleteCluster(context.Context, *connect.Request[v2.DeleteClusterRequest]) (*connect.Response[v2.DeleteClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.LifecycleService.DeleteCluster is not implemented")) +} + +// OperationServiceClient is a client for the akp.cluster.v2.OperationService service. +type OperationServiceClient interface { + GetOperation(context.Context, *connect.Request[v2.GetOperationRequest]) (*connect.Response[v2.GetOperationResponse], error) +} + +// NewOperationServiceClient constructs a client for the akp.cluster.v2.OperationService 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 NewOperationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) OperationServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + operationServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("OperationService").Methods() + return &operationServiceClient{ + getOperation: connect.NewClient[v2.GetOperationRequest, v2.GetOperationResponse]( + httpClient, + baseURL+OperationServiceGetOperationProcedure, + connect.WithSchema(operationServiceMethods.ByName("GetOperation")), + connect.WithClientOptions(opts...), + ), + } +} + +// operationServiceClient implements OperationServiceClient. +type operationServiceClient struct { + getOperation *connect.Client[v2.GetOperationRequest, v2.GetOperationResponse] +} + +// GetOperation calls akp.cluster.v2.OperationService.GetOperation. +func (c *operationServiceClient) GetOperation(ctx context.Context, req *connect.Request[v2.GetOperationRequest]) (*connect.Response[v2.GetOperationResponse], error) { + return c.getOperation.CallUnary(ctx, req) +} + +// OperationServiceHandler is an implementation of the akp.cluster.v2.OperationService service. +type OperationServiceHandler interface { + GetOperation(context.Context, *connect.Request[v2.GetOperationRequest]) (*connect.Response[v2.GetOperationResponse], error) +} + +// NewOperationServiceHandler 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 NewOperationServiceHandler(svc OperationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + operationServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("OperationService").Methods() + operationServiceGetOperationHandler := connect.NewUnaryHandler( + OperationServiceGetOperationProcedure, + svc.GetOperation, + connect.WithSchema(operationServiceMethods.ByName("GetOperation")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.OperationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case OperationServiceGetOperationProcedure: + operationServiceGetOperationHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedOperationServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedOperationServiceHandler struct{} + +func (UnimplementedOperationServiceHandler) GetOperation(context.Context, *connect.Request[v2.GetOperationRequest]) (*connect.Response[v2.GetOperationResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.OperationService.GetOperation is not implemented")) +} + +// HubServiceClient is a client for the akp.cluster.v2.HubService service. +type HubServiceClient interface { + // GetHubInfo is how a cluster joins each of an account's active hub clusters. Needs the + // organization's viewer. + GetHubInfo(context.Context, *connect.Request[v2.GetHubInfoRequest]) (*connect.Response[v2.GetHubInfoResponse], error) + // ListAllHubClusters lists the active hub clusters, of the organizations the caller owns, that + // the caller has connected. + ListAllHubClusters(context.Context, *connect.Request[v2.ListAllHubClustersRequest]) (*connect.Response[v2.ListAllHubClustersResponse], error) +} + +// NewHubServiceClient constructs a client for the akp.cluster.v2.HubService 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 NewHubServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HubServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + hubServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("HubService").Methods() + return &hubServiceClient{ + getHubInfo: connect.NewClient[v2.GetHubInfoRequest, v2.GetHubInfoResponse]( + httpClient, + baseURL+HubServiceGetHubInfoProcedure, + connect.WithSchema(hubServiceMethods.ByName("GetHubInfo")), + connect.WithClientOptions(opts...), + ), + listAllHubClusters: connect.NewClient[v2.ListAllHubClustersRequest, v2.ListAllHubClustersResponse]( + httpClient, + baseURL+HubServiceListAllHubClustersProcedure, + connect.WithSchema(hubServiceMethods.ByName("ListAllHubClusters")), + connect.WithClientOptions(opts...), + ), + } +} + +// hubServiceClient implements HubServiceClient. +type hubServiceClient struct { + getHubInfo *connect.Client[v2.GetHubInfoRequest, v2.GetHubInfoResponse] + listAllHubClusters *connect.Client[v2.ListAllHubClustersRequest, v2.ListAllHubClustersResponse] +} + +// GetHubInfo calls akp.cluster.v2.HubService.GetHubInfo. +func (c *hubServiceClient) GetHubInfo(ctx context.Context, req *connect.Request[v2.GetHubInfoRequest]) (*connect.Response[v2.GetHubInfoResponse], error) { + return c.getHubInfo.CallUnary(ctx, req) +} + +// ListAllHubClusters calls akp.cluster.v2.HubService.ListAllHubClusters. +func (c *hubServiceClient) ListAllHubClusters(ctx context.Context, req *connect.Request[v2.ListAllHubClustersRequest]) (*connect.Response[v2.ListAllHubClustersResponse], error) { + return c.listAllHubClusters.CallUnary(ctx, req) +} + +// HubServiceHandler is an implementation of the akp.cluster.v2.HubService service. +type HubServiceHandler interface { + // GetHubInfo is how a cluster joins each of an account's active hub clusters. Needs the + // organization's viewer. + GetHubInfo(context.Context, *connect.Request[v2.GetHubInfoRequest]) (*connect.Response[v2.GetHubInfoResponse], error) + // ListAllHubClusters lists the active hub clusters, of the organizations the caller owns, that + // the caller has connected. + ListAllHubClusters(context.Context, *connect.Request[v2.ListAllHubClustersRequest]) (*connect.Response[v2.ListAllHubClustersResponse], error) +} + +// NewHubServiceHandler 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 NewHubServiceHandler(svc HubServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + hubServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("HubService").Methods() + hubServiceGetHubInfoHandler := connect.NewUnaryHandler( + HubServiceGetHubInfoProcedure, + svc.GetHubInfo, + connect.WithSchema(hubServiceMethods.ByName("GetHubInfo")), + connect.WithHandlerOptions(opts...), + ) + hubServiceListAllHubClustersHandler := connect.NewUnaryHandler( + HubServiceListAllHubClustersProcedure, + svc.ListAllHubClusters, + connect.WithSchema(hubServiceMethods.ByName("ListAllHubClusters")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.HubService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case HubServiceGetHubInfoProcedure: + hubServiceGetHubInfoHandler.ServeHTTP(w, r) + case HubServiceListAllHubClustersProcedure: + hubServiceListAllHubClustersHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedHubServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedHubServiceHandler struct{} + +func (UnimplementedHubServiceHandler) GetHubInfo(context.Context, *connect.Request[v2.GetHubInfoRequest]) (*connect.Response[v2.GetHubInfoResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.HubService.GetHubInfo is not implemented")) +} + +func (UnimplementedHubServiceHandler) ListAllHubClusters(context.Context, *connect.Request[v2.ListAllHubClustersRequest]) (*connect.Response[v2.ListAllHubClustersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.HubService.ListAllHubClusters is not implemented")) +} + +// VirtualClusterServiceClient is a client for the akp.cluster.v2.VirtualClusterService service. +type VirtualClusterServiceClient interface { + // CreateVirtualCluster starts creating a virtual cluster and importing it. Needs the + // organization's cluster creator. + CreateVirtualCluster(context.Context, *connect.Request[v2.CreateVirtualClusterRequest]) (*connect.Response[v2.CreateVirtualClusterResponse], error) + // ImportVirtualCluster starts importing an existing virtual cluster. Needs the organization's + // cluster importer. + ImportVirtualCluster(context.Context, *connect.Request[v2.ImportVirtualClusterRequest]) (*connect.Response[v2.ImportVirtualClusterResponse], error) +} + +// NewVirtualClusterServiceClient constructs a client for the akp.cluster.v2.VirtualClusterService +// 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 NewVirtualClusterServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) VirtualClusterServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + virtualClusterServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("VirtualClusterService").Methods() + return &virtualClusterServiceClient{ + createVirtualCluster: connect.NewClient[v2.CreateVirtualClusterRequest, v2.CreateVirtualClusterResponse]( + httpClient, + baseURL+VirtualClusterServiceCreateVirtualClusterProcedure, + connect.WithSchema(virtualClusterServiceMethods.ByName("CreateVirtualCluster")), + connect.WithClientOptions(opts...), + ), + importVirtualCluster: connect.NewClient[v2.ImportVirtualClusterRequest, v2.ImportVirtualClusterResponse]( + httpClient, + baseURL+VirtualClusterServiceImportVirtualClusterProcedure, + connect.WithSchema(virtualClusterServiceMethods.ByName("ImportVirtualCluster")), + connect.WithClientOptions(opts...), + ), + } +} + +// virtualClusterServiceClient implements VirtualClusterServiceClient. +type virtualClusterServiceClient struct { + createVirtualCluster *connect.Client[v2.CreateVirtualClusterRequest, v2.CreateVirtualClusterResponse] + importVirtualCluster *connect.Client[v2.ImportVirtualClusterRequest, v2.ImportVirtualClusterResponse] +} + +// CreateVirtualCluster calls akp.cluster.v2.VirtualClusterService.CreateVirtualCluster. +func (c *virtualClusterServiceClient) CreateVirtualCluster(ctx context.Context, req *connect.Request[v2.CreateVirtualClusterRequest]) (*connect.Response[v2.CreateVirtualClusterResponse], error) { + return c.createVirtualCluster.CallUnary(ctx, req) +} + +// ImportVirtualCluster calls akp.cluster.v2.VirtualClusterService.ImportVirtualCluster. +func (c *virtualClusterServiceClient) ImportVirtualCluster(ctx context.Context, req *connect.Request[v2.ImportVirtualClusterRequest]) (*connect.Response[v2.ImportVirtualClusterResponse], error) { + return c.importVirtualCluster.CallUnary(ctx, req) +} + +// VirtualClusterServiceHandler is an implementation of the akp.cluster.v2.VirtualClusterService +// service. +type VirtualClusterServiceHandler interface { + // CreateVirtualCluster starts creating a virtual cluster and importing it. Needs the + // organization's cluster creator. + CreateVirtualCluster(context.Context, *connect.Request[v2.CreateVirtualClusterRequest]) (*connect.Response[v2.CreateVirtualClusterResponse], error) + // ImportVirtualCluster starts importing an existing virtual cluster. Needs the organization's + // cluster importer. + ImportVirtualCluster(context.Context, *connect.Request[v2.ImportVirtualClusterRequest]) (*connect.Response[v2.ImportVirtualClusterResponse], error) +} + +// NewVirtualClusterServiceHandler 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 NewVirtualClusterServiceHandler(svc VirtualClusterServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + virtualClusterServiceMethods := v2.File_akp_cluster_v2_lifecycle_proto.Services().ByName("VirtualClusterService").Methods() + virtualClusterServiceCreateVirtualClusterHandler := connect.NewUnaryHandler( + VirtualClusterServiceCreateVirtualClusterProcedure, + svc.CreateVirtualCluster, + connect.WithSchema(virtualClusterServiceMethods.ByName("CreateVirtualCluster")), + connect.WithHandlerOptions(opts...), + ) + virtualClusterServiceImportVirtualClusterHandler := connect.NewUnaryHandler( + VirtualClusterServiceImportVirtualClusterProcedure, + svc.ImportVirtualCluster, + connect.WithSchema(virtualClusterServiceMethods.ByName("ImportVirtualCluster")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.VirtualClusterService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case VirtualClusterServiceCreateVirtualClusterProcedure: + virtualClusterServiceCreateVirtualClusterHandler.ServeHTTP(w, r) + case VirtualClusterServiceImportVirtualClusterProcedure: + virtualClusterServiceImportVirtualClusterHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedVirtualClusterServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedVirtualClusterServiceHandler struct{} + +func (UnimplementedVirtualClusterServiceHandler) CreateVirtualCluster(context.Context, *connect.Request[v2.CreateVirtualClusterRequest]) (*connect.Response[v2.CreateVirtualClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.VirtualClusterService.CreateVirtualCluster is not implemented")) +} + +func (UnimplementedVirtualClusterServiceHandler) ImportVirtualCluster(context.Context, *connect.Request[v2.ImportVirtualClusterRequest]) (*connect.Response[v2.ImportVirtualClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.VirtualClusterService.ImportVirtualCluster is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/platform.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/platform.connect.go new file mode 100644 index 000000000..f1a1e632a --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/platform.connect.go @@ -0,0 +1,196 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/cluster/v2/platform.proto + +package clusterv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + 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 ( + // PresetServiceName is the fully-qualified name of the PresetService service. + PresetServiceName = "akp.cluster.v2.PresetService" + // ProfileServiceName is the fully-qualified name of the ProfileService service. + ProfileServiceName = "akp.cluster.v2.ProfileService" +) + +// 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 ( + // PresetServiceUpdateSpokePresetProcedure is the fully-qualified name of the PresetService's + // UpdateSpokePreset RPC. + PresetServiceUpdateSpokePresetProcedure = "/akp.cluster.v2.PresetService/UpdateSpokePreset" + // ProfileServiceListClusterProfilesProcedure is the fully-qualified name of the ProfileService's + // ListClusterProfiles RPC. + ProfileServiceListClusterProfilesProcedure = "/akp.cluster.v2.ProfileService/ListClusterProfiles" +) + +// PresetServiceClient is a client for the akp.cluster.v2.PresetService service. +type PresetServiceClient interface { + // UpdateSpokePreset sets the values of a feature of a spoke cluster in its profile binding on + // its hub. + UpdateSpokePreset(context.Context, *connect.Request[v2.UpdateSpokePresetRequest]) (*connect.Response[v2.UpdateSpokePresetResponse], error) +} + +// NewPresetServiceClient constructs a client for the akp.cluster.v2.PresetService 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 NewPresetServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PresetServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + presetServiceMethods := v2.File_akp_cluster_v2_platform_proto.Services().ByName("PresetService").Methods() + return &presetServiceClient{ + updateSpokePreset: connect.NewClient[v2.UpdateSpokePresetRequest, v2.UpdateSpokePresetResponse]( + httpClient, + baseURL+PresetServiceUpdateSpokePresetProcedure, + connect.WithSchema(presetServiceMethods.ByName("UpdateSpokePreset")), + connect.WithClientOptions(opts...), + ), + } +} + +// presetServiceClient implements PresetServiceClient. +type presetServiceClient struct { + updateSpokePreset *connect.Client[v2.UpdateSpokePresetRequest, v2.UpdateSpokePresetResponse] +} + +// UpdateSpokePreset calls akp.cluster.v2.PresetService.UpdateSpokePreset. +func (c *presetServiceClient) UpdateSpokePreset(ctx context.Context, req *connect.Request[v2.UpdateSpokePresetRequest]) (*connect.Response[v2.UpdateSpokePresetResponse], error) { + return c.updateSpokePreset.CallUnary(ctx, req) +} + +// PresetServiceHandler is an implementation of the akp.cluster.v2.PresetService service. +type PresetServiceHandler interface { + // UpdateSpokePreset sets the values of a feature of a spoke cluster in its profile binding on + // its hub. + UpdateSpokePreset(context.Context, *connect.Request[v2.UpdateSpokePresetRequest]) (*connect.Response[v2.UpdateSpokePresetResponse], error) +} + +// NewPresetServiceHandler 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 NewPresetServiceHandler(svc PresetServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + presetServiceMethods := v2.File_akp_cluster_v2_platform_proto.Services().ByName("PresetService").Methods() + presetServiceUpdateSpokePresetHandler := connect.NewUnaryHandler( + PresetServiceUpdateSpokePresetProcedure, + svc.UpdateSpokePreset, + connect.WithSchema(presetServiceMethods.ByName("UpdateSpokePreset")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.PresetService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case PresetServiceUpdateSpokePresetProcedure: + presetServiceUpdateSpokePresetHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedPresetServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedPresetServiceHandler struct{} + +func (UnimplementedPresetServiceHandler) UpdateSpokePreset(context.Context, *connect.Request[v2.UpdateSpokePresetRequest]) (*connect.Response[v2.UpdateSpokePresetResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.PresetService.UpdateSpokePreset is not implemented")) +} + +// ProfileServiceClient is a client for the akp.cluster.v2.ProfileService service. +type ProfileServiceClient interface { + ListClusterProfiles(context.Context, *connect.Request[v2.ListClusterProfilesRequest]) (*connect.Response[v2.ListClusterProfilesResponse], error) +} + +// NewProfileServiceClient constructs a client for the akp.cluster.v2.ProfileService 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 NewProfileServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProfileServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + profileServiceMethods := v2.File_akp_cluster_v2_platform_proto.Services().ByName("ProfileService").Methods() + return &profileServiceClient{ + listClusterProfiles: connect.NewClient[v2.ListClusterProfilesRequest, v2.ListClusterProfilesResponse]( + httpClient, + baseURL+ProfileServiceListClusterProfilesProcedure, + connect.WithSchema(profileServiceMethods.ByName("ListClusterProfiles")), + connect.WithClientOptions(opts...), + ), + } +} + +// profileServiceClient implements ProfileServiceClient. +type profileServiceClient struct { + listClusterProfiles *connect.Client[v2.ListClusterProfilesRequest, v2.ListClusterProfilesResponse] +} + +// ListClusterProfiles calls akp.cluster.v2.ProfileService.ListClusterProfiles. +func (c *profileServiceClient) ListClusterProfiles(ctx context.Context, req *connect.Request[v2.ListClusterProfilesRequest]) (*connect.Response[v2.ListClusterProfilesResponse], error) { + return c.listClusterProfiles.CallUnary(ctx, req) +} + +// ProfileServiceHandler is an implementation of the akp.cluster.v2.ProfileService service. +type ProfileServiceHandler interface { + ListClusterProfiles(context.Context, *connect.Request[v2.ListClusterProfilesRequest]) (*connect.Response[v2.ListClusterProfilesResponse], error) +} + +// NewProfileServiceHandler 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 NewProfileServiceHandler(svc ProfileServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + profileServiceMethods := v2.File_akp_cluster_v2_platform_proto.Services().ByName("ProfileService").Methods() + profileServiceListClusterProfilesHandler := connect.NewUnaryHandler( + ProfileServiceListClusterProfilesProcedure, + svc.ListClusterProfiles, + connect.WithSchema(profileServiceMethods.ByName("ListClusterProfiles")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.ProfileService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ProfileServiceListClusterProfilesProcedure: + profileServiceListClusterProfilesHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedProfileServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedProfileServiceHandler struct{} + +func (UnimplementedProfileServiceHandler) ListClusterProfiles(context.Context, *connect.Request[v2.ListClusterProfilesRequest]) (*connect.Response[v2.ListClusterProfilesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ProfileService.ListClusterProfiles is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/resource.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/resource.connect.go new file mode 100644 index 000000000..af86ec773 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/resource.connect.go @@ -0,0 +1,853 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/cluster/v2/resource.proto + +package clusterv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + 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 ( + // ResourceServiceName is the fully-qualified name of the ResourceService service. + ResourceServiceName = "akp.cluster.v2.ResourceService" +) + +// 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 ( + // ResourceServiceGetResourceProcedure is the fully-qualified name of the ResourceService's + // GetResource RPC. + ResourceServiceGetResourceProcedure = "/akp.cluster.v2.ResourceService/GetResource" + // ResourceServiceListResourcesProcedure is the fully-qualified name of the ResourceService's + // ListResources RPC. + ResourceServiceListResourcesProcedure = "/akp.cluster.v2.ResourceService/ListResources" + // ResourceServiceCreateResourceProcedure is the fully-qualified name of the ResourceService's + // CreateResource RPC. + ResourceServiceCreateResourceProcedure = "/akp.cluster.v2.ResourceService/CreateResource" + // ResourceServiceUpdateResourceProcedure is the fully-qualified name of the ResourceService's + // UpdateResource RPC. + ResourceServiceUpdateResourceProcedure = "/akp.cluster.v2.ResourceService/UpdateResource" + // ResourceServicePatchResourceProcedure is the fully-qualified name of the ResourceService's + // PatchResource RPC. + ResourceServicePatchResourceProcedure = "/akp.cluster.v2.ResourceService/PatchResource" + // ResourceServicePatchResourceStatusProcedure is the fully-qualified name of the ResourceService's + // PatchResourceStatus RPC. + ResourceServicePatchResourceStatusProcedure = "/akp.cluster.v2.ResourceService/PatchResourceStatus" + // ResourceServiceDeleteResourceProcedure is the fully-qualified name of the ResourceService's + // DeleteResource RPC. + ResourceServiceDeleteResourceProcedure = "/akp.cluster.v2.ResourceService/DeleteResource" + // ResourceServiceDeleteResourcesProcedure is the fully-qualified name of the ResourceService's + // DeleteResources RPC. + ResourceServiceDeleteResourcesProcedure = "/akp.cluster.v2.ResourceService/DeleteResources" + // ResourceServiceBatchDeleteResourcesProcedure is the fully-qualified name of the ResourceService's + // BatchDeleteResources RPC. + ResourceServiceBatchDeleteResourcesProcedure = "/akp.cluster.v2.ResourceService/BatchDeleteResources" + // ResourceServiceListResourceEventsProcedure is the fully-qualified name of the ResourceService's + // ListResourceEvents RPC. + ResourceServiceListResourceEventsProcedure = "/akp.cluster.v2.ResourceService/ListResourceEvents" + // ResourceServiceGetResourceControllerProcedure is the fully-qualified name of the + // ResourceService's GetResourceController RPC. + ResourceServiceGetResourceControllerProcedure = "/akp.cluster.v2.ResourceService/GetResourceController" + // ResourceServiceGetScaleProcedure is the fully-qualified name of the ResourceService's GetScale + // RPC. + ResourceServiceGetScaleProcedure = "/akp.cluster.v2.ResourceService/GetScale" + // ResourceServiceUpdateScaleProcedure is the fully-qualified name of the ResourceService's + // UpdateScale RPC. + ResourceServiceUpdateScaleProcedure = "/akp.cluster.v2.ResourceService/UpdateScale" + // ResourceServiceListHorizontalPodAutoscalersProcedure is the fully-qualified name of the + // ResourceService's ListHorizontalPodAutoscalers RPC. + ResourceServiceListHorizontalPodAutoscalersProcedure = "/akp.cluster.v2.ResourceService/ListHorizontalPodAutoscalers" + // ResourceServiceListGroupVersionObjectsProcedure is the fully-qualified name of the + // ResourceService's ListGroupVersionObjects RPC. + ResourceServiceListGroupVersionObjectsProcedure = "/akp.cluster.v2.ResourceService/ListGroupVersionObjects" + // ResourceServiceGetNodeMetricsProcedure is the fully-qualified name of the ResourceService's + // GetNodeMetrics RPC. + ResourceServiceGetNodeMetricsProcedure = "/akp.cluster.v2.ResourceService/GetNodeMetrics" + // ResourceServiceGetPodMetricsProcedure is the fully-qualified name of the ResourceService's + // GetPodMetrics RPC. + ResourceServiceGetPodMetricsProcedure = "/akp.cluster.v2.ResourceService/GetPodMetrics" + // ResourceServiceCreateSelfSubjectAccessReviewsProcedure is the fully-qualified name of the + // ResourceService's CreateSelfSubjectAccessReviews RPC. + ResourceServiceCreateSelfSubjectAccessReviewsProcedure = "/akp.cluster.v2.ResourceService/CreateSelfSubjectAccessReviews" + // ResourceServiceGetAvailableMenuProcedure is the fully-qualified name of the ResourceService's + // GetAvailableMenu RPC. + ResourceServiceGetAvailableMenuProcedure = "/akp.cluster.v2.ResourceService/GetAvailableMenu" + // ResourceServiceRenderResourceProcedure is the fully-qualified name of the ResourceService's + // RenderResource RPC. + ResourceServiceRenderResourceProcedure = "/akp.cluster.v2.ResourceService/RenderResource" + // ResourceServiceGetDatabaseConfigurationProcedure is the fully-qualified name of the + // ResourceService's GetDatabaseConfiguration RPC. + ResourceServiceGetDatabaseConfigurationProcedure = "/akp.cluster.v2.ResourceService/GetDatabaseConfiguration" + // ResourceServiceCreateResourceFromManifestProcedure is the fully-qualified name of the + // ResourceService's CreateResourceFromManifest RPC. + ResourceServiceCreateResourceFromManifestProcedure = "/akp.cluster.v2.ResourceService/CreateResourceFromManifest" + // ResourceServiceGetResourceHistoryProcedure is the fully-qualified name of the ResourceService's + // GetResourceHistory RPC. + ResourceServiceGetResourceHistoryProcedure = "/akp.cluster.v2.ResourceService/GetResourceHistory" + // ResourceServiceStreamPodLogsProcedure is the fully-qualified name of the ResourceService's + // StreamPodLogs RPC. + ResourceServiceStreamPodLogsProcedure = "/akp.cluster.v2.ResourceService/StreamPodLogs" +) + +// ResourceServiceClient is a client for the akp.cluster.v2.ResourceService service. +type ResourceServiceClient interface { + // GetResource is an object, or the view of it the request asks for. + GetResource(context.Context, *connect.Request[v2.GetResourceRequest]) (*connect.Response[v2.GetResourceResponse], error) + // ListResources lists the objects of a resource, in a namespace or across the cluster. A whole + // list is sorted: feature sets by whether they require features, then title, anything else + // newest first, then by name. A page keeps the API server's order. + ListResources(context.Context, *connect.Request[v2.ListResourcesRequest]) (*connect.Response[v2.ListResourcesResponse], error) + // CreateResource creates an object. + CreateResource(context.Context, *connect.Request[v2.CreateResourceRequest]) (*connect.Response[v2.CreateResourceResponse], error) + // UpdateResource replaces an object. + UpdateResource(context.Context, *connect.Request[v2.UpdateResourceRequest]) (*connect.Response[v2.UpdateResourceResponse], error) + // PatchResource patches an object. + PatchResource(context.Context, *connect.Request[v2.PatchResourceRequest]) (*connect.Response[v2.PatchResourceResponse], error) + // PatchResourceStatus patches the status subresource of an object. + PatchResourceStatus(context.Context, *connect.Request[v2.PatchResourceStatusRequest]) (*connect.Response[v2.PatchResourceStatusResponse], error) + // DeleteResource deletes an object. + DeleteResource(context.Context, *connect.Request[v2.DeleteResourceRequest]) (*connect.Response[v2.DeleteResourceResponse], error) + // DeleteResources deletes the objects of a resource a selector selects. + DeleteResources(context.Context, *connect.Request[v2.DeleteResourcesRequest]) (*connect.Response[v2.DeleteResourcesResponse], error) + // BatchDeleteResources deletes objects of any resources, and answers the ones it could not. + BatchDeleteResources(context.Context, *connect.Request[v2.BatchDeleteResourcesRequest]) (*connect.Response[v2.BatchDeleteResourcesResponse], error) + // ListResourceEvents lists the events of an object. + ListResourceEvents(context.Context, *connect.Request[v2.ListResourceEventsRequest]) (*connect.Response[v2.ListResourceEventsResponse], error) + // GetResourceController is the workload that controls an object, or the object itself. + GetResourceController(context.Context, *connect.Request[v2.GetResourceControllerRequest]) (*connect.Response[v2.GetResourceControllerResponse], error) + // GetScale is the scale subresource of a namespaced object. + GetScale(context.Context, *connect.Request[v2.GetScaleRequest]) (*connect.Response[v2.GetScaleResponse], error) + // UpdateScale sets the replicas of a namespaced object through its scale subresource. + UpdateScale(context.Context, *connect.Request[v2.UpdateScaleRequest]) (*connect.Response[v2.UpdateScaleResponse], error) + // ListHorizontalPodAutoscalers lists the horizontal pod autoscalers that scale an object. + ListHorizontalPodAutoscalers(context.Context, *connect.Request[v2.ListHorizontalPodAutoscalersRequest]) (*connect.Response[v2.ListHorizontalPodAutoscalersResponse], error) + // ListGroupVersionObjects lists the names of every object of an API group version, by kind. + ListGroupVersionObjects(context.Context, *connect.Request[v2.ListGroupVersionObjectsRequest]) (*connect.Response[v2.ListGroupVersionObjectsResponse], error) + // GetNodeMetrics is a node's capacity, allocatable resources and usage. A cluster without the + // metrics API has no usage. + GetNodeMetrics(context.Context, *connect.Request[v2.GetNodeMetricsRequest]) (*connect.Response[v2.GetNodeMetricsResponse], error) + // GetPodMetrics is a pod's requests, limits and usage, by container and in total. A cluster + // without the metrics API has no usage. + GetPodMetrics(context.Context, *connect.Request[v2.GetPodMetricsRequest]) (*connect.Response[v2.GetPodMetricsResponse], error) + // CreateSelfSubjectAccessReviews asks the cluster, all at once, whether the caller may do what + // each review describes. + CreateSelfSubjectAccessReviews(context.Context, *connect.Request[v2.CreateSelfSubjectAccessReviewsRequest]) (*connect.Response[v2.CreateSelfSubjectAccessReviewsResponse], error) + // GetAvailableMenu is a meta.k8s.appscode.com menu, as far as the caller may use it. + GetAvailableMenu(context.Context, *connect.Request[v2.GetAvailableMenuRequest]) (*connect.Response[v2.GetAvailableMenuResponse], error) + // RenderResource creates one of the virtual objects that render a view of the cluster (see + // RenderResourceRequest) and answers it. + RenderResource(context.Context, *connect.Request[v2.RenderResourceRequest]) (*connect.Response[v2.RenderResourceResponse], error) + // GetDatabaseConfiguration is a ui.kubedb.com DatabaseConfiguration, read with get options of + // its API server's own. + GetDatabaseConfiguration(context.Context, *connect.Request[v2.GetDatabaseConfigurationRequest]) (*connect.Response[v2.GetDatabaseConfigurationResponse], error) + // CreateResourceFromManifest creates the object of a YAML or JSON manifest of any kind the + // cluster serves, in its namespace (default if it names none) for a namespaced kind. + CreateResourceFromManifest(context.Context, *connect.Request[v2.CreateResourceFromManifestRequest]) (*connect.Response[v2.CreateResourceFromManifestResponse], error) + // GetResourceHistory is the recorded history of the resources of a cluster. Unavailable where + // AKP keeps no history. + GetResourceHistory(context.Context, *connect.Request[v2.GetResourceHistoryRequest]) (*connect.Response[v2.GetResourceHistoryResponse], error) + // StreamPodLogs follows the log of a container, from its last lines, until the caller ends the + // stream or the container's log ends. Each message is one line. + StreamPodLogs(context.Context, *connect.Request[v2.StreamPodLogsRequest]) (*connect.ServerStreamForClient[v2.StreamPodLogsResponse], error) +} + +// NewResourceServiceClient constructs a client for the akp.cluster.v2.ResourceService 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 NewResourceServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ResourceServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + resourceServiceMethods := v2.File_akp_cluster_v2_resource_proto.Services().ByName("ResourceService").Methods() + return &resourceServiceClient{ + getResource: connect.NewClient[v2.GetResourceRequest, v2.GetResourceResponse]( + httpClient, + baseURL+ResourceServiceGetResourceProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetResource")), + connect.WithClientOptions(opts...), + ), + listResources: connect.NewClient[v2.ListResourcesRequest, v2.ListResourcesResponse]( + httpClient, + baseURL+ResourceServiceListResourcesProcedure, + connect.WithSchema(resourceServiceMethods.ByName("ListResources")), + connect.WithClientOptions(opts...), + ), + createResource: connect.NewClient[v2.CreateResourceRequest, v2.CreateResourceResponse]( + httpClient, + baseURL+ResourceServiceCreateResourceProcedure, + connect.WithSchema(resourceServiceMethods.ByName("CreateResource")), + connect.WithClientOptions(opts...), + ), + updateResource: connect.NewClient[v2.UpdateResourceRequest, v2.UpdateResourceResponse]( + httpClient, + baseURL+ResourceServiceUpdateResourceProcedure, + connect.WithSchema(resourceServiceMethods.ByName("UpdateResource")), + connect.WithClientOptions(opts...), + ), + patchResource: connect.NewClient[v2.PatchResourceRequest, v2.PatchResourceResponse]( + httpClient, + baseURL+ResourceServicePatchResourceProcedure, + connect.WithSchema(resourceServiceMethods.ByName("PatchResource")), + connect.WithClientOptions(opts...), + ), + patchResourceStatus: connect.NewClient[v2.PatchResourceStatusRequest, v2.PatchResourceStatusResponse]( + httpClient, + baseURL+ResourceServicePatchResourceStatusProcedure, + connect.WithSchema(resourceServiceMethods.ByName("PatchResourceStatus")), + connect.WithClientOptions(opts...), + ), + deleteResource: connect.NewClient[v2.DeleteResourceRequest, v2.DeleteResourceResponse]( + httpClient, + baseURL+ResourceServiceDeleteResourceProcedure, + connect.WithSchema(resourceServiceMethods.ByName("DeleteResource")), + connect.WithClientOptions(opts...), + ), + deleteResources: connect.NewClient[v2.DeleteResourcesRequest, v2.DeleteResourcesResponse]( + httpClient, + baseURL+ResourceServiceDeleteResourcesProcedure, + connect.WithSchema(resourceServiceMethods.ByName("DeleteResources")), + connect.WithClientOptions(opts...), + ), + batchDeleteResources: connect.NewClient[v2.BatchDeleteResourcesRequest, v2.BatchDeleteResourcesResponse]( + httpClient, + baseURL+ResourceServiceBatchDeleteResourcesProcedure, + connect.WithSchema(resourceServiceMethods.ByName("BatchDeleteResources")), + connect.WithClientOptions(opts...), + ), + listResourceEvents: connect.NewClient[v2.ListResourceEventsRequest, v2.ListResourceEventsResponse]( + httpClient, + baseURL+ResourceServiceListResourceEventsProcedure, + connect.WithSchema(resourceServiceMethods.ByName("ListResourceEvents")), + connect.WithClientOptions(opts...), + ), + getResourceController: connect.NewClient[v2.GetResourceControllerRequest, v2.GetResourceControllerResponse]( + httpClient, + baseURL+ResourceServiceGetResourceControllerProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetResourceController")), + connect.WithClientOptions(opts...), + ), + getScale: connect.NewClient[v2.GetScaleRequest, v2.GetScaleResponse]( + httpClient, + baseURL+ResourceServiceGetScaleProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetScale")), + connect.WithClientOptions(opts...), + ), + updateScale: connect.NewClient[v2.UpdateScaleRequest, v2.UpdateScaleResponse]( + httpClient, + baseURL+ResourceServiceUpdateScaleProcedure, + connect.WithSchema(resourceServiceMethods.ByName("UpdateScale")), + connect.WithClientOptions(opts...), + ), + listHorizontalPodAutoscalers: connect.NewClient[v2.ListHorizontalPodAutoscalersRequest, v2.ListHorizontalPodAutoscalersResponse]( + httpClient, + baseURL+ResourceServiceListHorizontalPodAutoscalersProcedure, + connect.WithSchema(resourceServiceMethods.ByName("ListHorizontalPodAutoscalers")), + connect.WithClientOptions(opts...), + ), + listGroupVersionObjects: connect.NewClient[v2.ListGroupVersionObjectsRequest, v2.ListGroupVersionObjectsResponse]( + httpClient, + baseURL+ResourceServiceListGroupVersionObjectsProcedure, + connect.WithSchema(resourceServiceMethods.ByName("ListGroupVersionObjects")), + connect.WithClientOptions(opts...), + ), + getNodeMetrics: connect.NewClient[v2.GetNodeMetricsRequest, v2.GetNodeMetricsResponse]( + httpClient, + baseURL+ResourceServiceGetNodeMetricsProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetNodeMetrics")), + connect.WithClientOptions(opts...), + ), + getPodMetrics: connect.NewClient[v2.GetPodMetricsRequest, v2.GetPodMetricsResponse]( + httpClient, + baseURL+ResourceServiceGetPodMetricsProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetPodMetrics")), + connect.WithClientOptions(opts...), + ), + createSelfSubjectAccessReviews: connect.NewClient[v2.CreateSelfSubjectAccessReviewsRequest, v2.CreateSelfSubjectAccessReviewsResponse]( + httpClient, + baseURL+ResourceServiceCreateSelfSubjectAccessReviewsProcedure, + connect.WithSchema(resourceServiceMethods.ByName("CreateSelfSubjectAccessReviews")), + connect.WithClientOptions(opts...), + ), + getAvailableMenu: connect.NewClient[v2.GetAvailableMenuRequest, v2.GetAvailableMenuResponse]( + httpClient, + baseURL+ResourceServiceGetAvailableMenuProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetAvailableMenu")), + connect.WithClientOptions(opts...), + ), + renderResource: connect.NewClient[v2.RenderResourceRequest, v2.RenderResourceResponse]( + httpClient, + baseURL+ResourceServiceRenderResourceProcedure, + connect.WithSchema(resourceServiceMethods.ByName("RenderResource")), + connect.WithClientOptions(opts...), + ), + getDatabaseConfiguration: connect.NewClient[v2.GetDatabaseConfigurationRequest, v2.GetDatabaseConfigurationResponse]( + httpClient, + baseURL+ResourceServiceGetDatabaseConfigurationProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetDatabaseConfiguration")), + connect.WithClientOptions(opts...), + ), + createResourceFromManifest: connect.NewClient[v2.CreateResourceFromManifestRequest, v2.CreateResourceFromManifestResponse]( + httpClient, + baseURL+ResourceServiceCreateResourceFromManifestProcedure, + connect.WithSchema(resourceServiceMethods.ByName("CreateResourceFromManifest")), + connect.WithClientOptions(opts...), + ), + getResourceHistory: connect.NewClient[v2.GetResourceHistoryRequest, v2.GetResourceHistoryResponse]( + httpClient, + baseURL+ResourceServiceGetResourceHistoryProcedure, + connect.WithSchema(resourceServiceMethods.ByName("GetResourceHistory")), + connect.WithClientOptions(opts...), + ), + streamPodLogs: connect.NewClient[v2.StreamPodLogsRequest, v2.StreamPodLogsResponse]( + httpClient, + baseURL+ResourceServiceStreamPodLogsProcedure, + connect.WithSchema(resourceServiceMethods.ByName("StreamPodLogs")), + connect.WithClientOptions(opts...), + ), + } +} + +// resourceServiceClient implements ResourceServiceClient. +type resourceServiceClient struct { + getResource *connect.Client[v2.GetResourceRequest, v2.GetResourceResponse] + listResources *connect.Client[v2.ListResourcesRequest, v2.ListResourcesResponse] + createResource *connect.Client[v2.CreateResourceRequest, v2.CreateResourceResponse] + updateResource *connect.Client[v2.UpdateResourceRequest, v2.UpdateResourceResponse] + patchResource *connect.Client[v2.PatchResourceRequest, v2.PatchResourceResponse] + patchResourceStatus *connect.Client[v2.PatchResourceStatusRequest, v2.PatchResourceStatusResponse] + deleteResource *connect.Client[v2.DeleteResourceRequest, v2.DeleteResourceResponse] + deleteResources *connect.Client[v2.DeleteResourcesRequest, v2.DeleteResourcesResponse] + batchDeleteResources *connect.Client[v2.BatchDeleteResourcesRequest, v2.BatchDeleteResourcesResponse] + listResourceEvents *connect.Client[v2.ListResourceEventsRequest, v2.ListResourceEventsResponse] + getResourceController *connect.Client[v2.GetResourceControllerRequest, v2.GetResourceControllerResponse] + getScale *connect.Client[v2.GetScaleRequest, v2.GetScaleResponse] + updateScale *connect.Client[v2.UpdateScaleRequest, v2.UpdateScaleResponse] + listHorizontalPodAutoscalers *connect.Client[v2.ListHorizontalPodAutoscalersRequest, v2.ListHorizontalPodAutoscalersResponse] + listGroupVersionObjects *connect.Client[v2.ListGroupVersionObjectsRequest, v2.ListGroupVersionObjectsResponse] + getNodeMetrics *connect.Client[v2.GetNodeMetricsRequest, v2.GetNodeMetricsResponse] + getPodMetrics *connect.Client[v2.GetPodMetricsRequest, v2.GetPodMetricsResponse] + createSelfSubjectAccessReviews *connect.Client[v2.CreateSelfSubjectAccessReviewsRequest, v2.CreateSelfSubjectAccessReviewsResponse] + getAvailableMenu *connect.Client[v2.GetAvailableMenuRequest, v2.GetAvailableMenuResponse] + renderResource *connect.Client[v2.RenderResourceRequest, v2.RenderResourceResponse] + getDatabaseConfiguration *connect.Client[v2.GetDatabaseConfigurationRequest, v2.GetDatabaseConfigurationResponse] + createResourceFromManifest *connect.Client[v2.CreateResourceFromManifestRequest, v2.CreateResourceFromManifestResponse] + getResourceHistory *connect.Client[v2.GetResourceHistoryRequest, v2.GetResourceHistoryResponse] + streamPodLogs *connect.Client[v2.StreamPodLogsRequest, v2.StreamPodLogsResponse] +} + +// GetResource calls akp.cluster.v2.ResourceService.GetResource. +func (c *resourceServiceClient) GetResource(ctx context.Context, req *connect.Request[v2.GetResourceRequest]) (*connect.Response[v2.GetResourceResponse], error) { + return c.getResource.CallUnary(ctx, req) +} + +// ListResources calls akp.cluster.v2.ResourceService.ListResources. +func (c *resourceServiceClient) ListResources(ctx context.Context, req *connect.Request[v2.ListResourcesRequest]) (*connect.Response[v2.ListResourcesResponse], error) { + return c.listResources.CallUnary(ctx, req) +} + +// CreateResource calls akp.cluster.v2.ResourceService.CreateResource. +func (c *resourceServiceClient) CreateResource(ctx context.Context, req *connect.Request[v2.CreateResourceRequest]) (*connect.Response[v2.CreateResourceResponse], error) { + return c.createResource.CallUnary(ctx, req) +} + +// UpdateResource calls akp.cluster.v2.ResourceService.UpdateResource. +func (c *resourceServiceClient) UpdateResource(ctx context.Context, req *connect.Request[v2.UpdateResourceRequest]) (*connect.Response[v2.UpdateResourceResponse], error) { + return c.updateResource.CallUnary(ctx, req) +} + +// PatchResource calls akp.cluster.v2.ResourceService.PatchResource. +func (c *resourceServiceClient) PatchResource(ctx context.Context, req *connect.Request[v2.PatchResourceRequest]) (*connect.Response[v2.PatchResourceResponse], error) { + return c.patchResource.CallUnary(ctx, req) +} + +// PatchResourceStatus calls akp.cluster.v2.ResourceService.PatchResourceStatus. +func (c *resourceServiceClient) PatchResourceStatus(ctx context.Context, req *connect.Request[v2.PatchResourceStatusRequest]) (*connect.Response[v2.PatchResourceStatusResponse], error) { + return c.patchResourceStatus.CallUnary(ctx, req) +} + +// DeleteResource calls akp.cluster.v2.ResourceService.DeleteResource. +func (c *resourceServiceClient) DeleteResource(ctx context.Context, req *connect.Request[v2.DeleteResourceRequest]) (*connect.Response[v2.DeleteResourceResponse], error) { + return c.deleteResource.CallUnary(ctx, req) +} + +// DeleteResources calls akp.cluster.v2.ResourceService.DeleteResources. +func (c *resourceServiceClient) DeleteResources(ctx context.Context, req *connect.Request[v2.DeleteResourcesRequest]) (*connect.Response[v2.DeleteResourcesResponse], error) { + return c.deleteResources.CallUnary(ctx, req) +} + +// BatchDeleteResources calls akp.cluster.v2.ResourceService.BatchDeleteResources. +func (c *resourceServiceClient) BatchDeleteResources(ctx context.Context, req *connect.Request[v2.BatchDeleteResourcesRequest]) (*connect.Response[v2.BatchDeleteResourcesResponse], error) { + return c.batchDeleteResources.CallUnary(ctx, req) +} + +// ListResourceEvents calls akp.cluster.v2.ResourceService.ListResourceEvents. +func (c *resourceServiceClient) ListResourceEvents(ctx context.Context, req *connect.Request[v2.ListResourceEventsRequest]) (*connect.Response[v2.ListResourceEventsResponse], error) { + return c.listResourceEvents.CallUnary(ctx, req) +} + +// GetResourceController calls akp.cluster.v2.ResourceService.GetResourceController. +func (c *resourceServiceClient) GetResourceController(ctx context.Context, req *connect.Request[v2.GetResourceControllerRequest]) (*connect.Response[v2.GetResourceControllerResponse], error) { + return c.getResourceController.CallUnary(ctx, req) +} + +// GetScale calls akp.cluster.v2.ResourceService.GetScale. +func (c *resourceServiceClient) GetScale(ctx context.Context, req *connect.Request[v2.GetScaleRequest]) (*connect.Response[v2.GetScaleResponse], error) { + return c.getScale.CallUnary(ctx, req) +} + +// UpdateScale calls akp.cluster.v2.ResourceService.UpdateScale. +func (c *resourceServiceClient) UpdateScale(ctx context.Context, req *connect.Request[v2.UpdateScaleRequest]) (*connect.Response[v2.UpdateScaleResponse], error) { + return c.updateScale.CallUnary(ctx, req) +} + +// ListHorizontalPodAutoscalers calls akp.cluster.v2.ResourceService.ListHorizontalPodAutoscalers. +func (c *resourceServiceClient) ListHorizontalPodAutoscalers(ctx context.Context, req *connect.Request[v2.ListHorizontalPodAutoscalersRequest]) (*connect.Response[v2.ListHorizontalPodAutoscalersResponse], error) { + return c.listHorizontalPodAutoscalers.CallUnary(ctx, req) +} + +// ListGroupVersionObjects calls akp.cluster.v2.ResourceService.ListGroupVersionObjects. +func (c *resourceServiceClient) ListGroupVersionObjects(ctx context.Context, req *connect.Request[v2.ListGroupVersionObjectsRequest]) (*connect.Response[v2.ListGroupVersionObjectsResponse], error) { + return c.listGroupVersionObjects.CallUnary(ctx, req) +} + +// GetNodeMetrics calls akp.cluster.v2.ResourceService.GetNodeMetrics. +func (c *resourceServiceClient) GetNodeMetrics(ctx context.Context, req *connect.Request[v2.GetNodeMetricsRequest]) (*connect.Response[v2.GetNodeMetricsResponse], error) { + return c.getNodeMetrics.CallUnary(ctx, req) +} + +// GetPodMetrics calls akp.cluster.v2.ResourceService.GetPodMetrics. +func (c *resourceServiceClient) GetPodMetrics(ctx context.Context, req *connect.Request[v2.GetPodMetricsRequest]) (*connect.Response[v2.GetPodMetricsResponse], error) { + return c.getPodMetrics.CallUnary(ctx, req) +} + +// CreateSelfSubjectAccessReviews calls +// akp.cluster.v2.ResourceService.CreateSelfSubjectAccessReviews. +func (c *resourceServiceClient) CreateSelfSubjectAccessReviews(ctx context.Context, req *connect.Request[v2.CreateSelfSubjectAccessReviewsRequest]) (*connect.Response[v2.CreateSelfSubjectAccessReviewsResponse], error) { + return c.createSelfSubjectAccessReviews.CallUnary(ctx, req) +} + +// GetAvailableMenu calls akp.cluster.v2.ResourceService.GetAvailableMenu. +func (c *resourceServiceClient) GetAvailableMenu(ctx context.Context, req *connect.Request[v2.GetAvailableMenuRequest]) (*connect.Response[v2.GetAvailableMenuResponse], error) { + return c.getAvailableMenu.CallUnary(ctx, req) +} + +// RenderResource calls akp.cluster.v2.ResourceService.RenderResource. +func (c *resourceServiceClient) RenderResource(ctx context.Context, req *connect.Request[v2.RenderResourceRequest]) (*connect.Response[v2.RenderResourceResponse], error) { + return c.renderResource.CallUnary(ctx, req) +} + +// GetDatabaseConfiguration calls akp.cluster.v2.ResourceService.GetDatabaseConfiguration. +func (c *resourceServiceClient) GetDatabaseConfiguration(ctx context.Context, req *connect.Request[v2.GetDatabaseConfigurationRequest]) (*connect.Response[v2.GetDatabaseConfigurationResponse], error) { + return c.getDatabaseConfiguration.CallUnary(ctx, req) +} + +// CreateResourceFromManifest calls akp.cluster.v2.ResourceService.CreateResourceFromManifest. +func (c *resourceServiceClient) CreateResourceFromManifest(ctx context.Context, req *connect.Request[v2.CreateResourceFromManifestRequest]) (*connect.Response[v2.CreateResourceFromManifestResponse], error) { + return c.createResourceFromManifest.CallUnary(ctx, req) +} + +// GetResourceHistory calls akp.cluster.v2.ResourceService.GetResourceHistory. +func (c *resourceServiceClient) GetResourceHistory(ctx context.Context, req *connect.Request[v2.GetResourceHistoryRequest]) (*connect.Response[v2.GetResourceHistoryResponse], error) { + return c.getResourceHistory.CallUnary(ctx, req) +} + +// StreamPodLogs calls akp.cluster.v2.ResourceService.StreamPodLogs. +func (c *resourceServiceClient) StreamPodLogs(ctx context.Context, req *connect.Request[v2.StreamPodLogsRequest]) (*connect.ServerStreamForClient[v2.StreamPodLogsResponse], error) { + return c.streamPodLogs.CallServerStream(ctx, req) +} + +// ResourceServiceHandler is an implementation of the akp.cluster.v2.ResourceService service. +type ResourceServiceHandler interface { + // GetResource is an object, or the view of it the request asks for. + GetResource(context.Context, *connect.Request[v2.GetResourceRequest]) (*connect.Response[v2.GetResourceResponse], error) + // ListResources lists the objects of a resource, in a namespace or across the cluster. A whole + // list is sorted: feature sets by whether they require features, then title, anything else + // newest first, then by name. A page keeps the API server's order. + ListResources(context.Context, *connect.Request[v2.ListResourcesRequest]) (*connect.Response[v2.ListResourcesResponse], error) + // CreateResource creates an object. + CreateResource(context.Context, *connect.Request[v2.CreateResourceRequest]) (*connect.Response[v2.CreateResourceResponse], error) + // UpdateResource replaces an object. + UpdateResource(context.Context, *connect.Request[v2.UpdateResourceRequest]) (*connect.Response[v2.UpdateResourceResponse], error) + // PatchResource patches an object. + PatchResource(context.Context, *connect.Request[v2.PatchResourceRequest]) (*connect.Response[v2.PatchResourceResponse], error) + // PatchResourceStatus patches the status subresource of an object. + PatchResourceStatus(context.Context, *connect.Request[v2.PatchResourceStatusRequest]) (*connect.Response[v2.PatchResourceStatusResponse], error) + // DeleteResource deletes an object. + DeleteResource(context.Context, *connect.Request[v2.DeleteResourceRequest]) (*connect.Response[v2.DeleteResourceResponse], error) + // DeleteResources deletes the objects of a resource a selector selects. + DeleteResources(context.Context, *connect.Request[v2.DeleteResourcesRequest]) (*connect.Response[v2.DeleteResourcesResponse], error) + // BatchDeleteResources deletes objects of any resources, and answers the ones it could not. + BatchDeleteResources(context.Context, *connect.Request[v2.BatchDeleteResourcesRequest]) (*connect.Response[v2.BatchDeleteResourcesResponse], error) + // ListResourceEvents lists the events of an object. + ListResourceEvents(context.Context, *connect.Request[v2.ListResourceEventsRequest]) (*connect.Response[v2.ListResourceEventsResponse], error) + // GetResourceController is the workload that controls an object, or the object itself. + GetResourceController(context.Context, *connect.Request[v2.GetResourceControllerRequest]) (*connect.Response[v2.GetResourceControllerResponse], error) + // GetScale is the scale subresource of a namespaced object. + GetScale(context.Context, *connect.Request[v2.GetScaleRequest]) (*connect.Response[v2.GetScaleResponse], error) + // UpdateScale sets the replicas of a namespaced object through its scale subresource. + UpdateScale(context.Context, *connect.Request[v2.UpdateScaleRequest]) (*connect.Response[v2.UpdateScaleResponse], error) + // ListHorizontalPodAutoscalers lists the horizontal pod autoscalers that scale an object. + ListHorizontalPodAutoscalers(context.Context, *connect.Request[v2.ListHorizontalPodAutoscalersRequest]) (*connect.Response[v2.ListHorizontalPodAutoscalersResponse], error) + // ListGroupVersionObjects lists the names of every object of an API group version, by kind. + ListGroupVersionObjects(context.Context, *connect.Request[v2.ListGroupVersionObjectsRequest]) (*connect.Response[v2.ListGroupVersionObjectsResponse], error) + // GetNodeMetrics is a node's capacity, allocatable resources and usage. A cluster without the + // metrics API has no usage. + GetNodeMetrics(context.Context, *connect.Request[v2.GetNodeMetricsRequest]) (*connect.Response[v2.GetNodeMetricsResponse], error) + // GetPodMetrics is a pod's requests, limits and usage, by container and in total. A cluster + // without the metrics API has no usage. + GetPodMetrics(context.Context, *connect.Request[v2.GetPodMetricsRequest]) (*connect.Response[v2.GetPodMetricsResponse], error) + // CreateSelfSubjectAccessReviews asks the cluster, all at once, whether the caller may do what + // each review describes. + CreateSelfSubjectAccessReviews(context.Context, *connect.Request[v2.CreateSelfSubjectAccessReviewsRequest]) (*connect.Response[v2.CreateSelfSubjectAccessReviewsResponse], error) + // GetAvailableMenu is a meta.k8s.appscode.com menu, as far as the caller may use it. + GetAvailableMenu(context.Context, *connect.Request[v2.GetAvailableMenuRequest]) (*connect.Response[v2.GetAvailableMenuResponse], error) + // RenderResource creates one of the virtual objects that render a view of the cluster (see + // RenderResourceRequest) and answers it. + RenderResource(context.Context, *connect.Request[v2.RenderResourceRequest]) (*connect.Response[v2.RenderResourceResponse], error) + // GetDatabaseConfiguration is a ui.kubedb.com DatabaseConfiguration, read with get options of + // its API server's own. + GetDatabaseConfiguration(context.Context, *connect.Request[v2.GetDatabaseConfigurationRequest]) (*connect.Response[v2.GetDatabaseConfigurationResponse], error) + // CreateResourceFromManifest creates the object of a YAML or JSON manifest of any kind the + // cluster serves, in its namespace (default if it names none) for a namespaced kind. + CreateResourceFromManifest(context.Context, *connect.Request[v2.CreateResourceFromManifestRequest]) (*connect.Response[v2.CreateResourceFromManifestResponse], error) + // GetResourceHistory is the recorded history of the resources of a cluster. Unavailable where + // AKP keeps no history. + GetResourceHistory(context.Context, *connect.Request[v2.GetResourceHistoryRequest]) (*connect.Response[v2.GetResourceHistoryResponse], error) + // StreamPodLogs follows the log of a container, from its last lines, until the caller ends the + // stream or the container's log ends. Each message is one line. + StreamPodLogs(context.Context, *connect.Request[v2.StreamPodLogsRequest], *connect.ServerStream[v2.StreamPodLogsResponse]) error +} + +// NewResourceServiceHandler 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 NewResourceServiceHandler(svc ResourceServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + resourceServiceMethods := v2.File_akp_cluster_v2_resource_proto.Services().ByName("ResourceService").Methods() + resourceServiceGetResourceHandler := connect.NewUnaryHandler( + ResourceServiceGetResourceProcedure, + svc.GetResource, + connect.WithSchema(resourceServiceMethods.ByName("GetResource")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceListResourcesHandler := connect.NewUnaryHandler( + ResourceServiceListResourcesProcedure, + svc.ListResources, + connect.WithSchema(resourceServiceMethods.ByName("ListResources")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceCreateResourceHandler := connect.NewUnaryHandler( + ResourceServiceCreateResourceProcedure, + svc.CreateResource, + connect.WithSchema(resourceServiceMethods.ByName("CreateResource")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceUpdateResourceHandler := connect.NewUnaryHandler( + ResourceServiceUpdateResourceProcedure, + svc.UpdateResource, + connect.WithSchema(resourceServiceMethods.ByName("UpdateResource")), + connect.WithHandlerOptions(opts...), + ) + resourceServicePatchResourceHandler := connect.NewUnaryHandler( + ResourceServicePatchResourceProcedure, + svc.PatchResource, + connect.WithSchema(resourceServiceMethods.ByName("PatchResource")), + connect.WithHandlerOptions(opts...), + ) + resourceServicePatchResourceStatusHandler := connect.NewUnaryHandler( + ResourceServicePatchResourceStatusProcedure, + svc.PatchResourceStatus, + connect.WithSchema(resourceServiceMethods.ByName("PatchResourceStatus")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceDeleteResourceHandler := connect.NewUnaryHandler( + ResourceServiceDeleteResourceProcedure, + svc.DeleteResource, + connect.WithSchema(resourceServiceMethods.ByName("DeleteResource")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceDeleteResourcesHandler := connect.NewUnaryHandler( + ResourceServiceDeleteResourcesProcedure, + svc.DeleteResources, + connect.WithSchema(resourceServiceMethods.ByName("DeleteResources")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceBatchDeleteResourcesHandler := connect.NewUnaryHandler( + ResourceServiceBatchDeleteResourcesProcedure, + svc.BatchDeleteResources, + connect.WithSchema(resourceServiceMethods.ByName("BatchDeleteResources")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceListResourceEventsHandler := connect.NewUnaryHandler( + ResourceServiceListResourceEventsProcedure, + svc.ListResourceEvents, + connect.WithSchema(resourceServiceMethods.ByName("ListResourceEvents")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetResourceControllerHandler := connect.NewUnaryHandler( + ResourceServiceGetResourceControllerProcedure, + svc.GetResourceController, + connect.WithSchema(resourceServiceMethods.ByName("GetResourceController")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetScaleHandler := connect.NewUnaryHandler( + ResourceServiceGetScaleProcedure, + svc.GetScale, + connect.WithSchema(resourceServiceMethods.ByName("GetScale")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceUpdateScaleHandler := connect.NewUnaryHandler( + ResourceServiceUpdateScaleProcedure, + svc.UpdateScale, + connect.WithSchema(resourceServiceMethods.ByName("UpdateScale")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceListHorizontalPodAutoscalersHandler := connect.NewUnaryHandler( + ResourceServiceListHorizontalPodAutoscalersProcedure, + svc.ListHorizontalPodAutoscalers, + connect.WithSchema(resourceServiceMethods.ByName("ListHorizontalPodAutoscalers")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceListGroupVersionObjectsHandler := connect.NewUnaryHandler( + ResourceServiceListGroupVersionObjectsProcedure, + svc.ListGroupVersionObjects, + connect.WithSchema(resourceServiceMethods.ByName("ListGroupVersionObjects")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetNodeMetricsHandler := connect.NewUnaryHandler( + ResourceServiceGetNodeMetricsProcedure, + svc.GetNodeMetrics, + connect.WithSchema(resourceServiceMethods.ByName("GetNodeMetrics")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetPodMetricsHandler := connect.NewUnaryHandler( + ResourceServiceGetPodMetricsProcedure, + svc.GetPodMetrics, + connect.WithSchema(resourceServiceMethods.ByName("GetPodMetrics")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceCreateSelfSubjectAccessReviewsHandler := connect.NewUnaryHandler( + ResourceServiceCreateSelfSubjectAccessReviewsProcedure, + svc.CreateSelfSubjectAccessReviews, + connect.WithSchema(resourceServiceMethods.ByName("CreateSelfSubjectAccessReviews")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetAvailableMenuHandler := connect.NewUnaryHandler( + ResourceServiceGetAvailableMenuProcedure, + svc.GetAvailableMenu, + connect.WithSchema(resourceServiceMethods.ByName("GetAvailableMenu")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceRenderResourceHandler := connect.NewUnaryHandler( + ResourceServiceRenderResourceProcedure, + svc.RenderResource, + connect.WithSchema(resourceServiceMethods.ByName("RenderResource")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetDatabaseConfigurationHandler := connect.NewUnaryHandler( + ResourceServiceGetDatabaseConfigurationProcedure, + svc.GetDatabaseConfiguration, + connect.WithSchema(resourceServiceMethods.ByName("GetDatabaseConfiguration")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceCreateResourceFromManifestHandler := connect.NewUnaryHandler( + ResourceServiceCreateResourceFromManifestProcedure, + svc.CreateResourceFromManifest, + connect.WithSchema(resourceServiceMethods.ByName("CreateResourceFromManifest")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceGetResourceHistoryHandler := connect.NewUnaryHandler( + ResourceServiceGetResourceHistoryProcedure, + svc.GetResourceHistory, + connect.WithSchema(resourceServiceMethods.ByName("GetResourceHistory")), + connect.WithHandlerOptions(opts...), + ) + resourceServiceStreamPodLogsHandler := connect.NewServerStreamHandler( + ResourceServiceStreamPodLogsProcedure, + svc.StreamPodLogs, + connect.WithSchema(resourceServiceMethods.ByName("StreamPodLogs")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.ResourceService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ResourceServiceGetResourceProcedure: + resourceServiceGetResourceHandler.ServeHTTP(w, r) + case ResourceServiceListResourcesProcedure: + resourceServiceListResourcesHandler.ServeHTTP(w, r) + case ResourceServiceCreateResourceProcedure: + resourceServiceCreateResourceHandler.ServeHTTP(w, r) + case ResourceServiceUpdateResourceProcedure: + resourceServiceUpdateResourceHandler.ServeHTTP(w, r) + case ResourceServicePatchResourceProcedure: + resourceServicePatchResourceHandler.ServeHTTP(w, r) + case ResourceServicePatchResourceStatusProcedure: + resourceServicePatchResourceStatusHandler.ServeHTTP(w, r) + case ResourceServiceDeleteResourceProcedure: + resourceServiceDeleteResourceHandler.ServeHTTP(w, r) + case ResourceServiceDeleteResourcesProcedure: + resourceServiceDeleteResourcesHandler.ServeHTTP(w, r) + case ResourceServiceBatchDeleteResourcesProcedure: + resourceServiceBatchDeleteResourcesHandler.ServeHTTP(w, r) + case ResourceServiceListResourceEventsProcedure: + resourceServiceListResourceEventsHandler.ServeHTTP(w, r) + case ResourceServiceGetResourceControllerProcedure: + resourceServiceGetResourceControllerHandler.ServeHTTP(w, r) + case ResourceServiceGetScaleProcedure: + resourceServiceGetScaleHandler.ServeHTTP(w, r) + case ResourceServiceUpdateScaleProcedure: + resourceServiceUpdateScaleHandler.ServeHTTP(w, r) + case ResourceServiceListHorizontalPodAutoscalersProcedure: + resourceServiceListHorizontalPodAutoscalersHandler.ServeHTTP(w, r) + case ResourceServiceListGroupVersionObjectsProcedure: + resourceServiceListGroupVersionObjectsHandler.ServeHTTP(w, r) + case ResourceServiceGetNodeMetricsProcedure: + resourceServiceGetNodeMetricsHandler.ServeHTTP(w, r) + case ResourceServiceGetPodMetricsProcedure: + resourceServiceGetPodMetricsHandler.ServeHTTP(w, r) + case ResourceServiceCreateSelfSubjectAccessReviewsProcedure: + resourceServiceCreateSelfSubjectAccessReviewsHandler.ServeHTTP(w, r) + case ResourceServiceGetAvailableMenuProcedure: + resourceServiceGetAvailableMenuHandler.ServeHTTP(w, r) + case ResourceServiceRenderResourceProcedure: + resourceServiceRenderResourceHandler.ServeHTTP(w, r) + case ResourceServiceGetDatabaseConfigurationProcedure: + resourceServiceGetDatabaseConfigurationHandler.ServeHTTP(w, r) + case ResourceServiceCreateResourceFromManifestProcedure: + resourceServiceCreateResourceFromManifestHandler.ServeHTTP(w, r) + case ResourceServiceGetResourceHistoryProcedure: + resourceServiceGetResourceHistoryHandler.ServeHTTP(w, r) + case ResourceServiceStreamPodLogsProcedure: + resourceServiceStreamPodLogsHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedResourceServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedResourceServiceHandler struct{} + +func (UnimplementedResourceServiceHandler) GetResource(context.Context, *connect.Request[v2.GetResourceRequest]) (*connect.Response[v2.GetResourceResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetResource is not implemented")) +} + +func (UnimplementedResourceServiceHandler) ListResources(context.Context, *connect.Request[v2.ListResourcesRequest]) (*connect.Response[v2.ListResourcesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.ListResources is not implemented")) +} + +func (UnimplementedResourceServiceHandler) CreateResource(context.Context, *connect.Request[v2.CreateResourceRequest]) (*connect.Response[v2.CreateResourceResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.CreateResource is not implemented")) +} + +func (UnimplementedResourceServiceHandler) UpdateResource(context.Context, *connect.Request[v2.UpdateResourceRequest]) (*connect.Response[v2.UpdateResourceResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.UpdateResource is not implemented")) +} + +func (UnimplementedResourceServiceHandler) PatchResource(context.Context, *connect.Request[v2.PatchResourceRequest]) (*connect.Response[v2.PatchResourceResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.PatchResource is not implemented")) +} + +func (UnimplementedResourceServiceHandler) PatchResourceStatus(context.Context, *connect.Request[v2.PatchResourceStatusRequest]) (*connect.Response[v2.PatchResourceStatusResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.PatchResourceStatus is not implemented")) +} + +func (UnimplementedResourceServiceHandler) DeleteResource(context.Context, *connect.Request[v2.DeleteResourceRequest]) (*connect.Response[v2.DeleteResourceResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.DeleteResource is not implemented")) +} + +func (UnimplementedResourceServiceHandler) DeleteResources(context.Context, *connect.Request[v2.DeleteResourcesRequest]) (*connect.Response[v2.DeleteResourcesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.DeleteResources is not implemented")) +} + +func (UnimplementedResourceServiceHandler) BatchDeleteResources(context.Context, *connect.Request[v2.BatchDeleteResourcesRequest]) (*connect.Response[v2.BatchDeleteResourcesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.BatchDeleteResources is not implemented")) +} + +func (UnimplementedResourceServiceHandler) ListResourceEvents(context.Context, *connect.Request[v2.ListResourceEventsRequest]) (*connect.Response[v2.ListResourceEventsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.ListResourceEvents is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetResourceController(context.Context, *connect.Request[v2.GetResourceControllerRequest]) (*connect.Response[v2.GetResourceControllerResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetResourceController is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetScale(context.Context, *connect.Request[v2.GetScaleRequest]) (*connect.Response[v2.GetScaleResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetScale is not implemented")) +} + +func (UnimplementedResourceServiceHandler) UpdateScale(context.Context, *connect.Request[v2.UpdateScaleRequest]) (*connect.Response[v2.UpdateScaleResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.UpdateScale is not implemented")) +} + +func (UnimplementedResourceServiceHandler) ListHorizontalPodAutoscalers(context.Context, *connect.Request[v2.ListHorizontalPodAutoscalersRequest]) (*connect.Response[v2.ListHorizontalPodAutoscalersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.ListHorizontalPodAutoscalers is not implemented")) +} + +func (UnimplementedResourceServiceHandler) ListGroupVersionObjects(context.Context, *connect.Request[v2.ListGroupVersionObjectsRequest]) (*connect.Response[v2.ListGroupVersionObjectsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.ListGroupVersionObjects is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetNodeMetrics(context.Context, *connect.Request[v2.GetNodeMetricsRequest]) (*connect.Response[v2.GetNodeMetricsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetNodeMetrics is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetPodMetrics(context.Context, *connect.Request[v2.GetPodMetricsRequest]) (*connect.Response[v2.GetPodMetricsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetPodMetrics is not implemented")) +} + +func (UnimplementedResourceServiceHandler) CreateSelfSubjectAccessReviews(context.Context, *connect.Request[v2.CreateSelfSubjectAccessReviewsRequest]) (*connect.Response[v2.CreateSelfSubjectAccessReviewsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.CreateSelfSubjectAccessReviews is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetAvailableMenu(context.Context, *connect.Request[v2.GetAvailableMenuRequest]) (*connect.Response[v2.GetAvailableMenuResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetAvailableMenu is not implemented")) +} + +func (UnimplementedResourceServiceHandler) RenderResource(context.Context, *connect.Request[v2.RenderResourceRequest]) (*connect.Response[v2.RenderResourceResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.RenderResource is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetDatabaseConfiguration(context.Context, *connect.Request[v2.GetDatabaseConfigurationRequest]) (*connect.Response[v2.GetDatabaseConfigurationResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetDatabaseConfiguration is not implemented")) +} + +func (UnimplementedResourceServiceHandler) CreateResourceFromManifest(context.Context, *connect.Request[v2.CreateResourceFromManifestRequest]) (*connect.Response[v2.CreateResourceFromManifestResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.CreateResourceFromManifest is not implemented")) +} + +func (UnimplementedResourceServiceHandler) GetResourceHistory(context.Context, *connect.Request[v2.GetResourceHistoryRequest]) (*connect.Response[v2.GetResourceHistoryResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.GetResourceHistory is not implemented")) +} + +func (UnimplementedResourceServiceHandler) StreamPodLogs(context.Context, *connect.Request[v2.StreamPodLogsRequest], *connect.ServerStream[v2.StreamPodLogsResponse]) error { + return connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.ResourceService.StreamPodLogs is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/subscription.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/subscription.connect.go new file mode 100644 index 000000000..bdaeceeb5 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect/subscription.connect.go @@ -0,0 +1,176 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/cluster/v2/subscription.proto + +package clusterv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + 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 ( + // SubscriptionServiceName is the fully-qualified name of the SubscriptionService service. + SubscriptionServiceName = "akp.cluster.v2.SubscriptionService" +) + +// 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 ( + // SubscriptionServiceSubscribeProcedure is the fully-qualified name of the SubscriptionService's + // Subscribe RPC. + SubscriptionServiceSubscribeProcedure = "/akp.cluster.v2.SubscriptionService/Subscribe" + // SubscriptionServiceCheckSubscriptionProcedure is the fully-qualified name of the + // SubscriptionService's CheckSubscription RPC. + SubscriptionServiceCheckSubscriptionProcedure = "/akp.cluster.v2.SubscriptionService/CheckSubscription" + // SubscriptionServiceUnsubscribeProcedure is the fully-qualified name of the SubscriptionService's + // Unsubscribe RPC. + SubscriptionServiceUnsubscribeProcedure = "/akp.cluster.v2.SubscriptionService/Unsubscribe" +) + +// SubscriptionServiceClient is a client for the akp.cluster.v2.SubscriptionService service. +type SubscriptionServiceClient interface { + Subscribe(context.Context, *connect.Request[v2.SubscribeRequest]) (*connect.Response[v2.SubscribeResponse], error) + CheckSubscription(context.Context, *connect.Request[v2.CheckSubscriptionRequest]) (*connect.Response[v2.CheckSubscriptionResponse], error) + Unsubscribe(context.Context, *connect.Request[v2.UnsubscribeRequest]) (*connect.Response[v2.UnsubscribeResponse], error) +} + +// NewSubscriptionServiceClient constructs a client for the akp.cluster.v2.SubscriptionService +// 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 NewSubscriptionServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SubscriptionServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + subscriptionServiceMethods := v2.File_akp_cluster_v2_subscription_proto.Services().ByName("SubscriptionService").Methods() + return &subscriptionServiceClient{ + subscribe: connect.NewClient[v2.SubscribeRequest, v2.SubscribeResponse]( + httpClient, + baseURL+SubscriptionServiceSubscribeProcedure, + connect.WithSchema(subscriptionServiceMethods.ByName("Subscribe")), + connect.WithClientOptions(opts...), + ), + checkSubscription: connect.NewClient[v2.CheckSubscriptionRequest, v2.CheckSubscriptionResponse]( + httpClient, + baseURL+SubscriptionServiceCheckSubscriptionProcedure, + connect.WithSchema(subscriptionServiceMethods.ByName("CheckSubscription")), + connect.WithClientOptions(opts...), + ), + unsubscribe: connect.NewClient[v2.UnsubscribeRequest, v2.UnsubscribeResponse]( + httpClient, + baseURL+SubscriptionServiceUnsubscribeProcedure, + connect.WithSchema(subscriptionServiceMethods.ByName("Unsubscribe")), + connect.WithClientOptions(opts...), + ), + } +} + +// subscriptionServiceClient implements SubscriptionServiceClient. +type subscriptionServiceClient struct { + subscribe *connect.Client[v2.SubscribeRequest, v2.SubscribeResponse] + checkSubscription *connect.Client[v2.CheckSubscriptionRequest, v2.CheckSubscriptionResponse] + unsubscribe *connect.Client[v2.UnsubscribeRequest, v2.UnsubscribeResponse] +} + +// Subscribe calls akp.cluster.v2.SubscriptionService.Subscribe. +func (c *subscriptionServiceClient) Subscribe(ctx context.Context, req *connect.Request[v2.SubscribeRequest]) (*connect.Response[v2.SubscribeResponse], error) { + return c.subscribe.CallUnary(ctx, req) +} + +// CheckSubscription calls akp.cluster.v2.SubscriptionService.CheckSubscription. +func (c *subscriptionServiceClient) CheckSubscription(ctx context.Context, req *connect.Request[v2.CheckSubscriptionRequest]) (*connect.Response[v2.CheckSubscriptionResponse], error) { + return c.checkSubscription.CallUnary(ctx, req) +} + +// Unsubscribe calls akp.cluster.v2.SubscriptionService.Unsubscribe. +func (c *subscriptionServiceClient) Unsubscribe(ctx context.Context, req *connect.Request[v2.UnsubscribeRequest]) (*connect.Response[v2.UnsubscribeResponse], error) { + return c.unsubscribe.CallUnary(ctx, req) +} + +// SubscriptionServiceHandler is an implementation of the akp.cluster.v2.SubscriptionService +// service. +type SubscriptionServiceHandler interface { + Subscribe(context.Context, *connect.Request[v2.SubscribeRequest]) (*connect.Response[v2.SubscribeResponse], error) + CheckSubscription(context.Context, *connect.Request[v2.CheckSubscriptionRequest]) (*connect.Response[v2.CheckSubscriptionResponse], error) + Unsubscribe(context.Context, *connect.Request[v2.UnsubscribeRequest]) (*connect.Response[v2.UnsubscribeResponse], error) +} + +// NewSubscriptionServiceHandler 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 NewSubscriptionServiceHandler(svc SubscriptionServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + subscriptionServiceMethods := v2.File_akp_cluster_v2_subscription_proto.Services().ByName("SubscriptionService").Methods() + subscriptionServiceSubscribeHandler := connect.NewUnaryHandler( + SubscriptionServiceSubscribeProcedure, + svc.Subscribe, + connect.WithSchema(subscriptionServiceMethods.ByName("Subscribe")), + connect.WithHandlerOptions(opts...), + ) + subscriptionServiceCheckSubscriptionHandler := connect.NewUnaryHandler( + SubscriptionServiceCheckSubscriptionProcedure, + svc.CheckSubscription, + connect.WithSchema(subscriptionServiceMethods.ByName("CheckSubscription")), + connect.WithHandlerOptions(opts...), + ) + subscriptionServiceUnsubscribeHandler := connect.NewUnaryHandler( + SubscriptionServiceUnsubscribeProcedure, + svc.Unsubscribe, + connect.WithSchema(subscriptionServiceMethods.ByName("Unsubscribe")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.cluster.v2.SubscriptionService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case SubscriptionServiceSubscribeProcedure: + subscriptionServiceSubscribeHandler.ServeHTTP(w, r) + case SubscriptionServiceCheckSubscriptionProcedure: + subscriptionServiceCheckSubscriptionHandler.ServeHTTP(w, r) + case SubscriptionServiceUnsubscribeProcedure: + subscriptionServiceUnsubscribeHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedSubscriptionServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedSubscriptionServiceHandler struct{} + +func (UnimplementedSubscriptionServiceHandler) Subscribe(context.Context, *connect.Request[v2.SubscribeRequest]) (*connect.Response[v2.SubscribeResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.SubscriptionService.Subscribe is not implemented")) +} + +func (UnimplementedSubscriptionServiceHandler) CheckSubscription(context.Context, *connect.Request[v2.CheckSubscriptionRequest]) (*connect.Response[v2.CheckSubscriptionResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.SubscriptionService.CheckSubscription is not implemented")) +} + +func (UnimplementedSubscriptionServiceHandler) Unsubscribe(context.Context, *connect.Request[v2.UnsubscribeRequest]) (*connect.Response[v2.UnsubscribeResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.cluster.v2.SubscriptionService.Unsubscribe is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/command.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/command.pb.go new file mode 100644 index 000000000..e8b75991e --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/command.pb.go @@ -0,0 +1,215 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/cluster/v2/command.proto + +package clusterv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ExecuteCommandRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // command is the plugin and its arguments, e.g. "kubectl-dba describe pg -n demo pg1". + Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExecuteCommandRequest) Reset() { + *x = ExecuteCommandRequest{} + mi := &file_akp_cluster_v2_command_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecuteCommandRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteCommandRequest) ProtoMessage() {} + +func (x *ExecuteCommandRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_command_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteCommandRequest.ProtoReflect.Descriptor instead. +func (*ExecuteCommandRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_command_proto_rawDescGZIP(), []int{0} +} + +func (x *ExecuteCommandRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ExecuteCommandRequest) GetCommand() string { + if x != nil { + return x.Command + } + return "" +} + +type ExecuteCommandResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Stdout string `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"` + Stderr string `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"` + // exit_code is the plugin's; a plugin that fails still answers. + ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExecuteCommandResponse) Reset() { + *x = ExecuteCommandResponse{} + mi := &file_akp_cluster_v2_command_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecuteCommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteCommandResponse) ProtoMessage() {} + +func (x *ExecuteCommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_command_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteCommandResponse.ProtoReflect.Descriptor instead. +func (*ExecuteCommandResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_command_proto_rawDescGZIP(), []int{1} +} + +func (x *ExecuteCommandResponse) GetStdout() string { + if x != nil { + return x.Stdout + } + return "" +} + +func (x *ExecuteCommandResponse) GetStderr() string { + if x != nil { + return x.Stderr + } + return "" +} + +func (x *ExecuteCommandResponse) GetExitCode() int32 { + if x != nil { + return x.ExitCode + } + return 0 +} + +var File_akp_cluster_v2_command_proto protoreflect.FileDescriptor + +const file_akp_cluster_v2_command_proto_rawDesc = "" + + "\n" + + "\x1cakp/cluster/v2/command.proto\x12\x0eakp.cluster.v2\x1a\x1cakp/cluster/v2/cluster.proto\x1a\x1bbuf/validate/validate.proto\"x\n" + + "\x15ExecuteCommandRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12!\n" + + "\acommand\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acommand\"e\n" + + "\x16ExecuteCommandResponse\x12\x16\n" + + "\x06stdout\x18\x01 \x01(\tR\x06stdout\x12\x16\n" + + "\x06stderr\x18\x02 \x01(\tR\x06stderr\x12\x1b\n" + + "\texit_code\x18\x03 \x01(\x05R\bexitCode2s\n" + + "\x0eCommandService\x12a\n" + + "\x0eExecuteCommand\x12%.akp.cluster.v2.ExecuteCommandRequest\x1a&.akp.cluster.v2.ExecuteCommandResponse\"\x00B\xb9\x01\n" + + "\x12com.akp.cluster.v2B\fCommandProtoP\x01Z;go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2;clusterv2\xa2\x02\x03ACX\xaa\x02\x0eAkp.Cluster.V2\xca\x02\x0eAkp\\Cluster\\V2\xe2\x02\x1aAkp\\Cluster\\V2\\GPBMetadata\xea\x02\x10Akp::Cluster::V2b\x06proto3" + +var ( + file_akp_cluster_v2_command_proto_rawDescOnce sync.Once + file_akp_cluster_v2_command_proto_rawDescData []byte +) + +func file_akp_cluster_v2_command_proto_rawDescGZIP() []byte { + file_akp_cluster_v2_command_proto_rawDescOnce.Do(func() { + file_akp_cluster_v2_command_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_command_proto_rawDesc), len(file_akp_cluster_v2_command_proto_rawDesc))) + }) + return file_akp_cluster_v2_command_proto_rawDescData +} + +var file_akp_cluster_v2_command_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_akp_cluster_v2_command_proto_goTypes = []any{ + (*ExecuteCommandRequest)(nil), // 0: akp.cluster.v2.ExecuteCommandRequest + (*ExecuteCommandResponse)(nil), // 1: akp.cluster.v2.ExecuteCommandResponse + (*ClusterRef)(nil), // 2: akp.cluster.v2.ClusterRef +} +var file_akp_cluster_v2_command_proto_depIdxs = []int32{ + 2, // 0: akp.cluster.v2.ExecuteCommandRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 0, // 1: akp.cluster.v2.CommandService.ExecuteCommand:input_type -> akp.cluster.v2.ExecuteCommandRequest + 1, // 2: akp.cluster.v2.CommandService.ExecuteCommand:output_type -> akp.cluster.v2.ExecuteCommandResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_akp_cluster_v2_command_proto_init() } +func file_akp_cluster_v2_command_proto_init() { + if File_akp_cluster_v2_command_proto != nil { + return + } + file_akp_cluster_v2_cluster_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_command_proto_rawDesc), len(file_akp_cluster_v2_command_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_cluster_v2_command_proto_goTypes, + DependencyIndexes: file_akp_cluster_v2_command_proto_depIdxs, + MessageInfos: file_akp_cluster_v2_command_proto_msgTypes, + }.Build() + File_akp_cluster_v2_command_proto = out.File + file_akp_cluster_v2_command_proto_goTypes = nil + file_akp_cluster_v2_command_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/lifecycle.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/lifecycle.pb.go new file mode 100644 index 000000000..b0a7492c5 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/lifecycle.pb.go @@ -0,0 +1,3975 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/cluster/v2/lifecycle.proto + +package clusterv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Operation is a long-running change to a cluster. +type Operation struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + // type is e.g. "cluster_import" or "cluster_remove". + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + // status is "pending", "dispatching", "running", "succeeded" or "failed". + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + ClusterName string `protobuf:"bytes,6,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` + // response_id is what the operation's progress events are published under. + ResponseId string `protobuf:"bytes,7,opt,name=response_id,json=responseId,proto3" json:"response_id,omitempty"` + ErrorMessage string `protobuf:"bytes,8,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Operation) Reset() { + *x = Operation{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Operation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Operation) ProtoMessage() {} + +func (x *Operation) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Operation.ProtoReflect.Descriptor instead. +func (*Operation) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{0} +} + +func (x *Operation) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Operation) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *Operation) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Operation) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Operation) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Operation) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *Operation) GetResponseId() string { + if x != nil { + return x.ResponseId + } + return "" +} + +func (x *Operation) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *Operation) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Operation) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +// OperationOptions are how a started operation reports progress. +type OperationOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + // response_id names the operation's progress events; a new one is made when empty. + ResponseId string `protobuf:"bytes,1,opt,name=response_id,json=responseId,proto3" json:"response_id,omitempty"` + // silent leaves out the notification when the operation ends. + Silent bool `protobuf:"varint,2,opt,name=silent,proto3" json:"silent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OperationOptions) Reset() { + *x = OperationOptions{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OperationOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationOptions) ProtoMessage() {} + +func (x *OperationOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OperationOptions.ProtoReflect.Descriptor instead. +func (*OperationOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{1} +} + +func (x *OperationOptions) GetResponseId() string { + if x != nil { + return x.ResponseId + } + return "" +} + +func (x *OperationOptions) GetSilent() bool { + if x != nil { + return x.Silent + } + return false +} + +// ComponentOptions are the components AKP installs in, or removes from, a cluster. +type ComponentOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + FluxCd bool `protobuf:"varint,1,opt,name=flux_cd,json=fluxCd,proto3" json:"flux_cd,omitempty"` + ArgoCd *ArgoCDOptions `protobuf:"bytes,2,opt,name=argo_cd,json=argoCd,proto3" json:"argo_cd,omitempty"` + FeatureSets []*FeatureSet `protobuf:"bytes,3,rep,name=feature_sets,json=featureSets,proto3" json:"feature_sets,omitempty"` + AllFeatures bool `protobuf:"varint,4,opt,name=all_features,json=allFeatures,proto3" json:"all_features,omitempty"` + ClusterProfile string `protobuf:"bytes,5,opt,name=cluster_profile,json=clusterProfile,proto3" json:"cluster_profile,omitempty"` + MonitoringClusterName string `protobuf:"bytes,6,opt,name=monitoring_cluster_name,json=monitoringClusterName,proto3" json:"monitoring_cluster_name,omitempty"` + SpokeComponents bool `protobuf:"varint,7,opt,name=spoke_components,json=spokeComponents,proto3" json:"spoke_components,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComponentOptions) Reset() { + *x = ComponentOptions{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComponentOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComponentOptions) ProtoMessage() {} + +func (x *ComponentOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComponentOptions.ProtoReflect.Descriptor instead. +func (*ComponentOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{2} +} + +func (x *ComponentOptions) GetFluxCd() bool { + if x != nil { + return x.FluxCd + } + return false +} + +func (x *ComponentOptions) GetArgoCd() *ArgoCDOptions { + if x != nil { + return x.ArgoCd + } + return nil +} + +func (x *ComponentOptions) GetFeatureSets() []*FeatureSet { + if x != nil { + return x.FeatureSets + } + return nil +} + +func (x *ComponentOptions) GetAllFeatures() bool { + if x != nil { + return x.AllFeatures + } + return false +} + +func (x *ComponentOptions) GetClusterProfile() string { + if x != nil { + return x.ClusterProfile + } + return "" +} + +func (x *ComponentOptions) GetMonitoringClusterName() string { + if x != nil { + return x.MonitoringClusterName + } + return "" +} + +func (x *ComponentOptions) GetSpokeComponents() bool { + if x != nil { + return x.SpokeComponents + } + return false +} + +// ArgoCDOptions pick the cluster's Argo CD strategy: standalone, central (principal_cluster_name), +// an existing Argo CD (managed_argo) or the cluster as principal (in_cluster_argo). +type ArgoCDOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + PrincipalClusterName string `protobuf:"bytes,2,opt,name=principal_cluster_name,json=principalClusterName,proto3" json:"principal_cluster_name,omitempty"` + ManagedArgo *ManagedArgo `protobuf:"bytes,3,opt,name=managed_argo,json=managedArgo,proto3" json:"managed_argo,omitempty"` + InClusterArgo *InClusterArgo `protobuf:"bytes,4,opt,name=in_cluster_argo,json=inClusterArgo,proto3" json:"in_cluster_argo,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArgoCDOptions) Reset() { + *x = ArgoCDOptions{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArgoCDOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArgoCDOptions) ProtoMessage() {} + +func (x *ArgoCDOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArgoCDOptions.ProtoReflect.Descriptor instead. +func (*ArgoCDOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{3} +} + +func (x *ArgoCDOptions) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *ArgoCDOptions) GetPrincipalClusterName() string { + if x != nil { + return x.PrincipalClusterName + } + return "" +} + +func (x *ArgoCDOptions) GetManagedArgo() *ManagedArgo { + if x != nil { + return x.ManagedArgo + } + return nil +} + +func (x *ArgoCDOptions) GetInClusterArgo() *InClusterArgo { + if x != nil { + return x.InClusterArgo + } + return nil +} + +type ManagedArgo struct { + state protoimpl.MessageState `protogen:"open.v1"` + ExistingKubeconfig string `protobuf:"bytes,1,opt,name=existing_kubeconfig,json=existingKubeconfig,proto3" json:"existing_kubeconfig,omitempty"` + // argo_cd_cluster_name is the name the cluster is registered as in the existing Argo CD. + ArgoCdClusterName string `protobuf:"bytes,2,opt,name=argo_cd_cluster_name,json=argoCdClusterName,proto3" json:"argo_cd_cluster_name,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ManagedArgo) Reset() { + *x = ManagedArgo{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ManagedArgo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManagedArgo) ProtoMessage() {} + +func (x *ManagedArgo) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManagedArgo.ProtoReflect.Descriptor instead. +func (*ManagedArgo) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{4} +} + +func (x *ManagedArgo) GetExistingKubeconfig() string { + if x != nil { + return x.ExistingKubeconfig + } + return "" +} + +func (x *ManagedArgo) GetArgoCdClusterName() string { + if x != nil { + return x.ArgoCdClusterName + } + return "" +} + +func (x *ManagedArgo) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type InClusterArgo struct { + state protoimpl.MessageState `protogen:"open.v1"` + DeployPrincipal bool `protobuf:"varint,1,opt,name=deploy_principal,json=deployPrincipal,proto3" json:"deploy_principal,omitempty"` + PrincipalServiceType string `protobuf:"bytes,2,opt,name=principal_service_type,json=principalServiceType,proto3" json:"principal_service_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InClusterArgo) Reset() { + *x = InClusterArgo{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InClusterArgo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InClusterArgo) ProtoMessage() {} + +func (x *InClusterArgo) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InClusterArgo.ProtoReflect.Descriptor instead. +func (*InClusterArgo) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{5} +} + +func (x *InClusterArgo) GetDeployPrincipal() bool { + if x != nil { + return x.DeployPrincipal + } + return false +} + +func (x *InClusterArgo) GetPrincipalServiceType() string { + if x != nil { + return x.PrincipalServiceType + } + return "" +} + +type FeatureSet struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Features []string `protobuf:"bytes,2,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeatureSet) Reset() { + *x = FeatureSet{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeatureSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSet) ProtoMessage() {} + +func (x *FeatureSet) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSet.ProtoReflect.Descriptor instead. +func (*FeatureSet) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{6} +} + +func (x *FeatureSet) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FeatureSet) GetFeatures() []string { + if x != nil { + return x.Features + } + return nil +} + +type RemoveClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Components *ComponentOptions `protobuf:"bytes,2,opt,name=components,proto3" json:"components,omitempty"` + Operation *OperationOptions `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClusterRequest) Reset() { + *x = RemoveClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClusterRequest) ProtoMessage() {} + +func (x *RemoveClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClusterRequest.ProtoReflect.Descriptor instead. +func (*RemoveClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{7} +} + +func (x *RemoveClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *RemoveClusterRequest) GetComponents() *ComponentOptions { + if x != nil { + return x.Components + } + return nil +} + +func (x *RemoveClusterRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type RemoveClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClusterResponse) Reset() { + *x = RemoveClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClusterResponse) ProtoMessage() {} + +func (x *RemoveClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClusterResponse.ProtoReflect.Descriptor instead. +func (*RemoveClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{8} +} + +func (x *RemoveClusterResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type ForgetClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ForgetClusterRequest) Reset() { + *x = ForgetClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ForgetClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ForgetClusterRequest) ProtoMessage() {} + +func (x *ForgetClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ForgetClusterRequest.ProtoReflect.Descriptor instead. +func (*ForgetClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{9} +} + +func (x *ForgetClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type ForgetClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ForgetClusterResponse) Reset() { + *x = ForgetClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ForgetClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ForgetClusterResponse) ProtoMessage() {} + +func (x *ForgetClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ForgetClusterResponse.ProtoReflect.Descriptor instead. +func (*ForgetClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{10} +} + +type GetClusterStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterStatusRequest) Reset() { + *x = GetClusterStatusRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterStatusRequest) ProtoMessage() {} + +func (x *GetClusterStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterStatusRequest.ProtoReflect.Descriptor instead. +func (*GetClusterStatusRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{11} +} + +func (x *GetClusterStatusRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type GetClusterStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // cluster_set_name is the cluster set of a spoke cluster. + ClusterSetName string `protobuf:"bytes,2,opt,name=cluster_set_name,json=clusterSetName,proto3" json:"cluster_set_name,omitempty"` + // is_capi_cluster_upgradeable is set for a Cluster API cluster with a newer version available. + IsCapiClusterUpgradeable bool `protobuf:"varint,3,opt,name=is_capi_cluster_upgradeable,json=isCapiClusterUpgradeable,proto3" json:"is_capi_cluster_upgradeable,omitempty"` + // cluster_api is set for a cluster Cluster API manages, as the cluster reports it. + ClusterApi *ClusterAPIInfo `protobuf:"bytes,4,opt,name=cluster_api,json=clusterApi,proto3" json:"cluster_api,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterStatusResponse) Reset() { + *x = GetClusterStatusResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterStatusResponse) ProtoMessage() {} + +func (x *GetClusterStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterStatusResponse.ProtoReflect.Descriptor instead. +func (*GetClusterStatusResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{12} +} + +func (x *GetClusterStatusResponse) GetCluster() *Cluster { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetClusterStatusResponse) GetClusterSetName() string { + if x != nil { + return x.ClusterSetName + } + return "" +} + +func (x *GetClusterStatusResponse) GetIsCapiClusterUpgradeable() bool { + if x != nil { + return x.IsCapiClusterUpgradeable + } + return false +} + +func (x *GetClusterStatusResponse) GetClusterApi() *ClusterAPIInfo { + if x != nil { + return x.ClusterApi + } + return nil +} + +type ListUpgradeableVersionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUpgradeableVersionsRequest) Reset() { + *x = ListUpgradeableVersionsRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUpgradeableVersionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUpgradeableVersionsRequest) ProtoMessage() {} + +func (x *ListUpgradeableVersionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUpgradeableVersionsRequest.ProtoReflect.Descriptor instead. +func (*ListUpgradeableVersionsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{13} +} + +func (x *ListUpgradeableVersionsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type ListUpgradeableVersionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Versions []string `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUpgradeableVersionsResponse) Reset() { + *x = ListUpgradeableVersionsResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUpgradeableVersionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUpgradeableVersionsResponse) ProtoMessage() {} + +func (x *ListUpgradeableVersionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUpgradeableVersionsResponse.ProtoReflect.Descriptor instead. +func (*ListUpgradeableVersionsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{14} +} + +func (x *ListUpgradeableVersionsResponse) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +type ListArgoCDClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListArgoCDClustersRequest) Reset() { + *x = ListArgoCDClustersRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListArgoCDClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListArgoCDClustersRequest) ProtoMessage() {} + +func (x *ListArgoCDClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListArgoCDClustersRequest.ProtoReflect.Descriptor instead. +func (*ListArgoCDClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{15} +} + +func (x *ListArgoCDClustersRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +type ListArgoCDClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*ArgoCDCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListArgoCDClustersResponse) Reset() { + *x = ListArgoCDClustersResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListArgoCDClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListArgoCDClustersResponse) ProtoMessage() {} + +func (x *ListArgoCDClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListArgoCDClustersResponse.ProtoReflect.Descriptor instead. +func (*ListArgoCDClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{16} +} + +func (x *ListArgoCDClustersResponse) GetClusters() []*ArgoCDCluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ArgoCDCluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // namespace is where the Argo CD principal runs. + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArgoCDCluster) Reset() { + *x = ArgoCDCluster{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArgoCDCluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArgoCDCluster) ProtoMessage() {} + +func (x *ArgoCDCluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArgoCDCluster.ProtoReflect.Descriptor instead. +func (*ArgoCDCluster) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{17} +} + +func (x *ArgoCDCluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ArgoCDCluster) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ArgoCDCluster) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type GetOperationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOperationRequest) Reset() { + *x = GetOperationRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOperationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOperationRequest) ProtoMessage() {} + +func (x *GetOperationRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOperationRequest.ProtoReflect.Descriptor instead. +func (*GetOperationRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{18} +} + +func (x *GetOperationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetOperationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOperationResponse) Reset() { + *x = GetOperationResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOperationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOperationResponse) ProtoMessage() {} + +func (x *GetOperationResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOperationResponse.ProtoReflect.Descriptor instead. +func (*GetOperationResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{19} +} + +func (x *GetOperationResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type GetHubInfoRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetHubInfoRequest) Reset() { + *x = GetHubInfoRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetHubInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHubInfoRequest) ProtoMessage() {} + +func (x *GetHubInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetHubInfoRequest.ProtoReflect.Descriptor instead. +func (*GetHubInfoRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{20} +} + +func (x *GetHubInfoRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +type GetHubInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // hubs maps a hub cluster's name to how to join it. + Hubs map[string]*HubAccess `protobuf:"bytes,1,rep,name=hubs,proto3" json:"hubs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetHubInfoResponse) Reset() { + *x = GetHubInfoResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetHubInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHubInfoResponse) ProtoMessage() {} + +func (x *GetHubInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetHubInfoResponse.ProtoReflect.Descriptor instead. +func (*GetHubInfoResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{21} +} + +func (x *GetHubInfoResponse) GetHubs() map[string]*HubAccess { + if x != nil { + return x.Hubs + } + return nil +} + +type HubAccess struct { + state protoimpl.MessageState `protogen:"open.v1"` + ApiServer string `protobuf:"bytes,1,opt,name=api_server,json=apiServer,proto3" json:"api_server,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HubAccess) Reset() { + *x = HubAccess{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HubAccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HubAccess) ProtoMessage() {} + +func (x *HubAccess) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HubAccess.ProtoReflect.Descriptor instead. +func (*HubAccess) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{22} +} + +func (x *HubAccess) GetApiServer() string { + if x != nil { + return x.ApiServer + } + return "" +} + +func (x *HubAccess) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type ListAllHubClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAllHubClustersRequest) Reset() { + *x = ListAllHubClustersRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAllHubClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAllHubClustersRequest) ProtoMessage() {} + +func (x *ListAllHubClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAllHubClustersRequest.ProtoReflect.Descriptor instead. +func (*ListAllHubClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{23} +} + +type ListAllHubClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hubs []*HubCluster `protobuf:"bytes,1,rep,name=hubs,proto3" json:"hubs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAllHubClustersResponse) Reset() { + *x = ListAllHubClustersResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAllHubClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAllHubClustersResponse) ProtoMessage() {} + +func (x *ListAllHubClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAllHubClustersResponse.ProtoReflect.Descriptor instead. +func (*ListAllHubClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{24} +} + +func (x *ListAllHubClustersResponse) GetHubs() []*HubCluster { + if x != nil { + return x.Hubs + } + return nil +} + +type HubCluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + OwnerName string `protobuf:"bytes,2,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"` + NodeCount int32 `protobuf:"varint,5,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"` + Provider string `protobuf:"bytes,6,opt,name=provider,proto3" json:"provider,omitempty"` + // hub_type is "OCM" or "OCM-MC" (a multicluster control plane). + HubType string `protobuf:"bytes,7,opt,name=hub_type,json=hubType,proto3" json:"hub_type,omitempty"` + Location string `protobuf:"bytes,8,opt,name=location,proto3" json:"location,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HubCluster) Reset() { + *x = HubCluster{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HubCluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HubCluster) ProtoMessage() {} + +func (x *HubCluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HubCluster.ProtoReflect.Descriptor instead. +func (*HubCluster) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{25} +} + +func (x *HubCluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HubCluster) GetOwnerName() string { + if x != nil { + return x.OwnerName + } + return "" +} + +func (x *HubCluster) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *HubCluster) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *HubCluster) GetNodeCount() int32 { + if x != nil { + return x.NodeCount + } + return 0 +} + +func (x *HubCluster) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *HubCluster) GetHubType() string { + if x != nil { + return x.HubType + } + return "" +} + +func (x *HubCluster) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *HubCluster) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +// VirtualClusterOptions name a virtual cluster on a host cluster, and the hub it joins, if any. +type VirtualClusterOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + HostClusterUid string `protobuf:"bytes,2,opt,name=host_cluster_uid,json=hostClusterUid,proto3" json:"host_cluster_uid,omitempty"` + HostClusterOwnerId string `protobuf:"bytes,3,opt,name=host_cluster_owner_id,json=hostClusterOwnerId,proto3" json:"host_cluster_owner_id,omitempty"` + HubClusterUid string `protobuf:"bytes,4,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + HubClusterOwnerId string `protobuf:"bytes,5,opt,name=hub_cluster_owner_id,json=hubClusterOwnerId,proto3" json:"hub_cluster_owner_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VirtualClusterOptions) Reset() { + *x = VirtualClusterOptions{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VirtualClusterOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VirtualClusterOptions) ProtoMessage() {} + +func (x *VirtualClusterOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VirtualClusterOptions.ProtoReflect.Descriptor instead. +func (*VirtualClusterOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{26} +} + +func (x *VirtualClusterOptions) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *VirtualClusterOptions) GetHostClusterUid() string { + if x != nil { + return x.HostClusterUid + } + return "" +} + +func (x *VirtualClusterOptions) GetHostClusterOwnerId() string { + if x != nil { + return x.HostClusterOwnerId + } + return "" +} + +func (x *VirtualClusterOptions) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *VirtualClusterOptions) GetHubClusterOwnerId() string { + if x != nil { + return x.HubClusterOwnerId + } + return "" +} + +type CreateVirtualClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // owner is the account the virtual cluster is imported into. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Cluster *VirtualClusterOptions `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Operation *OperationOptions `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateVirtualClusterRequest) Reset() { + *x = CreateVirtualClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateVirtualClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateVirtualClusterRequest) ProtoMessage() {} + +func (x *CreateVirtualClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateVirtualClusterRequest.ProtoReflect.Descriptor instead. +func (*CreateVirtualClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{27} +} + +func (x *CreateVirtualClusterRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *CreateVirtualClusterRequest) GetCluster() *VirtualClusterOptions { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *CreateVirtualClusterRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type CreateVirtualClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateVirtualClusterResponse) Reset() { + *x = CreateVirtualClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateVirtualClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateVirtualClusterResponse) ProtoMessage() {} + +func (x *CreateVirtualClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateVirtualClusterResponse.ProtoReflect.Descriptor instead. +func (*CreateVirtualClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{28} +} + +func (x *CreateVirtualClusterResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type ImportVirtualClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Cluster *VirtualClusterOptions `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + Operation *OperationOptions `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImportVirtualClusterRequest) Reset() { + *x = ImportVirtualClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImportVirtualClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportVirtualClusterRequest) ProtoMessage() {} + +func (x *ImportVirtualClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportVirtualClusterRequest.ProtoReflect.Descriptor instead. +func (*ImportVirtualClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{29} +} + +func (x *ImportVirtualClusterRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ImportVirtualClusterRequest) GetCluster() *VirtualClusterOptions { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ImportVirtualClusterRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type ImportVirtualClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImportVirtualClusterResponse) Reset() { + *x = ImportVirtualClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImportVirtualClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportVirtualClusterResponse) ProtoMessage() {} + +func (x *ImportVirtualClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportVirtualClusterResponse.ProtoReflect.Descriptor instead. +func (*ImportVirtualClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{30} +} + +func (x *ImportVirtualClusterResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type ReconcileFeaturesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Features []string `protobuf:"bytes,2,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReconcileFeaturesRequest) Reset() { + *x = ReconcileFeaturesRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReconcileFeaturesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconcileFeaturesRequest) ProtoMessage() {} + +func (x *ReconcileFeaturesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconcileFeaturesRequest.ProtoReflect.Descriptor instead. +func (*ReconcileFeaturesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{31} +} + +func (x *ReconcileFeaturesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ReconcileFeaturesRequest) GetFeatures() []string { + if x != nil { + return x.Features + } + return nil +} + +type ReconcileFeaturesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReconcileFeaturesResponse) Reset() { + *x = ReconcileFeaturesResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReconcileFeaturesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconcileFeaturesResponse) ProtoMessage() {} + +func (x *ReconcileFeaturesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconcileFeaturesResponse.ProtoReflect.Descriptor instead. +func (*ReconcileFeaturesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{32} +} + +type CheckSkipCredentialsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + // provider is the hosting provider, e.g. "eks". + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckSkipCredentialsRequest) Reset() { + *x = CheckSkipCredentialsRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckSkipCredentialsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckSkipCredentialsRequest) ProtoMessage() {} + +func (x *CheckSkipCredentialsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckSkipCredentialsRequest.ProtoReflect.Descriptor instead. +func (*CheckSkipCredentialsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{33} +} + +func (x *CheckSkipCredentialsRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *CheckSkipCredentialsRequest) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +type CheckSkipCredentialsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + SkipCredentials bool `protobuf:"varint,1,opt,name=skip_credentials,json=skipCredentials,proto3" json:"skip_credentials,omitempty"` + // reason is e.g. "permissions_verified" or "unsupported_provider". + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckSkipCredentialsResponse) Reset() { + *x = CheckSkipCredentialsResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckSkipCredentialsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckSkipCredentialsResponse) ProtoMessage() {} + +func (x *CheckSkipCredentialsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckSkipCredentialsResponse.ProtoReflect.Descriptor instead. +func (*CheckSkipCredentialsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{34} +} + +func (x *CheckSkipCredentialsResponse) GetSkipCredentials() bool { + if x != nil { + return x.SkipCredentials + } + return false +} + +func (x *CheckSkipCredentialsResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *CheckSkipCredentialsResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// ClusterNames are the names a cluster imports with, and the hub cluster it joins. +type ClusterNames struct { + state protoimpl.MessageState `protogen:"open.v1"` + // name is the cluster's ID in the account. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // hub_cluster_uid is the hub cluster the cluster joins as a spoke, if any. + HubClusterUid string `protobuf:"bytes,3,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + // infra_namespace is where a virtual cluster's infrastructure runs on its host. + InfraNamespace string `protobuf:"bytes,4,opt,name=infra_namespace,json=infraNamespace,proto3" json:"infra_namespace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterNames) Reset() { + *x = ClusterNames{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterNames) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterNames) ProtoMessage() {} + +func (x *ClusterNames) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterNames.ProtoReflect.Descriptor instead. +func (*ClusterNames) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{35} +} + +func (x *ClusterNames) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterNames) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ClusterNames) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *ClusterNames) GetInfraNamespace() string { + if x != nil { + return x.InfraNamespace + } + return "" +} + +// ProviderOptions are how AKP reaches a cluster of a hosting provider. +type ProviderOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + // name is the hosting provider: "GKE", "AKS", "EKS", "DigitalOcean", "Linode", "Rancher" or + // "Generic", in any case. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // credential names the caller's cloud credential. + Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` + // eks_auth_mode is how an EKS cluster imported without credentials authenticates. + EksAuthMode string `protobuf:"bytes,3,opt,name=eks_auth_mode,json=eksAuthMode,proto3" json:"eks_auth_mode,omitempty"` + // cluster_id is the cluster's ID at the provider. + ClusterId string `protobuf:"bytes,4,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + Project string `protobuf:"bytes,5,opt,name=project,proto3" json:"project,omitempty"` + Region string `protobuf:"bytes,6,opt,name=region,proto3" json:"region,omitempty"` + ResourceGroup string `protobuf:"bytes,7,opt,name=resource_group,json=resourceGroup,proto3" json:"resource_group,omitempty"` + // kubeconfig reaches a generic cluster. + Kubeconfig string `protobuf:"bytes,8,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProviderOptions) Reset() { + *x = ProviderOptions{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProviderOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProviderOptions) ProtoMessage() {} + +func (x *ProviderOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProviderOptions.ProtoReflect.Descriptor instead. +func (*ProviderOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{36} +} + +func (x *ProviderOptions) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ProviderOptions) GetCredential() string { + if x != nil { + return x.Credential + } + return "" +} + +func (x *ProviderOptions) GetEksAuthMode() string { + if x != nil { + return x.EksAuthMode + } + return "" +} + +func (x *ProviderOptions) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +func (x *ProviderOptions) GetProject() string { + if x != nil { + return x.Project + } + return "" +} + +func (x *ProviderOptions) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *ProviderOptions) GetResourceGroup() string { + if x != nil { + return x.ResourceGroup + } + return "" +} + +func (x *ProviderOptions) GetKubeconfig() string { + if x != nil { + return x.Kubeconfig + } + return "" +} + +type CheckClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Names *ClusterNames `protobuf:"bytes,2,opt,name=names,proto3" json:"names,omitempty"` + Provider *ProviderOptions `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckClusterRequest) Reset() { + *x = CheckClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckClusterRequest) ProtoMessage() {} + +func (x *CheckClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckClusterRequest.ProtoReflect.Descriptor instead. +func (*CheckClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{37} +} + +func (x *CheckClusterRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *CheckClusterRequest) GetNames() *ClusterNames { + if x != nil { + return x.Names + } + return nil +} + +func (x *CheckClusterRequest) GetProvider() *ProviderOptions { + if x != nil { + return x.Provider + } + return nil +} + +type CheckClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // cluster has no id when it is not imported. + Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckClusterResponse) Reset() { + *x = CheckClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckClusterResponse) ProtoMessage() {} + +func (x *CheckClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckClusterResponse.ProtoReflect.Descriptor instead. +func (*CheckClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{38} +} + +func (x *CheckClusterResponse) GetCluster() *Cluster { + if x != nil { + return x.Cluster + } + return nil +} + +type ValidateImportRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Names *ClusterNames `protobuf:"bytes,2,opt,name=names,proto3" json:"names,omitempty"` + Provider *ProviderOptions `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` + // for_connect checks only what connecting to an imported cluster needs. + ForConnect bool `protobuf:"varint,4,opt,name=for_connect,json=forConnect,proto3" json:"for_connect,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateImportRequest) Reset() { + *x = ValidateImportRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateImportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateImportRequest) ProtoMessage() {} + +func (x *ValidateImportRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateImportRequest.ProtoReflect.Descriptor instead. +func (*ValidateImportRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{39} +} + +func (x *ValidateImportRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ValidateImportRequest) GetNames() *ClusterNames { + if x != nil { + return x.Names + } + return nil +} + +func (x *ValidateImportRequest) GetProvider() *ProviderOptions { + if x != nil { + return x.Provider + } + return nil +} + +func (x *ValidateImportRequest) GetForConnect() bool { + if x != nil { + return x.ForConnect + } + return false +} + +type ValidateImportResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AlreadyImported bool `protobuf:"varint,1,opt,name=already_imported,json=alreadyImported,proto3" json:"already_imported,omitempty"` + DisplayName *NameValidation `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Name *NameValidation `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + MonitoringClusters []string `protobuf:"bytes,5,rep,name=monitoring_clusters,json=monitoringClusters,proto3" json:"monitoring_clusters,omitempty"` + // The rest is unset for_connect. + FluxCd *FluxCDStatus `protobuf:"bytes,6,opt,name=flux_cd,json=fluxCd,proto3" json:"flux_cd,omitempty"` + FeatureSets []*AvailableFeatureSet `protobuf:"bytes,7,rep,name=feature_sets,json=featureSets,proto3" json:"feature_sets,omitempty"` + ClusterApi *ClusterAPIInfo `protobuf:"bytes,8,opt,name=cluster_api,json=clusterApi,proto3" json:"cluster_api,omitempty"` + ClusterMetadata *ClusterIdentity `protobuf:"bytes,9,opt,name=cluster_metadata,json=clusterMetadata,proto3" json:"cluster_metadata,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateImportResponse) Reset() { + *x = ValidateImportResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateImportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateImportResponse) ProtoMessage() {} + +func (x *ValidateImportResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateImportResponse.ProtoReflect.Descriptor instead. +func (*ValidateImportResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{40} +} + +func (x *ValidateImportResponse) GetAlreadyImported() bool { + if x != nil { + return x.AlreadyImported + } + return false +} + +func (x *ValidateImportResponse) GetDisplayName() *NameValidation { + if x != nil { + return x.DisplayName + } + return nil +} + +func (x *ValidateImportResponse) GetName() *NameValidation { + if x != nil { + return x.Name + } + return nil +} + +func (x *ValidateImportResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ValidateImportResponse) GetMonitoringClusters() []string { + if x != nil { + return x.MonitoringClusters + } + return nil +} + +func (x *ValidateImportResponse) GetFluxCd() *FluxCDStatus { + if x != nil { + return x.FluxCd + } + return nil +} + +func (x *ValidateImportResponse) GetFeatureSets() []*AvailableFeatureSet { + if x != nil { + return x.FeatureSets + } + return nil +} + +func (x *ValidateImportResponse) GetClusterApi() *ClusterAPIInfo { + if x != nil { + return x.ClusterApi + } + return nil +} + +func (x *ValidateImportResponse) GetClusterMetadata() *ClusterIdentity { + if x != nil { + return x.ClusterMetadata + } + return nil +} + +type NameValidation struct { + state protoimpl.MessageState `protogen:"open.v1"` + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NameValidation) Reset() { + *x = NameValidation{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NameValidation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NameValidation) ProtoMessage() {} + +func (x *NameValidation) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NameValidation.ProtoReflect.Descriptor instead. +func (*NameValidation) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{41} +} + +func (x *NameValidation) GetValid() bool { + if x != nil { + return x.Valid + } + return false +} + +func (x *NameValidation) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type FluxCDStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + Installed bool `protobuf:"varint,1,opt,name=installed,proto3" json:"installed,omitempty"` + Ready bool `protobuf:"varint,2,opt,name=ready,proto3" json:"ready,omitempty"` + // managed is a Flux CD AKP installed. + Managed bool `protobuf:"varint,3,opt,name=managed,proto3" json:"managed,omitempty"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FluxCDStatus) Reset() { + *x = FluxCDStatus{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FluxCDStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FluxCDStatus) ProtoMessage() {} + +func (x *FluxCDStatus) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FluxCDStatus.ProtoReflect.Descriptor instead. +func (*FluxCDStatus) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{42} +} + +func (x *FluxCDStatus) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +func (x *FluxCDStatus) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *FluxCDStatus) GetManaged() bool { + if x != nil { + return x.Managed + } + return false +} + +func (x *FluxCDStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type AvailableFeatureSet struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Recommended bool `protobuf:"varint,4,opt,name=recommended,proto3" json:"recommended,omitempty"` + Features []*AvailableFeature `protobuf:"bytes,5,rep,name=features,proto3" json:"features,omitempty"` + RequiredFeatures []string `protobuf:"bytes,6,rep,name=required_features,json=requiredFeatures,proto3" json:"required_features,omitempty"` + Installed bool `protobuf:"varint,7,opt,name=installed,proto3" json:"installed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AvailableFeatureSet) Reset() { + *x = AvailableFeatureSet{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AvailableFeatureSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AvailableFeatureSet) ProtoMessage() {} + +func (x *AvailableFeatureSet) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AvailableFeatureSet.ProtoReflect.Descriptor instead. +func (*AvailableFeatureSet) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{43} +} + +func (x *AvailableFeatureSet) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AvailableFeatureSet) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AvailableFeatureSet) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *AvailableFeatureSet) GetRecommended() bool { + if x != nil { + return x.Recommended + } + return false +} + +func (x *AvailableFeatureSet) GetFeatures() []*AvailableFeature { + if x != nil { + return x.Features + } + return nil +} + +func (x *AvailableFeatureSet) GetRequiredFeatures() []string { + if x != nil { + return x.RequiredFeatures + } + return nil +} + +func (x *AvailableFeatureSet) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +type AvailableFeature struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Recommended bool `protobuf:"varint,4,opt,name=recommended,proto3" json:"recommended,omitempty"` + Installed bool `protobuf:"varint,5,opt,name=installed,proto3" json:"installed,omitempty"` + FeatureBlock string `protobuf:"bytes,6,opt,name=feature_block,json=featureBlock,proto3" json:"feature_block,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AvailableFeature) Reset() { + *x = AvailableFeature{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AvailableFeature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AvailableFeature) ProtoMessage() {} + +func (x *AvailableFeature) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AvailableFeature.ProtoReflect.Descriptor instead. +func (*AvailableFeature) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{44} +} + +func (x *AvailableFeature) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AvailableFeature) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *AvailableFeature) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *AvailableFeature) GetRecommended() bool { + if x != nil { + return x.Recommended + } + return false +} + +func (x *AvailableFeature) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +func (x *AvailableFeature) GetFeatureBlock() string { + if x != nil { + return x.FeatureBlock + } + return "" +} + +// ClusterAPIInfo is the Cluster API cluster a cluster is. +type ClusterAPIInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // provider is e.g. "capa", "capz" or "capg". + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + ClusterName string `protobuf:"bytes,3,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterAPIInfo) Reset() { + *x = ClusterAPIInfo{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterAPIInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterAPIInfo) ProtoMessage() {} + +func (x *ClusterAPIInfo) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterAPIInfo.ProtoReflect.Descriptor instead. +func (*ClusterAPIInfo) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{45} +} + +func (x *ClusterAPIInfo) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *ClusterAPIInfo) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ClusterAPIInfo) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +type ImportClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Names *ClusterNames `protobuf:"bytes,2,opt,name=names,proto3" json:"names,omitempty"` + Provider *ProviderOptions `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` + Components *ComponentOptions `protobuf:"bytes,4,opt,name=components,proto3" json:"components,omitempty"` + // offline_license is a PEM encoded license for an installation that cannot reach the licensor. + OfflineLicense string `protobuf:"bytes,5,opt,name=offline_license,json=offlineLicense,proto3" json:"offline_license,omitempty"` + Operation *OperationOptions `protobuf:"bytes,6,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImportClusterRequest) Reset() { + *x = ImportClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImportClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportClusterRequest) ProtoMessage() {} + +func (x *ImportClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportClusterRequest.ProtoReflect.Descriptor instead. +func (*ImportClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{46} +} + +func (x *ImportClusterRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ImportClusterRequest) GetNames() *ClusterNames { + if x != nil { + return x.Names + } + return nil +} + +func (x *ImportClusterRequest) GetProvider() *ProviderOptions { + if x != nil { + return x.Provider + } + return nil +} + +func (x *ImportClusterRequest) GetComponents() *ComponentOptions { + if x != nil { + return x.Components + } + return nil +} + +func (x *ImportClusterRequest) GetOfflineLicense() string { + if x != nil { + return x.OfflineLicense + } + return "" +} + +func (x *ImportClusterRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type ImportClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Operation *Operation `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImportClusterResponse) Reset() { + *x = ImportClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImportClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportClusterResponse) ProtoMessage() {} + +func (x *ImportClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportClusterResponse.ProtoReflect.Descriptor instead. +func (*ImportClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{47} +} + +func (x *ImportClusterResponse) GetCluster() *Cluster { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ImportClusterResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type ConnectClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // credential names the caller's cloud credential. + Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` + // kubeconfig reaches a generic cluster. + Kubeconfig string `protobuf:"bytes,3,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` + // reconnect renews the credentials the caller connected the cluster with. + Reconnect bool `protobuf:"varint,4,opt,name=reconnect,proto3" json:"reconnect,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConnectClusterRequest) Reset() { + *x = ConnectClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectClusterRequest) ProtoMessage() {} + +func (x *ConnectClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectClusterRequest.ProtoReflect.Descriptor instead. +func (*ConnectClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{48} +} + +func (x *ConnectClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ConnectClusterRequest) GetCredential() string { + if x != nil { + return x.Credential + } + return "" +} + +func (x *ConnectClusterRequest) GetKubeconfig() string { + if x != nil { + return x.Kubeconfig + } + return "" +} + +func (x *ConnectClusterRequest) GetReconnect() bool { + if x != nil { + return x.Reconnect + } + return false +} + +type ConnectClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConnectClusterResponse) Reset() { + *x = ConnectClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectClusterResponse) ProtoMessage() {} + +func (x *ConnectClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectClusterResponse.ProtoReflect.Descriptor instead. +func (*ConnectClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{49} +} + +func (x *ConnectClusterResponse) GetCluster() *Cluster { + if x != nil { + return x.Cluster + } + return nil +} + +type ReconfigureClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // hub_cluster_uid is the hub cluster to join, if the cluster is not a spoke yet. + HubClusterUid string `protobuf:"bytes,2,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + Components *ComponentOptions `protobuf:"bytes,3,opt,name=components,proto3" json:"components,omitempty"` + OfflineLicense string `protobuf:"bytes,4,opt,name=offline_license,json=offlineLicense,proto3" json:"offline_license,omitempty"` + Operation *OperationOptions `protobuf:"bytes,5,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReconfigureClusterRequest) Reset() { + *x = ReconfigureClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReconfigureClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconfigureClusterRequest) ProtoMessage() {} + +func (x *ReconfigureClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconfigureClusterRequest.ProtoReflect.Descriptor instead. +func (*ReconfigureClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{50} +} + +func (x *ReconfigureClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ReconfigureClusterRequest) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *ReconfigureClusterRequest) GetComponents() *ComponentOptions { + if x != nil { + return x.Components + } + return nil +} + +func (x *ReconfigureClusterRequest) GetOfflineLicense() string { + if x != nil { + return x.OfflineLicense + } + return "" +} + +func (x *ReconfigureClusterRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type ReconfigureClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReconfigureClusterResponse) Reset() { + *x = ReconfigureClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReconfigureClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconfigureClusterResponse) ProtoMessage() {} + +func (x *ReconfigureClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconfigureClusterResponse.ProtoReflect.Descriptor instead. +func (*ReconfigureClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{51} +} + +func (x *ReconfigureClusterResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type ConvertFeatureRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Feature string `protobuf:"bytes,2,opt,name=feature,proto3" json:"feature,omitempty"` + Operation *OperationOptions `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConvertFeatureRequest) Reset() { + *x = ConvertFeatureRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConvertFeatureRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConvertFeatureRequest) ProtoMessage() {} + +func (x *ConvertFeatureRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConvertFeatureRequest.ProtoReflect.Descriptor instead. +func (*ConvertFeatureRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{52} +} + +func (x *ConvertFeatureRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ConvertFeatureRequest) GetFeature() string { + if x != nil { + return x.Feature + } + return "" +} + +func (x *ConvertFeatureRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type ConvertFeatureResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConvertFeatureResponse) Reset() { + *x = ConvertFeatureResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConvertFeatureResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConvertFeatureResponse) ProtoMessage() {} + +func (x *ConvertFeatureResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConvertFeatureResponse.ProtoReflect.Descriptor instead. +func (*ConvertFeatureResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{53} +} + +func (x *ConvertFeatureResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type UpgradeKubernetesVersionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // version is e.g. "v1.30.4". + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Operation *OperationOptions `protobuf:"bytes,3,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpgradeKubernetesVersionRequest) Reset() { + *x = UpgradeKubernetesVersionRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpgradeKubernetesVersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpgradeKubernetesVersionRequest) ProtoMessage() {} + +func (x *UpgradeKubernetesVersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpgradeKubernetesVersionRequest.ProtoReflect.Descriptor instead. +func (*UpgradeKubernetesVersionRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{54} +} + +func (x *UpgradeKubernetesVersionRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpgradeKubernetesVersionRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *UpgradeKubernetesVersionRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type UpgradeKubernetesVersionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpgradeKubernetesVersionResponse) Reset() { + *x = UpgradeKubernetesVersionResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpgradeKubernetesVersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpgradeKubernetesVersionResponse) ProtoMessage() {} + +func (x *UpgradeKubernetesVersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpgradeKubernetesVersionResponse.ProtoReflect.Descriptor instead. +func (*UpgradeKubernetesVersionResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{55} +} + +func (x *UpgradeKubernetesVersionResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +type DeleteClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Operation *OperationOptions `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClusterRequest) Reset() { + *x = DeleteClusterRequest{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClusterRequest) ProtoMessage() {} + +func (x *DeleteClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClusterRequest.ProtoReflect.Descriptor instead. +func (*DeleteClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{56} +} + +func (x *DeleteClusterRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *DeleteClusterRequest) GetOperation() *OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type DeleteClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClusterResponse) Reset() { + *x = DeleteClusterResponse{} + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClusterResponse) ProtoMessage() {} + +func (x *DeleteClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_lifecycle_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClusterResponse.ProtoReflect.Descriptor instead. +func (*DeleteClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_lifecycle_proto_rawDescGZIP(), []int{57} +} + +func (x *DeleteClusterResponse) GetOperation() *Operation { + if x != nil { + return x.Operation + } + return nil +} + +var File_akp_cluster_v2_lifecycle_proto protoreflect.FileDescriptor + +const file_akp_cluster_v2_lifecycle_proto_rawDesc = "" + + "\n" + + "\x1eakp/cluster/v2/lifecycle.proto\x12\x0eakp.cluster.v2\x1a\x1cakp/cluster/v2/cluster.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd2\x02\n" + + "\tOperation\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x10\n" + + "\x03uid\x18\x02 \x01(\tR\x03uid\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\x12\x16\n" + + "\x06status\x18\x04 \x01(\tR\x06status\x12\x14\n" + + "\x05title\x18\x05 \x01(\tR\x05title\x12!\n" + + "\fcluster_name\x18\x06 \x01(\tR\vclusterName\x12\x1f\n" + + "\vresponse_id\x18\a \x01(\tR\n" + + "responseId\x12#\n" + + "\rerror_message\x18\b \x01(\tR\ferrorMessage\x12;\n" + + "\vcreate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\x12;\n" + + "\vupdate_time\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "updateTime\"K\n" + + "\x10OperationOptions\x12\x1f\n" + + "\vresponse_id\x18\x01 \x01(\tR\n" + + "responseId\x12\x16\n" + + "\x06silent\x18\x02 \x01(\bR\x06silent\"\xd1\x02\n" + + "\x10ComponentOptions\x12\x17\n" + + "\aflux_cd\x18\x01 \x01(\bR\x06fluxCd\x126\n" + + "\aargo_cd\x18\x02 \x01(\v2\x1d.akp.cluster.v2.ArgoCDOptionsR\x06argoCd\x12=\n" + + "\ffeature_sets\x18\x03 \x03(\v2\x1a.akp.cluster.v2.FeatureSetR\vfeatureSets\x12!\n" + + "\fall_features\x18\x04 \x01(\bR\vallFeatures\x12'\n" + + "\x0fcluster_profile\x18\x05 \x01(\tR\x0eclusterProfile\x126\n" + + "\x17monitoring_cluster_name\x18\x06 \x01(\tR\x15monitoringClusterName\x12)\n" + + "\x10spoke_components\x18\a \x01(\bR\x0fspokeComponents\"\xe6\x01\n" + + "\rArgoCDOptions\x12\x18\n" + + "\aenabled\x18\x01 \x01(\bR\aenabled\x124\n" + + "\x16principal_cluster_name\x18\x02 \x01(\tR\x14principalClusterName\x12>\n" + + "\fmanaged_argo\x18\x03 \x01(\v2\x1b.akp.cluster.v2.ManagedArgoR\vmanagedArgo\x12E\n" + + "\x0fin_cluster_argo\x18\x04 \x01(\v2\x1d.akp.cluster.v2.InClusterArgoR\rinClusterArgo\"\x8d\x01\n" + + "\vManagedArgo\x12/\n" + + "\x13existing_kubeconfig\x18\x01 \x01(\tR\x12existingKubeconfig\x12/\n" + + "\x14argo_cd_cluster_name\x18\x02 \x01(\tR\x11argoCdClusterName\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\"p\n" + + "\rInClusterArgo\x12)\n" + + "\x10deploy_principal\x18\x01 \x01(\bR\x0fdeployPrincipal\x124\n" + + "\x16principal_service_type\x18\x02 \x01(\tR\x14principalServiceType\"E\n" + + "\n" + + "FeatureSet\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x1a\n" + + "\bfeatures\x18\x02 \x03(\tR\bfeatures\"\xd6\x01\n" + + "\x14RemoveClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12@\n" + + "\n" + + "components\x18\x02 \x01(\v2 .akp.cluster.v2.ComponentOptionsR\n" + + "components\x12>\n" + + "\toperation\x18\x03 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"P\n" + + "\x15RemoveClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"T\n" + + "\x14ForgetClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"\x17\n" + + "\x15ForgetClusterResponse\"W\n" + + "\x17GetClusterStatusRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"\xf7\x01\n" + + "\x18GetClusterStatusResponse\x121\n" + + "\acluster\x18\x01 \x01(\v2\x17.akp.cluster.v2.ClusterR\acluster\x12(\n" + + "\x10cluster_set_name\x18\x02 \x01(\tR\x0eclusterSetName\x12=\n" + + "\x1bis_capi_cluster_upgradeable\x18\x03 \x01(\bR\x18isCapiClusterUpgradeable\x12?\n" + + "\vcluster_api\x18\x04 \x01(\v2\x1e.akp.cluster.v2.ClusterAPIInfoR\n" + + "clusterApi\"^\n" + + "\x1eListUpgradeableVersionsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"=\n" + + "\x1fListUpgradeableVersionsResponse\x12\x1a\n" + + "\bversions\x18\x01 \x03(\tR\bversions\":\n" + + "\x19ListArgoCDClustersRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\"W\n" + + "\x1aListArgoCDClustersResponse\x129\n" + + "\bclusters\x18\x01 \x03(\v2\x1d.akp.cluster.v2.ArgoCDClusterR\bclusters\"d\n" + + "\rArgoCDCluster\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\";\n" + + "\x13GetOperationRequest\x12$\n" + + "\x02id\x18\x01 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x02id\"O\n" + + "\x14GetOperationResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"2\n" + + "\x11GetHubInfoRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\"\xaa\x01\n" + + "\x12GetHubInfoResponse\x12@\n" + + "\x04hubs\x18\x01 \x03(\v2,.akp.cluster.v2.GetHubInfoResponse.HubsEntryR\x04hubs\x1aR\n" + + "\tHubsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12/\n" + + "\x05value\x18\x02 \x01(\v2\x19.akp.cluster.v2.HubAccessR\x05value:\x028\x01\"@\n" + + "\tHubAccess\x12\x1d\n" + + "\n" + + "api_server\x18\x01 \x01(\tR\tapiServer\x12\x14\n" + + "\x05token\x18\x02 \x01(\tR\x05token\"\x1b\n" + + "\x19ListAllHubClustersRequest\"L\n" + + "\x1aListAllHubClustersResponse\x12.\n" + + "\x04hubs\x18\x01 \x03(\v2\x1a.akp.cluster.v2.HubClusterR\x04hubs\"\xa3\x02\n" + + "\n" + + "HubCluster\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" + + "\n" + + "owner_name\x18\x02 \x01(\tR\townerName\x12!\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12\x10\n" + + "\x03uid\x18\x04 \x01(\tR\x03uid\x12\x1d\n" + + "\n" + + "node_count\x18\x05 \x01(\x05R\tnodeCount\x12\x1a\n" + + "\bprovider\x18\x06 \x01(\tR\bprovider\x12\x19\n" + + "\bhub_type\x18\a \x01(\tR\ahubType\x12\x1a\n" + + "\blocation\x18\b \x01(\tR\blocation\x12;\n" + + "\vcreate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\"\xa2\x02\n" + + "\x15VirtualClusterOptions\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x121\n" + + "\x10host_cluster_uid\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x0ehostClusterUid\x12G\n" + + "\x15host_cluster_owner_id\x18\x03 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x12hostClusterOwnerId\x12&\n" + + "\x0fhub_cluster_uid\x18\x04 \x01(\tR\rhubClusterUid\x12H\n" + + "\x14hub_cluster_owner_id\x18\x05 \x01(\tB\x17\xbaH\x14r\x122\x10^([1-9][0-9]*)?$R\x11hubClusterOwnerId\"\xc5\x01\n" + + "\x1bCreateVirtualClusterRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x12G\n" + + "\acluster\x18\x02 \x01(\v2%.akp.cluster.v2.VirtualClusterOptionsB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12>\n" + + "\toperation\x18\x03 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"W\n" + + "\x1cCreateVirtualClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"\xc5\x01\n" + + "\x1bImportVirtualClusterRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x12G\n" + + "\acluster\x18\x02 \x01(\v2%.akp.cluster.v2.VirtualClusterOptionsB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12>\n" + + "\toperation\x18\x03 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"W\n" + + "\x1cImportVirtualClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"~\n" + + "\x18ReconcileFeaturesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12$\n" + + "\bfeatures\x18\x02 \x03(\tB\b\xbaH\x05\x92\x01\x02\b\x01R\bfeatures\"\x1b\n" + + "\x19ReconcileFeaturesResponse\"o\n" + + "\x1bCheckSkipCredentialsRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12#\n" + + "\bprovider\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\bprovider\"{\n" + + "\x1cCheckSkipCredentialsResponse\x12)\n" + + "\x10skip_credentials\x18\x01 \x01(\bR\x0fskipCredentials\x12\x16\n" + + "\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"\x96\x01\n" + + "\fClusterNames\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12&\n" + + "\x0fhub_cluster_uid\x18\x03 \x01(\tR\rhubClusterUid\x12'\n" + + "\x0finfra_namespace\x18\x04 \x01(\tR\x0einfraNamespace\"\xdd\x02\n" + + "\x0fProviderOptions\x12R\n" + + "\x04name\x18\x01 \x01(\tB>\xbaH;r927^(?i)(gke|aks|eks|digitalocean|linode|rancher|generic)$R\x04name\x12\x1e\n" + + "\n" + + "credential\x18\x02 \x01(\tR\n" + + "credential\x12>\n" + + "\reks_auth_mode\x18\x03 \x01(\tB\x1a\xbaH\x17r\x15R\x00R\x04IRSAR\vPodIdentityR\veksAuthMode\x12\x1d\n" + + "\n" + + "cluster_id\x18\x04 \x01(\tR\tclusterId\x12\x18\n" + + "\aproject\x18\x05 \x01(\tR\aproject\x12\x16\n" + + "\x06region\x18\x06 \x01(\tR\x06region\x12%\n" + + "\x0eresource_group\x18\a \x01(\tR\rresourceGroup\x12\x1e\n" + + "\n" + + "kubeconfig\x18\b \x01(\tR\n" + + "kubeconfig\"\xad\x01\n" + + "\x13CheckClusterRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x122\n" + + "\x05names\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ClusterNamesR\x05names\x12C\n" + + "\bprovider\x18\x03 \x01(\v2\x1f.akp.cluster.v2.ProviderOptionsB\x06\xbaH\x03\xc8\x01\x01R\bprovider\"I\n" + + "\x14CheckClusterResponse\x121\n" + + "\acluster\x18\x01 \x01(\v2\x17.akp.cluster.v2.ClusterR\acluster\"\xd0\x01\n" + + "\x15ValidateImportRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x122\n" + + "\x05names\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ClusterNamesR\x05names\x12C\n" + + "\bprovider\x18\x03 \x01(\v2\x1f.akp.cluster.v2.ProviderOptionsB\x06\xbaH\x03\xc8\x01\x01R\bprovider\x12\x1f\n" + + "\vfor_connect\x18\x04 \x01(\bR\n" + + "forConnect\"\x91\x04\n" + + "\x16ValidateImportResponse\x12)\n" + + "\x10already_imported\x18\x01 \x01(\bR\x0falreadyImported\x12A\n" + + "\fdisplay_name\x18\x02 \x01(\v2\x1e.akp.cluster.v2.NameValidationR\vdisplayName\x122\n" + + "\x04name\x18\x03 \x01(\v2\x1e.akp.cluster.v2.NameValidationR\x04name\x12\x18\n" + + "\amessage\x18\x04 \x01(\tR\amessage\x12/\n" + + "\x13monitoring_clusters\x18\x05 \x03(\tR\x12monitoringClusters\x125\n" + + "\aflux_cd\x18\x06 \x01(\v2\x1c.akp.cluster.v2.FluxCDStatusR\x06fluxCd\x12F\n" + + "\ffeature_sets\x18\a \x03(\v2#.akp.cluster.v2.AvailableFeatureSetR\vfeatureSets\x12?\n" + + "\vcluster_api\x18\b \x01(\v2\x1e.akp.cluster.v2.ClusterAPIInfoR\n" + + "clusterApi\x12J\n" + + "\x10cluster_metadata\x18\t \x01(\v2\x1f.akp.cluster.v2.ClusterIdentityR\x0fclusterMetadata\">\n" + + "\x0eNameValidation\x12\x14\n" + + "\x05valid\x18\x01 \x01(\bR\x05valid\x12\x16\n" + + "\x06reason\x18\x02 \x01(\tR\x06reason\"v\n" + + "\fFluxCDStatus\x12\x1c\n" + + "\tinstalled\x18\x01 \x01(\bR\tinstalled\x12\x14\n" + + "\x05ready\x18\x02 \x01(\bR\x05ready\x12\x18\n" + + "\amanaged\x18\x03 \x01(\bR\amanaged\x12\x18\n" + + "\amessage\x18\x04 \x01(\tR\amessage\"\x8c\x02\n" + + "\x13AvailableFeatureSet\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12 \n" + + "\vrecommended\x18\x04 \x01(\bR\vrecommended\x12<\n" + + "\bfeatures\x18\x05 \x03(\v2 .akp.cluster.v2.AvailableFeatureR\bfeatures\x12+\n" + + "\x11required_features\x18\x06 \x03(\tR\x10requiredFeatures\x12\x1c\n" + + "\tinstalled\x18\a \x01(\bR\tinstalled\"\xc3\x01\n" + + "\x10AvailableFeature\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12 \n" + + "\vrecommended\x18\x04 \x01(\bR\vrecommended\x12\x1c\n" + + "\tinstalled\x18\x05 \x01(\bR\tinstalled\x12#\n" + + "\rfeature_block\x18\x06 \x01(\tR\ffeatureBlock\"m\n" + + "\x0eClusterAPIInfo\x12\x1a\n" + + "\bprovider\x18\x01 \x01(\tR\bprovider\x12\x1c\n" + + "\tnamespace\x18\x02 \x01(\tR\tnamespace\x12!\n" + + "\fcluster_name\x18\x03 \x01(\tR\vclusterName\"\xd9\x02\n" + + "\x14ImportClusterRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\x122\n" + + "\x05names\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ClusterNamesR\x05names\x12C\n" + + "\bprovider\x18\x03 \x01(\v2\x1f.akp.cluster.v2.ProviderOptionsB\x06\xbaH\x03\xc8\x01\x01R\bprovider\x12@\n" + + "\n" + + "components\x18\x04 \x01(\v2 .akp.cluster.v2.ComponentOptionsR\n" + + "components\x12'\n" + + "\x0foffline_license\x18\x05 \x01(\tR\x0eofflineLicense\x12>\n" + + "\toperation\x18\x06 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"\x83\x01\n" + + "\x15ImportClusterResponse\x121\n" + + "\acluster\x18\x01 \x01(\v2\x17.akp.cluster.v2.ClusterR\acluster\x127\n" + + "\toperation\x18\x02 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"\xb3\x01\n" + + "\x15ConnectClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x1e\n" + + "\n" + + "credential\x18\x02 \x01(\tR\n" + + "credential\x12\x1e\n" + + "\n" + + "kubeconfig\x18\x03 \x01(\tR\n" + + "kubeconfig\x12\x1c\n" + + "\treconnect\x18\x04 \x01(\bR\treconnect\"K\n" + + "\x16ConnectClusterResponse\x121\n" + + "\acluster\x18\x01 \x01(\v2\x17.akp.cluster.v2.ClusterR\acluster\"\xac\x02\n" + + "\x19ReconfigureClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12&\n" + + "\x0fhub_cluster_uid\x18\x02 \x01(\tR\rhubClusterUid\x12@\n" + + "\n" + + "components\x18\x03 \x01(\v2 .akp.cluster.v2.ComponentOptionsR\n" + + "components\x12'\n" + + "\x0foffline_license\x18\x04 \x01(\tR\x0eofflineLicense\x12>\n" + + "\toperation\x18\x05 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"U\n" + + "\x1aReconfigureClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"\xb8\x01\n" + + "\x15ConvertFeatureRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12!\n" + + "\afeature\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\afeature\x12>\n" + + "\toperation\x18\x03 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"Q\n" + + "\x16ConvertFeatureResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"\xdb\x01\n" + + "\x1fUpgradeKubernetesVersionRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12:\n" + + "\aversion\x18\x02 \x01(\tB \xbaH\x1dr\x1b2\x19^v?[0-9]+(\\.[0-9]+){1,2}$R\aversion\x12>\n" + + "\toperation\x18\x03 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"[\n" + + " UpgradeKubernetesVersionResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"\x94\x01\n" + + "\x14DeleteClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12>\n" + + "\toperation\x18\x02 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"P\n" + + "\x15DeleteClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation2\xbf\f\n" + + "\x10LifecycleService\x12^\n" + + "\rRemoveCluster\x12$.akp.cluster.v2.RemoveClusterRequest\x1a%.akp.cluster.v2.RemoveClusterResponse\"\x00\x12^\n" + + "\rForgetCluster\x12$.akp.cluster.v2.ForgetClusterRequest\x1a%.akp.cluster.v2.ForgetClusterResponse\"\x00\x12g\n" + + "\x10GetClusterStatus\x12'.akp.cluster.v2.GetClusterStatusRequest\x1a(.akp.cluster.v2.GetClusterStatusResponse\"\x00\x12|\n" + + "\x17ListUpgradeableVersions\x12..akp.cluster.v2.ListUpgradeableVersionsRequest\x1a/.akp.cluster.v2.ListUpgradeableVersionsResponse\"\x00\x12m\n" + + "\x12ListArgoCDClusters\x12).akp.cluster.v2.ListArgoCDClustersRequest\x1a*.akp.cluster.v2.ListArgoCDClustersResponse\"\x00\x12j\n" + + "\x11ReconcileFeatures\x12(.akp.cluster.v2.ReconcileFeaturesRequest\x1a).akp.cluster.v2.ReconcileFeaturesResponse\"\x00\x12s\n" + + "\x14CheckSkipCredentials\x12+.akp.cluster.v2.CheckSkipCredentialsRequest\x1a,.akp.cluster.v2.CheckSkipCredentialsResponse\"\x00\x12[\n" + + "\fCheckCluster\x12#.akp.cluster.v2.CheckClusterRequest\x1a$.akp.cluster.v2.CheckClusterResponse\"\x00\x12a\n" + + "\x0eValidateImport\x12%.akp.cluster.v2.ValidateImportRequest\x1a&.akp.cluster.v2.ValidateImportResponse\"\x00\x12^\n" + + "\rImportCluster\x12$.akp.cluster.v2.ImportClusterRequest\x1a%.akp.cluster.v2.ImportClusterResponse\"\x00\x12a\n" + + "\x0eConnectCluster\x12%.akp.cluster.v2.ConnectClusterRequest\x1a&.akp.cluster.v2.ConnectClusterResponse\"\x00\x12m\n" + + "\x12ReconfigureCluster\x12).akp.cluster.v2.ReconfigureClusterRequest\x1a*.akp.cluster.v2.ReconfigureClusterResponse\"\x00\x12a\n" + + "\x0eConvertFeature\x12%.akp.cluster.v2.ConvertFeatureRequest\x1a&.akp.cluster.v2.ConvertFeatureResponse\"\x00\x12\x7f\n" + + "\x18UpgradeKubernetesVersion\x12/.akp.cluster.v2.UpgradeKubernetesVersionRequest\x1a0.akp.cluster.v2.UpgradeKubernetesVersionResponse\"\x00\x12^\n" + + "\rDeleteCluster\x12$.akp.cluster.v2.DeleteClusterRequest\x1a%.akp.cluster.v2.DeleteClusterResponse\"\x002o\n" + + "\x10OperationService\x12[\n" + + "\fGetOperation\x12#.akp.cluster.v2.GetOperationRequest\x1a$.akp.cluster.v2.GetOperationResponse\"\x002\xd2\x01\n" + + "\n" + + "HubService\x12U\n" + + "\n" + + "GetHubInfo\x12!.akp.cluster.v2.GetHubInfoRequest\x1a\".akp.cluster.v2.GetHubInfoResponse\"\x00\x12m\n" + + "\x12ListAllHubClusters\x12).akp.cluster.v2.ListAllHubClustersRequest\x1a*.akp.cluster.v2.ListAllHubClustersResponse\"\x002\x81\x02\n" + + "\x15VirtualClusterService\x12s\n" + + "\x14CreateVirtualCluster\x12+.akp.cluster.v2.CreateVirtualClusterRequest\x1a,.akp.cluster.v2.CreateVirtualClusterResponse\"\x00\x12s\n" + + "\x14ImportVirtualCluster\x12+.akp.cluster.v2.ImportVirtualClusterRequest\x1a,.akp.cluster.v2.ImportVirtualClusterResponse\"\x00B\xbb\x01\n" + + "\x12com.akp.cluster.v2B\x0eLifecycleProtoP\x01Z;go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2;clusterv2\xa2\x02\x03ACX\xaa\x02\x0eAkp.Cluster.V2\xca\x02\x0eAkp\\Cluster\\V2\xe2\x02\x1aAkp\\Cluster\\V2\\GPBMetadata\xea\x02\x10Akp::Cluster::V2b\x06proto3" + +var ( + file_akp_cluster_v2_lifecycle_proto_rawDescOnce sync.Once + file_akp_cluster_v2_lifecycle_proto_rawDescData []byte +) + +func file_akp_cluster_v2_lifecycle_proto_rawDescGZIP() []byte { + file_akp_cluster_v2_lifecycle_proto_rawDescOnce.Do(func() { + file_akp_cluster_v2_lifecycle_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_lifecycle_proto_rawDesc), len(file_akp_cluster_v2_lifecycle_proto_rawDesc))) + }) + return file_akp_cluster_v2_lifecycle_proto_rawDescData +} + +var file_akp_cluster_v2_lifecycle_proto_msgTypes = make([]protoimpl.MessageInfo, 59) +var file_akp_cluster_v2_lifecycle_proto_goTypes = []any{ + (*Operation)(nil), // 0: akp.cluster.v2.Operation + (*OperationOptions)(nil), // 1: akp.cluster.v2.OperationOptions + (*ComponentOptions)(nil), // 2: akp.cluster.v2.ComponentOptions + (*ArgoCDOptions)(nil), // 3: akp.cluster.v2.ArgoCDOptions + (*ManagedArgo)(nil), // 4: akp.cluster.v2.ManagedArgo + (*InClusterArgo)(nil), // 5: akp.cluster.v2.InClusterArgo + (*FeatureSet)(nil), // 6: akp.cluster.v2.FeatureSet + (*RemoveClusterRequest)(nil), // 7: akp.cluster.v2.RemoveClusterRequest + (*RemoveClusterResponse)(nil), // 8: akp.cluster.v2.RemoveClusterResponse + (*ForgetClusterRequest)(nil), // 9: akp.cluster.v2.ForgetClusterRequest + (*ForgetClusterResponse)(nil), // 10: akp.cluster.v2.ForgetClusterResponse + (*GetClusterStatusRequest)(nil), // 11: akp.cluster.v2.GetClusterStatusRequest + (*GetClusterStatusResponse)(nil), // 12: akp.cluster.v2.GetClusterStatusResponse + (*ListUpgradeableVersionsRequest)(nil), // 13: akp.cluster.v2.ListUpgradeableVersionsRequest + (*ListUpgradeableVersionsResponse)(nil), // 14: akp.cluster.v2.ListUpgradeableVersionsResponse + (*ListArgoCDClustersRequest)(nil), // 15: akp.cluster.v2.ListArgoCDClustersRequest + (*ListArgoCDClustersResponse)(nil), // 16: akp.cluster.v2.ListArgoCDClustersResponse + (*ArgoCDCluster)(nil), // 17: akp.cluster.v2.ArgoCDCluster + (*GetOperationRequest)(nil), // 18: akp.cluster.v2.GetOperationRequest + (*GetOperationResponse)(nil), // 19: akp.cluster.v2.GetOperationResponse + (*GetHubInfoRequest)(nil), // 20: akp.cluster.v2.GetHubInfoRequest + (*GetHubInfoResponse)(nil), // 21: akp.cluster.v2.GetHubInfoResponse + (*HubAccess)(nil), // 22: akp.cluster.v2.HubAccess + (*ListAllHubClustersRequest)(nil), // 23: akp.cluster.v2.ListAllHubClustersRequest + (*ListAllHubClustersResponse)(nil), // 24: akp.cluster.v2.ListAllHubClustersResponse + (*HubCluster)(nil), // 25: akp.cluster.v2.HubCluster + (*VirtualClusterOptions)(nil), // 26: akp.cluster.v2.VirtualClusterOptions + (*CreateVirtualClusterRequest)(nil), // 27: akp.cluster.v2.CreateVirtualClusterRequest + (*CreateVirtualClusterResponse)(nil), // 28: akp.cluster.v2.CreateVirtualClusterResponse + (*ImportVirtualClusterRequest)(nil), // 29: akp.cluster.v2.ImportVirtualClusterRequest + (*ImportVirtualClusterResponse)(nil), // 30: akp.cluster.v2.ImportVirtualClusterResponse + (*ReconcileFeaturesRequest)(nil), // 31: akp.cluster.v2.ReconcileFeaturesRequest + (*ReconcileFeaturesResponse)(nil), // 32: akp.cluster.v2.ReconcileFeaturesResponse + (*CheckSkipCredentialsRequest)(nil), // 33: akp.cluster.v2.CheckSkipCredentialsRequest + (*CheckSkipCredentialsResponse)(nil), // 34: akp.cluster.v2.CheckSkipCredentialsResponse + (*ClusterNames)(nil), // 35: akp.cluster.v2.ClusterNames + (*ProviderOptions)(nil), // 36: akp.cluster.v2.ProviderOptions + (*CheckClusterRequest)(nil), // 37: akp.cluster.v2.CheckClusterRequest + (*CheckClusterResponse)(nil), // 38: akp.cluster.v2.CheckClusterResponse + (*ValidateImportRequest)(nil), // 39: akp.cluster.v2.ValidateImportRequest + (*ValidateImportResponse)(nil), // 40: akp.cluster.v2.ValidateImportResponse + (*NameValidation)(nil), // 41: akp.cluster.v2.NameValidation + (*FluxCDStatus)(nil), // 42: akp.cluster.v2.FluxCDStatus + (*AvailableFeatureSet)(nil), // 43: akp.cluster.v2.AvailableFeatureSet + (*AvailableFeature)(nil), // 44: akp.cluster.v2.AvailableFeature + (*ClusterAPIInfo)(nil), // 45: akp.cluster.v2.ClusterAPIInfo + (*ImportClusterRequest)(nil), // 46: akp.cluster.v2.ImportClusterRequest + (*ImportClusterResponse)(nil), // 47: akp.cluster.v2.ImportClusterResponse + (*ConnectClusterRequest)(nil), // 48: akp.cluster.v2.ConnectClusterRequest + (*ConnectClusterResponse)(nil), // 49: akp.cluster.v2.ConnectClusterResponse + (*ReconfigureClusterRequest)(nil), // 50: akp.cluster.v2.ReconfigureClusterRequest + (*ReconfigureClusterResponse)(nil), // 51: akp.cluster.v2.ReconfigureClusterResponse + (*ConvertFeatureRequest)(nil), // 52: akp.cluster.v2.ConvertFeatureRequest + (*ConvertFeatureResponse)(nil), // 53: akp.cluster.v2.ConvertFeatureResponse + (*UpgradeKubernetesVersionRequest)(nil), // 54: akp.cluster.v2.UpgradeKubernetesVersionRequest + (*UpgradeKubernetesVersionResponse)(nil), // 55: akp.cluster.v2.UpgradeKubernetesVersionResponse + (*DeleteClusterRequest)(nil), // 56: akp.cluster.v2.DeleteClusterRequest + (*DeleteClusterResponse)(nil), // 57: akp.cluster.v2.DeleteClusterResponse + nil, // 58: akp.cluster.v2.GetHubInfoResponse.HubsEntry + (*timestamppb.Timestamp)(nil), // 59: google.protobuf.Timestamp + (*ClusterRef)(nil), // 60: akp.cluster.v2.ClusterRef + (*Cluster)(nil), // 61: akp.cluster.v2.Cluster + (*ClusterIdentity)(nil), // 62: akp.cluster.v2.ClusterIdentity +} +var file_akp_cluster_v2_lifecycle_proto_depIdxs = []int32{ + 59, // 0: akp.cluster.v2.Operation.create_time:type_name -> google.protobuf.Timestamp + 59, // 1: akp.cluster.v2.Operation.update_time:type_name -> google.protobuf.Timestamp + 3, // 2: akp.cluster.v2.ComponentOptions.argo_cd:type_name -> akp.cluster.v2.ArgoCDOptions + 6, // 3: akp.cluster.v2.ComponentOptions.feature_sets:type_name -> akp.cluster.v2.FeatureSet + 4, // 4: akp.cluster.v2.ArgoCDOptions.managed_argo:type_name -> akp.cluster.v2.ManagedArgo + 5, // 5: akp.cluster.v2.ArgoCDOptions.in_cluster_argo:type_name -> akp.cluster.v2.InClusterArgo + 60, // 6: akp.cluster.v2.RemoveClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 2, // 7: akp.cluster.v2.RemoveClusterRequest.components:type_name -> akp.cluster.v2.ComponentOptions + 1, // 8: akp.cluster.v2.RemoveClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 9: akp.cluster.v2.RemoveClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 60, // 10: akp.cluster.v2.ForgetClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 60, // 11: akp.cluster.v2.GetClusterStatusRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 61, // 12: akp.cluster.v2.GetClusterStatusResponse.cluster:type_name -> akp.cluster.v2.Cluster + 45, // 13: akp.cluster.v2.GetClusterStatusResponse.cluster_api:type_name -> akp.cluster.v2.ClusterAPIInfo + 60, // 14: akp.cluster.v2.ListUpgradeableVersionsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 17, // 15: akp.cluster.v2.ListArgoCDClustersResponse.clusters:type_name -> akp.cluster.v2.ArgoCDCluster + 0, // 16: akp.cluster.v2.GetOperationResponse.operation:type_name -> akp.cluster.v2.Operation + 58, // 17: akp.cluster.v2.GetHubInfoResponse.hubs:type_name -> akp.cluster.v2.GetHubInfoResponse.HubsEntry + 25, // 18: akp.cluster.v2.ListAllHubClustersResponse.hubs:type_name -> akp.cluster.v2.HubCluster + 59, // 19: akp.cluster.v2.HubCluster.create_time:type_name -> google.protobuf.Timestamp + 26, // 20: akp.cluster.v2.CreateVirtualClusterRequest.cluster:type_name -> akp.cluster.v2.VirtualClusterOptions + 1, // 21: akp.cluster.v2.CreateVirtualClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 22: akp.cluster.v2.CreateVirtualClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 26, // 23: akp.cluster.v2.ImportVirtualClusterRequest.cluster:type_name -> akp.cluster.v2.VirtualClusterOptions + 1, // 24: akp.cluster.v2.ImportVirtualClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 25: akp.cluster.v2.ImportVirtualClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 60, // 26: akp.cluster.v2.ReconcileFeaturesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 35, // 27: akp.cluster.v2.CheckClusterRequest.names:type_name -> akp.cluster.v2.ClusterNames + 36, // 28: akp.cluster.v2.CheckClusterRequest.provider:type_name -> akp.cluster.v2.ProviderOptions + 61, // 29: akp.cluster.v2.CheckClusterResponse.cluster:type_name -> akp.cluster.v2.Cluster + 35, // 30: akp.cluster.v2.ValidateImportRequest.names:type_name -> akp.cluster.v2.ClusterNames + 36, // 31: akp.cluster.v2.ValidateImportRequest.provider:type_name -> akp.cluster.v2.ProviderOptions + 41, // 32: akp.cluster.v2.ValidateImportResponse.display_name:type_name -> akp.cluster.v2.NameValidation + 41, // 33: akp.cluster.v2.ValidateImportResponse.name:type_name -> akp.cluster.v2.NameValidation + 42, // 34: akp.cluster.v2.ValidateImportResponse.flux_cd:type_name -> akp.cluster.v2.FluxCDStatus + 43, // 35: akp.cluster.v2.ValidateImportResponse.feature_sets:type_name -> akp.cluster.v2.AvailableFeatureSet + 45, // 36: akp.cluster.v2.ValidateImportResponse.cluster_api:type_name -> akp.cluster.v2.ClusterAPIInfo + 62, // 37: akp.cluster.v2.ValidateImportResponse.cluster_metadata:type_name -> akp.cluster.v2.ClusterIdentity + 44, // 38: akp.cluster.v2.AvailableFeatureSet.features:type_name -> akp.cluster.v2.AvailableFeature + 35, // 39: akp.cluster.v2.ImportClusterRequest.names:type_name -> akp.cluster.v2.ClusterNames + 36, // 40: akp.cluster.v2.ImportClusterRequest.provider:type_name -> akp.cluster.v2.ProviderOptions + 2, // 41: akp.cluster.v2.ImportClusterRequest.components:type_name -> akp.cluster.v2.ComponentOptions + 1, // 42: akp.cluster.v2.ImportClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 61, // 43: akp.cluster.v2.ImportClusterResponse.cluster:type_name -> akp.cluster.v2.Cluster + 0, // 44: akp.cluster.v2.ImportClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 60, // 45: akp.cluster.v2.ConnectClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 61, // 46: akp.cluster.v2.ConnectClusterResponse.cluster:type_name -> akp.cluster.v2.Cluster + 60, // 47: akp.cluster.v2.ReconfigureClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 2, // 48: akp.cluster.v2.ReconfigureClusterRequest.components:type_name -> akp.cluster.v2.ComponentOptions + 1, // 49: akp.cluster.v2.ReconfigureClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 50: akp.cluster.v2.ReconfigureClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 60, // 51: akp.cluster.v2.ConvertFeatureRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 52: akp.cluster.v2.ConvertFeatureRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 53: akp.cluster.v2.ConvertFeatureResponse.operation:type_name -> akp.cluster.v2.Operation + 60, // 54: akp.cluster.v2.UpgradeKubernetesVersionRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 55: akp.cluster.v2.UpgradeKubernetesVersionRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 56: akp.cluster.v2.UpgradeKubernetesVersionResponse.operation:type_name -> akp.cluster.v2.Operation + 60, // 57: akp.cluster.v2.DeleteClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 58: akp.cluster.v2.DeleteClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 0, // 59: akp.cluster.v2.DeleteClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 22, // 60: akp.cluster.v2.GetHubInfoResponse.HubsEntry.value:type_name -> akp.cluster.v2.HubAccess + 7, // 61: akp.cluster.v2.LifecycleService.RemoveCluster:input_type -> akp.cluster.v2.RemoveClusterRequest + 9, // 62: akp.cluster.v2.LifecycleService.ForgetCluster:input_type -> akp.cluster.v2.ForgetClusterRequest + 11, // 63: akp.cluster.v2.LifecycleService.GetClusterStatus:input_type -> akp.cluster.v2.GetClusterStatusRequest + 13, // 64: akp.cluster.v2.LifecycleService.ListUpgradeableVersions:input_type -> akp.cluster.v2.ListUpgradeableVersionsRequest + 15, // 65: akp.cluster.v2.LifecycleService.ListArgoCDClusters:input_type -> akp.cluster.v2.ListArgoCDClustersRequest + 31, // 66: akp.cluster.v2.LifecycleService.ReconcileFeatures:input_type -> akp.cluster.v2.ReconcileFeaturesRequest + 33, // 67: akp.cluster.v2.LifecycleService.CheckSkipCredentials:input_type -> akp.cluster.v2.CheckSkipCredentialsRequest + 37, // 68: akp.cluster.v2.LifecycleService.CheckCluster:input_type -> akp.cluster.v2.CheckClusterRequest + 39, // 69: akp.cluster.v2.LifecycleService.ValidateImport:input_type -> akp.cluster.v2.ValidateImportRequest + 46, // 70: akp.cluster.v2.LifecycleService.ImportCluster:input_type -> akp.cluster.v2.ImportClusterRequest + 48, // 71: akp.cluster.v2.LifecycleService.ConnectCluster:input_type -> akp.cluster.v2.ConnectClusterRequest + 50, // 72: akp.cluster.v2.LifecycleService.ReconfigureCluster:input_type -> akp.cluster.v2.ReconfigureClusterRequest + 52, // 73: akp.cluster.v2.LifecycleService.ConvertFeature:input_type -> akp.cluster.v2.ConvertFeatureRequest + 54, // 74: akp.cluster.v2.LifecycleService.UpgradeKubernetesVersion:input_type -> akp.cluster.v2.UpgradeKubernetesVersionRequest + 56, // 75: akp.cluster.v2.LifecycleService.DeleteCluster:input_type -> akp.cluster.v2.DeleteClusterRequest + 18, // 76: akp.cluster.v2.OperationService.GetOperation:input_type -> akp.cluster.v2.GetOperationRequest + 20, // 77: akp.cluster.v2.HubService.GetHubInfo:input_type -> akp.cluster.v2.GetHubInfoRequest + 23, // 78: akp.cluster.v2.HubService.ListAllHubClusters:input_type -> akp.cluster.v2.ListAllHubClustersRequest + 27, // 79: akp.cluster.v2.VirtualClusterService.CreateVirtualCluster:input_type -> akp.cluster.v2.CreateVirtualClusterRequest + 29, // 80: akp.cluster.v2.VirtualClusterService.ImportVirtualCluster:input_type -> akp.cluster.v2.ImportVirtualClusterRequest + 8, // 81: akp.cluster.v2.LifecycleService.RemoveCluster:output_type -> akp.cluster.v2.RemoveClusterResponse + 10, // 82: akp.cluster.v2.LifecycleService.ForgetCluster:output_type -> akp.cluster.v2.ForgetClusterResponse + 12, // 83: akp.cluster.v2.LifecycleService.GetClusterStatus:output_type -> akp.cluster.v2.GetClusterStatusResponse + 14, // 84: akp.cluster.v2.LifecycleService.ListUpgradeableVersions:output_type -> akp.cluster.v2.ListUpgradeableVersionsResponse + 16, // 85: akp.cluster.v2.LifecycleService.ListArgoCDClusters:output_type -> akp.cluster.v2.ListArgoCDClustersResponse + 32, // 86: akp.cluster.v2.LifecycleService.ReconcileFeatures:output_type -> akp.cluster.v2.ReconcileFeaturesResponse + 34, // 87: akp.cluster.v2.LifecycleService.CheckSkipCredentials:output_type -> akp.cluster.v2.CheckSkipCredentialsResponse + 38, // 88: akp.cluster.v2.LifecycleService.CheckCluster:output_type -> akp.cluster.v2.CheckClusterResponse + 40, // 89: akp.cluster.v2.LifecycleService.ValidateImport:output_type -> akp.cluster.v2.ValidateImportResponse + 47, // 90: akp.cluster.v2.LifecycleService.ImportCluster:output_type -> akp.cluster.v2.ImportClusterResponse + 49, // 91: akp.cluster.v2.LifecycleService.ConnectCluster:output_type -> akp.cluster.v2.ConnectClusterResponse + 51, // 92: akp.cluster.v2.LifecycleService.ReconfigureCluster:output_type -> akp.cluster.v2.ReconfigureClusterResponse + 53, // 93: akp.cluster.v2.LifecycleService.ConvertFeature:output_type -> akp.cluster.v2.ConvertFeatureResponse + 55, // 94: akp.cluster.v2.LifecycleService.UpgradeKubernetesVersion:output_type -> akp.cluster.v2.UpgradeKubernetesVersionResponse + 57, // 95: akp.cluster.v2.LifecycleService.DeleteCluster:output_type -> akp.cluster.v2.DeleteClusterResponse + 19, // 96: akp.cluster.v2.OperationService.GetOperation:output_type -> akp.cluster.v2.GetOperationResponse + 21, // 97: akp.cluster.v2.HubService.GetHubInfo:output_type -> akp.cluster.v2.GetHubInfoResponse + 24, // 98: akp.cluster.v2.HubService.ListAllHubClusters:output_type -> akp.cluster.v2.ListAllHubClustersResponse + 28, // 99: akp.cluster.v2.VirtualClusterService.CreateVirtualCluster:output_type -> akp.cluster.v2.CreateVirtualClusterResponse + 30, // 100: akp.cluster.v2.VirtualClusterService.ImportVirtualCluster:output_type -> akp.cluster.v2.ImportVirtualClusterResponse + 81, // [81:101] is the sub-list for method output_type + 61, // [61:81] is the sub-list for method input_type + 61, // [61:61] is the sub-list for extension type_name + 61, // [61:61] is the sub-list for extension extendee + 0, // [0:61] is the sub-list for field type_name +} + +func init() { file_akp_cluster_v2_lifecycle_proto_init() } +func file_akp_cluster_v2_lifecycle_proto_init() { + if File_akp_cluster_v2_lifecycle_proto != nil { + return + } + file_akp_cluster_v2_cluster_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_lifecycle_proto_rawDesc), len(file_akp_cluster_v2_lifecycle_proto_rawDesc)), + NumEnums: 0, + NumMessages: 59, + NumExtensions: 0, + NumServices: 4, + }, + GoTypes: file_akp_cluster_v2_lifecycle_proto_goTypes, + DependencyIndexes: file_akp_cluster_v2_lifecycle_proto_depIdxs, + MessageInfos: file_akp_cluster_v2_lifecycle_proto_msgTypes, + }.Build() + File_akp_cluster_v2_lifecycle_proto = out.File + file_akp_cluster_v2_lifecycle_proto_goTypes = nil + file_akp_cluster_v2_lifecycle_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/platform.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/platform.pb.go new file mode 100644 index 000000000..2bb65ca89 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/platform.pb.go @@ -0,0 +1,290 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/cluster/v2/platform.proto + +package clusterv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UpdateSpokePresetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // preset is the feature's name. + Preset string `protobuf:"bytes,2,opt,name=preset,proto3" json:"preset,omitempty"` + Values *structpb.Struct `protobuf:"bytes,3,opt,name=values,proto3" json:"values,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateSpokePresetRequest) Reset() { + *x = UpdateSpokePresetRequest{} + mi := &file_akp_cluster_v2_platform_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateSpokePresetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateSpokePresetRequest) ProtoMessage() {} + +func (x *UpdateSpokePresetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_platform_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateSpokePresetRequest.ProtoReflect.Descriptor instead. +func (*UpdateSpokePresetRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_platform_proto_rawDescGZIP(), []int{0} +} + +func (x *UpdateSpokePresetRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpdateSpokePresetRequest) GetPreset() string { + if x != nil { + return x.Preset + } + return "" +} + +func (x *UpdateSpokePresetRequest) GetValues() *structpb.Struct { + if x != nil { + return x.Values + } + return nil +} + +type UpdateSpokePresetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateSpokePresetResponse) Reset() { + *x = UpdateSpokePresetResponse{} + mi := &file_akp_cluster_v2_platform_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateSpokePresetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateSpokePresetResponse) ProtoMessage() {} + +func (x *UpdateSpokePresetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_platform_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateSpokePresetResponse.ProtoReflect.Descriptor instead. +func (*UpdateSpokePresetResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_platform_proto_rawDescGZIP(), []int{1} +} + +type ListClusterProfilesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClusterProfilesRequest) Reset() { + *x = ListClusterProfilesRequest{} + mi := &file_akp_cluster_v2_platform_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClusterProfilesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClusterProfilesRequest) ProtoMessage() {} + +func (x *ListClusterProfilesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_platform_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClusterProfilesRequest.ProtoReflect.Descriptor instead. +func (*ListClusterProfilesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_platform_proto_rawDescGZIP(), []int{2} +} + +type ListClusterProfilesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // profiles are meta.k8s.appscode.com ClusterProfile objects. + Profiles []*structpb.Struct `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClusterProfilesResponse) Reset() { + *x = ListClusterProfilesResponse{} + mi := &file_akp_cluster_v2_platform_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClusterProfilesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClusterProfilesResponse) ProtoMessage() {} + +func (x *ListClusterProfilesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_platform_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClusterProfilesResponse.ProtoReflect.Descriptor instead. +func (*ListClusterProfilesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_platform_proto_rawDescGZIP(), []int{3} +} + +func (x *ListClusterProfilesResponse) GetProfiles() []*structpb.Struct { + if x != nil { + return x.Profiles + } + return nil +} + +var File_akp_cluster_v2_platform_proto protoreflect.FileDescriptor + +const file_akp_cluster_v2_platform_proto_rawDesc = "" + + "\n" + + "\x1dakp/cluster/v2/platform.proto\x12\x0eakp.cluster.v2\x1a\x1cakp/cluster/v2/cluster.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xaa\x01\n" + + "\x18UpdateSpokePresetRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x1f\n" + + "\x06preset\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x06preset\x12/\n" + + "\x06values\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x06values\"\x1b\n" + + "\x19UpdateSpokePresetResponse\"\x1c\n" + + "\x1aListClusterProfilesRequest\"R\n" + + "\x1bListClusterProfilesResponse\x123\n" + + "\bprofiles\x18\x01 \x03(\v2\x17.google.protobuf.StructR\bprofiles2{\n" + + "\rPresetService\x12j\n" + + "\x11UpdateSpokePreset\x12(.akp.cluster.v2.UpdateSpokePresetRequest\x1a).akp.cluster.v2.UpdateSpokePresetResponse\"\x002\x82\x01\n" + + "\x0eProfileService\x12p\n" + + "\x13ListClusterProfiles\x12*.akp.cluster.v2.ListClusterProfilesRequest\x1a+.akp.cluster.v2.ListClusterProfilesResponse\"\x00B\xba\x01\n" + + "\x12com.akp.cluster.v2B\rPlatformProtoP\x01Z;go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2;clusterv2\xa2\x02\x03ACX\xaa\x02\x0eAkp.Cluster.V2\xca\x02\x0eAkp\\Cluster\\V2\xe2\x02\x1aAkp\\Cluster\\V2\\GPBMetadata\xea\x02\x10Akp::Cluster::V2b\x06proto3" + +var ( + file_akp_cluster_v2_platform_proto_rawDescOnce sync.Once + file_akp_cluster_v2_platform_proto_rawDescData []byte +) + +func file_akp_cluster_v2_platform_proto_rawDescGZIP() []byte { + file_akp_cluster_v2_platform_proto_rawDescOnce.Do(func() { + file_akp_cluster_v2_platform_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_platform_proto_rawDesc), len(file_akp_cluster_v2_platform_proto_rawDesc))) + }) + return file_akp_cluster_v2_platform_proto_rawDescData +} + +var file_akp_cluster_v2_platform_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_akp_cluster_v2_platform_proto_goTypes = []any{ + (*UpdateSpokePresetRequest)(nil), // 0: akp.cluster.v2.UpdateSpokePresetRequest + (*UpdateSpokePresetResponse)(nil), // 1: akp.cluster.v2.UpdateSpokePresetResponse + (*ListClusterProfilesRequest)(nil), // 2: akp.cluster.v2.ListClusterProfilesRequest + (*ListClusterProfilesResponse)(nil), // 3: akp.cluster.v2.ListClusterProfilesResponse + (*ClusterRef)(nil), // 4: akp.cluster.v2.ClusterRef + (*structpb.Struct)(nil), // 5: google.protobuf.Struct +} +var file_akp_cluster_v2_platform_proto_depIdxs = []int32{ + 4, // 0: akp.cluster.v2.UpdateSpokePresetRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 5, // 1: akp.cluster.v2.UpdateSpokePresetRequest.values:type_name -> google.protobuf.Struct + 5, // 2: akp.cluster.v2.ListClusterProfilesResponse.profiles:type_name -> google.protobuf.Struct + 0, // 3: akp.cluster.v2.PresetService.UpdateSpokePreset:input_type -> akp.cluster.v2.UpdateSpokePresetRequest + 2, // 4: akp.cluster.v2.ProfileService.ListClusterProfiles:input_type -> akp.cluster.v2.ListClusterProfilesRequest + 1, // 5: akp.cluster.v2.PresetService.UpdateSpokePreset:output_type -> akp.cluster.v2.UpdateSpokePresetResponse + 3, // 6: akp.cluster.v2.ProfileService.ListClusterProfiles:output_type -> akp.cluster.v2.ListClusterProfilesResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_akp_cluster_v2_platform_proto_init() } +func file_akp_cluster_v2_platform_proto_init() { + if File_akp_cluster_v2_platform_proto != nil { + return + } + file_akp_cluster_v2_cluster_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_platform_proto_rawDesc), len(file_akp_cluster_v2_platform_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_akp_cluster_v2_platform_proto_goTypes, + DependencyIndexes: file_akp_cluster_v2_platform_proto_depIdxs, + MessageInfos: file_akp_cluster_v2_platform_proto_msgTypes, + }.Build() + File_akp_cluster_v2_platform_proto = out.File + file_akp_cluster_v2_platform_proto_goTypes = nil + file_akp_cluster_v2_platform_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/resource.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/resource.pb.go new file mode 100644 index 000000000..d9303faf1 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/resource.pb.go @@ -0,0 +1,4535 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/cluster/v2/resource.proto + +package clusterv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PatchType is how a patch is read. +type PatchType int32 + +const ( + PatchType_PATCH_TYPE_UNSPECIFIED PatchType = 0 + // A JSON patch (RFC 6902). + PatchType_PATCH_TYPE_JSON PatchType = 1 + // A JSON merge patch (RFC 7386). + PatchType_PATCH_TYPE_MERGE PatchType = 2 + // A Kubernetes strategic merge patch. + PatchType_PATCH_TYPE_STRATEGIC_MERGE PatchType = 3 + // The whole object as it should be: AKP sends the JSON patch from the current object to it, + // leaving the resource version alone. + PatchType_PATCH_TYPE_OBJECT PatchType = 4 +) + +// Enum value maps for PatchType. +var ( + PatchType_name = map[int32]string{ + 0: "PATCH_TYPE_UNSPECIFIED", + 1: "PATCH_TYPE_JSON", + 2: "PATCH_TYPE_MERGE", + 3: "PATCH_TYPE_STRATEGIC_MERGE", + 4: "PATCH_TYPE_OBJECT", + } + PatchType_value = map[string]int32{ + "PATCH_TYPE_UNSPECIFIED": 0, + "PATCH_TYPE_JSON": 1, + "PATCH_TYPE_MERGE": 2, + "PATCH_TYPE_STRATEGIC_MERGE": 3, + "PATCH_TYPE_OBJECT": 4, + } +) + +func (x PatchType) Enum() *PatchType { + p := new(PatchType) + *p = x + return p +} + +func (x PatchType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PatchType) Descriptor() protoreflect.EnumDescriptor { + return file_akp_cluster_v2_resource_proto_enumTypes[0].Descriptor() +} + +func (PatchType) Type() protoreflect.EnumType { + return &file_akp_cluster_v2_resource_proto_enumTypes[0] +} + +func (x PatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PatchType.Descriptor instead. +func (PatchType) EnumDescriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{0} +} + +// ResourceType names a Kubernetes resource. +type ResourceType struct { + state protoimpl.MessageState `protogen:"open.v1"` + // group is the API group; empty or "core" is the core group. + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // resource is the resource's plural name, e.g. "deployments". + Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResourceType) Reset() { + *x = ResourceType{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceType) ProtoMessage() {} + +func (x *ResourceType) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceType.ProtoReflect.Descriptor instead. +func (*ResourceType) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{0} +} + +func (x *ResourceType) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *ResourceType) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ResourceType) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +// ResourceKey names an object. +type ResourceKey struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type *ResourceType `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // namespace is empty for a cluster-scoped object. + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResourceKey) Reset() { + *x = ResourceKey{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceKey) ProtoMessage() {} + +func (x *ResourceKey) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceKey.ProtoReflect.Descriptor instead. +func (*ResourceKey) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{1} +} + +func (x *ResourceKey) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *ResourceKey) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ResourceKey) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// View is what a read answers instead of the object, if anything. +type View struct { + state protoimpl.MessageState `protogen:"open.v1"` + // filter keeps the fields of the answer it names: an object whose keys are the fields to keep, + // true for the whole field or an object (or a list of one) to filter it further. It wins over + // table. + Filter *structpb.Struct `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` + // table answers a meta.k8s.io/v1 Table of the object or list. + Table bool `protobuf:"varint,2,opt,name=table,proto3" json:"table,omitempty"` + // table_definition is the ResourceTableDefinition of the table; empty is the resource's own. + TableDefinition string `protobuf:"bytes,3,opt,name=table_definition,json=tableDefinition,proto3" json:"table_definition,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *View) Reset() { + *x = View{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *View) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*View) ProtoMessage() {} + +func (x *View) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use View.ProtoReflect.Descriptor instead. +func (*View) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{2} +} + +func (x *View) GetFilter() *structpb.Struct { + if x != nil { + return x.Filter + } + return nil +} + +func (x *View) GetTable() bool { + if x != nil { + return x.Table + } + return false +} + +func (x *View) GetTableDefinition() string { + if x != nil { + return x.TableDefinition + } + return "" +} + +// ListOptions are Kubernetes' list options. +type ListOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + LabelSelector string `protobuf:"bytes,1,opt,name=label_selector,json=labelSelector,proto3" json:"label_selector,omitempty"` + FieldSelector string `protobuf:"bytes,2,opt,name=field_selector,json=fieldSelector,proto3" json:"field_selector,omitempty"` + Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + // continue is the token of the next page, from the previous page. + Continue string `protobuf:"bytes,4,opt,name=continue,proto3" json:"continue,omitempty"` + ResourceVersion string `protobuf:"bytes,5,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` + ResourceVersionMatch string `protobuf:"bytes,6,opt,name=resource_version_match,json=resourceVersionMatch,proto3" json:"resource_version_match,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListOptions) Reset() { + *x = ListOptions{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListOptions) ProtoMessage() {} + +func (x *ListOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. +func (*ListOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{3} +} + +func (x *ListOptions) GetLabelSelector() string { + if x != nil { + return x.LabelSelector + } + return "" +} + +func (x *ListOptions) GetFieldSelector() string { + if x != nil { + return x.FieldSelector + } + return "" +} + +func (x *ListOptions) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListOptions) GetContinue() string { + if x != nil { + return x.Continue + } + return "" +} + +func (x *ListOptions) GetResourceVersion() string { + if x != nil { + return x.ResourceVersion + } + return "" +} + +func (x *ListOptions) GetResourceVersionMatch() string { + if x != nil { + return x.ResourceVersionMatch + } + return "" +} + +// WriteOptions are Kubernetes' create and update options. +type WriteOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + // dry_run is ["All"] to validate without persisting. + DryRun []string `protobuf:"bytes,1,rep,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` + FieldManager string `protobuf:"bytes,2,opt,name=field_manager,json=fieldManager,proto3" json:"field_manager,omitempty"` + // field_validation is "Ignore", "Warn" or "Strict". + FieldValidation string `protobuf:"bytes,3,opt,name=field_validation,json=fieldValidation,proto3" json:"field_validation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WriteOptions) Reset() { + *x = WriteOptions{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteOptions) ProtoMessage() {} + +func (x *WriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteOptions.ProtoReflect.Descriptor instead. +func (*WriteOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{4} +} + +func (x *WriteOptions) GetDryRun() []string { + if x != nil { + return x.DryRun + } + return nil +} + +func (x *WriteOptions) GetFieldManager() string { + if x != nil { + return x.FieldManager + } + return "" +} + +func (x *WriteOptions) GetFieldValidation() string { + if x != nil { + return x.FieldValidation + } + return "" +} + +// PatchOptions are Kubernetes' patch options. +type PatchOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + DryRun []string `protobuf:"bytes,1,rep,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` + FieldManager string `protobuf:"bytes,2,opt,name=field_manager,json=fieldManager,proto3" json:"field_manager,omitempty"` + FieldValidation string `protobuf:"bytes,3,opt,name=field_validation,json=fieldValidation,proto3" json:"field_validation,omitempty"` + Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchOptions) Reset() { + *x = PatchOptions{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchOptions) ProtoMessage() {} + +func (x *PatchOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchOptions.ProtoReflect.Descriptor instead. +func (*PatchOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{5} +} + +func (x *PatchOptions) GetDryRun() []string { + if x != nil { + return x.DryRun + } + return nil +} + +func (x *PatchOptions) GetFieldManager() string { + if x != nil { + return x.FieldManager + } + return "" +} + +func (x *PatchOptions) GetFieldValidation() string { + if x != nil { + return x.FieldValidation + } + return "" +} + +func (x *PatchOptions) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +// DeleteOptions are Kubernetes' delete options. +type DeleteOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + GracePeriodSeconds *int64 `protobuf:"varint,1,opt,name=grace_period_seconds,json=gracePeriodSeconds,proto3,oneof" json:"grace_period_seconds,omitempty"` + // propagation_policy is "Orphan", "Background" or "Foreground". + PropagationPolicy string `protobuf:"bytes,2,opt,name=propagation_policy,json=propagationPolicy,proto3" json:"propagation_policy,omitempty"` + DryRun []string `protobuf:"bytes,3,rep,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"` + // The object is deleted only if it still has this UID and resource version, where given. + PreconditionUid string `protobuf:"bytes,4,opt,name=precondition_uid,json=preconditionUid,proto3" json:"precondition_uid,omitempty"` + PreconditionResourceVersion string `protobuf:"bytes,5,opt,name=precondition_resource_version,json=preconditionResourceVersion,proto3" json:"precondition_resource_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteOptions) Reset() { + *x = DeleteOptions{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOptions) ProtoMessage() {} + +func (x *DeleteOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteOptions.ProtoReflect.Descriptor instead. +func (*DeleteOptions) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteOptions) GetGracePeriodSeconds() int64 { + if x != nil && x.GracePeriodSeconds != nil { + return *x.GracePeriodSeconds + } + return 0 +} + +func (x *DeleteOptions) GetPropagationPolicy() string { + if x != nil { + return x.PropagationPolicy + } + return "" +} + +func (x *DeleteOptions) GetDryRun() []string { + if x != nil { + return x.DryRun + } + return nil +} + +func (x *DeleteOptions) GetPreconditionUid() string { + if x != nil { + return x.PreconditionUid + } + return "" +} + +func (x *DeleteOptions) GetPreconditionResourceVersion() string { + if x != nil { + return x.PreconditionResourceVersion + } + return "" +} + +type GetResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // namespace is empty for a cluster-scoped resource. + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // resource_version reads the object at a version, as Kubernetes' get options. + ResourceVersion string `protobuf:"bytes,5,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` + View *View `protobuf:"bytes,6,opt,name=view,proto3" json:"view,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResourceRequest) Reset() { + *x = GetResourceRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResourceRequest) ProtoMessage() {} + +func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResourceRequest.ProtoReflect.Descriptor instead. +func (*GetResourceRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{7} +} + +func (x *GetResourceRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetResourceRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *GetResourceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *GetResourceRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetResourceRequest) GetResourceVersion() string { + if x != nil { + return x.ResourceVersion + } + return "" +} + +func (x *GetResourceRequest) GetView() *View { + if x != nil { + return x.View + } + return nil +} + +type GetResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // object is the JSON of the object, or of its view. + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResourceResponse) Reset() { + *x = GetResourceResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResourceResponse) ProtoMessage() {} + +func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResourceResponse.ProtoReflect.Descriptor instead. +func (*GetResourceResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{8} +} + +func (x *GetResourceResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type ListResourcesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // namespace is empty for every namespace, or a cluster-scoped resource. + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Options *ListOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` + View *View `protobuf:"bytes,5,opt,name=view,proto3" json:"view,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResourcesRequest) Reset() { + *x = ListResourcesRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListResourcesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResourcesRequest) ProtoMessage() {} + +func (x *ListResourcesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResourcesRequest.ProtoReflect.Descriptor instead. +func (*ListResourcesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{9} +} + +func (x *ListResourcesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ListResourcesRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *ListResourcesRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListResourcesRequest) GetOptions() *ListOptions { + if x != nil { + return x.Options + } + return nil +} + +func (x *ListResourcesRequest) GetView() *View { + if x != nil { + return x.View + } + return nil +} + +type ListResourcesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // list is the JSON of the list, or of its view. + List []byte `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResourcesResponse) Reset() { + *x = ListResourcesResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListResourcesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResourcesResponse) ProtoMessage() {} + +func (x *ListResourcesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResourcesResponse.ProtoReflect.Descriptor instead. +func (*ListResourcesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{10} +} + +func (x *ListResourcesResponse) GetList() []byte { + if x != nil { + return x.List + } + return nil +} + +type CreateResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + // object is the JSON of the object. + Object []byte `protobuf:"bytes,4,opt,name=object,proto3" json:"object,omitempty"` + Options *WriteOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResourceRequest) Reset() { + *x = CreateResourceRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResourceRequest) ProtoMessage() {} + +func (x *CreateResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResourceRequest.ProtoReflect.Descriptor instead. +func (*CreateResourceRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{11} +} + +func (x *CreateResourceRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *CreateResourceRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *CreateResourceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *CreateResourceRequest) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +func (x *CreateResourceRequest) GetOptions() *WriteOptions { + if x != nil { + return x.Options + } + return nil +} + +type CreateResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResourceResponse) Reset() { + *x = CreateResourceResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResourceResponse) ProtoMessage() {} + +func (x *CreateResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResourceResponse.ProtoReflect.Descriptor instead. +func (*CreateResourceResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{12} +} + +func (x *CreateResourceResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type UpdateResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // object is the JSON of the object, which names it as name does. + Object []byte `protobuf:"bytes,5,opt,name=object,proto3" json:"object,omitempty"` + Options *WriteOptions `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateResourceRequest) Reset() { + *x = UpdateResourceRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateResourceRequest) ProtoMessage() {} + +func (x *UpdateResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateResourceRequest.ProtoReflect.Descriptor instead. +func (*UpdateResourceRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdateResourceRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpdateResourceRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *UpdateResourceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *UpdateResourceRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateResourceRequest) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +func (x *UpdateResourceRequest) GetOptions() *WriteOptions { + if x != nil { + return x.Options + } + return nil +} + +type UpdateResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateResourceResponse) Reset() { + *x = UpdateResourceResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateResourceResponse) ProtoMessage() {} + +func (x *UpdateResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateResourceResponse.ProtoReflect.Descriptor instead. +func (*UpdateResourceResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{14} +} + +func (x *UpdateResourceResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type PatchResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + PatchType PatchType `protobuf:"varint,5,opt,name=patch_type,json=patchType,proto3,enum=akp.cluster.v2.PatchType" json:"patch_type,omitempty"` + // patch is the JSON of the patch. + Patch []byte `protobuf:"bytes,6,opt,name=patch,proto3" json:"patch,omitempty"` + Options *PatchOptions `protobuf:"bytes,7,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResourceRequest) Reset() { + *x = PatchResourceRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchResourceRequest) ProtoMessage() {} + +func (x *PatchResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchResourceRequest.ProtoReflect.Descriptor instead. +func (*PatchResourceRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{15} +} + +func (x *PatchResourceRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *PatchResourceRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *PatchResourceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *PatchResourceRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PatchResourceRequest) GetPatchType() PatchType { + if x != nil { + return x.PatchType + } + return PatchType_PATCH_TYPE_UNSPECIFIED +} + +func (x *PatchResourceRequest) GetPatch() []byte { + if x != nil { + return x.Patch + } + return nil +} + +func (x *PatchResourceRequest) GetOptions() *PatchOptions { + if x != nil { + return x.Options + } + return nil +} + +type PatchResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResourceResponse) Reset() { + *x = PatchResourceResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchResourceResponse) ProtoMessage() {} + +func (x *PatchResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchResourceResponse.ProtoReflect.Descriptor instead. +func (*PatchResourceResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{16} +} + +func (x *PatchResourceResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type PatchResourceStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + PatchType PatchType `protobuf:"varint,5,opt,name=patch_type,json=patchType,proto3,enum=akp.cluster.v2.PatchType" json:"patch_type,omitempty"` + Patch []byte `protobuf:"bytes,6,opt,name=patch,proto3" json:"patch,omitempty"` + Options *PatchOptions `protobuf:"bytes,7,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResourceStatusRequest) Reset() { + *x = PatchResourceStatusRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchResourceStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchResourceStatusRequest) ProtoMessage() {} + +func (x *PatchResourceStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchResourceStatusRequest.ProtoReflect.Descriptor instead. +func (*PatchResourceStatusRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{17} +} + +func (x *PatchResourceStatusRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *PatchResourceStatusRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *PatchResourceStatusRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *PatchResourceStatusRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PatchResourceStatusRequest) GetPatchType() PatchType { + if x != nil { + return x.PatchType + } + return PatchType_PATCH_TYPE_UNSPECIFIED +} + +func (x *PatchResourceStatusRequest) GetPatch() []byte { + if x != nil { + return x.Patch + } + return nil +} + +func (x *PatchResourceStatusRequest) GetOptions() *PatchOptions { + if x != nil { + return x.Options + } + return nil +} + +type PatchResourceStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PatchResourceStatusResponse) Reset() { + *x = PatchResourceStatusResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchResourceStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchResourceStatusResponse) ProtoMessage() {} + +func (x *PatchResourceStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchResourceStatusResponse.ProtoReflect.Descriptor instead. +func (*PatchResourceStatusResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{18} +} + +func (x *PatchResourceStatusResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type DeleteResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Options *DeleteOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResourceRequest) Reset() { + *x = DeleteResourceRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResourceRequest) ProtoMessage() {} + +func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead. +func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{19} +} + +func (x *DeleteResourceRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *DeleteResourceRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *DeleteResourceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *DeleteResourceRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeleteResourceRequest) GetOptions() *DeleteOptions { + if x != nil { + return x.Options + } + return nil +} + +type DeleteResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResourceResponse) Reset() { + *x = DeleteResourceResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResourceResponse) ProtoMessage() {} + +func (x *DeleteResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResourceResponse.ProtoReflect.Descriptor instead. +func (*DeleteResourceResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{20} +} + +type DeleteResourcesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Options *DeleteOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` + // selector selects the objects to delete; without one, every object is. + Selector *ListOptions `protobuf:"bytes,5,opt,name=selector,proto3" json:"selector,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResourcesRequest) Reset() { + *x = DeleteResourcesRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteResourcesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResourcesRequest) ProtoMessage() {} + +func (x *DeleteResourcesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResourcesRequest.ProtoReflect.Descriptor instead. +func (*DeleteResourcesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{21} +} + +func (x *DeleteResourcesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *DeleteResourcesRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *DeleteResourcesRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *DeleteResourcesRequest) GetOptions() *DeleteOptions { + if x != nil { + return x.Options + } + return nil +} + +func (x *DeleteResourcesRequest) GetSelector() *ListOptions { + if x != nil { + return x.Selector + } + return nil +} + +type DeleteResourcesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResourcesResponse) Reset() { + *x = DeleteResourcesResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteResourcesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResourcesResponse) ProtoMessage() {} + +func (x *DeleteResourcesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResourcesResponse.ProtoReflect.Descriptor instead. +func (*DeleteResourcesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{22} +} + +type BatchDeleteResourcesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Resources []*ResourceKey `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BatchDeleteResourcesRequest) Reset() { + *x = BatchDeleteResourcesRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BatchDeleteResourcesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchDeleteResourcesRequest) ProtoMessage() {} + +func (x *BatchDeleteResourcesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchDeleteResourcesRequest.ProtoReflect.Descriptor instead. +func (*BatchDeleteResourcesRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{23} +} + +func (x *BatchDeleteResourcesRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *BatchDeleteResourcesRequest) GetResources() []*ResourceKey { + if x != nil { + return x.Resources + } + return nil +} + +type BatchDeleteResourcesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // failures are the objects that were not deleted, and why. + Failures []*ResourceDeleteFailure `protobuf:"bytes,1,rep,name=failures,proto3" json:"failures,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BatchDeleteResourcesResponse) Reset() { + *x = BatchDeleteResourcesResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BatchDeleteResourcesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchDeleteResourcesResponse) ProtoMessage() {} + +func (x *BatchDeleteResourcesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchDeleteResourcesResponse.ProtoReflect.Descriptor instead. +func (*BatchDeleteResourcesResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{24} +} + +func (x *BatchDeleteResourcesResponse) GetFailures() []*ResourceDeleteFailure { + if x != nil { + return x.Failures + } + return nil +} + +type ResourceDeleteFailure struct { + state protoimpl.MessageState `protogen:"open.v1"` + Resource *ResourceKey `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + // code is the HTTP status of the cluster's answer, 500 if it gave none. + Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResourceDeleteFailure) Reset() { + *x = ResourceDeleteFailure{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceDeleteFailure) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceDeleteFailure) ProtoMessage() {} + +func (x *ResourceDeleteFailure) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceDeleteFailure.ProtoReflect.Descriptor instead. +func (*ResourceDeleteFailure) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{25} +} + +func (x *ResourceDeleteFailure) GetResource() *ResourceKey { + if x != nil { + return x.Resource + } + return nil +} + +func (x *ResourceDeleteFailure) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ResourceDeleteFailure) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *ResourceDeleteFailure) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ListResourceEventsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // options page the events; their selectors are the object's. + Options *ListOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"` + // filter is as View's. + Filter *structpb.Struct `protobuf:"bytes,6,opt,name=filter,proto3" json:"filter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResourceEventsRequest) Reset() { + *x = ListResourceEventsRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListResourceEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResourceEventsRequest) ProtoMessage() {} + +func (x *ListResourceEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResourceEventsRequest.ProtoReflect.Descriptor instead. +func (*ListResourceEventsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{26} +} + +func (x *ListResourceEventsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ListResourceEventsRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *ListResourceEventsRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListResourceEventsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListResourceEventsRequest) GetOptions() *ListOptions { + if x != nil { + return x.Options + } + return nil +} + +func (x *ListResourceEventsRequest) GetFilter() *structpb.Struct { + if x != nil { + return x.Filter + } + return nil +} + +type ListResourceEventsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // list is the JSON of the event list, or of its filter. + List []byte `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResourceEventsResponse) Reset() { + *x = ListResourceEventsResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListResourceEventsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResourceEventsResponse) ProtoMessage() {} + +func (x *ListResourceEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResourceEventsResponse.ProtoReflect.Descriptor instead. +func (*ListResourceEventsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{27} +} + +func (x *ListResourceEventsResponse) GetList() []byte { + if x != nil { + return x.List + } + return nil +} + +type GetResourceControllerRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResourceControllerRequest) Reset() { + *x = GetResourceControllerRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResourceControllerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResourceControllerRequest) ProtoMessage() {} + +func (x *GetResourceControllerRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResourceControllerRequest.ProtoReflect.Descriptor instead. +func (*GetResourceControllerRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{28} +} + +func (x *GetResourceControllerRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetResourceControllerRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *GetResourceControllerRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *GetResourceControllerRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetResourceControllerResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResourceControllerResponse) Reset() { + *x = GetResourceControllerResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResourceControllerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResourceControllerResponse) ProtoMessage() {} + +func (x *GetResourceControllerResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResourceControllerResponse.ProtoReflect.Descriptor instead. +func (*GetResourceControllerResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{29} +} + +func (x *GetResourceControllerResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type GetScaleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetScaleRequest) Reset() { + *x = GetScaleRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetScaleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetScaleRequest) ProtoMessage() {} + +func (x *GetScaleRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetScaleRequest.ProtoReflect.Descriptor instead. +func (*GetScaleRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{30} +} + +func (x *GetScaleRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetScaleRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *GetScaleRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *GetScaleRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetScaleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // scale is the JSON of the autoscaling/v1 Scale. + Scale []byte `protobuf:"bytes,1,opt,name=scale,proto3" json:"scale,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetScaleResponse) Reset() { + *x = GetScaleResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetScaleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetScaleResponse) ProtoMessage() {} + +func (x *GetScaleResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetScaleResponse.ProtoReflect.Descriptor instead. +func (*GetScaleResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{31} +} + +func (x *GetScaleResponse) GetScale() []byte { + if x != nil { + return x.Scale + } + return nil +} + +type UpdateScaleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Replicas int32 `protobuf:"varint,5,opt,name=replicas,proto3" json:"replicas,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateScaleRequest) Reset() { + *x = UpdateScaleRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateScaleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateScaleRequest) ProtoMessage() {} + +func (x *UpdateScaleRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateScaleRequest.ProtoReflect.Descriptor instead. +func (*UpdateScaleRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{32} +} + +func (x *UpdateScaleRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpdateScaleRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *UpdateScaleRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *UpdateScaleRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateScaleRequest) GetReplicas() int32 { + if x != nil { + return x.Replicas + } + return 0 +} + +type UpdateScaleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Scale []byte `protobuf:"bytes,1,opt,name=scale,proto3" json:"scale,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateScaleResponse) Reset() { + *x = UpdateScaleResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateScaleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateScaleResponse) ProtoMessage() {} + +func (x *UpdateScaleResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateScaleResponse.ProtoReflect.Descriptor instead. +func (*UpdateScaleResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{33} +} + +func (x *UpdateScaleResponse) GetScale() []byte { + if x != nil { + return x.Scale + } + return nil +} + +type ListHorizontalPodAutoscalersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // resource is the plural resource name of the scaled object, e.g. "deployments". + Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Options *ListOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListHorizontalPodAutoscalersRequest) Reset() { + *x = ListHorizontalPodAutoscalersRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListHorizontalPodAutoscalersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHorizontalPodAutoscalersRequest) ProtoMessage() {} + +func (x *ListHorizontalPodAutoscalersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListHorizontalPodAutoscalersRequest.ProtoReflect.Descriptor instead. +func (*ListHorizontalPodAutoscalersRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{34} +} + +func (x *ListHorizontalPodAutoscalersRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ListHorizontalPodAutoscalersRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *ListHorizontalPodAutoscalersRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ListHorizontalPodAutoscalersRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ListHorizontalPodAutoscalersRequest) GetOptions() *ListOptions { + if x != nil { + return x.Options + } + return nil +} + +type ListHorizontalPodAutoscalersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // list is the JSON of the autoscaling/v1 HorizontalPodAutoscalerList. + List []byte `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListHorizontalPodAutoscalersResponse) Reset() { + *x = ListHorizontalPodAutoscalersResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListHorizontalPodAutoscalersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHorizontalPodAutoscalersResponse) ProtoMessage() {} + +func (x *ListHorizontalPodAutoscalersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListHorizontalPodAutoscalersResponse.ProtoReflect.Descriptor instead. +func (*ListHorizontalPodAutoscalersResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{35} +} + +func (x *ListHorizontalPodAutoscalersResponse) GetList() []byte { + if x != nil { + return x.List + } + return nil +} + +type ListGroupVersionObjectsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // group is the API group; empty or "core" is the core group. + Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupVersionObjectsRequest) Reset() { + *x = ListGroupVersionObjectsRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupVersionObjectsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupVersionObjectsRequest) ProtoMessage() {} + +func (x *ListGroupVersionObjectsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupVersionObjectsRequest.ProtoReflect.Descriptor instead. +func (*ListGroupVersionObjectsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{36} +} + +func (x *ListGroupVersionObjectsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ListGroupVersionObjectsRequest) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *ListGroupVersionObjectsRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type ListGroupVersionObjectsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // objects are the object names of each kind. + Objects map[string]*ObjectNames `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupVersionObjectsResponse) Reset() { + *x = ListGroupVersionObjectsResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupVersionObjectsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupVersionObjectsResponse) ProtoMessage() {} + +func (x *ListGroupVersionObjectsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupVersionObjectsResponse.ProtoReflect.Descriptor instead. +func (*ListGroupVersionObjectsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{37} +} + +func (x *ListGroupVersionObjectsResponse) GetObjects() map[string]*ObjectNames { + if x != nil { + return x.Objects + } + return nil +} + +type ObjectNames struct { + state protoimpl.MessageState `protogen:"open.v1"` + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObjectNames) Reset() { + *x = ObjectNames{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ObjectNames) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectNames) ProtoMessage() {} + +func (x *ObjectNames) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectNames.ProtoReflect.Descriptor instead. +func (*ObjectNames) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{38} +} + +func (x *ObjectNames) GetNames() []string { + if x != nil { + return x.Names + } + return nil +} + +type GetNodeMetricsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNodeMetricsRequest) Reset() { + *x = GetNodeMetricsRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNodeMetricsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNodeMetricsRequest) ProtoMessage() {} + +func (x *GetNodeMetricsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNodeMetricsRequest.ProtoReflect.Descriptor instead. +func (*GetNodeMetricsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{39} +} + +func (x *GetNodeMetricsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetNodeMetricsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetNodeMetricsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // resources are by resource name, e.g. "cpu" or "memory". + Resources map[string]*NodeResourceMetrics `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNodeMetricsResponse) Reset() { + *x = GetNodeMetricsResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNodeMetricsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNodeMetricsResponse) ProtoMessage() {} + +func (x *GetNodeMetricsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNodeMetricsResponse.ProtoReflect.Descriptor instead. +func (*GetNodeMetricsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{40} +} + +func (x *GetNodeMetricsResponse) GetResources() map[string]*NodeResourceMetrics { + if x != nil { + return x.Resources + } + return nil +} + +// NodeResourceMetrics is one resource of a node: CPU in millicores ("250m"), memory in MiB +// ("512Mi"), anything else as a count. usage_percent is of allocatable, e.g. "12.50". +type NodeResourceMetrics struct { + state protoimpl.MessageState `protogen:"open.v1"` + Capacity string `protobuf:"bytes,1,opt,name=capacity,proto3" json:"capacity,omitempty"` + Allocatable string `protobuf:"bytes,2,opt,name=allocatable,proto3" json:"allocatable,omitempty"` + Usage string `protobuf:"bytes,3,opt,name=usage,proto3" json:"usage,omitempty"` + UsagePercent string `protobuf:"bytes,4,opt,name=usage_percent,json=usagePercent,proto3" json:"usage_percent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NodeResourceMetrics) Reset() { + *x = NodeResourceMetrics{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NodeResourceMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeResourceMetrics) ProtoMessage() {} + +func (x *NodeResourceMetrics) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeResourceMetrics.ProtoReflect.Descriptor instead. +func (*NodeResourceMetrics) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{41} +} + +func (x *NodeResourceMetrics) GetCapacity() string { + if x != nil { + return x.Capacity + } + return "" +} + +func (x *NodeResourceMetrics) GetAllocatable() string { + if x != nil { + return x.Allocatable + } + return "" +} + +func (x *NodeResourceMetrics) GetUsage() string { + if x != nil { + return x.Usage + } + return "" +} + +func (x *NodeResourceMetrics) GetUsagePercent() string { + if x != nil { + return x.UsagePercent + } + return "" +} + +type GetPodMetricsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPodMetricsRequest) Reset() { + *x = GetPodMetricsRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPodMetricsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPodMetricsRequest) ProtoMessage() {} + +func (x *GetPodMetricsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPodMetricsRequest.ProtoReflect.Descriptor instead. +func (*GetPodMetricsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{42} +} + +func (x *GetPodMetricsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetPodMetricsRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *GetPodMetricsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetPodMetricsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // containers are by name. + Containers []*ContainerMetrics `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` + // resources are the pod's totals, by resource name. + Resources map[string]*ContainerResourceMetrics `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPodMetricsResponse) Reset() { + *x = GetPodMetricsResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPodMetricsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPodMetricsResponse) ProtoMessage() {} + +func (x *GetPodMetricsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPodMetricsResponse.ProtoReflect.Descriptor instead. +func (*GetPodMetricsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{43} +} + +func (x *GetPodMetricsResponse) GetContainers() []*ContainerMetrics { + if x != nil { + return x.Containers + } + return nil +} + +func (x *GetPodMetricsResponse) GetResources() map[string]*ContainerResourceMetrics { + if x != nil { + return x.Resources + } + return nil +} + +type ContainerMetrics struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Resources map[string]*ContainerResourceMetrics `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContainerMetrics) Reset() { + *x = ContainerMetrics{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContainerMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerMetrics) ProtoMessage() {} + +func (x *ContainerMetrics) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerMetrics.ProtoReflect.Descriptor instead. +func (*ContainerMetrics) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{44} +} + +func (x *ContainerMetrics) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ContainerMetrics) GetResources() map[string]*ContainerResourceMetrics { + if x != nil { + return x.Resources + } + return nil +} + +// ContainerResourceMetrics is one resource of a container, in NodeResourceMetrics' units. +// usage_percent is of limits. +type ContainerResourceMetrics struct { + state protoimpl.MessageState `protogen:"open.v1"` + Requests string `protobuf:"bytes,1,opt,name=requests,proto3" json:"requests,omitempty"` + Limits string `protobuf:"bytes,2,opt,name=limits,proto3" json:"limits,omitempty"` + Usage string `protobuf:"bytes,3,opt,name=usage,proto3" json:"usage,omitempty"` + UsagePercent string `protobuf:"bytes,4,opt,name=usage_percent,json=usagePercent,proto3" json:"usage_percent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContainerResourceMetrics) Reset() { + *x = ContainerResourceMetrics{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContainerResourceMetrics) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerResourceMetrics) ProtoMessage() {} + +func (x *ContainerResourceMetrics) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerResourceMetrics.ProtoReflect.Descriptor instead. +func (*ContainerResourceMetrics) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{45} +} + +func (x *ContainerResourceMetrics) GetRequests() string { + if x != nil { + return x.Requests + } + return "" +} + +func (x *ContainerResourceMetrics) GetLimits() string { + if x != nil { + return x.Limits + } + return "" +} + +func (x *ContainerResourceMetrics) GetUsage() string { + if x != nil { + return x.Usage + } + return "" +} + +func (x *ContainerResourceMetrics) GetUsagePercent() string { + if x != nil { + return x.UsagePercent + } + return "" +} + +type CreateSelfSubjectAccessReviewsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // reviews are the JSON of authorization.k8s.io/v1 SelfSubjectAccessReviews. + Reviews [][]byte `protobuf:"bytes,2,rep,name=reviews,proto3" json:"reviews,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateSelfSubjectAccessReviewsRequest) Reset() { + *x = CreateSelfSubjectAccessReviewsRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateSelfSubjectAccessReviewsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSelfSubjectAccessReviewsRequest) ProtoMessage() {} + +func (x *CreateSelfSubjectAccessReviewsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSelfSubjectAccessReviewsRequest.ProtoReflect.Descriptor instead. +func (*CreateSelfSubjectAccessReviewsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{46} +} + +func (x *CreateSelfSubjectAccessReviewsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *CreateSelfSubjectAccessReviewsRequest) GetReviews() [][]byte { + if x != nil { + return x.Reviews + } + return nil +} + +type CreateSelfSubjectAccessReviewsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // reviews are the answered reviews, in the request's order. + Reviews [][]byte `protobuf:"bytes,1,rep,name=reviews,proto3" json:"reviews,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateSelfSubjectAccessReviewsResponse) Reset() { + *x = CreateSelfSubjectAccessReviewsResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateSelfSubjectAccessReviewsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSelfSubjectAccessReviewsResponse) ProtoMessage() {} + +func (x *CreateSelfSubjectAccessReviewsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSelfSubjectAccessReviewsResponse.ProtoReflect.Descriptor instead. +func (*CreateSelfSubjectAccessReviewsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{47} +} + +func (x *CreateSelfSubjectAccessReviewsResponse) GetReviews() [][]byte { + if x != nil { + return x.Reviews + } + return nil +} + +type GetAvailableMenuRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // resource is the menu resource, e.g. "menus". + Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` + Menu string `protobuf:"bytes,3,opt,name=menu,proto3" json:"menu,omitempty"` + // filter is as View's. + Filter *structpb.Struct `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAvailableMenuRequest) Reset() { + *x = GetAvailableMenuRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAvailableMenuRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAvailableMenuRequest) ProtoMessage() {} + +func (x *GetAvailableMenuRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAvailableMenuRequest.ProtoReflect.Descriptor instead. +func (*GetAvailableMenuRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{48} +} + +func (x *GetAvailableMenuRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetAvailableMenuRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *GetAvailableMenuRequest) GetMenu() string { + if x != nil { + return x.Menu + } + return "" +} + +func (x *GetAvailableMenuRequest) GetFilter() *structpb.Struct { + if x != nil { + return x.Filter + } + return nil +} + +type GetAvailableMenuResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Menu []byte `protobuf:"bytes,1,opt,name=menu,proto3" json:"menu,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAvailableMenuResponse) Reset() { + *x = GetAvailableMenuResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAvailableMenuResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAvailableMenuResponse) ProtoMessage() {} + +func (x *GetAvailableMenuResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAvailableMenuResponse.ProtoReflect.Descriptor instead. +func (*GetAvailableMenuResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{49} +} + +func (x *GetAvailableMenuResponse) GetMenu() []byte { + if x != nil { + return x.Menu + } + return nil +} + +type RenderResourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // type is one of meta.k8s.appscode.com/v1alpha1 renders, renderdashboards, rendermenus and + // resourcegraphs, reports.scanner.appscode.com/v1alpha1 images and cvereports, and + // policy.k8s.appscode.com/v1alpha1 policyreports. + Type *ResourceType `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // object is the JSON of the request object. + Object []byte `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` + Options *WriteOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenderResourceRequest) Reset() { + *x = RenderResourceRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenderResourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenderResourceRequest) ProtoMessage() {} + +func (x *RenderResourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenderResourceRequest.ProtoReflect.Descriptor instead. +func (*RenderResourceRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{50} +} + +func (x *RenderResourceRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *RenderResourceRequest) GetType() *ResourceType { + if x != nil { + return x.Type + } + return nil +} + +func (x *RenderResourceRequest) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +func (x *RenderResourceRequest) GetOptions() *WriteOptions { + if x != nil { + return x.Options + } + return nil +} + +type RenderResourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // object is the JSON of the answered object, without a resource version. + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenderResourceResponse) Reset() { + *x = RenderResourceResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenderResourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenderResourceResponse) ProtoMessage() {} + +func (x *RenderResourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenderResourceResponse.ProtoReflect.Descriptor instead. +func (*RenderResourceResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{51} +} + +func (x *RenderResourceResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type GetDatabaseConfigurationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // parameters are the get options of its API server, e.g. keys. + Parameters []*QueryParameter `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"` + View *View `protobuf:"bytes,5,opt,name=view,proto3" json:"view,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDatabaseConfigurationRequest) Reset() { + *x = GetDatabaseConfigurationRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDatabaseConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDatabaseConfigurationRequest) ProtoMessage() {} + +func (x *GetDatabaseConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDatabaseConfigurationRequest.ProtoReflect.Descriptor instead. +func (*GetDatabaseConfigurationRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{52} +} + +func (x *GetDatabaseConfigurationRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetDatabaseConfigurationRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *GetDatabaseConfigurationRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetDatabaseConfigurationRequest) GetParameters() []*QueryParameter { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *GetDatabaseConfigurationRequest) GetView() *View { + if x != nil { + return x.View + } + return nil +} + +type QueryParameter struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QueryParameter) Reset() { + *x = QueryParameter{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryParameter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParameter) ProtoMessage() {} + +func (x *QueryParameter) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryParameter.ProtoReflect.Descriptor instead. +func (*QueryParameter) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{53} +} + +func (x *QueryParameter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QueryParameter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type GetDatabaseConfigurationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetDatabaseConfigurationResponse) Reset() { + *x = GetDatabaseConfigurationResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetDatabaseConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDatabaseConfigurationResponse) ProtoMessage() {} + +func (x *GetDatabaseConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDatabaseConfigurationResponse.ProtoReflect.Descriptor instead. +func (*GetDatabaseConfigurationResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{54} +} + +func (x *GetDatabaseConfigurationResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type CreateResourceFromManifestRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Manifest []byte `protobuf:"bytes,2,opt,name=manifest,proto3" json:"manifest,omitempty"` + Options *WriteOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResourceFromManifestRequest) Reset() { + *x = CreateResourceFromManifestRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResourceFromManifestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResourceFromManifestRequest) ProtoMessage() {} + +func (x *CreateResourceFromManifestRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResourceFromManifestRequest.ProtoReflect.Descriptor instead. +func (*CreateResourceFromManifestRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{55} +} + +func (x *CreateResourceFromManifestRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *CreateResourceFromManifestRequest) GetManifest() []byte { + if x != nil { + return x.Manifest + } + return nil +} + +func (x *CreateResourceFromManifestRequest) GetOptions() *WriteOptions { + if x != nil { + return x.Options + } + return nil +} + +type CreateResourceFromManifestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Object []byte `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResourceFromManifestResponse) Reset() { + *x = CreateResourceFromManifestResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResourceFromManifestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResourceFromManifestResponse) ProtoMessage() {} + +func (x *CreateResourceFromManifestResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResourceFromManifestResponse.ProtoReflect.Descriptor instead. +func (*CreateResourceFromManifestResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{56} +} + +func (x *CreateResourceFromManifestResponse) GetObject() []byte { + if x != nil { + return x.Object + } + return nil +} + +type GetResourceHistoryRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Product string `protobuf:"bytes,2,opt,name=product,proto3" json:"product,omitempty"` + Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"` + Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"` + // rid is the resource's ID in the history. + Rid string `protobuf:"bytes,5,opt,name=rid,proto3" json:"rid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResourceHistoryRequest) Reset() { + *x = GetResourceHistoryRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResourceHistoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResourceHistoryRequest) ProtoMessage() {} + +func (x *GetResourceHistoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResourceHistoryRequest.ProtoReflect.Descriptor instead. +func (*GetResourceHistoryRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{57} +} + +func (x *GetResourceHistoryRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetResourceHistoryRequest) GetProduct() string { + if x != nil { + return x.Product + } + return "" +} + +func (x *GetResourceHistoryRequest) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *GetResourceHistoryRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *GetResourceHistoryRequest) GetRid() string { + if x != nil { + return x.Rid + } + return "" +} + +type GetResourceHistoryResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Entries []*HistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetResourceHistoryResponse) Reset() { + *x = GetResourceHistoryResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetResourceHistoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResourceHistoryResponse) ProtoMessage() {} + +func (x *GetResourceHistoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResourceHistoryResponse.ProtoReflect.Descriptor instead. +func (*GetResourceHistoryResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{58} +} + +func (x *GetResourceHistoryResponse) GetEntries() []*HistoryEntry { + if x != nil { + return x.Entries + } + return nil +} + +type HistoryEntry struct { + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Values []*HistoryValue `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` + // last_seen is in Unix seconds. + LastSeen int64 `protobuf:"varint,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HistoryEntry) Reset() { + *x = HistoryEntry{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HistoryEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryEntry) ProtoMessage() {} + +func (x *HistoryEntry) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoryEntry.ProtoReflect.Descriptor instead. +func (*HistoryEntry) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{59} +} + +func (x *HistoryEntry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *HistoryEntry) GetValues() []*HistoryValue { + if x != nil { + return x.Values + } + return nil +} + +func (x *HistoryEntry) GetLastSeen() int64 { + if x != nil { + return x.LastSeen + } + return 0 +} + +type HistoryValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + // resource is the JSON of the object as it was, if recorded. + Resource []byte `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + ResourceId *HistoryResourceID `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + LicenseId string `protobuf:"bytes,3,opt,name=license_id,json=licenseId,proto3" json:"license_id,omitempty"` + Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` + // timestamp is in Unix seconds. + Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HistoryValue) Reset() { + *x = HistoryValue{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HistoryValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryValue) ProtoMessage() {} + +func (x *HistoryValue) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[60] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoryValue.ProtoReflect.Descriptor instead. +func (*HistoryValue) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{60} +} + +func (x *HistoryValue) GetResource() []byte { + if x != nil { + return x.Resource + } + return nil +} + +func (x *HistoryValue) GetResourceId() *HistoryResourceID { + if x != nil { + return x.ResourceId + } + return nil +} + +func (x *HistoryValue) GetLicenseId() string { + if x != nil { + return x.LicenseId + } + return "" +} + +func (x *HistoryValue) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *HistoryValue) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type HistoryResourceID struct { + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Kind string `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"` + // scope is "Namespaced" or "Cluster". + Scope string `protobuf:"bytes,5,opt,name=scope,proto3" json:"scope,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HistoryResourceID) Reset() { + *x = HistoryResourceID{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HistoryResourceID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryResourceID) ProtoMessage() {} + +func (x *HistoryResourceID) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[61] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoryResourceID.ProtoReflect.Descriptor instead. +func (*HistoryResourceID) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{61} +} + +func (x *HistoryResourceID) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *HistoryResourceID) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *HistoryResourceID) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HistoryResourceID) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *HistoryResourceID) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +type StreamPodLogsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // resource is "pods", or "services" for the first pod the service selects. + Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // container is the pod's first if empty. + Container string `protobuf:"bytes,5,opt,name=container,proto3" json:"container,omitempty"` + // tail_lines is how many of the last lines to start from, 200 if unset. + TailLines *int64 `protobuf:"varint,6,opt,name=tail_lines,json=tailLines,proto3,oneof" json:"tail_lines,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamPodLogsRequest) Reset() { + *x = StreamPodLogsRequest{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamPodLogsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamPodLogsRequest) ProtoMessage() {} + +func (x *StreamPodLogsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[62] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamPodLogsRequest.ProtoReflect.Descriptor instead. +func (*StreamPodLogsRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{62} +} + +func (x *StreamPodLogsRequest) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *StreamPodLogsRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *StreamPodLogsRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *StreamPodLogsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StreamPodLogsRequest) GetContainer() string { + if x != nil { + return x.Container + } + return "" +} + +func (x *StreamPodLogsRequest) GetTailLines() int64 { + if x != nil && x.TailLines != nil { + return *x.TailLines + } + return 0 +} + +type StreamPodLogsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // data is one line of the log, with its newline (the last may have none). + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamPodLogsResponse) Reset() { + *x = StreamPodLogsResponse{} + mi := &file_akp_cluster_v2_resource_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamPodLogsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamPodLogsResponse) ProtoMessage() {} + +func (x *StreamPodLogsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_resource_proto_msgTypes[63] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamPodLogsResponse.ProtoReflect.Descriptor instead. +func (*StreamPodLogsResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_resource_proto_rawDescGZIP(), []int{63} +} + +func (x *StreamPodLogsResponse) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +var File_akp_cluster_v2_resource_proto protoreflect.FileDescriptor + +const file_akp_cluster_v2_resource_proto_rawDesc = "" + + "\n" + + "\x1dakp/cluster/v2/resource.proto\x12\x0eakp.cluster.v2\x1a\x1cakp/cluster/v2/cluster.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\"l\n" + + "\fResourceType\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12!\n" + + "\aversion\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aversion\x12#\n" + + "\bresource\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\bresource\"\x82\x01\n" + + "\vResourceKey\x128\n" + + "\x04type\x18\x01 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x02 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"x\n" + + "\x04View\x12/\n" + + "\x06filter\x18\x01 \x01(\v2\x17.google.protobuf.StructR\x06filter\x12\x14\n" + + "\x05table\x18\x02 \x01(\bR\x05table\x12)\n" + + "\x10table_definition\x18\x03 \x01(\tR\x0ftableDefinition\"\xf7\x01\n" + + "\vListOptions\x12%\n" + + "\x0elabel_selector\x18\x01 \x01(\tR\rlabelSelector\x12%\n" + + "\x0efield_selector\x18\x02 \x01(\tR\rfieldSelector\x12\x1d\n" + + "\x05limit\x18\x03 \x01(\x03B\a\xbaH\x04\"\x02(\x00R\x05limit\x12\x1a\n" + + "\bcontinue\x18\x04 \x01(\tR\bcontinue\x12)\n" + + "\x10resource_version\x18\x05 \x01(\tR\x0fresourceVersion\x124\n" + + "\x16resource_version_match\x18\x06 \x01(\tR\x14resourceVersionMatch\"w\n" + + "\fWriteOptions\x12\x17\n" + + "\adry_run\x18\x01 \x03(\tR\x06dryRun\x12#\n" + + "\rfield_manager\x18\x02 \x01(\tR\ffieldManager\x12)\n" + + "\x10field_validation\x18\x03 \x01(\tR\x0ffieldValidation\"\x8d\x01\n" + + "\fPatchOptions\x12\x17\n" + + "\adry_run\x18\x01 \x03(\tR\x06dryRun\x12#\n" + + "\rfield_manager\x18\x02 \x01(\tR\ffieldManager\x12)\n" + + "\x10field_validation\x18\x03 \x01(\tR\x0ffieldValidation\x12\x14\n" + + "\x05force\x18\x04 \x01(\bR\x05force\"\x96\x02\n" + + "\rDeleteOptions\x125\n" + + "\x14grace_period_seconds\x18\x01 \x01(\x03H\x00R\x12gracePeriodSeconds\x88\x01\x01\x12-\n" + + "\x12propagation_policy\x18\x02 \x01(\tR\x11propagationPolicy\x12\x17\n" + + "\adry_run\x18\x03 \x03(\tR\x06dryRun\x12)\n" + + "\x10precondition_uid\x18\x04 \x01(\tR\x0fpreconditionUid\x12B\n" + + "\x1dprecondition_resource_version\x18\x05 \x01(\tR\x1bpreconditionResourceVersionB\x17\n" + + "\x15_grace_period_seconds\"\x9c\x02\n" + + "\x12GetResourceRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12)\n" + + "\x10resource_version\x18\x05 \x01(\tR\x0fresourceVersion\x12(\n" + + "\x04view\x18\x06 \x01(\v2\x14.akp.cluster.v2.ViewR\x04view\"-\n" + + "\x13GetResourceResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\x8d\x02\n" + + "\x14ListResourcesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x125\n" + + "\aoptions\x18\x04 \x01(\v2\x1b.akp.cluster.v2.ListOptionsR\aoptions\x12(\n" + + "\x04view\x18\x05 \x01(\v2\x14.akp.cluster.v2.ViewR\x04view\"+\n" + + "\x15ListResourcesResponse\x12\x12\n" + + "\x04list\x18\x01 \x01(\fR\x04list\"\x86\x02\n" + + "\x15CreateResourceRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1f\n" + + "\x06object\x18\x04 \x01(\fB\a\xbaH\x04z\x02\x10\x01R\x06object\x126\n" + + "\aoptions\x18\x05 \x01(\v2\x1c.akp.cluster.v2.WriteOptionsR\aoptions\"0\n" + + "\x16CreateResourceResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\xa3\x02\n" + + "\x15UpdateResourceRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x1f\n" + + "\x06object\x18\x05 \x01(\fB\a\xbaH\x04z\x02\x10\x01R\x06object\x126\n" + + "\aoptions\x18\x06 \x01(\v2\x1c.akp.cluster.v2.WriteOptionsR\aoptions\"0\n" + + "\x16UpdateResourceResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\xe6\x02\n" + + "\x14PatchResourceRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12D\n" + + "\n" + + "patch_type\x18\x05 \x01(\x0e2\x19.akp.cluster.v2.PatchTypeB\n" + + "\xbaH\a\x82\x01\x04\x10\x01 \x00R\tpatchType\x12\x1d\n" + + "\x05patch\x18\x06 \x01(\fB\a\xbaH\x04z\x02\x10\x01R\x05patch\x126\n" + + "\aoptions\x18\a \x01(\v2\x1c.akp.cluster.v2.PatchOptionsR\aoptions\"/\n" + + "\x15PatchResourceResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\xec\x02\n" + + "\x1aPatchResourceStatusRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12D\n" + + "\n" + + "patch_type\x18\x05 \x01(\x0e2\x19.akp.cluster.v2.PatchTypeB\n" + + "\xbaH\a\x82\x01\x04\x10\x01 \x00R\tpatchType\x12\x1d\n" + + "\x05patch\x18\x06 \x01(\fB\a\xbaH\x04z\x02\x10\x01R\x05patch\x126\n" + + "\aoptions\x18\a \x01(\v2\x1c.akp.cluster.v2.PatchOptionsR\aoptions\"5\n" + + "\x1bPatchResourceStatusResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\x83\x02\n" + + "\x15DeleteResourceRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x127\n" + + "\aoptions\x18\x05 \x01(\v2\x1d.akp.cluster.v2.DeleteOptionsR\aoptions\"\x18\n" + + "\x16DeleteResourceResponse\"\xa0\x02\n" + + "\x16DeleteResourcesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x127\n" + + "\aoptions\x18\x04 \x01(\v2\x1d.akp.cluster.v2.DeleteOptionsR\aoptions\x127\n" + + "\bselector\x18\x05 \x01(\v2\x1b.akp.cluster.v2.ListOptionsR\bselector\"\x19\n" + + "\x17DeleteResourcesResponse\"\x96\x01\n" + + "\x1bBatchDeleteResourcesRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x129\n" + + "\tresources\x18\x02 \x03(\v2\x1b.akp.cluster.v2.ResourceKeyR\tresources\"a\n" + + "\x1cBatchDeleteResourcesResponse\x12A\n" + + "\bfailures\x18\x01 \x03(\v2%.akp.cluster.v2.ResourceDeleteFailureR\bfailures\"\x96\x01\n" + + "\x15ResourceDeleteFailure\x127\n" + + "\bresource\x18\x01 \x01(\v2\x1b.akp.cluster.v2.ResourceKeyR\bresource\x12\x12\n" + + "\x04code\x18\x02 \x01(\x05R\x04code\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\x12\x18\n" + + "\amessage\x18\x04 \x01(\tR\amessage\"\xb6\x02\n" + + "\x19ListResourceEventsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x125\n" + + "\aoptions\x18\x05 \x01(\v2\x1b.akp.cluster.v2.ListOptionsR\aoptions\x12/\n" + + "\x06filter\x18\x06 \x01(\v2\x17.google.protobuf.StructR\x06filter\"0\n" + + "\x1aListResourceEventsResponse\x12\x12\n" + + "\x04list\x18\x01 \x01(\fR\x04list\"\xd1\x01\n" + + "\x1cGetResourceControllerRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"7\n" + + "\x1dGetResourceControllerResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\xcd\x01\n" + + "\x0fGetScaleRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12%\n" + + "\tnamespace\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"(\n" + + "\x10GetScaleResponse\x12\x14\n" + + "\x05scale\x18\x01 \x01(\fR\x05scale\"\xf5\x01\n" + + "\x12UpdateScaleRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12%\n" + + "\tnamespace\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12#\n" + + "\breplicas\x18\x05 \x01(\x05B\a\xbaH\x04\x1a\x02(\x00R\breplicas\"+\n" + + "\x13UpdateScaleResponse\x12\x14\n" + + "\x05scale\x18\x01 \x01(\fR\x05scale\"\x83\x02\n" + + "#ListHorizontalPodAutoscalersRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12#\n" + + "\bresource\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\bresource\x12%\n" + + "\tnamespace\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x125\n" + + "\aoptions\x18\x05 \x01(\v2\x1b.akp.cluster.v2.ListOptionsR\aoptions\":\n" + + "$ListHorizontalPodAutoscalersResponse\x12\x12\n" + + "\x04list\x18\x01 \x01(\fR\x04list\"\x97\x01\n" + + "\x1eListGroupVersionObjectsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x14\n" + + "\x05group\x18\x02 \x01(\tR\x05group\x12!\n" + + "\aversion\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aversion\"\xd2\x01\n" + + "\x1fListGroupVersionObjectsResponse\x12V\n" + + "\aobjects\x18\x01 \x03(\v2<.akp.cluster.v2.ListGroupVersionObjectsResponse.ObjectsEntryR\aobjects\x1aW\n" + + "\fObjectsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x121\n" + + "\x05value\x18\x02 \x01(\v2\x1b.akp.cluster.v2.ObjectNamesR\x05value:\x028\x01\"#\n" + + "\vObjectNames\x12\x14\n" + + "\x05names\x18\x01 \x03(\tR\x05names\"r\n" + + "\x15GetNodeMetricsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"\xd0\x01\n" + + "\x16GetNodeMetricsResponse\x12S\n" + + "\tresources\x18\x01 \x03(\v25.akp.cluster.v2.GetNodeMetricsResponse.ResourcesEntryR\tresources\x1aa\n" + + "\x0eResourcesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x129\n" + + "\x05value\x18\x02 \x01(\v2#.akp.cluster.v2.NodeResourceMetricsR\x05value:\x028\x01\"\x8e\x01\n" + + "\x13NodeResourceMetrics\x12\x1a\n" + + "\bcapacity\x18\x01 \x01(\tR\bcapacity\x12 \n" + + "\vallocatable\x18\x02 \x01(\tR\vallocatable\x12\x14\n" + + "\x05usage\x18\x03 \x01(\tR\x05usage\x12#\n" + + "\rusage_percent\x18\x04 \x01(\tR\fusagePercent\"\x98\x01\n" + + "\x14GetPodMetricsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12%\n" + + "\tnamespace\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"\x95\x02\n" + + "\x15GetPodMetricsResponse\x12@\n" + + "\n" + + "containers\x18\x01 \x03(\v2 .akp.cluster.v2.ContainerMetricsR\n" + + "containers\x12R\n" + + "\tresources\x18\x02 \x03(\v24.akp.cluster.v2.GetPodMetricsResponse.ResourcesEntryR\tresources\x1af\n" + + "\x0eResourcesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12>\n" + + "\x05value\x18\x02 \x01(\v2(.akp.cluster.v2.ContainerResourceMetricsR\x05value:\x028\x01\"\xdd\x01\n" + + "\x10ContainerMetrics\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12M\n" + + "\tresources\x18\x02 \x03(\v2/.akp.cluster.v2.ContainerMetrics.ResourcesEntryR\tresources\x1af\n" + + "\x0eResourcesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12>\n" + + "\x05value\x18\x02 \x01(\v2(.akp.cluster.v2.ContainerResourceMetricsR\x05value:\x028\x01\"\x89\x01\n" + + "\x18ContainerResourceMetrics\x12\x1a\n" + + "\brequests\x18\x01 \x01(\tR\brequests\x12\x16\n" + + "\x06limits\x18\x02 \x01(\tR\x06limits\x12\x14\n" + + "\x05usage\x18\x03 \x01(\tR\x05usage\x12#\n" + + "\rusage_percent\x18\x04 \x01(\tR\fusagePercent\"\x7f\n" + + "%CreateSelfSubjectAccessReviewsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x18\n" + + "\areviews\x18\x02 \x03(\fR\areviews\"B\n" + + "&CreateSelfSubjectAccessReviewsResponse\x12\x18\n" + + "\areviews\x18\x01 \x03(\fR\areviews\"\xca\x01\n" + + "\x17GetAvailableMenuRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12#\n" + + "\bresource\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\bresource\x12\x1b\n" + + "\x04menu\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04menu\x12/\n" + + "\x06filter\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x06filter\".\n" + + "\x18GetAvailableMenuResponse\x12\x12\n" + + "\x04menu\x18\x01 \x01(\fR\x04menu\"\xe8\x01\n" + + "\x15RenderResourceRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x128\n" + + "\x04type\x18\x02 \x01(\v2\x1c.akp.cluster.v2.ResourceTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1f\n" + + "\x06object\x18\x03 \x01(\fB\a\xbaH\x04z\x02\x10\x01R\x06object\x126\n" + + "\aoptions\x18\x04 \x01(\v2\x1c.akp.cluster.v2.WriteOptionsR\aoptions\"0\n" + + "\x16RenderResourceResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\x8d\x02\n" + + "\x1fGetDatabaseConfigurationRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12%\n" + + "\tnamespace\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12>\n" + + "\n" + + "parameters\x18\x04 \x03(\v2\x1e.akp.cluster.v2.QueryParameterR\n" + + "parameters\x12(\n" + + "\x04view\x18\x05 \x01(\v2\x14.akp.cluster.v2.ViewR\x04view\"C\n" + + "\x0eQueryParameter\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\":\n" + + " GetDatabaseConfigurationResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\xbe\x01\n" + + "!CreateResourceFromManifestRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12#\n" + + "\bmanifest\x18\x02 \x01(\fB\a\xbaH\x04z\x02\x10\x01R\bmanifest\x126\n" + + "\aoptions\x18\x03 \x01(\v2\x1c.akp.cluster.v2.WriteOptionsR\aoptions\"<\n" + + "\"CreateResourceFromManifestResponse\x12\x16\n" + + "\x06object\x18\x01 \x01(\fR\x06object\"\xb7\x01\n" + + "\x19GetResourceHistoryRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x18\n" + + "\aproduct\x18\x02 \x01(\tR\aproduct\x12\x14\n" + + "\x05group\x18\x03 \x01(\tR\x05group\x12\x1a\n" + + "\bresource\x18\x04 \x01(\tR\bresource\x12\x10\n" + + "\x03rid\x18\x05 \x01(\tR\x03rid\"T\n" + + "\x1aGetResourceHistoryResponse\x126\n" + + "\aentries\x18\x01 \x03(\v2\x1c.akp.cluster.v2.HistoryEntryR\aentries\"s\n" + + "\fHistoryEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x124\n" + + "\x06values\x18\x02 \x03(\v2\x1c.akp.cluster.v2.HistoryValueR\x06values\x12\x1b\n" + + "\tlast_seen\x18\x03 \x01(\x03R\blastSeen\"\xc5\x01\n" + + "\fHistoryValue\x12\x1a\n" + + "\bresource\x18\x01 \x01(\fR\bresource\x12B\n" + + "\vresource_id\x18\x02 \x01(\v2!.akp.cluster.v2.HistoryResourceIDR\n" + + "resourceId\x12\x1d\n" + + "\n" + + "license_id\x18\x03 \x01(\tR\tlicenseId\x12\x18\n" + + "\aversion\x18\x04 \x01(\x04R\aversion\x12\x1c\n" + + "\ttimestamp\x18\x05 \x01(\x03R\ttimestamp\"\x81\x01\n" + + "\x11HistoryResourceID\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04kind\x18\x04 \x01(\tR\x04kind\x12\x14\n" + + "\x05scope\x18\x05 \x01(\tR\x05scope\"\xa5\x02\n" + + "\x14StreamPodLogsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x121\n" + + "\bresource\x18\x02 \x01(\tB\x15\xbaH\x12r\x10R\x04podsR\bservicesR\bresource\x12%\n" + + "\tnamespace\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x1c\n" + + "\tcontainer\x18\x05 \x01(\tR\tcontainer\x12+\n" + + "\n" + + "tail_lines\x18\x06 \x01(\x03B\a\xbaH\x04\"\x02(\x00H\x00R\ttailLines\x88\x01\x01B\r\n" + + "\v_tail_lines\"+\n" + + "\x15StreamPodLogsResponse\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data*\x89\x01\n" + + "\tPatchType\x12\x1a\n" + + "\x16PATCH_TYPE_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fPATCH_TYPE_JSON\x10\x01\x12\x14\n" + + "\x10PATCH_TYPE_MERGE\x10\x02\x12\x1e\n" + + "\x1aPATCH_TYPE_STRATEGIC_MERGE\x10\x03\x12\x15\n" + + "\x11PATCH_TYPE_OBJECT\x10\x042\xbc\x14\n" + + "\x0fResourceService\x12X\n" + + "\vGetResource\x12\".akp.cluster.v2.GetResourceRequest\x1a#.akp.cluster.v2.GetResourceResponse\"\x00\x12^\n" + + "\rListResources\x12$.akp.cluster.v2.ListResourcesRequest\x1a%.akp.cluster.v2.ListResourcesResponse\"\x00\x12a\n" + + "\x0eCreateResource\x12%.akp.cluster.v2.CreateResourceRequest\x1a&.akp.cluster.v2.CreateResourceResponse\"\x00\x12a\n" + + "\x0eUpdateResource\x12%.akp.cluster.v2.UpdateResourceRequest\x1a&.akp.cluster.v2.UpdateResourceResponse\"\x00\x12^\n" + + "\rPatchResource\x12$.akp.cluster.v2.PatchResourceRequest\x1a%.akp.cluster.v2.PatchResourceResponse\"\x00\x12p\n" + + "\x13PatchResourceStatus\x12*.akp.cluster.v2.PatchResourceStatusRequest\x1a+.akp.cluster.v2.PatchResourceStatusResponse\"\x00\x12a\n" + + "\x0eDeleteResource\x12%.akp.cluster.v2.DeleteResourceRequest\x1a&.akp.cluster.v2.DeleteResourceResponse\"\x00\x12d\n" + + "\x0fDeleteResources\x12&.akp.cluster.v2.DeleteResourcesRequest\x1a'.akp.cluster.v2.DeleteResourcesResponse\"\x00\x12s\n" + + "\x14BatchDeleteResources\x12+.akp.cluster.v2.BatchDeleteResourcesRequest\x1a,.akp.cluster.v2.BatchDeleteResourcesResponse\"\x00\x12m\n" + + "\x12ListResourceEvents\x12).akp.cluster.v2.ListResourceEventsRequest\x1a*.akp.cluster.v2.ListResourceEventsResponse\"\x00\x12v\n" + + "\x15GetResourceController\x12,.akp.cluster.v2.GetResourceControllerRequest\x1a-.akp.cluster.v2.GetResourceControllerResponse\"\x00\x12O\n" + + "\bGetScale\x12\x1f.akp.cluster.v2.GetScaleRequest\x1a .akp.cluster.v2.GetScaleResponse\"\x00\x12X\n" + + "\vUpdateScale\x12\".akp.cluster.v2.UpdateScaleRequest\x1a#.akp.cluster.v2.UpdateScaleResponse\"\x00\x12\x8b\x01\n" + + "\x1cListHorizontalPodAutoscalers\x123.akp.cluster.v2.ListHorizontalPodAutoscalersRequest\x1a4.akp.cluster.v2.ListHorizontalPodAutoscalersResponse\"\x00\x12|\n" + + "\x17ListGroupVersionObjects\x12..akp.cluster.v2.ListGroupVersionObjectsRequest\x1a/.akp.cluster.v2.ListGroupVersionObjectsResponse\"\x00\x12a\n" + + "\x0eGetNodeMetrics\x12%.akp.cluster.v2.GetNodeMetricsRequest\x1a&.akp.cluster.v2.GetNodeMetricsResponse\"\x00\x12^\n" + + "\rGetPodMetrics\x12$.akp.cluster.v2.GetPodMetricsRequest\x1a%.akp.cluster.v2.GetPodMetricsResponse\"\x00\x12\x91\x01\n" + + "\x1eCreateSelfSubjectAccessReviews\x125.akp.cluster.v2.CreateSelfSubjectAccessReviewsRequest\x1a6.akp.cluster.v2.CreateSelfSubjectAccessReviewsResponse\"\x00\x12g\n" + + "\x10GetAvailableMenu\x12'.akp.cluster.v2.GetAvailableMenuRequest\x1a(.akp.cluster.v2.GetAvailableMenuResponse\"\x00\x12a\n" + + "\x0eRenderResource\x12%.akp.cluster.v2.RenderResourceRequest\x1a&.akp.cluster.v2.RenderResourceResponse\"\x00\x12\x7f\n" + + "\x18GetDatabaseConfiguration\x12/.akp.cluster.v2.GetDatabaseConfigurationRequest\x1a0.akp.cluster.v2.GetDatabaseConfigurationResponse\"\x00\x12\x85\x01\n" + + "\x1aCreateResourceFromManifest\x121.akp.cluster.v2.CreateResourceFromManifestRequest\x1a2.akp.cluster.v2.CreateResourceFromManifestResponse\"\x00\x12m\n" + + "\x12GetResourceHistory\x12).akp.cluster.v2.GetResourceHistoryRequest\x1a*.akp.cluster.v2.GetResourceHistoryResponse\"\x00\x12`\n" + + "\rStreamPodLogs\x12$.akp.cluster.v2.StreamPodLogsRequest\x1a%.akp.cluster.v2.StreamPodLogsResponse\"\x000\x01B\xba\x01\n" + + "\x12com.akp.cluster.v2B\rResourceProtoP\x01Z;go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2;clusterv2\xa2\x02\x03ACX\xaa\x02\x0eAkp.Cluster.V2\xca\x02\x0eAkp\\Cluster\\V2\xe2\x02\x1aAkp\\Cluster\\V2\\GPBMetadata\xea\x02\x10Akp::Cluster::V2b\x06proto3" + +var ( + file_akp_cluster_v2_resource_proto_rawDescOnce sync.Once + file_akp_cluster_v2_resource_proto_rawDescData []byte +) + +func file_akp_cluster_v2_resource_proto_rawDescGZIP() []byte { + file_akp_cluster_v2_resource_proto_rawDescOnce.Do(func() { + file_akp_cluster_v2_resource_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_resource_proto_rawDesc), len(file_akp_cluster_v2_resource_proto_rawDesc))) + }) + return file_akp_cluster_v2_resource_proto_rawDescData +} + +var file_akp_cluster_v2_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_akp_cluster_v2_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 68) +var file_akp_cluster_v2_resource_proto_goTypes = []any{ + (PatchType)(0), // 0: akp.cluster.v2.PatchType + (*ResourceType)(nil), // 1: akp.cluster.v2.ResourceType + (*ResourceKey)(nil), // 2: akp.cluster.v2.ResourceKey + (*View)(nil), // 3: akp.cluster.v2.View + (*ListOptions)(nil), // 4: akp.cluster.v2.ListOptions + (*WriteOptions)(nil), // 5: akp.cluster.v2.WriteOptions + (*PatchOptions)(nil), // 6: akp.cluster.v2.PatchOptions + (*DeleteOptions)(nil), // 7: akp.cluster.v2.DeleteOptions + (*GetResourceRequest)(nil), // 8: akp.cluster.v2.GetResourceRequest + (*GetResourceResponse)(nil), // 9: akp.cluster.v2.GetResourceResponse + (*ListResourcesRequest)(nil), // 10: akp.cluster.v2.ListResourcesRequest + (*ListResourcesResponse)(nil), // 11: akp.cluster.v2.ListResourcesResponse + (*CreateResourceRequest)(nil), // 12: akp.cluster.v2.CreateResourceRequest + (*CreateResourceResponse)(nil), // 13: akp.cluster.v2.CreateResourceResponse + (*UpdateResourceRequest)(nil), // 14: akp.cluster.v2.UpdateResourceRequest + (*UpdateResourceResponse)(nil), // 15: akp.cluster.v2.UpdateResourceResponse + (*PatchResourceRequest)(nil), // 16: akp.cluster.v2.PatchResourceRequest + (*PatchResourceResponse)(nil), // 17: akp.cluster.v2.PatchResourceResponse + (*PatchResourceStatusRequest)(nil), // 18: akp.cluster.v2.PatchResourceStatusRequest + (*PatchResourceStatusResponse)(nil), // 19: akp.cluster.v2.PatchResourceStatusResponse + (*DeleteResourceRequest)(nil), // 20: akp.cluster.v2.DeleteResourceRequest + (*DeleteResourceResponse)(nil), // 21: akp.cluster.v2.DeleteResourceResponse + (*DeleteResourcesRequest)(nil), // 22: akp.cluster.v2.DeleteResourcesRequest + (*DeleteResourcesResponse)(nil), // 23: akp.cluster.v2.DeleteResourcesResponse + (*BatchDeleteResourcesRequest)(nil), // 24: akp.cluster.v2.BatchDeleteResourcesRequest + (*BatchDeleteResourcesResponse)(nil), // 25: akp.cluster.v2.BatchDeleteResourcesResponse + (*ResourceDeleteFailure)(nil), // 26: akp.cluster.v2.ResourceDeleteFailure + (*ListResourceEventsRequest)(nil), // 27: akp.cluster.v2.ListResourceEventsRequest + (*ListResourceEventsResponse)(nil), // 28: akp.cluster.v2.ListResourceEventsResponse + (*GetResourceControllerRequest)(nil), // 29: akp.cluster.v2.GetResourceControllerRequest + (*GetResourceControllerResponse)(nil), // 30: akp.cluster.v2.GetResourceControllerResponse + (*GetScaleRequest)(nil), // 31: akp.cluster.v2.GetScaleRequest + (*GetScaleResponse)(nil), // 32: akp.cluster.v2.GetScaleResponse + (*UpdateScaleRequest)(nil), // 33: akp.cluster.v2.UpdateScaleRequest + (*UpdateScaleResponse)(nil), // 34: akp.cluster.v2.UpdateScaleResponse + (*ListHorizontalPodAutoscalersRequest)(nil), // 35: akp.cluster.v2.ListHorizontalPodAutoscalersRequest + (*ListHorizontalPodAutoscalersResponse)(nil), // 36: akp.cluster.v2.ListHorizontalPodAutoscalersResponse + (*ListGroupVersionObjectsRequest)(nil), // 37: akp.cluster.v2.ListGroupVersionObjectsRequest + (*ListGroupVersionObjectsResponse)(nil), // 38: akp.cluster.v2.ListGroupVersionObjectsResponse + (*ObjectNames)(nil), // 39: akp.cluster.v2.ObjectNames + (*GetNodeMetricsRequest)(nil), // 40: akp.cluster.v2.GetNodeMetricsRequest + (*GetNodeMetricsResponse)(nil), // 41: akp.cluster.v2.GetNodeMetricsResponse + (*NodeResourceMetrics)(nil), // 42: akp.cluster.v2.NodeResourceMetrics + (*GetPodMetricsRequest)(nil), // 43: akp.cluster.v2.GetPodMetricsRequest + (*GetPodMetricsResponse)(nil), // 44: akp.cluster.v2.GetPodMetricsResponse + (*ContainerMetrics)(nil), // 45: akp.cluster.v2.ContainerMetrics + (*ContainerResourceMetrics)(nil), // 46: akp.cluster.v2.ContainerResourceMetrics + (*CreateSelfSubjectAccessReviewsRequest)(nil), // 47: akp.cluster.v2.CreateSelfSubjectAccessReviewsRequest + (*CreateSelfSubjectAccessReviewsResponse)(nil), // 48: akp.cluster.v2.CreateSelfSubjectAccessReviewsResponse + (*GetAvailableMenuRequest)(nil), // 49: akp.cluster.v2.GetAvailableMenuRequest + (*GetAvailableMenuResponse)(nil), // 50: akp.cluster.v2.GetAvailableMenuResponse + (*RenderResourceRequest)(nil), // 51: akp.cluster.v2.RenderResourceRequest + (*RenderResourceResponse)(nil), // 52: akp.cluster.v2.RenderResourceResponse + (*GetDatabaseConfigurationRequest)(nil), // 53: akp.cluster.v2.GetDatabaseConfigurationRequest + (*QueryParameter)(nil), // 54: akp.cluster.v2.QueryParameter + (*GetDatabaseConfigurationResponse)(nil), // 55: akp.cluster.v2.GetDatabaseConfigurationResponse + (*CreateResourceFromManifestRequest)(nil), // 56: akp.cluster.v2.CreateResourceFromManifestRequest + (*CreateResourceFromManifestResponse)(nil), // 57: akp.cluster.v2.CreateResourceFromManifestResponse + (*GetResourceHistoryRequest)(nil), // 58: akp.cluster.v2.GetResourceHistoryRequest + (*GetResourceHistoryResponse)(nil), // 59: akp.cluster.v2.GetResourceHistoryResponse + (*HistoryEntry)(nil), // 60: akp.cluster.v2.HistoryEntry + (*HistoryValue)(nil), // 61: akp.cluster.v2.HistoryValue + (*HistoryResourceID)(nil), // 62: akp.cluster.v2.HistoryResourceID + (*StreamPodLogsRequest)(nil), // 63: akp.cluster.v2.StreamPodLogsRequest + (*StreamPodLogsResponse)(nil), // 64: akp.cluster.v2.StreamPodLogsResponse + nil, // 65: akp.cluster.v2.ListGroupVersionObjectsResponse.ObjectsEntry + nil, // 66: akp.cluster.v2.GetNodeMetricsResponse.ResourcesEntry + nil, // 67: akp.cluster.v2.GetPodMetricsResponse.ResourcesEntry + nil, // 68: akp.cluster.v2.ContainerMetrics.ResourcesEntry + (*structpb.Struct)(nil), // 69: google.protobuf.Struct + (*ClusterRef)(nil), // 70: akp.cluster.v2.ClusterRef +} +var file_akp_cluster_v2_resource_proto_depIdxs = []int32{ + 1, // 0: akp.cluster.v2.ResourceKey.type:type_name -> akp.cluster.v2.ResourceType + 69, // 1: akp.cluster.v2.View.filter:type_name -> google.protobuf.Struct + 70, // 2: akp.cluster.v2.GetResourceRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 3: akp.cluster.v2.GetResourceRequest.type:type_name -> akp.cluster.v2.ResourceType + 3, // 4: akp.cluster.v2.GetResourceRequest.view:type_name -> akp.cluster.v2.View + 70, // 5: akp.cluster.v2.ListResourcesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 6: akp.cluster.v2.ListResourcesRequest.type:type_name -> akp.cluster.v2.ResourceType + 4, // 7: akp.cluster.v2.ListResourcesRequest.options:type_name -> akp.cluster.v2.ListOptions + 3, // 8: akp.cluster.v2.ListResourcesRequest.view:type_name -> akp.cluster.v2.View + 70, // 9: akp.cluster.v2.CreateResourceRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 10: akp.cluster.v2.CreateResourceRequest.type:type_name -> akp.cluster.v2.ResourceType + 5, // 11: akp.cluster.v2.CreateResourceRequest.options:type_name -> akp.cluster.v2.WriteOptions + 70, // 12: akp.cluster.v2.UpdateResourceRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 13: akp.cluster.v2.UpdateResourceRequest.type:type_name -> akp.cluster.v2.ResourceType + 5, // 14: akp.cluster.v2.UpdateResourceRequest.options:type_name -> akp.cluster.v2.WriteOptions + 70, // 15: akp.cluster.v2.PatchResourceRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 16: akp.cluster.v2.PatchResourceRequest.type:type_name -> akp.cluster.v2.ResourceType + 0, // 17: akp.cluster.v2.PatchResourceRequest.patch_type:type_name -> akp.cluster.v2.PatchType + 6, // 18: akp.cluster.v2.PatchResourceRequest.options:type_name -> akp.cluster.v2.PatchOptions + 70, // 19: akp.cluster.v2.PatchResourceStatusRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 20: akp.cluster.v2.PatchResourceStatusRequest.type:type_name -> akp.cluster.v2.ResourceType + 0, // 21: akp.cluster.v2.PatchResourceStatusRequest.patch_type:type_name -> akp.cluster.v2.PatchType + 6, // 22: akp.cluster.v2.PatchResourceStatusRequest.options:type_name -> akp.cluster.v2.PatchOptions + 70, // 23: akp.cluster.v2.DeleteResourceRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 24: akp.cluster.v2.DeleteResourceRequest.type:type_name -> akp.cluster.v2.ResourceType + 7, // 25: akp.cluster.v2.DeleteResourceRequest.options:type_name -> akp.cluster.v2.DeleteOptions + 70, // 26: akp.cluster.v2.DeleteResourcesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 27: akp.cluster.v2.DeleteResourcesRequest.type:type_name -> akp.cluster.v2.ResourceType + 7, // 28: akp.cluster.v2.DeleteResourcesRequest.options:type_name -> akp.cluster.v2.DeleteOptions + 4, // 29: akp.cluster.v2.DeleteResourcesRequest.selector:type_name -> akp.cluster.v2.ListOptions + 70, // 30: akp.cluster.v2.BatchDeleteResourcesRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 2, // 31: akp.cluster.v2.BatchDeleteResourcesRequest.resources:type_name -> akp.cluster.v2.ResourceKey + 26, // 32: akp.cluster.v2.BatchDeleteResourcesResponse.failures:type_name -> akp.cluster.v2.ResourceDeleteFailure + 2, // 33: akp.cluster.v2.ResourceDeleteFailure.resource:type_name -> akp.cluster.v2.ResourceKey + 70, // 34: akp.cluster.v2.ListResourceEventsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 35: akp.cluster.v2.ListResourceEventsRequest.type:type_name -> akp.cluster.v2.ResourceType + 4, // 36: akp.cluster.v2.ListResourceEventsRequest.options:type_name -> akp.cluster.v2.ListOptions + 69, // 37: akp.cluster.v2.ListResourceEventsRequest.filter:type_name -> google.protobuf.Struct + 70, // 38: akp.cluster.v2.GetResourceControllerRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 39: akp.cluster.v2.GetResourceControllerRequest.type:type_name -> akp.cluster.v2.ResourceType + 70, // 40: akp.cluster.v2.GetScaleRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 41: akp.cluster.v2.GetScaleRequest.type:type_name -> akp.cluster.v2.ResourceType + 70, // 42: akp.cluster.v2.UpdateScaleRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 43: akp.cluster.v2.UpdateScaleRequest.type:type_name -> akp.cluster.v2.ResourceType + 70, // 44: akp.cluster.v2.ListHorizontalPodAutoscalersRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 4, // 45: akp.cluster.v2.ListHorizontalPodAutoscalersRequest.options:type_name -> akp.cluster.v2.ListOptions + 70, // 46: akp.cluster.v2.ListGroupVersionObjectsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 65, // 47: akp.cluster.v2.ListGroupVersionObjectsResponse.objects:type_name -> akp.cluster.v2.ListGroupVersionObjectsResponse.ObjectsEntry + 70, // 48: akp.cluster.v2.GetNodeMetricsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 66, // 49: akp.cluster.v2.GetNodeMetricsResponse.resources:type_name -> akp.cluster.v2.GetNodeMetricsResponse.ResourcesEntry + 70, // 50: akp.cluster.v2.GetPodMetricsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 45, // 51: akp.cluster.v2.GetPodMetricsResponse.containers:type_name -> akp.cluster.v2.ContainerMetrics + 67, // 52: akp.cluster.v2.GetPodMetricsResponse.resources:type_name -> akp.cluster.v2.GetPodMetricsResponse.ResourcesEntry + 68, // 53: akp.cluster.v2.ContainerMetrics.resources:type_name -> akp.cluster.v2.ContainerMetrics.ResourcesEntry + 70, // 54: akp.cluster.v2.CreateSelfSubjectAccessReviewsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 70, // 55: akp.cluster.v2.GetAvailableMenuRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 69, // 56: akp.cluster.v2.GetAvailableMenuRequest.filter:type_name -> google.protobuf.Struct + 70, // 57: akp.cluster.v2.RenderResourceRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 58: akp.cluster.v2.RenderResourceRequest.type:type_name -> akp.cluster.v2.ResourceType + 5, // 59: akp.cluster.v2.RenderResourceRequest.options:type_name -> akp.cluster.v2.WriteOptions + 70, // 60: akp.cluster.v2.GetDatabaseConfigurationRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 54, // 61: akp.cluster.v2.GetDatabaseConfigurationRequest.parameters:type_name -> akp.cluster.v2.QueryParameter + 3, // 62: akp.cluster.v2.GetDatabaseConfigurationRequest.view:type_name -> akp.cluster.v2.View + 70, // 63: akp.cluster.v2.CreateResourceFromManifestRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 5, // 64: akp.cluster.v2.CreateResourceFromManifestRequest.options:type_name -> akp.cluster.v2.WriteOptions + 70, // 65: akp.cluster.v2.GetResourceHistoryRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 60, // 66: akp.cluster.v2.GetResourceHistoryResponse.entries:type_name -> akp.cluster.v2.HistoryEntry + 61, // 67: akp.cluster.v2.HistoryEntry.values:type_name -> akp.cluster.v2.HistoryValue + 62, // 68: akp.cluster.v2.HistoryValue.resource_id:type_name -> akp.cluster.v2.HistoryResourceID + 70, // 69: akp.cluster.v2.StreamPodLogsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 39, // 70: akp.cluster.v2.ListGroupVersionObjectsResponse.ObjectsEntry.value:type_name -> akp.cluster.v2.ObjectNames + 42, // 71: akp.cluster.v2.GetNodeMetricsResponse.ResourcesEntry.value:type_name -> akp.cluster.v2.NodeResourceMetrics + 46, // 72: akp.cluster.v2.GetPodMetricsResponse.ResourcesEntry.value:type_name -> akp.cluster.v2.ContainerResourceMetrics + 46, // 73: akp.cluster.v2.ContainerMetrics.ResourcesEntry.value:type_name -> akp.cluster.v2.ContainerResourceMetrics + 8, // 74: akp.cluster.v2.ResourceService.GetResource:input_type -> akp.cluster.v2.GetResourceRequest + 10, // 75: akp.cluster.v2.ResourceService.ListResources:input_type -> akp.cluster.v2.ListResourcesRequest + 12, // 76: akp.cluster.v2.ResourceService.CreateResource:input_type -> akp.cluster.v2.CreateResourceRequest + 14, // 77: akp.cluster.v2.ResourceService.UpdateResource:input_type -> akp.cluster.v2.UpdateResourceRequest + 16, // 78: akp.cluster.v2.ResourceService.PatchResource:input_type -> akp.cluster.v2.PatchResourceRequest + 18, // 79: akp.cluster.v2.ResourceService.PatchResourceStatus:input_type -> akp.cluster.v2.PatchResourceStatusRequest + 20, // 80: akp.cluster.v2.ResourceService.DeleteResource:input_type -> akp.cluster.v2.DeleteResourceRequest + 22, // 81: akp.cluster.v2.ResourceService.DeleteResources:input_type -> akp.cluster.v2.DeleteResourcesRequest + 24, // 82: akp.cluster.v2.ResourceService.BatchDeleteResources:input_type -> akp.cluster.v2.BatchDeleteResourcesRequest + 27, // 83: akp.cluster.v2.ResourceService.ListResourceEvents:input_type -> akp.cluster.v2.ListResourceEventsRequest + 29, // 84: akp.cluster.v2.ResourceService.GetResourceController:input_type -> akp.cluster.v2.GetResourceControllerRequest + 31, // 85: akp.cluster.v2.ResourceService.GetScale:input_type -> akp.cluster.v2.GetScaleRequest + 33, // 86: akp.cluster.v2.ResourceService.UpdateScale:input_type -> akp.cluster.v2.UpdateScaleRequest + 35, // 87: akp.cluster.v2.ResourceService.ListHorizontalPodAutoscalers:input_type -> akp.cluster.v2.ListHorizontalPodAutoscalersRequest + 37, // 88: akp.cluster.v2.ResourceService.ListGroupVersionObjects:input_type -> akp.cluster.v2.ListGroupVersionObjectsRequest + 40, // 89: akp.cluster.v2.ResourceService.GetNodeMetrics:input_type -> akp.cluster.v2.GetNodeMetricsRequest + 43, // 90: akp.cluster.v2.ResourceService.GetPodMetrics:input_type -> akp.cluster.v2.GetPodMetricsRequest + 47, // 91: akp.cluster.v2.ResourceService.CreateSelfSubjectAccessReviews:input_type -> akp.cluster.v2.CreateSelfSubjectAccessReviewsRequest + 49, // 92: akp.cluster.v2.ResourceService.GetAvailableMenu:input_type -> akp.cluster.v2.GetAvailableMenuRequest + 51, // 93: akp.cluster.v2.ResourceService.RenderResource:input_type -> akp.cluster.v2.RenderResourceRequest + 53, // 94: akp.cluster.v2.ResourceService.GetDatabaseConfiguration:input_type -> akp.cluster.v2.GetDatabaseConfigurationRequest + 56, // 95: akp.cluster.v2.ResourceService.CreateResourceFromManifest:input_type -> akp.cluster.v2.CreateResourceFromManifestRequest + 58, // 96: akp.cluster.v2.ResourceService.GetResourceHistory:input_type -> akp.cluster.v2.GetResourceHistoryRequest + 63, // 97: akp.cluster.v2.ResourceService.StreamPodLogs:input_type -> akp.cluster.v2.StreamPodLogsRequest + 9, // 98: akp.cluster.v2.ResourceService.GetResource:output_type -> akp.cluster.v2.GetResourceResponse + 11, // 99: akp.cluster.v2.ResourceService.ListResources:output_type -> akp.cluster.v2.ListResourcesResponse + 13, // 100: akp.cluster.v2.ResourceService.CreateResource:output_type -> akp.cluster.v2.CreateResourceResponse + 15, // 101: akp.cluster.v2.ResourceService.UpdateResource:output_type -> akp.cluster.v2.UpdateResourceResponse + 17, // 102: akp.cluster.v2.ResourceService.PatchResource:output_type -> akp.cluster.v2.PatchResourceResponse + 19, // 103: akp.cluster.v2.ResourceService.PatchResourceStatus:output_type -> akp.cluster.v2.PatchResourceStatusResponse + 21, // 104: akp.cluster.v2.ResourceService.DeleteResource:output_type -> akp.cluster.v2.DeleteResourceResponse + 23, // 105: akp.cluster.v2.ResourceService.DeleteResources:output_type -> akp.cluster.v2.DeleteResourcesResponse + 25, // 106: akp.cluster.v2.ResourceService.BatchDeleteResources:output_type -> akp.cluster.v2.BatchDeleteResourcesResponse + 28, // 107: akp.cluster.v2.ResourceService.ListResourceEvents:output_type -> akp.cluster.v2.ListResourceEventsResponse + 30, // 108: akp.cluster.v2.ResourceService.GetResourceController:output_type -> akp.cluster.v2.GetResourceControllerResponse + 32, // 109: akp.cluster.v2.ResourceService.GetScale:output_type -> akp.cluster.v2.GetScaleResponse + 34, // 110: akp.cluster.v2.ResourceService.UpdateScale:output_type -> akp.cluster.v2.UpdateScaleResponse + 36, // 111: akp.cluster.v2.ResourceService.ListHorizontalPodAutoscalers:output_type -> akp.cluster.v2.ListHorizontalPodAutoscalersResponse + 38, // 112: akp.cluster.v2.ResourceService.ListGroupVersionObjects:output_type -> akp.cluster.v2.ListGroupVersionObjectsResponse + 41, // 113: akp.cluster.v2.ResourceService.GetNodeMetrics:output_type -> akp.cluster.v2.GetNodeMetricsResponse + 44, // 114: akp.cluster.v2.ResourceService.GetPodMetrics:output_type -> akp.cluster.v2.GetPodMetricsResponse + 48, // 115: akp.cluster.v2.ResourceService.CreateSelfSubjectAccessReviews:output_type -> akp.cluster.v2.CreateSelfSubjectAccessReviewsResponse + 50, // 116: akp.cluster.v2.ResourceService.GetAvailableMenu:output_type -> akp.cluster.v2.GetAvailableMenuResponse + 52, // 117: akp.cluster.v2.ResourceService.RenderResource:output_type -> akp.cluster.v2.RenderResourceResponse + 55, // 118: akp.cluster.v2.ResourceService.GetDatabaseConfiguration:output_type -> akp.cluster.v2.GetDatabaseConfigurationResponse + 57, // 119: akp.cluster.v2.ResourceService.CreateResourceFromManifest:output_type -> akp.cluster.v2.CreateResourceFromManifestResponse + 59, // 120: akp.cluster.v2.ResourceService.GetResourceHistory:output_type -> akp.cluster.v2.GetResourceHistoryResponse + 64, // 121: akp.cluster.v2.ResourceService.StreamPodLogs:output_type -> akp.cluster.v2.StreamPodLogsResponse + 98, // [98:122] is the sub-list for method output_type + 74, // [74:98] is the sub-list for method input_type + 74, // [74:74] is the sub-list for extension type_name + 74, // [74:74] is the sub-list for extension extendee + 0, // [0:74] is the sub-list for field type_name +} + +func init() { file_akp_cluster_v2_resource_proto_init() } +func file_akp_cluster_v2_resource_proto_init() { + if File_akp_cluster_v2_resource_proto != nil { + return + } + file_akp_cluster_v2_cluster_proto_init() + file_akp_cluster_v2_resource_proto_msgTypes[6].OneofWrappers = []any{} + file_akp_cluster_v2_resource_proto_msgTypes[62].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_resource_proto_rawDesc), len(file_akp_cluster_v2_resource_proto_rawDesc)), + NumEnums: 1, + NumMessages: 68, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_cluster_v2_resource_proto_goTypes, + DependencyIndexes: file_akp_cluster_v2_resource_proto_depIdxs, + EnumInfos: file_akp_cluster_v2_resource_proto_enumTypes, + MessageInfos: file_akp_cluster_v2_resource_proto_msgTypes, + }.Build() + File_akp_cluster_v2_resource_proto = out.File + file_akp_cluster_v2_resource_proto_goTypes = nil + file_akp_cluster_v2_resource_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/subscription.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/subscription.pb.go new file mode 100644 index 000000000..62020a866 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/subscription.pb.go @@ -0,0 +1,512 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/cluster/v2/subscription.proto + +package clusterv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SubscriptionTarget is what a subscription follows: the cluster, a namespace in it, or an +// object in that namespace. +type SubscriptionTarget struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Object *SubscriptionObject `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubscriptionTarget) Reset() { + *x = SubscriptionTarget{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubscriptionTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscriptionTarget) ProtoMessage() {} + +func (x *SubscriptionTarget) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscriptionTarget.ProtoReflect.Descriptor instead. +func (*SubscriptionTarget) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{0} +} + +func (x *SubscriptionTarget) GetCluster() *ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *SubscriptionTarget) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *SubscriptionTarget) GetObject() *SubscriptionObject { + if x != nil { + return x.Object + } + return nil +} + +// SubscriptionObject is an object of a namespace, by its API group, version, resource and name. +type SubscriptionObject struct { + state protoimpl.MessageState `protogen:"open.v1"` + // group is empty for the core API group. + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubscriptionObject) Reset() { + *x = SubscriptionObject{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubscriptionObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscriptionObject) ProtoMessage() {} + +func (x *SubscriptionObject) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscriptionObject.ProtoReflect.Descriptor instead. +func (*SubscriptionObject) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{1} +} + +func (x *SubscriptionObject) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *SubscriptionObject) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *SubscriptionObject) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *SubscriptionObject) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type SubscribeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Target *SubscriptionTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubscribeRequest) Reset() { + *x = SubscribeRequest{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubscribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeRequest) ProtoMessage() {} + +func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. +func (*SubscribeRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{2} +} + +func (x *SubscribeRequest) GetTarget() *SubscriptionTarget { + if x != nil { + return x.Target + } + return nil +} + +type SubscribeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubscribeResponse) Reset() { + *x = SubscribeResponse{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubscribeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubscribeResponse) ProtoMessage() {} + +func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead. +func (*SubscribeResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{3} +} + +type CheckSubscriptionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Target *SubscriptionTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckSubscriptionRequest) Reset() { + *x = CheckSubscriptionRequest{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckSubscriptionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckSubscriptionRequest) ProtoMessage() {} + +func (x *CheckSubscriptionRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckSubscriptionRequest.ProtoReflect.Descriptor instead. +func (*CheckSubscriptionRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{4} +} + +func (x *CheckSubscriptionRequest) GetTarget() *SubscriptionTarget { + if x != nil { + return x.Target + } + return nil +} + +type CheckSubscriptionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Subscribed bool `protobuf:"varint,1,opt,name=subscribed,proto3" json:"subscribed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckSubscriptionResponse) Reset() { + *x = CheckSubscriptionResponse{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckSubscriptionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckSubscriptionResponse) ProtoMessage() {} + +func (x *CheckSubscriptionResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckSubscriptionResponse.ProtoReflect.Descriptor instead. +func (*CheckSubscriptionResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{5} +} + +func (x *CheckSubscriptionResponse) GetSubscribed() bool { + if x != nil { + return x.Subscribed + } + return false +} + +type UnsubscribeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Target *SubscriptionTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnsubscribeRequest) Reset() { + *x = UnsubscribeRequest{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnsubscribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsubscribeRequest) ProtoMessage() {} + +func (x *UnsubscribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnsubscribeRequest.ProtoReflect.Descriptor instead. +func (*UnsubscribeRequest) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{6} +} + +func (x *UnsubscribeRequest) GetTarget() *SubscriptionTarget { + if x != nil { + return x.Target + } + return nil +} + +type UnsubscribeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnsubscribeResponse) Reset() { + *x = UnsubscribeResponse{} + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnsubscribeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsubscribeResponse) ProtoMessage() {} + +func (x *UnsubscribeResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_cluster_v2_subscription_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnsubscribeResponse.ProtoReflect.Descriptor instead. +func (*UnsubscribeResponse) Descriptor() ([]byte, []int) { + return file_akp_cluster_v2_subscription_proto_rawDescGZIP(), []int{7} +} + +var File_akp_cluster_v2_subscription_proto protoreflect.FileDescriptor + +const file_akp_cluster_v2_subscription_proto_rawDesc = "" + + "\n" + + "!akp/cluster/v2/subscription.proto\x12\x0eakp.cluster.v2\x1a\x1cakp/cluster/v2/cluster.proto\x1a\x1bbuf/validate/validate.proto\"\x93\x02\n" + + "\x12SubscriptionTarget\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x1c\n" + + "\tnamespace\x18\x02 \x01(\tR\tnamespace\x12:\n" + + "\x06object\x18\x03 \x01(\v2\".akp.cluster.v2.SubscriptionObjectR\x06object:e\xbaHb\x1a`\n" + + "\x16object_needs_namespace\x12\x1ban object is in a namespace\x1a)!has(this.object) || this.namespace != ''\"\x8f\x01\n" + + "\x12SubscriptionObject\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12!\n" + + "\aversion\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\aversion\x12#\n" + + "\bresource\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\bresource\x12\x1b\n" + + "\x04name\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"V\n" + + "\x10SubscribeRequest\x12B\n" + + "\x06target\x18\x01 \x01(\v2\".akp.cluster.v2.SubscriptionTargetB\x06\xbaH\x03\xc8\x01\x01R\x06target\"\x13\n" + + "\x11SubscribeResponse\"^\n" + + "\x18CheckSubscriptionRequest\x12B\n" + + "\x06target\x18\x01 \x01(\v2\".akp.cluster.v2.SubscriptionTargetB\x06\xbaH\x03\xc8\x01\x01R\x06target\";\n" + + "\x19CheckSubscriptionResponse\x12\x1e\n" + + "\n" + + "subscribed\x18\x01 \x01(\bR\n" + + "subscribed\"X\n" + + "\x12UnsubscribeRequest\x12B\n" + + "\x06target\x18\x01 \x01(\v2\".akp.cluster.v2.SubscriptionTargetB\x06\xbaH\x03\xc8\x01\x01R\x06target\"\x15\n" + + "\x13UnsubscribeResponse2\xaf\x02\n" + + "\x13SubscriptionService\x12R\n" + + "\tSubscribe\x12 .akp.cluster.v2.SubscribeRequest\x1a!.akp.cluster.v2.SubscribeResponse\"\x00\x12j\n" + + "\x11CheckSubscription\x12(.akp.cluster.v2.CheckSubscriptionRequest\x1a).akp.cluster.v2.CheckSubscriptionResponse\"\x00\x12X\n" + + "\vUnsubscribe\x12\".akp.cluster.v2.UnsubscribeRequest\x1a#.akp.cluster.v2.UnsubscribeResponse\"\x00B\xbe\x01\n" + + "\x12com.akp.cluster.v2B\x11SubscriptionProtoP\x01Z;go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2;clusterv2\xa2\x02\x03ACX\xaa\x02\x0eAkp.Cluster.V2\xca\x02\x0eAkp\\Cluster\\V2\xe2\x02\x1aAkp\\Cluster\\V2\\GPBMetadata\xea\x02\x10Akp::Cluster::V2b\x06proto3" + +var ( + file_akp_cluster_v2_subscription_proto_rawDescOnce sync.Once + file_akp_cluster_v2_subscription_proto_rawDescData []byte +) + +func file_akp_cluster_v2_subscription_proto_rawDescGZIP() []byte { + file_akp_cluster_v2_subscription_proto_rawDescOnce.Do(func() { + file_akp_cluster_v2_subscription_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_subscription_proto_rawDesc), len(file_akp_cluster_v2_subscription_proto_rawDesc))) + }) + return file_akp_cluster_v2_subscription_proto_rawDescData +} + +var file_akp_cluster_v2_subscription_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_akp_cluster_v2_subscription_proto_goTypes = []any{ + (*SubscriptionTarget)(nil), // 0: akp.cluster.v2.SubscriptionTarget + (*SubscriptionObject)(nil), // 1: akp.cluster.v2.SubscriptionObject + (*SubscribeRequest)(nil), // 2: akp.cluster.v2.SubscribeRequest + (*SubscribeResponse)(nil), // 3: akp.cluster.v2.SubscribeResponse + (*CheckSubscriptionRequest)(nil), // 4: akp.cluster.v2.CheckSubscriptionRequest + (*CheckSubscriptionResponse)(nil), // 5: akp.cluster.v2.CheckSubscriptionResponse + (*UnsubscribeRequest)(nil), // 6: akp.cluster.v2.UnsubscribeRequest + (*UnsubscribeResponse)(nil), // 7: akp.cluster.v2.UnsubscribeResponse + (*ClusterRef)(nil), // 8: akp.cluster.v2.ClusterRef +} +var file_akp_cluster_v2_subscription_proto_depIdxs = []int32{ + 8, // 0: akp.cluster.v2.SubscriptionTarget.cluster:type_name -> akp.cluster.v2.ClusterRef + 1, // 1: akp.cluster.v2.SubscriptionTarget.object:type_name -> akp.cluster.v2.SubscriptionObject + 0, // 2: akp.cluster.v2.SubscribeRequest.target:type_name -> akp.cluster.v2.SubscriptionTarget + 0, // 3: akp.cluster.v2.CheckSubscriptionRequest.target:type_name -> akp.cluster.v2.SubscriptionTarget + 0, // 4: akp.cluster.v2.UnsubscribeRequest.target:type_name -> akp.cluster.v2.SubscriptionTarget + 2, // 5: akp.cluster.v2.SubscriptionService.Subscribe:input_type -> akp.cluster.v2.SubscribeRequest + 4, // 6: akp.cluster.v2.SubscriptionService.CheckSubscription:input_type -> akp.cluster.v2.CheckSubscriptionRequest + 6, // 7: akp.cluster.v2.SubscriptionService.Unsubscribe:input_type -> akp.cluster.v2.UnsubscribeRequest + 3, // 8: akp.cluster.v2.SubscriptionService.Subscribe:output_type -> akp.cluster.v2.SubscribeResponse + 5, // 9: akp.cluster.v2.SubscriptionService.CheckSubscription:output_type -> akp.cluster.v2.CheckSubscriptionResponse + 7, // 10: akp.cluster.v2.SubscriptionService.Unsubscribe:output_type -> akp.cluster.v2.UnsubscribeResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_akp_cluster_v2_subscription_proto_init() } +func file_akp_cluster_v2_subscription_proto_init() { + if File_akp_cluster_v2_subscription_proto != nil { + return + } + file_akp_cluster_v2_cluster_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_cluster_v2_subscription_proto_rawDesc), len(file_akp_cluster_v2_subscription_proto_rawDesc)), + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_cluster_v2_subscription_proto_goTypes, + DependencyIndexes: file_akp_cluster_v2_subscription_proto_depIdxs, + MessageInfos: file_akp_cluster_v2_subscription_proto_msgTypes, + }.Build() + File_akp_cluster_v2_subscription_proto = out.File + file_akp_cluster_v2_subscription_proto_goTypes = nil + file_akp_cluster_v2_subscription_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/ocm/v2/ocm.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/ocm/v2/ocm.pb.go new file mode 100644 index 000000000..b2b60cebb --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/ocm/v2/ocm.pb.go @@ -0,0 +1,6408 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/ocm/v2/ocm.proto + +package ocmv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type HubCluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + NodeCount int32 `protobuf:"varint,3,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"` + Provider string `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"` + Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"` + // hub_type is "OCM", or "OCM-MC" for a multicluster control plane. + HubType string `protobuf:"bytes,6,opt,name=hub_type,json=hubType,proto3" json:"hub_type,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HubCluster) Reset() { + *x = HubCluster{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HubCluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HubCluster) ProtoMessage() {} + +func (x *HubCluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HubCluster.ProtoReflect.Descriptor instead. +func (*HubCluster) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{0} +} + +func (x *HubCluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HubCluster) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *HubCluster) GetNodeCount() int32 { + if x != nil { + return x.NodeCount + } + return 0 +} + +func (x *HubCluster) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *HubCluster) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *HubCluster) GetHubType() string { + if x != nil { + return x.HubType + } + return "" +} + +func (x *HubCluster) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +type ManagedCluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // url is the first API server address the cluster reports. + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + // cluster_uid is the cluster's ID claim. + ClusterUid string `protobuf:"bytes,3,opt,name=cluster_uid,json=clusterUid,proto3" json:"cluster_uid,omitempty"` + ClusterSet string `protobuf:"bytes,4,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + Accepted bool `protobuf:"varint,5,opt,name=accepted,proto3" json:"accepted,omitempty"` + KubernetesVersion string `protobuf:"bytes,6,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` + Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ManagedCluster) Reset() { + *x = ManagedCluster{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ManagedCluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManagedCluster) ProtoMessage() {} + +func (x *ManagedCluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManagedCluster.ProtoReflect.Descriptor instead. +func (*ManagedCluster) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{1} +} + +func (x *ManagedCluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ManagedCluster) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ManagedCluster) GetClusterUid() string { + if x != nil { + return x.ClusterUid + } + return "" +} + +func (x *ManagedCluster) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *ManagedCluster) GetAccepted() bool { + if x != nil { + return x.Accepted + } + return false +} + +func (x *ManagedCluster) GetKubernetesVersion() string { + if x != nil { + return x.KubernetesVersion + } + return "" +} + +func (x *ManagedCluster) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type ListHubClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // owner is the user or organization name. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListHubClustersRequest) Reset() { + *x = ListHubClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListHubClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHubClustersRequest) ProtoMessage() {} + +func (x *ListHubClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListHubClustersRequest.ProtoReflect.Descriptor instead. +func (*ListHubClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{2} +} + +func (x *ListHubClustersRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +type ListHubClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hubs []*HubCluster `protobuf:"bytes,1,rep,name=hubs,proto3" json:"hubs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListHubClustersResponse) Reset() { + *x = ListHubClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListHubClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHubClustersResponse) ProtoMessage() {} + +func (x *ListHubClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListHubClustersResponse.ProtoReflect.Descriptor instead. +func (*ListHubClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{3} +} + +func (x *ListHubClustersResponse) GetHubs() []*HubCluster { + if x != nil { + return x.Hubs + } + return nil +} + +type ListManagedClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListManagedClustersRequest) Reset() { + *x = ListManagedClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListManagedClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListManagedClustersRequest) ProtoMessage() {} + +func (x *ListManagedClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListManagedClustersRequest.ProtoReflect.Descriptor instead. +func (*ListManagedClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{4} +} + +func (x *ListManagedClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +type ListManagedClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*ManagedCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListManagedClustersResponse) Reset() { + *x = ListManagedClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListManagedClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListManagedClustersResponse) ProtoMessage() {} + +func (x *ListManagedClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListManagedClustersResponse.ProtoReflect.Descriptor instead. +func (*ListManagedClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{5} +} + +func (x *ListManagedClustersResponse) GetClusters() []*ManagedCluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ListSpokeClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // accepted lists the clusters the hub accepts, else those it has not accepted yet. + Accepted bool `protobuf:"varint,2,opt,name=accepted,proto3" json:"accepted,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListSpokeClustersRequest) Reset() { + *x = ListSpokeClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSpokeClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSpokeClustersRequest) ProtoMessage() {} + +func (x *ListSpokeClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSpokeClustersRequest.ProtoReflect.Descriptor instead. +func (*ListSpokeClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{6} +} + +func (x *ListSpokeClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListSpokeClustersRequest) GetAccepted() bool { + if x != nil { + return x.Accepted + } + return false +} + +type ListSpokeClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*ManagedCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListSpokeClustersResponse) Reset() { + *x = ListSpokeClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSpokeClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSpokeClustersResponse) ProtoMessage() {} + +func (x *ListSpokeClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSpokeClustersResponse.ProtoReflect.Descriptor instead. +func (*ListSpokeClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{7} +} + +func (x *ListSpokeClustersResponse) GetClusters() []*ManagedCluster { + if x != nil { + return x.Clusters + } + return nil +} + +type AcceptManagedClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + Clusters []string `protobuf:"bytes,2,rep,name=clusters,proto3" json:"clusters,omitempty"` + // skip_approve_check approves every certificate request of the clusters. + SkipApproveCheck bool `protobuf:"varint,3,opt,name=skip_approve_check,json=skipApproveCheck,proto3" json:"skip_approve_check,omitempty"` + // requesters are the requesters whose certificate requests are approved, where several + // requested for one cluster. + Requesters []string `protobuf:"bytes,4,rep,name=requesters,proto3" json:"requesters,omitempty"` + DeployArgocd bool `protobuf:"varint,5,opt,name=deploy_argocd,json=deployArgocd,proto3" json:"deploy_argocd,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AcceptManagedClustersRequest) Reset() { + *x = AcceptManagedClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AcceptManagedClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptManagedClustersRequest) ProtoMessage() {} + +func (x *AcceptManagedClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcceptManagedClustersRequest.ProtoReflect.Descriptor instead. +func (*AcceptManagedClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{8} +} + +func (x *AcceptManagedClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *AcceptManagedClustersRequest) GetClusters() []string { + if x != nil { + return x.Clusters + } + return nil +} + +func (x *AcceptManagedClustersRequest) GetSkipApproveCheck() bool { + if x != nil { + return x.SkipApproveCheck + } + return false +} + +func (x *AcceptManagedClustersRequest) GetRequesters() []string { + if x != nil { + return x.Requesters + } + return nil +} + +func (x *AcceptManagedClustersRequest) GetDeployArgocd() bool { + if x != nil { + return x.DeployArgocd + } + return false +} + +type AcceptManagedClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AcceptManagedClustersResponse) Reset() { + *x = AcceptManagedClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AcceptManagedClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptManagedClustersResponse) ProtoMessage() {} + +func (x *AcceptManagedClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcceptManagedClustersResponse.ProtoReflect.Descriptor instead. +func (*AcceptManagedClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{9} +} + +type RemoveManagedClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveManagedClusterRequest) Reset() { + *x = RemoveManagedClusterRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveManagedClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveManagedClusterRequest) ProtoMessage() {} + +func (x *RemoveManagedClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveManagedClusterRequest.ProtoReflect.Descriptor instead. +func (*RemoveManagedClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{10} +} + +func (x *RemoveManagedClusterRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *RemoveManagedClusterRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +type RemoveManagedClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveManagedClusterResponse) Reset() { + *x = RemoveManagedClusterResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveManagedClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveManagedClusterResponse) ProtoMessage() {} + +func (x *RemoveManagedClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveManagedClusterResponse.ProtoReflect.Descriptor instead. +func (*RemoveManagedClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{11} +} + +type ValidateClusterFeatureSetsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // profile is the cluster profile; the default is the one client organizations need. + Profile string `protobuf:"bytes,2,opt,name=profile,proto3" json:"profile,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateClusterFeatureSetsRequest) Reset() { + *x = ValidateClusterFeatureSetsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateClusterFeatureSetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateClusterFeatureSetsRequest) ProtoMessage() {} + +func (x *ValidateClusterFeatureSetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateClusterFeatureSetsRequest.ProtoReflect.Descriptor instead. +func (*ValidateClusterFeatureSetsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{12} +} + +func (x *ValidateClusterFeatureSetsRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ValidateClusterFeatureSetsRequest) GetProfile() string { + if x != nil { + return x.Profile + } + return "" +} + +type ValidateClusterFeatureSetsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + // disabled_features are the profile's features the cluster has not enabled. + DisabledFeatures []string `protobuf:"bytes,2,rep,name=disabled_features,json=disabledFeatures,proto3" json:"disabled_features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateClusterFeatureSetsResponse) Reset() { + *x = ValidateClusterFeatureSetsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateClusterFeatureSetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateClusterFeatureSetsResponse) ProtoMessage() {} + +func (x *ValidateClusterFeatureSetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateClusterFeatureSetsResponse.ProtoReflect.Descriptor instead. +func (*ValidateClusterFeatureSetsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{13} +} + +func (x *ValidateClusterFeatureSetsResponse) GetValid() bool { + if x != nil { + return x.Valid + } + return false +} + +func (x *ValidateClusterFeatureSetsResponse) GetDisabledFeatures() []string { + if x != nil { + return x.DisabledFeatures + } + return nil +} + +type ListAvailableClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // for_client_organization keeps only the clusters with the features client organizations + // need. + ForClientOrganization bool `protobuf:"varint,2,opt,name=for_client_organization,json=forClientOrganization,proto3" json:"for_client_organization,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAvailableClustersRequest) Reset() { + *x = ListAvailableClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAvailableClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAvailableClustersRequest) ProtoMessage() {} + +func (x *ListAvailableClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAvailableClustersRequest.ProtoReflect.Descriptor instead. +func (*ListAvailableClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{14} +} + +func (x *ListAvailableClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListAvailableClustersRequest) GetForClientOrganization() bool { + if x != nil { + return x.ForClientOrganization + } + return false +} + +type ListAvailableClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*ManagedCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAvailableClustersResponse) Reset() { + *x = ListAvailableClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAvailableClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAvailableClustersResponse) ProtoMessage() {} + +func (x *ListAvailableClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAvailableClustersResponse.ProtoReflect.Descriptor instead. +func (*ListAvailableClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{15} +} + +func (x *ListAvailableClustersResponse) GetClusters() []*ManagedCluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ListAvailableClusterSetsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // for_client_organization leaves out the global, default and control plane sets, and needs + // the features client organizations need. + ForClientOrganization bool `protobuf:"varint,2,opt,name=for_client_organization,json=forClientOrganization,proto3" json:"for_client_organization,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAvailableClusterSetsRequest) Reset() { + *x = ListAvailableClusterSetsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAvailableClusterSetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAvailableClusterSetsRequest) ProtoMessage() {} + +func (x *ListAvailableClusterSetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAvailableClusterSetsRequest.ProtoReflect.Descriptor instead. +func (*ListAvailableClusterSetsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{16} +} + +func (x *ListAvailableClusterSetsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListAvailableClusterSetsRequest) GetForClientOrganization() bool { + if x != nil { + return x.ForClientOrganization + } + return false +} + +type ListAvailableClusterSetsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterSets []string `protobuf:"bytes,1,rep,name=cluster_sets,json=clusterSets,proto3" json:"cluster_sets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAvailableClusterSetsResponse) Reset() { + *x = ListAvailableClusterSetsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAvailableClusterSetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAvailableClusterSetsResponse) ProtoMessage() {} + +func (x *ListAvailableClusterSetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAvailableClusterSetsResponse.ProtoReflect.Descriptor instead. +func (*ListAvailableClusterSetsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{17} +} + +func (x *ListAvailableClusterSetsResponse) GetClusterSets() []string { + if x != nil { + return x.ClusterSets + } + return nil +} + +type ClusterSet struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + ClusterCount int32 `protobuf:"varint,3,opt,name=cluster_count,json=clusterCount,proto3" json:"cluster_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterSet) Reset() { + *x = ClusterSet{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterSet) ProtoMessage() {} + +func (x *ClusterSet) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterSet.ProtoReflect.Descriptor instead. +func (*ClusterSet) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{18} +} + +func (x *ClusterSet) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterSet) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ClusterSet) GetClusterCount() int32 { + if x != nil { + return x.ClusterCount + } + return 0 +} + +type ClusterSetCluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + NodeCount int32 `protobuf:"varint,3,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"` + Provider string `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"` + KubernetesVersion string `protobuf:"bytes,5,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` + // imported is set for a cluster the hub's owner has imported; the rest of the fields are then + // its record's. + Imported bool `protobuf:"varint,6,opt,name=imported,proto3" json:"imported,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterSetCluster) Reset() { + *x = ClusterSetCluster{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterSetCluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterSetCluster) ProtoMessage() {} + +func (x *ClusterSetCluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterSetCluster.ProtoReflect.Descriptor instead. +func (*ClusterSetCluster) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{19} +} + +func (x *ClusterSetCluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterSetCluster) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ClusterSetCluster) GetNodeCount() int32 { + if x != nil { + return x.NodeCount + } + return 0 +} + +func (x *ClusterSetCluster) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *ClusterSetCluster) GetKubernetesVersion() string { + if x != nil { + return x.KubernetesVersion + } + return "" +} + +func (x *ClusterSetCluster) GetImported() bool { + if x != nil { + return x.Imported + } + return false +} + +type ListClusterSetsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClusterSetsRequest) Reset() { + *x = ListClusterSetsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClusterSetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClusterSetsRequest) ProtoMessage() {} + +func (x *ListClusterSetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClusterSetsRequest.ProtoReflect.Descriptor instead. +func (*ListClusterSetsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{20} +} + +func (x *ListClusterSetsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +type ListClusterSetsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterSets []*ClusterSet `protobuf:"bytes,1,rep,name=cluster_sets,json=clusterSets,proto3" json:"cluster_sets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClusterSetsResponse) Reset() { + *x = ListClusterSetsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClusterSetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClusterSetsResponse) ProtoMessage() {} + +func (x *ListClusterSetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClusterSetsResponse.ProtoReflect.Descriptor instead. +func (*ListClusterSetsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{21} +} + +func (x *ListClusterSetsResponse) GetClusterSets() []*ClusterSet { + if x != nil { + return x.ClusterSets + } + return nil +} + +type CreateClusterSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateClusterSetRequest) Reset() { + *x = CreateClusterSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateClusterSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateClusterSetRequest) ProtoMessage() {} + +func (x *CreateClusterSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateClusterSetRequest.ProtoReflect.Descriptor instead. +func (*CreateClusterSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{22} +} + +func (x *CreateClusterSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *CreateClusterSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type CreateClusterSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateClusterSetResponse) Reset() { + *x = CreateClusterSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateClusterSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateClusterSetResponse) ProtoMessage() {} + +func (x *CreateClusterSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateClusterSetResponse.ProtoReflect.Descriptor instead. +func (*CreateClusterSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{23} +} + +type DeleteClusterSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClusterSetRequest) Reset() { + *x = DeleteClusterSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClusterSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClusterSetRequest) ProtoMessage() {} + +func (x *DeleteClusterSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClusterSetRequest.ProtoReflect.Descriptor instead. +func (*DeleteClusterSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{24} +} + +func (x *DeleteClusterSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *DeleteClusterSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type DeleteClusterSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClusterSetResponse) Reset() { + *x = DeleteClusterSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClusterSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClusterSetResponse) ProtoMessage() {} + +func (x *DeleteClusterSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClusterSetResponse.ProtoReflect.Descriptor instead. +func (*DeleteClusterSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{25} +} + +type AddClustersToClusterSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + Clusters []string `protobuf:"bytes,3,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddClustersToClusterSetRequest) Reset() { + *x = AddClustersToClusterSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddClustersToClusterSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddClustersToClusterSetRequest) ProtoMessage() {} + +func (x *AddClustersToClusterSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddClustersToClusterSetRequest.ProtoReflect.Descriptor instead. +func (*AddClustersToClusterSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{26} +} + +func (x *AddClustersToClusterSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *AddClustersToClusterSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *AddClustersToClusterSetRequest) GetClusters() []string { + if x != nil { + return x.Clusters + } + return nil +} + +type AddClustersToClusterSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // already_in are the clusters that were in the set already. + AlreadyIn []string `protobuf:"bytes,1,rep,name=already_in,json=alreadyIn,proto3" json:"already_in,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddClustersToClusterSetResponse) Reset() { + *x = AddClustersToClusterSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddClustersToClusterSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddClustersToClusterSetResponse) ProtoMessage() {} + +func (x *AddClustersToClusterSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddClustersToClusterSetResponse.ProtoReflect.Descriptor instead. +func (*AddClustersToClusterSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{27} +} + +func (x *AddClustersToClusterSetResponse) GetAlreadyIn() []string { + if x != nil { + return x.AlreadyIn + } + return nil +} + +type RemoveClustersFromClusterSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + Clusters []string `protobuf:"bytes,3,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClustersFromClusterSetRequest) Reset() { + *x = RemoveClustersFromClusterSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClustersFromClusterSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClustersFromClusterSetRequest) ProtoMessage() {} + +func (x *RemoveClustersFromClusterSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClustersFromClusterSetRequest.ProtoReflect.Descriptor instead. +func (*RemoveClustersFromClusterSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{28} +} + +func (x *RemoveClustersFromClusterSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *RemoveClustersFromClusterSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *RemoveClustersFromClusterSetRequest) GetClusters() []string { + if x != nil { + return x.Clusters + } + return nil +} + +type RemoveClustersFromClusterSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClustersFromClusterSetResponse) Reset() { + *x = RemoveClustersFromClusterSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClustersFromClusterSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClustersFromClusterSetResponse) ProtoMessage() {} + +func (x *RemoveClustersFromClusterSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClustersFromClusterSetResponse.ProtoReflect.Descriptor instead. +func (*RemoveClustersFromClusterSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{29} +} + +type ListClusterSetClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClusterSetClustersRequest) Reset() { + *x = ListClusterSetClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClusterSetClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClusterSetClustersRequest) ProtoMessage() {} + +func (x *ListClusterSetClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClusterSetClustersRequest.ProtoReflect.Descriptor instead. +func (*ListClusterSetClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{30} +} + +func (x *ListClusterSetClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListClusterSetClustersRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type ListClusterSetClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*ClusterSetCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClusterSetClustersResponse) Reset() { + *x = ListClusterSetClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClusterSetClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClusterSetClustersResponse) ProtoMessage() {} + +func (x *ListClusterSetClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClusterSetClustersResponse.ProtoReflect.Descriptor instead. +func (*ListClusterSetClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{31} +} + +func (x *ListClusterSetClustersResponse) GetClusters() []*ClusterSetCluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ListAddableClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAddableClustersRequest) Reset() { + *x = ListAddableClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAddableClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAddableClustersRequest) ProtoMessage() {} + +func (x *ListAddableClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAddableClustersRequest.ProtoReflect.Descriptor instead. +func (*ListAddableClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{32} +} + +func (x *ListAddableClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListAddableClustersRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type ListAddableClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []string `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAddableClustersResponse) Reset() { + *x = ListAddableClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAddableClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAddableClustersResponse) ProtoMessage() {} + +func (x *ListAddableClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAddableClustersResponse.ProtoReflect.Descriptor instead. +func (*ListAddableClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{33} +} + +func (x *ListAddableClustersResponse) GetClusters() []string { + if x != nil { + return x.Clusters + } + return nil +} + +type BoundNamespace struct { + state protoimpl.MessageState `protogen:"open.v1"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + ClusterSets []string `protobuf:"bytes,2,rep,name=cluster_sets,json=clusterSets,proto3" json:"cluster_sets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BoundNamespace) Reset() { + *x = BoundNamespace{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BoundNamespace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoundNamespace) ProtoMessage() {} + +func (x *BoundNamespace) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoundNamespace.ProtoReflect.Descriptor instead. +func (*BoundNamespace) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{34} +} + +func (x *BoundNamespace) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *BoundNamespace) GetClusterSets() []string { + if x != nil { + return x.ClusterSets + } + return nil +} + +type ListBoundNamespacesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBoundNamespacesRequest) Reset() { + *x = ListBoundNamespacesRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBoundNamespacesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBoundNamespacesRequest) ProtoMessage() {} + +func (x *ListBoundNamespacesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBoundNamespacesRequest.ProtoReflect.Descriptor instead. +func (*ListBoundNamespacesRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{35} +} + +func (x *ListBoundNamespacesRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +type ListBoundNamespacesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Namespaces []*BoundNamespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBoundNamespacesResponse) Reset() { + *x = ListBoundNamespacesResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBoundNamespacesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBoundNamespacesResponse) ProtoMessage() {} + +func (x *ListBoundNamespacesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBoundNamespacesResponse.ProtoReflect.Descriptor instead. +func (*ListBoundNamespacesResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{36} +} + +func (x *ListBoundNamespacesResponse) GetNamespaces() []*BoundNamespace { + if x != nil { + return x.Namespaces + } + return nil +} + +type BindNamespaceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BindNamespaceRequest) Reset() { + *x = BindNamespaceRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BindNamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindNamespaceRequest) ProtoMessage() {} + +func (x *BindNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BindNamespaceRequest.ProtoReflect.Descriptor instead. +func (*BindNamespaceRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{37} +} + +func (x *BindNamespaceRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *BindNamespaceRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *BindNamespaceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type BindNamespaceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BindNamespaceResponse) Reset() { + *x = BindNamespaceResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BindNamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindNamespaceResponse) ProtoMessage() {} + +func (x *BindNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BindNamespaceResponse.ProtoReflect.Descriptor instead. +func (*BindNamespaceResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{38} +} + +type UnbindNamespaceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnbindNamespaceRequest) Reset() { + *x = UnbindNamespaceRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnbindNamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnbindNamespaceRequest) ProtoMessage() {} + +func (x *UnbindNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnbindNamespaceRequest.ProtoReflect.Descriptor instead. +func (*UnbindNamespaceRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{39} +} + +func (x *UnbindNamespaceRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *UnbindNamespaceRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *UnbindNamespaceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type UnbindNamespaceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnbindNamespaceResponse) Reset() { + *x = UnbindNamespaceResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnbindNamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnbindNamespaceResponse) ProtoMessage() {} + +func (x *UnbindNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnbindNamespaceResponse.ProtoReflect.Descriptor instead. +func (*UnbindNamespaceResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{40} +} + +// HubUser is an AKP user, as hub users are shown. +type HubUser struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HubUser) Reset() { + *x = HubUser{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HubUser) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HubUser) ProtoMessage() {} + +func (x *HubUser) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HubUser.ProtoReflect.Descriptor instead. +func (*HubUser) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{41} +} + +func (x *HubUser) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *HubUser) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HubUser) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *HubUser) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +type RoleMembers struct { + state protoimpl.MessageState `protogen:"open.v1"` + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Users []*HubUser `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleMembers) Reset() { + *x = RoleMembers{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleMembers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleMembers) ProtoMessage() {} + +func (x *RoleMembers) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoleMembers.ProtoReflect.Descriptor instead. +func (*RoleMembers) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{42} +} + +func (x *RoleMembers) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *RoleMembers) GetUsers() []*HubUser { + if x != nil { + return x.Users + } + return nil +} + +type GetClusterSetAuthInfoRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterSetAuthInfoRequest) Reset() { + *x = GetClusterSetAuthInfoRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterSetAuthInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterSetAuthInfoRequest) ProtoMessage() {} + +func (x *GetClusterSetAuthInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterSetAuthInfoRequest.ProtoReflect.Descriptor instead. +func (*GetClusterSetAuthInfoRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{43} +} + +func (x *GetClusterSetAuthInfoRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetClusterSetAuthInfoRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type GetClusterSetAuthInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Roles []*RoleMembers `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterSetAuthInfoResponse) Reset() { + *x = GetClusterSetAuthInfoResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterSetAuthInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterSetAuthInfoResponse) ProtoMessage() {} + +func (x *GetClusterSetAuthInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterSetAuthInfoResponse.ProtoReflect.Descriptor instead. +func (*GetClusterSetAuthInfoResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{44} +} + +func (x *GetClusterSetAuthInfoResponse) GetRoles() []*RoleMembers { + if x != nil { + return x.Roles + } + return nil +} + +// Permission is a role a user has on a managed cluster or a cluster set. +type Permission struct { + state protoimpl.MessageState `protogen:"open.v1"` + // name is the cluster's or cluster set's. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ClusterSet bool `protobuf:"varint,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + // role_kind is "ClusterRole" or "Role". + RoleKind string `protobuf:"bytes,3,opt,name=role_kind,json=roleKind,proto3" json:"role_kind,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` + // role_namespaces narrow the role to namespaces; none is every namespace. + RoleNamespaces []string `protobuf:"bytes,5,rep,name=role_namespaces,json=roleNamespaces,proto3" json:"role_namespaces,omitempty"` + // binding is the name of the binding that grants the permission. + Binding string `protobuf:"bytes,6,opt,name=binding,proto3" json:"binding,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Permission) Reset() { + *x = Permission{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Permission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Permission) ProtoMessage() {} + +func (x *Permission) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Permission.ProtoReflect.Descriptor instead. +func (*Permission) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{45} +} + +func (x *Permission) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Permission) GetClusterSet() bool { + if x != nil { + return x.ClusterSet + } + return false +} + +func (x *Permission) GetRoleKind() string { + if x != nil { + return x.RoleKind + } + return "" +} + +func (x *Permission) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *Permission) GetRoleNamespaces() []string { + if x != nil { + return x.RoleNamespaces + } + return nil +} + +func (x *Permission) GetBinding() string { + if x != nil { + return x.Binding + } + return "" +} + +type SyncAccountsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncAccountsRequest) Reset() { + *x = SyncAccountsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncAccountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncAccountsRequest) ProtoMessage() {} + +func (x *SyncAccountsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncAccountsRequest.ProtoReflect.Descriptor instead. +func (*SyncAccountsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{46} +} + +func (x *SyncAccountsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +type SyncAccountsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncAccountsResponse) Reset() { + *x = SyncAccountsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncAccountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncAccountsResponse) ProtoMessage() {} + +func (x *SyncAccountsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncAccountsResponse.ProtoReflect.Descriptor instead. +func (*SyncAccountsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{47} +} + +type ListUsersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUsersRequest) Reset() { + *x = ListUsersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersRequest) ProtoMessage() {} + +func (x *ListUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead. +func (*ListUsersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{48} +} + +func (x *ListUsersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +type ListUsersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*HubUser `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUsersResponse) Reset() { + *x = ListUsersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersResponse) ProtoMessage() {} + +func (x *ListUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead. +func (*ListUsersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{49} +} + +func (x *ListUsersResponse) GetUsers() []*HubUser { + if x != nil { + return x.Users + } + return nil +} + +type CreateUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // user_name is the AKP user's. + UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{50} +} + +func (x *CreateUserRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *CreateUserRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *CreateUserRequest) GetPermissions() []*Permission { + if x != nil { + return x.Permissions + } + return nil +} + +type CreateUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserResponse) Reset() { + *x = CreateUserResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserResponse) ProtoMessage() {} + +func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. +func (*CreateUserResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{51} +} + +type UpdateUserPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserPermissionsRequest) Reset() { + *x = UpdateUserPermissionsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserPermissionsRequest) ProtoMessage() {} + +func (x *UpdateUserPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserPermissionsRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserPermissionsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{52} +} + +func (x *UpdateUserPermissionsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *UpdateUserPermissionsRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *UpdateUserPermissionsRequest) GetPermissions() []*Permission { + if x != nil { + return x.Permissions + } + return nil +} + +type UpdateUserPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserPermissionsResponse) Reset() { + *x = UpdateUserPermissionsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserPermissionsResponse) ProtoMessage() {} + +func (x *UpdateUserPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserPermissionsResponse.ProtoReflect.Descriptor instead. +func (*UpdateUserPermissionsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{53} +} + +type GetUserPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserPermissionsRequest) Reset() { + *x = GetUserPermissionsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserPermissionsRequest) ProtoMessage() {} + +func (x *GetUserPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserPermissionsRequest.ProtoReflect.Descriptor instead. +func (*GetUserPermissionsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{54} +} + +func (x *GetUserPermissionsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetUserPermissionsRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type GetUserPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterPermissions []*Permission `protobuf:"bytes,1,rep,name=cluster_permissions,json=clusterPermissions,proto3" json:"cluster_permissions,omitempty"` + ClusterSetPermissions []*Permission `protobuf:"bytes,2,rep,name=cluster_set_permissions,json=clusterSetPermissions,proto3" json:"cluster_set_permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserPermissionsResponse) Reset() { + *x = GetUserPermissionsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserPermissionsResponse) ProtoMessage() {} + +func (x *GetUserPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserPermissionsResponse.ProtoReflect.Descriptor instead. +func (*GetUserPermissionsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{55} +} + +func (x *GetUserPermissionsResponse) GetClusterPermissions() []*Permission { + if x != nil { + return x.ClusterPermissions + } + return nil +} + +func (x *GetUserPermissionsResponse) GetClusterSetPermissions() []*Permission { + if x != nil { + return x.ClusterSetPermissions + } + return nil +} + +type ListUserClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUserClustersRequest) Reset() { + *x = ListUserClustersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUserClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserClustersRequest) ProtoMessage() {} + +func (x *ListUserClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserClustersRequest.ProtoReflect.Descriptor instead. +func (*ListUserClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{56} +} + +func (x *ListUserClustersRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListUserClustersRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type ListUserClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []string `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUserClustersResponse) Reset() { + *x = ListUserClustersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUserClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserClustersResponse) ProtoMessage() {} + +func (x *ListUserClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserClustersResponse.ProtoReflect.Descriptor instead. +func (*ListUserClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{57} +} + +func (x *ListUserClustersResponse) GetClusters() []string { + if x != nil { + return x.Clusters + } + return nil +} + +type GetUserKubeconfigRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + // cluster is the managed cluster's name. + Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserKubeconfigRequest) Reset() { + *x = GetUserKubeconfigRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserKubeconfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserKubeconfigRequest) ProtoMessage() {} + +func (x *GetUserKubeconfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserKubeconfigRequest.ProtoReflect.Descriptor instead. +func (*GetUserKubeconfigRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{58} +} + +func (x *GetUserKubeconfigRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetUserKubeconfigRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetUserKubeconfigRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +type GetUserKubeconfigResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // kubeconfig is YAML. + Kubeconfig []byte `protobuf:"bytes,1,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserKubeconfigResponse) Reset() { + *x = GetUserKubeconfigResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserKubeconfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserKubeconfigResponse) ProtoMessage() {} + +func (x *GetUserKubeconfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserKubeconfigResponse.ProtoReflect.Descriptor instead. +func (*GetUserKubeconfigResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{59} +} + +func (x *GetUserKubeconfigResponse) GetKubeconfig() []byte { + if x != nil { + return x.Kubeconfig + } + return nil +} + +// BindingRef names a namespaced binding. +type BindingRef struct { + state protoimpl.MessageState `protogen:"open.v1"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BindingRef) Reset() { + *x = BindingRef{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BindingRef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindingRef) ProtoMessage() {} + +func (x *BindingRef) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[60] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BindingRef.ProtoReflect.Descriptor instead. +func (*BindingRef) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{60} +} + +func (x *BindingRef) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *BindingRef) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type RemoveUserPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // cluster_set_bindings name the cluster set role bindings to delete. + ClusterSetBindings []string `protobuf:"bytes,2,rep,name=cluster_set_bindings,json=clusterSetBindings,proto3" json:"cluster_set_bindings,omitempty"` + // cluster_bindings name the cluster role bindings to delete. + ClusterBindings []*BindingRef `protobuf:"bytes,3,rep,name=cluster_bindings,json=clusterBindings,proto3" json:"cluster_bindings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveUserPermissionsRequest) Reset() { + *x = RemoveUserPermissionsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveUserPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveUserPermissionsRequest) ProtoMessage() {} + +func (x *RemoveUserPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[61] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveUserPermissionsRequest.ProtoReflect.Descriptor instead. +func (*RemoveUserPermissionsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{61} +} + +func (x *RemoveUserPermissionsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *RemoveUserPermissionsRequest) GetClusterSetBindings() []string { + if x != nil { + return x.ClusterSetBindings + } + return nil +} + +func (x *RemoveUserPermissionsRequest) GetClusterBindings() []*BindingRef { + if x != nil { + return x.ClusterBindings + } + return nil +} + +type RemoveUserPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveUserPermissionsResponse) Reset() { + *x = RemoveUserPermissionsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveUserPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveUserPermissionsResponse) ProtoMessage() {} + +func (x *RemoveUserPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[62] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveUserPermissionsResponse.ProtoReflect.Descriptor instead. +func (*RemoveUserPermissionsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{62} +} + +type DeleteUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[63] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{63} +} + +func (x *DeleteUserRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *DeleteUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type DeleteUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteUserResponse) Reset() { + *x = DeleteUserResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserResponse) ProtoMessage() {} + +func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[64] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. +func (*DeleteUserResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{64} +} + +type Feature struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Recommended bool `protobuf:"varint,4,opt,name=recommended,proto3" json:"recommended,omitempty"` + Installed bool `protobuf:"varint,5,opt,name=installed,proto3" json:"installed,omitempty"` + FeatureBlock string `protobuf:"bytes,6,opt,name=feature_block,json=featureBlock,proto3" json:"feature_block,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Feature) Reset() { + *x = Feature{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Feature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Feature) ProtoMessage() {} + +func (x *Feature) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[65] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Feature.ProtoReflect.Descriptor instead. +func (*Feature) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{65} +} + +func (x *Feature) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Feature) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Feature) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Feature) GetRecommended() bool { + if x != nil { + return x.Recommended + } + return false +} + +func (x *Feature) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +func (x *Feature) GetFeatureBlock() string { + if x != nil { + return x.FeatureBlock + } + return "" +} + +type FeatureSet struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Recommended bool `protobuf:"varint,4,opt,name=recommended,proto3" json:"recommended,omitempty"` + Features []*Feature `protobuf:"bytes,5,rep,name=features,proto3" json:"features,omitempty"` + RequiredFeatures []string `protobuf:"bytes,6,rep,name=required_features,json=requiredFeatures,proto3" json:"required_features,omitempty"` + Installed bool `protobuf:"varint,7,opt,name=installed,proto3" json:"installed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeatureSet) Reset() { + *x = FeatureSet{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeatureSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSet) ProtoMessage() {} + +func (x *FeatureSet) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[66] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSet.ProtoReflect.Descriptor instead. +func (*FeatureSet) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{66} +} + +func (x *FeatureSet) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FeatureSet) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *FeatureSet) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *FeatureSet) GetRecommended() bool { + if x != nil { + return x.Recommended + } + return false +} + +func (x *FeatureSet) GetFeatures() []*Feature { + if x != nil { + return x.Features + } + return nil +} + +func (x *FeatureSet) GetRequiredFeatures() []string { + if x != nil { + return x.RequiredFeatures + } + return nil +} + +func (x *FeatureSet) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +type ListFeatureSetsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFeatureSetsRequest) Reset() { + *x = ListFeatureSetsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFeatureSetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFeatureSetsRequest) ProtoMessage() {} + +func (x *ListFeatureSetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[67] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFeatureSetsRequest.ProtoReflect.Descriptor instead. +func (*ListFeatureSetsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{67} +} + +func (x *ListFeatureSetsRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ListFeatureSetsRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type ListFeatureSetsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + FeatureSets []*FeatureSet `protobuf:"bytes,1,rep,name=feature_sets,json=featureSets,proto3" json:"feature_sets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFeatureSetsResponse) Reset() { + *x = ListFeatureSetsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFeatureSetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFeatureSetsResponse) ProtoMessage() {} + +func (x *ListFeatureSetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[68] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFeatureSetsResponse.ProtoReflect.Descriptor instead. +func (*ListFeatureSetsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{68} +} + +func (x *ListFeatureSetsResponse) GetFeatureSets() []*FeatureSet { + if x != nil { + return x.FeatureSets + } + return nil +} + +type InstallFeatureSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + // chart is the feature set editor's chart. + Chart string `protobuf:"bytes,3,opt,name=chart,proto3" json:"chart,omitempty"` + // model is the editor's model; its resources are the features' HelmReleases. + Model *structpb.Struct `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstallFeatureSetRequest) Reset() { + *x = InstallFeatureSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstallFeatureSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallFeatureSetRequest) ProtoMessage() {} + +func (x *InstallFeatureSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[69] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallFeatureSetRequest.ProtoReflect.Descriptor instead. +func (*InstallFeatureSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{69} +} + +func (x *InstallFeatureSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *InstallFeatureSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *InstallFeatureSetRequest) GetChart() string { + if x != nil { + return x.Chart + } + return "" +} + +func (x *InstallFeatureSetRequest) GetModel() *structpb.Struct { + if x != nil { + return x.Model + } + return nil +} + +type InstallFeatureSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstallFeatureSetResponse) Reset() { + *x = InstallFeatureSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstallFeatureSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallFeatureSetResponse) ProtoMessage() {} + +func (x *InstallFeatureSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[70] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallFeatureSetResponse.ProtoReflect.Descriptor instead. +func (*InstallFeatureSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{70} +} + +type UpdateClusterFeatureSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + // cluster is the managed cluster's name. + Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` + Chart string `protobuf:"bytes,4,opt,name=chart,proto3" json:"chart,omitempty"` + Model *structpb.Struct `protobuf:"bytes,5,opt,name=model,proto3" json:"model,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateClusterFeatureSetRequest) Reset() { + *x = UpdateClusterFeatureSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateClusterFeatureSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateClusterFeatureSetRequest) ProtoMessage() {} + +func (x *UpdateClusterFeatureSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[71] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateClusterFeatureSetRequest.ProtoReflect.Descriptor instead. +func (*UpdateClusterFeatureSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{71} +} + +func (x *UpdateClusterFeatureSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *UpdateClusterFeatureSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *UpdateClusterFeatureSetRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *UpdateClusterFeatureSetRequest) GetChart() string { + if x != nil { + return x.Chart + } + return "" +} + +func (x *UpdateClusterFeatureSetRequest) GetModel() *structpb.Struct { + if x != nil { + return x.Model + } + return nil +} + +type UpdateClusterFeatureSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateClusterFeatureSetResponse) Reset() { + *x = UpdateClusterFeatureSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateClusterFeatureSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateClusterFeatureSetResponse) ProtoMessage() {} + +func (x *UpdateClusterFeatureSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[72] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateClusterFeatureSetResponse.ProtoReflect.Descriptor instead. +func (*UpdateClusterFeatureSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{72} +} + +type DisableFeatureSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + FeatureSet string `protobuf:"bytes,3,opt,name=feature_set,json=featureSet,proto3" json:"feature_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DisableFeatureSetRequest) Reset() { + *x = DisableFeatureSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisableFeatureSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableFeatureSetRequest) ProtoMessage() {} + +func (x *DisableFeatureSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[73] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableFeatureSetRequest.ProtoReflect.Descriptor instead. +func (*DisableFeatureSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{73} +} + +func (x *DisableFeatureSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *DisableFeatureSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *DisableFeatureSetRequest) GetFeatureSet() string { + if x != nil { + return x.FeatureSet + } + return "" +} + +type DisableFeatureSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DisableFeatureSetResponse) Reset() { + *x = DisableFeatureSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisableFeatureSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableFeatureSetResponse) ProtoMessage() {} + +func (x *DisableFeatureSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[74] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableFeatureSetResponse.ProtoReflect.Descriptor instead. +func (*DisableFeatureSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{74} +} + +type CheckAutoUpdateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckAutoUpdateRequest) Reset() { + *x = CheckAutoUpdateRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckAutoUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckAutoUpdateRequest) ProtoMessage() {} + +func (x *CheckAutoUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[75] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckAutoUpdateRequest.ProtoReflect.Descriptor instead. +func (*CheckAutoUpdateRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{75} +} + +func (x *CheckAutoUpdateRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *CheckAutoUpdateRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type CheckAutoUpdateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Possible bool `protobuf:"varint,1,opt,name=possible,proto3" json:"possible,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckAutoUpdateResponse) Reset() { + *x = CheckAutoUpdateResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckAutoUpdateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckAutoUpdateResponse) ProtoMessage() {} + +func (x *CheckAutoUpdateResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[76] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckAutoUpdateResponse.ProtoReflect.Descriptor instead. +func (*CheckAutoUpdateResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{76} +} + +func (x *CheckAutoUpdateResponse) GetPossible() bool { + if x != nil { + return x.Possible + } + return false +} + +type AutoUpdateClusterSetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AutoUpdateClusterSetRequest) Reset() { + *x = AutoUpdateClusterSetRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AutoUpdateClusterSetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoUpdateClusterSetRequest) ProtoMessage() {} + +func (x *AutoUpdateClusterSetRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[77] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoUpdateClusterSetRequest.ProtoReflect.Descriptor instead. +func (*AutoUpdateClusterSetRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{77} +} + +func (x *AutoUpdateClusterSetRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *AutoUpdateClusterSetRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type AutoUpdateClusterSetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AutoUpdateClusterSetResponse) Reset() { + *x = AutoUpdateClusterSetResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AutoUpdateClusterSetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoUpdateClusterSetResponse) ProtoMessage() {} + +func (x *AutoUpdateClusterSetResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[78] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoUpdateClusterSetResponse.ProtoReflect.Descriptor instead. +func (*AutoUpdateClusterSetResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{78} +} + +type FeatureSyncStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + FeatureSet string `protobuf:"bytes,1,opt,name=feature_set,json=featureSet,proto3" json:"feature_set,omitempty"` + Feature string `protobuf:"bytes,2,opt,name=feature,proto3" json:"feature,omitempty"` + InSyncClusters []string `protobuf:"bytes,3,rep,name=in_sync_clusters,json=inSyncClusters,proto3" json:"in_sync_clusters,omitempty"` + // unaligned_clusters have the feature enabled though the profile does not have it. + UnalignedClusters []string `protobuf:"bytes,4,rep,name=unaligned_clusters,json=unalignedClusters,proto3" json:"unaligned_clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeatureSyncStatus) Reset() { + *x = FeatureSyncStatus{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[79] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeatureSyncStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSyncStatus) ProtoMessage() {} + +func (x *FeatureSyncStatus) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[79] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSyncStatus.ProtoReflect.Descriptor instead. +func (*FeatureSyncStatus) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{79} +} + +func (x *FeatureSyncStatus) GetFeatureSet() string { + if x != nil { + return x.FeatureSet + } + return "" +} + +func (x *FeatureSyncStatus) GetFeature() string { + if x != nil { + return x.Feature + } + return "" +} + +func (x *FeatureSyncStatus) GetInSyncClusters() []string { + if x != nil { + return x.InSyncClusters + } + return nil +} + +func (x *FeatureSyncStatus) GetUnalignedClusters() []string { + if x != nil { + return x.UnalignedClusters + } + return nil +} + +type GetFeatureSetsSyncStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeatureSetsSyncStatusRequest) Reset() { + *x = GetFeatureSetsSyncStatusRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[80] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeatureSetsSyncStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeatureSetsSyncStatusRequest) ProtoMessage() {} + +func (x *GetFeatureSetsSyncStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[80] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFeatureSetsSyncStatusRequest.ProtoReflect.Descriptor instead. +func (*GetFeatureSetsSyncStatusRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{80} +} + +func (x *GetFeatureSetsSyncStatusRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetFeatureSetsSyncStatusRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type GetFeatureSetsSyncStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Features []*FeatureSyncStatus `protobuf:"bytes,1,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeatureSetsSyncStatusResponse) Reset() { + *x = GetFeatureSetsSyncStatusResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeatureSetsSyncStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeatureSetsSyncStatusResponse) ProtoMessage() {} + +func (x *GetFeatureSetsSyncStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[81] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFeatureSetsSyncStatusResponse.ProtoReflect.Descriptor instead. +func (*GetFeatureSetsSyncStatusResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{81} +} + +func (x *GetFeatureSetsSyncStatusResponse) GetFeatures() []*FeatureSyncStatus { + if x != nil { + return x.Features + } + return nil +} + +type ClusterVersion struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterVersion) Reset() { + *x = ClusterVersion{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[82] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterVersion) ProtoMessage() {} + +func (x *ClusterVersion) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[82] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterVersion.ProtoReflect.Descriptor instead. +func (*ClusterVersion) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{82} +} + +func (x *ClusterVersion) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *ClusterVersion) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type GetOpscenterFeaturesVersionSyncRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOpscenterFeaturesVersionSyncRequest) Reset() { + *x = GetOpscenterFeaturesVersionSyncRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[83] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOpscenterFeaturesVersionSyncRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOpscenterFeaturesVersionSyncRequest) ProtoMessage() {} + +func (x *GetOpscenterFeaturesVersionSyncRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[83] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOpscenterFeaturesVersionSyncRequest.ProtoReflect.Descriptor instead. +func (*GetOpscenterFeaturesVersionSyncRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{83} +} + +func (x *GetOpscenterFeaturesVersionSyncRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetOpscenterFeaturesVersionSyncRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +type GetOpscenterFeaturesVersionSyncResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterSetVersion string `protobuf:"bytes,1,opt,name=cluster_set_version,json=clusterSetVersion,proto3" json:"cluster_set_version,omitempty"` + Clusters []*ClusterVersion `protobuf:"bytes,2,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOpscenterFeaturesVersionSyncResponse) Reset() { + *x = GetOpscenterFeaturesVersionSyncResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOpscenterFeaturesVersionSyncResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOpscenterFeaturesVersionSyncResponse) ProtoMessage() {} + +func (x *GetOpscenterFeaturesVersionSyncResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[84] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOpscenterFeaturesVersionSyncResponse.ProtoReflect.Descriptor instead. +func (*GetOpscenterFeaturesVersionSyncResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{84} +} + +func (x *GetOpscenterFeaturesVersionSyncResponse) GetClusterSetVersion() string { + if x != nil { + return x.ClusterSetVersion + } + return "" +} + +func (x *GetOpscenterFeaturesVersionSyncResponse) GetClusters() []*ClusterVersion { + if x != nil { + return x.Clusters + } + return nil +} + +type GetFeatureSyncStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + ClusterSet string `protobuf:"bytes,2,opt,name=cluster_set,json=clusterSet,proto3" json:"cluster_set,omitempty"` + Feature string `protobuf:"bytes,3,opt,name=feature,proto3" json:"feature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeatureSyncStatusRequest) Reset() { + *x = GetFeatureSyncStatusRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[85] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeatureSyncStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeatureSyncStatusRequest) ProtoMessage() {} + +func (x *GetFeatureSyncStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[85] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFeatureSyncStatusRequest.ProtoReflect.Descriptor instead. +func (*GetFeatureSyncStatusRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{85} +} + +func (x *GetFeatureSyncStatusRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetFeatureSyncStatusRequest) GetClusterSet() string { + if x != nil { + return x.ClusterSet + } + return "" +} + +func (x *GetFeatureSyncStatusRequest) GetFeature() string { + if x != nil { + return x.Feature + } + return "" +} + +type GetFeatureSyncStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + InSyncClusters []string `protobuf:"bytes,1,rep,name=in_sync_clusters,json=inSyncClusters,proto3" json:"in_sync_clusters,omitempty"` + OutOfSyncClusters []string `protobuf:"bytes,2,rep,name=out_of_sync_clusters,json=outOfSyncClusters,proto3" json:"out_of_sync_clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFeatureSyncStatusResponse) Reset() { + *x = GetFeatureSyncStatusResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[86] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFeatureSyncStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeatureSyncStatusResponse) ProtoMessage() {} + +func (x *GetFeatureSyncStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[86] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFeatureSyncStatusResponse.ProtoReflect.Descriptor instead. +func (*GetFeatureSyncStatusResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{86} +} + +func (x *GetFeatureSyncStatusResponse) GetInSyncClusters() []string { + if x != nil { + return x.InSyncClusters + } + return nil +} + +func (x *GetFeatureSyncStatusResponse) GetOutOfSyncClusters() []string { + if x != nil { + return x.OutOfSyncClusters + } + return nil +} + +type GetSpokeInstallCommandRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // cluster is the name the cluster joins the hub with. + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSpokeInstallCommandRequest) Reset() { + *x = GetSpokeInstallCommandRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[87] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSpokeInstallCommandRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSpokeInstallCommandRequest) ProtoMessage() {} + +func (x *GetSpokeInstallCommandRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[87] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSpokeInstallCommandRequest.ProtoReflect.Descriptor instead. +func (*GetSpokeInstallCommandRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{87} +} + +func (x *GetSpokeInstallCommandRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *GetSpokeInstallCommandRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +type GetSpokeInstallCommandResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSpokeInstallCommandResponse) Reset() { + *x = GetSpokeInstallCommandResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[88] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSpokeInstallCommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSpokeInstallCommandResponse) ProtoMessage() {} + +func (x *GetSpokeInstallCommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[88] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSpokeInstallCommandResponse.ProtoReflect.Descriptor instead. +func (*GetSpokeInstallCommandResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{88} +} + +func (x *GetSpokeInstallCommandResponse) GetCommand() string { + if x != nil { + return x.Command + } + return "" +} + +type ImportManagedClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hub *v2.ClusterRef `protobuf:"bytes,1,opt,name=hub,proto3" json:"hub,omitempty"` + // cluster is the managed cluster's name. + Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"` + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + FeatureSets []*v2.FeatureSet `protobuf:"bytes,4,rep,name=feature_sets,json=featureSets,proto3" json:"feature_sets,omitempty"` + ClusterProfile string `protobuf:"bytes,5,opt,name=cluster_profile,json=clusterProfile,proto3" json:"cluster_profile,omitempty"` + Operation *v2.OperationOptions `protobuf:"bytes,6,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImportManagedClusterRequest) Reset() { + *x = ImportManagedClusterRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[89] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImportManagedClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportManagedClusterRequest) ProtoMessage() {} + +func (x *ImportManagedClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[89] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportManagedClusterRequest.ProtoReflect.Descriptor instead. +func (*ImportManagedClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{89} +} + +func (x *ImportManagedClusterRequest) GetHub() *v2.ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +func (x *ImportManagedClusterRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *ImportManagedClusterRequest) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *ImportManagedClusterRequest) GetFeatureSets() []*v2.FeatureSet { + if x != nil { + return x.FeatureSets + } + return nil +} + +func (x *ImportManagedClusterRequest) GetClusterProfile() string { + if x != nil { + return x.ClusterProfile + } + return "" +} + +func (x *ImportManagedClusterRequest) GetOperation() *v2.OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type ImportManagedClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *v2.Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ImportManagedClusterResponse) Reset() { + *x = ImportManagedClusterResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[90] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImportManagedClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportManagedClusterResponse) ProtoMessage() {} + +func (x *ImportManagedClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[90] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportManagedClusterResponse.ProtoReflect.Descriptor instead. +func (*ImportManagedClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{90} +} + +func (x *ImportManagedClusterResponse) GetOperation() *v2.Operation { + if x != nil { + return x.Operation + } + return nil +} + +type ConvertToSpokeClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // cluster is the cluster that becomes a spoke. + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // hub_cluster_uid is the UID of the hub it joins. + HubClusterUid string `protobuf:"bytes,2,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + Components *v2.ComponentOptions `protobuf:"bytes,3,opt,name=components,proto3" json:"components,omitempty"` + // credential names the caller's cloud credential, for an EKS cluster reached without one. + Credential string `protobuf:"bytes,4,opt,name=credential,proto3" json:"credential,omitempty"` + Operation *v2.OperationOptions `protobuf:"bytes,5,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConvertToSpokeClusterRequest) Reset() { + *x = ConvertToSpokeClusterRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[91] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConvertToSpokeClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConvertToSpokeClusterRequest) ProtoMessage() {} + +func (x *ConvertToSpokeClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[91] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConvertToSpokeClusterRequest.ProtoReflect.Descriptor instead. +func (*ConvertToSpokeClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{91} +} + +func (x *ConvertToSpokeClusterRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *ConvertToSpokeClusterRequest) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *ConvertToSpokeClusterRequest) GetComponents() *v2.ComponentOptions { + if x != nil { + return x.Components + } + return nil +} + +func (x *ConvertToSpokeClusterRequest) GetCredential() string { + if x != nil { + return x.Credential + } + return "" +} + +func (x *ConvertToSpokeClusterRequest) GetOperation() *v2.OperationOptions { + if x != nil { + return x.Operation + } + return nil +} + +type ConvertToSpokeClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Operation *v2.Operation `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConvertToSpokeClusterResponse) Reset() { + *x = ConvertToSpokeClusterResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[92] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConvertToSpokeClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConvertToSpokeClusterResponse) ProtoMessage() {} + +func (x *ConvertToSpokeClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[92] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConvertToSpokeClusterResponse.ProtoReflect.Descriptor instead. +func (*ConvertToSpokeClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{92} +} + +func (x *ConvertToSpokeClusterResponse) GetOperation() *v2.Operation { + if x != nil { + return x.Operation + } + return nil +} + +// ClientOrgRole is a role a client organization's user has on its cluster. +type ClientOrgRole struct { + state protoimpl.MessageState `protogen:"open.v1"` + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + // namespace is the role binding's; empty for a cluster role binding. + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Binding string `protobuf:"bytes,3,opt,name=binding,proto3" json:"binding,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientOrgRole) Reset() { + *x = ClientOrgRole{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[93] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientOrgRole) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientOrgRole) ProtoMessage() {} + +func (x *ClientOrgRole) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[93] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientOrgRole.ProtoReflect.Descriptor instead. +func (*ClientOrgRole) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{93} +} + +func (x *ClientOrgRole) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *ClientOrgRole) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ClientOrgRole) GetBinding() string { + if x != nil { + return x.Binding + } + return "" +} + +type ListClientOrgUsersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // cluster is the client organization's. + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClientOrgUsersRequest) Reset() { + *x = ListClientOrgUsersRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[94] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClientOrgUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClientOrgUsersRequest) ProtoMessage() {} + +func (x *ListClientOrgUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[94] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClientOrgUsersRequest.ProtoReflect.Descriptor instead. +func (*ListClientOrgUsersRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{94} +} + +func (x *ListClientOrgUsersRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +type ListClientOrgUsersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*HubUser `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClientOrgUsersResponse) Reset() { + *x = ListClientOrgUsersResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[95] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClientOrgUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClientOrgUsersResponse) ProtoMessage() {} + +func (x *ListClientOrgUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[95] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClientOrgUsersResponse.ProtoReflect.Descriptor instead. +func (*ListClientOrgUsersResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{95} +} + +func (x *ListClientOrgUsersResponse) GetUsers() []*HubUser { + if x != nil { + return x.Users + } + return nil +} + +type CreateClientOrgUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + // permissions are on the cluster; cluster sets and other clusters are refused. + Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateClientOrgUserRequest) Reset() { + *x = CreateClientOrgUserRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[96] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateClientOrgUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateClientOrgUserRequest) ProtoMessage() {} + +func (x *CreateClientOrgUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[96] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateClientOrgUserRequest.ProtoReflect.Descriptor instead. +func (*CreateClientOrgUserRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{96} +} + +func (x *CreateClientOrgUserRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *CreateClientOrgUserRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *CreateClientOrgUserRequest) GetPermissions() []*Permission { + if x != nil { + return x.Permissions + } + return nil +} + +type CreateClientOrgUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateClientOrgUserResponse) Reset() { + *x = CreateClientOrgUserResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[97] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateClientOrgUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateClientOrgUserResponse) ProtoMessage() {} + +func (x *CreateClientOrgUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[97] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateClientOrgUserResponse.ProtoReflect.Descriptor instead. +func (*CreateClientOrgUserResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{97} +} + +type UpdateClientOrgUserPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateClientOrgUserPermissionsRequest) Reset() { + *x = UpdateClientOrgUserPermissionsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[98] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateClientOrgUserPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateClientOrgUserPermissionsRequest) ProtoMessage() {} + +func (x *UpdateClientOrgUserPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[98] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateClientOrgUserPermissionsRequest.ProtoReflect.Descriptor instead. +func (*UpdateClientOrgUserPermissionsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{98} +} + +func (x *UpdateClientOrgUserPermissionsRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *UpdateClientOrgUserPermissionsRequest) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *UpdateClientOrgUserPermissionsRequest) GetPermissions() []*Permission { + if x != nil { + return x.Permissions + } + return nil +} + +type UpdateClientOrgUserPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateClientOrgUserPermissionsResponse) Reset() { + *x = UpdateClientOrgUserPermissionsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[99] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateClientOrgUserPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateClientOrgUserPermissionsResponse) ProtoMessage() {} + +func (x *UpdateClientOrgUserPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[99] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateClientOrgUserPermissionsResponse.ProtoReflect.Descriptor instead. +func (*UpdateClientOrgUserPermissionsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{99} +} + +type GetClientOrgUserPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + // namespaces are where the user's roles are listed. + Namespaces []string `protobuf:"bytes,3,rep,name=namespaces,proto3" json:"namespaces,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrgUserPermissionsRequest) Reset() { + *x = GetClientOrgUserPermissionsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[100] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrgUserPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrgUserPermissionsRequest) ProtoMessage() {} + +func (x *GetClientOrgUserPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[100] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrgUserPermissionsRequest.ProtoReflect.Descriptor instead. +func (*GetClientOrgUserPermissionsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{100} +} + +func (x *GetClientOrgUserPermissionsRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetClientOrgUserPermissionsRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetClientOrgUserPermissionsRequest) GetNamespaces() []string { + if x != nil { + return x.Namespaces + } + return nil +} + +type GetClientOrgUserPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Roles []*ClientOrgRole `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` + ClusterRoles []*ClientOrgRole `protobuf:"bytes,2,rep,name=cluster_roles,json=clusterRoles,proto3" json:"cluster_roles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrgUserPermissionsResponse) Reset() { + *x = GetClientOrgUserPermissionsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[101] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrgUserPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrgUserPermissionsResponse) ProtoMessage() {} + +func (x *GetClientOrgUserPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[101] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrgUserPermissionsResponse.ProtoReflect.Descriptor instead. +func (*GetClientOrgUserPermissionsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{101} +} + +func (x *GetClientOrgUserPermissionsResponse) GetRoles() []*ClientOrgRole { + if x != nil { + return x.Roles + } + return nil +} + +func (x *GetClientOrgUserPermissionsResponse) GetClusterRoles() []*ClientOrgRole { + if x != nil { + return x.ClusterRoles + } + return nil +} + +type GetClientOrgUserKubeconfigRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrgUserKubeconfigRequest) Reset() { + *x = GetClientOrgUserKubeconfigRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[102] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrgUserKubeconfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrgUserKubeconfigRequest) ProtoMessage() {} + +func (x *GetClientOrgUserKubeconfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[102] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrgUserKubeconfigRequest.ProtoReflect.Descriptor instead. +func (*GetClientOrgUserKubeconfigRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{102} +} + +func (x *GetClientOrgUserKubeconfigRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *GetClientOrgUserKubeconfigRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type GetClientOrgUserKubeconfigResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // kubeconfig is YAML. + Kubeconfig []byte `protobuf:"bytes,1,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrgUserKubeconfigResponse) Reset() { + *x = GetClientOrgUserKubeconfigResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[103] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrgUserKubeconfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrgUserKubeconfigResponse) ProtoMessage() {} + +func (x *GetClientOrgUserKubeconfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[103] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrgUserKubeconfigResponse.ProtoReflect.Descriptor instead. +func (*GetClientOrgUserKubeconfigResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{103} +} + +func (x *GetClientOrgUserKubeconfigResponse) GetKubeconfig() []byte { + if x != nil { + return x.Kubeconfig + } + return nil +} + +type RemoveClientOrgUserPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + // cluster_role_bindings name the cluster role bindings to delete. + ClusterRoleBindings []string `protobuf:"bytes,2,rep,name=cluster_role_bindings,json=clusterRoleBindings,proto3" json:"cluster_role_bindings,omitempty"` + RoleBindings []*BindingRef `protobuf:"bytes,3,rep,name=role_bindings,json=roleBindings,proto3" json:"role_bindings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClientOrgUserPermissionsRequest) Reset() { + *x = RemoveClientOrgUserPermissionsRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[104] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClientOrgUserPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClientOrgUserPermissionsRequest) ProtoMessage() {} + +func (x *RemoveClientOrgUserPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[104] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClientOrgUserPermissionsRequest.ProtoReflect.Descriptor instead. +func (*RemoveClientOrgUserPermissionsRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{104} +} + +func (x *RemoveClientOrgUserPermissionsRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *RemoveClientOrgUserPermissionsRequest) GetClusterRoleBindings() []string { + if x != nil { + return x.ClusterRoleBindings + } + return nil +} + +func (x *RemoveClientOrgUserPermissionsRequest) GetRoleBindings() []*BindingRef { + if x != nil { + return x.RoleBindings + } + return nil +} + +type RemoveClientOrgUserPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClientOrgUserPermissionsResponse) Reset() { + *x = RemoveClientOrgUserPermissionsResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[105] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClientOrgUserPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClientOrgUserPermissionsResponse) ProtoMessage() {} + +func (x *RemoveClientOrgUserPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[105] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClientOrgUserPermissionsResponse.ProtoReflect.Descriptor instead. +func (*RemoveClientOrgUserPermissionsResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{105} +} + +type DeleteClientOrgUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Cluster *v2.ClusterRef `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClientOrgUserRequest) Reset() { + *x = DeleteClientOrgUserRequest{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[106] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClientOrgUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClientOrgUserRequest) ProtoMessage() {} + +func (x *DeleteClientOrgUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[106] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClientOrgUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteClientOrgUserRequest) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{106} +} + +func (x *DeleteClientOrgUserRequest) GetCluster() *v2.ClusterRef { + if x != nil { + return x.Cluster + } + return nil +} + +func (x *DeleteClientOrgUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type DeleteClientOrgUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClientOrgUserResponse) Reset() { + *x = DeleteClientOrgUserResponse{} + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[107] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClientOrgUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClientOrgUserResponse) ProtoMessage() {} + +func (x *DeleteClientOrgUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_ocm_v2_ocm_proto_msgTypes[107] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClientOrgUserResponse.ProtoReflect.Descriptor instead. +func (*DeleteClientOrgUserResponse) Descriptor() ([]byte, []int) { + return file_akp_ocm_v2_ocm_proto_rawDescGZIP(), []int{107} +} + +var File_akp_ocm_v2_ocm_proto protoreflect.FileDescriptor + +const file_akp_ocm_v2_ocm_proto_rawDesc = "" + + "\n" + + "\x14akp/ocm/v2/ocm.proto\x12\n" + + "akp.ocm.v2\x1a\x1cakp/cluster/v2/cluster.proto\x1a\x1eakp/cluster/v2/lifecycle.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x01\n" + + "\n" + + "HubCluster\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1d\n" + + "\n" + + "node_count\x18\x03 \x01(\x05R\tnodeCount\x12\x1a\n" + + "\bprovider\x18\x04 \x01(\tR\bprovider\x12\x1a\n" + + "\blocation\x18\x05 \x01(\tR\blocation\x12\x19\n" + + "\bhub_type\x18\x06 \x01(\tR\ahubType\x12;\n" + + "\vcreate_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\"\xbe\x02\n" + + "\x0eManagedCluster\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + + "\x03url\x18\x02 \x01(\tR\x03url\x12\x1f\n" + + "\vcluster_uid\x18\x03 \x01(\tR\n" + + "clusterUid\x12\x1f\n" + + "\vcluster_set\x18\x04 \x01(\tR\n" + + "clusterSet\x12\x1a\n" + + "\baccepted\x18\x05 \x01(\bR\baccepted\x12-\n" + + "\x12kubernetes_version\x18\x06 \x01(\tR\x11kubernetesVersion\x12>\n" + + "\x06labels\x18\a \x03(\v2&.akp.ocm.v2.ManagedCluster.LabelsEntryR\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"7\n" + + "\x16ListHubClustersRequest\x12\x1d\n" + + "\x05owner\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05owner\"E\n" + + "\x17ListHubClustersResponse\x12*\n" + + "\x04hubs\x18\x01 \x03(\v2\x16.akp.ocm.v2.HubClusterR\x04hubs\"R\n" + + "\x1aListManagedClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\"U\n" + + "\x1bListManagedClustersResponse\x126\n" + + "\bclusters\x18\x01 \x03(\v2\x1a.akp.ocm.v2.ManagedClusterR\bclusters\"l\n" + + "\x18ListSpokeClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12\x1a\n" + + "\baccepted\x18\x02 \x01(\bR\baccepted\"S\n" + + "\x19ListSpokeClustersResponse\x126\n" + + "\bclusters\x18\x01 \x03(\v2\x1a.akp.ocm.v2.ManagedClusterR\bclusters\"\xed\x01\n" + + "\x1cAcceptManagedClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12$\n" + + "\bclusters\x18\x02 \x03(\tB\b\xbaH\x05\x92\x01\x02\b\x01R\bclusters\x12,\n" + + "\x12skip_approve_check\x18\x03 \x01(\bR\x10skipApproveCheck\x12\x1e\n" + + "\n" + + "requesters\x18\x04 \x03(\tR\n" + + "requesters\x12#\n" + + "\rdeploy_argocd\x18\x05 \x01(\bR\fdeployArgocd\"\x1f\n" + + "\x1dAcceptManagedClustersResponse\"v\n" + + "\x1bRemoveManagedClusterRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12!\n" + + "\acluster\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\"\x1e\n" + + "\x1cRemoveManagedClusterResponse\"{\n" + + "!ValidateClusterFeatureSetsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12\x18\n" + + "\aprofile\x18\x02 \x01(\tR\aprofile\"g\n" + + "\"ValidateClusterFeatureSetsResponse\x12\x14\n" + + "\x05valid\x18\x01 \x01(\bR\x05valid\x12+\n" + + "\x11disabled_features\x18\x02 \x03(\tR\x10disabledFeatures\"\x8c\x01\n" + + "\x1cListAvailableClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x126\n" + + "\x17for_client_organization\x18\x02 \x01(\bR\x15forClientOrganization\"W\n" + + "\x1dListAvailableClustersResponse\x126\n" + + "\bclusters\x18\x01 \x03(\v2\x1a.akp.ocm.v2.ManagedClusterR\bclusters\"\x8f\x01\n" + + "\x1fListAvailableClusterSetsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x126\n" + + "\x17for_client_organization\x18\x02 \x01(\bR\x15forClientOrganization\"E\n" + + " ListAvailableClusterSetsResponse\x12!\n" + + "\fcluster_sets\x18\x01 \x03(\tR\vclusterSets\"[\n" + + "\n" + + "ClusterSet\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12#\n" + + "\rcluster_count\x18\x03 \x01(\x05R\fclusterCount\"\xd0\x01\n" + + "\x11ClusterSetCluster\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x1d\n" + + "\n" + + "node_count\x18\x03 \x01(\x05R\tnodeCount\x12\x1a\n" + + "\bprovider\x18\x04 \x01(\tR\bprovider\x12-\n" + + "\x12kubernetes_version\x18\x05 \x01(\tR\x11kubernetesVersion\x12\x1a\n" + + "\bimported\x18\x06 \x01(\bR\bimported\"N\n" + + "\x16ListClusterSetsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\"T\n" + + "\x17ListClusterSetsResponse\x129\n" + + "\fcluster_sets\x18\x01 \x03(\v2\x16.akp.ocm.v2.ClusterSetR\vclusterSets\"y\n" + + "\x17CreateClusterSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"\x1a\n" + + "\x18CreateClusterSetResponse\"y\n" + + "\x17DeleteClusterSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"\x1a\n" + + "\x18DeleteClusterSetResponse\"\x9c\x01\n" + + "\x1eAddClustersToClusterSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12\x1a\n" + + "\bclusters\x18\x03 \x03(\tR\bclusters\"@\n" + + "\x1fAddClustersToClusterSetResponse\x12\x1d\n" + + "\n" + + "already_in\x18\x01 \x03(\tR\talreadyIn\"\xa1\x01\n" + + "#RemoveClustersFromClusterSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12\x1a\n" + + "\bclusters\x18\x03 \x03(\tR\bclusters\"&\n" + + "$RemoveClustersFromClusterSetResponse\"\x7f\n" + + "\x1dListClusterSetClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"[\n" + + "\x1eListClusterSetClustersResponse\x129\n" + + "\bclusters\x18\x01 \x03(\v2\x1d.akp.ocm.v2.ClusterSetClusterR\bclusters\"|\n" + + "\x1aListAddableClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"9\n" + + "\x1bListAddableClustersResponse\x12\x1a\n" + + "\bclusters\x18\x01 \x03(\tR\bclusters\"Q\n" + + "\x0eBoundNamespace\x12\x1c\n" + + "\tnamespace\x18\x01 \x01(\tR\tnamespace\x12!\n" + + "\fcluster_sets\x18\x02 \x03(\tR\vclusterSets\"R\n" + + "\x1aListBoundNamespacesRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\"Y\n" + + "\x1bListBoundNamespacesResponse\x12:\n" + + "\n" + + "namespaces\x18\x01 \x03(\v2\x1a.akp.ocm.v2.BoundNamespaceR\n" + + "namespaces\"\x9d\x01\n" + + "\x14BindNamespaceRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12%\n" + + "\tnamespace\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\"\x17\n" + + "\x15BindNamespaceResponse\"\x9f\x01\n" + + "\x16UnbindNamespaceRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12%\n" + + "\tnamespace\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tnamespace\"\x19\n" + + "\x17UnbindNamespaceResponse\"i\n" + + "\aHubUser\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1b\n" + + "\tfull_name\x18\x03 \x01(\tR\bfullName\x12\x1d\n" + + "\n" + + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\"L\n" + + "\vRoleMembers\x12\x12\n" + + "\x04role\x18\x01 \x01(\tR\x04role\x12)\n" + + "\x05users\x18\x02 \x03(\v2\x13.akp.ocm.v2.HubUserR\x05users\"~\n" + + "\x1cGetClusterSetAuthInfoRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"N\n" + + "\x1dGetClusterSetAuthInfoResponse\x12-\n" + + "\x05roles\x18\x01 \x03(\v2\x17.akp.ocm.v2.RoleMembersR\x05roles\"\xb5\x01\n" + + "\n" + + "Permission\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1f\n" + + "\vcluster_set\x18\x02 \x01(\bR\n" + + "clusterSet\x12\x1b\n" + + "\trole_kind\x18\x03 \x01(\tR\broleKind\x12\x12\n" + + "\x04role\x18\x04 \x01(\tR\x04role\x12'\n" + + "\x0frole_namespaces\x18\x05 \x03(\tR\x0eroleNamespaces\x12\x18\n" + + "\abinding\x18\x06 \x01(\tR\abinding\"K\n" + + "\x13SyncAccountsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\"\x16\n" + + "\x14SyncAccountsResponse\"H\n" + + "\x10ListUsersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\">\n" + + "\x11ListUsersResponse\x12)\n" + + "\x05users\x18\x01 \x03(\v2\x13.akp.ocm.v2.HubUserR\x05users\"\xa9\x01\n" + + "\x11CreateUserRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12$\n" + + "\tuser_name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\buserName\x128\n" + + "\vpermissions\x18\x03 \x03(\v2\x16.akp.ocm.v2.PermissionR\vpermissions\"\x14\n" + + "\x12CreateUserResponse\"\xb4\x01\n" + + "\x1cUpdateUserPermissionsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12$\n" + + "\tuser_name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\buserName\x128\n" + + "\vpermissions\x18\x03 \x03(\v2\x16.akp.ocm.v2.PermissionR\vpermissions\"\x1f\n" + + "\x1dUpdateUserPermissionsResponse\"\x80\x01\n" + + "\x19GetUserPermissionsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\"\xb5\x01\n" + + "\x1aGetUserPermissionsResponse\x12G\n" + + "\x13cluster_permissions\x18\x01 \x03(\v2\x16.akp.ocm.v2.PermissionR\x12clusterPermissions\x12N\n" + + "\x17cluster_set_permissions\x18\x02 \x03(\v2\x16.akp.ocm.v2.PermissionR\x15clusterSetPermissions\"~\n" + + "\x17ListUserClustersRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\"6\n" + + "\x18ListUserClustersResponse\x12\x1a\n" + + "\bclusters\x18\x01 \x03(\tR\bclusters\"\xa2\x01\n" + + "\x18GetUserKubeconfigRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\x12!\n" + + "\acluster\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\";\n" + + "\x19GetUserKubeconfigResponse\x12\x1e\n" + + "\n" + + "kubeconfig\x18\x01 \x01(\fR\n" + + "kubeconfig\">\n" + + "\n" + + "BindingRef\x12\x1c\n" + + "\tnamespace\x18\x01 \x01(\tR\tnamespace\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"\xc9\x01\n" + + "\x1cRemoveUserPermissionsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x120\n" + + "\x14cluster_set_bindings\x18\x02 \x03(\tR\x12clusterSetBindings\x12A\n" + + "\x10cluster_bindings\x18\x03 \x03(\v2\x16.akp.ocm.v2.BindingRefR\x0fclusterBindings\"\x1f\n" + + "\x1dRemoveUserPermissionsResponse\"x\n" + + "\x11DeleteUserRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\"\x14\n" + + "\x12DeleteUserResponse\"\xba\x01\n" + + "\aFeature\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12 \n" + + "\vrecommended\x18\x04 \x01(\bR\vrecommended\x12\x1c\n" + + "\tinstalled\x18\x05 \x01(\bR\tinstalled\x12#\n" + + "\rfeature_block\x18\x06 \x01(\tR\ffeatureBlock\"\xf6\x01\n" + + "\n" + + "FeatureSet\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12 \n" + + "\vrecommended\x18\x04 \x01(\bR\vrecommended\x12/\n" + + "\bfeatures\x18\x05 \x03(\v2\x13.akp.ocm.v2.FeatureR\bfeatures\x12+\n" + + "\x11required_features\x18\x06 \x03(\tR\x10requiredFeatures\x12\x1c\n" + + "\tinstalled\x18\a \x01(\bR\tinstalled\"x\n" + + "\x16ListFeatureSetsRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"T\n" + + "\x17ListFeatureSetsResponse\x129\n" + + "\ffeature_sets\x18\x01 \x03(\v2\x16.akp.ocm.v2.FeatureSetR\vfeatureSets\"\xbf\x01\n" + + "\x18InstallFeatureSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12\x14\n" + + "\x05chart\x18\x03 \x01(\tR\x05chart\x12-\n" + + "\x05model\x18\x04 \x01(\v2\x17.google.protobuf.StructR\x05model\"\x1b\n" + + "\x19InstallFeatureSetResponse\"\xe8\x01\n" + + "\x1eUpdateClusterFeatureSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12!\n" + + "\acluster\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\x12\x14\n" + + "\x05chart\x18\x04 \x01(\tR\x05chart\x12-\n" + + "\x05model\x18\x05 \x01(\v2\x17.google.protobuf.StructR\x05model\"!\n" + + "\x1fUpdateClusterFeatureSetResponse\"\xa4\x01\n" + + "\x18DisableFeatureSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12(\n" + + "\vfeature_set\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "featureSet\"\x1b\n" + + "\x19DisableFeatureSetResponse\"x\n" + + "\x16CheckAutoUpdateRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"5\n" + + "\x17CheckAutoUpdateResponse\x12\x1a\n" + + "\bpossible\x18\x01 \x01(\bR\bpossible\"}\n" + + "\x1bAutoUpdateClusterSetRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"\x1e\n" + + "\x1cAutoUpdateClusterSetResponse\"\xa7\x01\n" + + "\x11FeatureSyncStatus\x12\x1f\n" + + "\vfeature_set\x18\x01 \x01(\tR\n" + + "featureSet\x12\x18\n" + + "\afeature\x18\x02 \x01(\tR\afeature\x12(\n" + + "\x10in_sync_clusters\x18\x03 \x03(\tR\x0einSyncClusters\x12-\n" + + "\x12unaligned_clusters\x18\x04 \x03(\tR\x11unalignedClusters\"\x81\x01\n" + + "\x1fGetFeatureSetsSyncStatusRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"]\n" + + " GetFeatureSetsSyncStatusResponse\x129\n" + + "\bfeatures\x18\x01 \x03(\v2\x1d.akp.ocm.v2.FeatureSyncStatusR\bfeatures\"D\n" + + "\x0eClusterVersion\x12\x18\n" + + "\acluster\x18\x01 \x01(\tR\acluster\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\"\x88\x01\n" + + "&GetOpscenterFeaturesVersionSyncRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\"\x91\x01\n" + + "'GetOpscenterFeaturesVersionSyncResponse\x12.\n" + + "\x13cluster_set_version\x18\x01 \x01(\tR\x11clusterSetVersion\x126\n" + + "\bclusters\x18\x02 \x03(\v2\x1a.akp.ocm.v2.ClusterVersionR\bclusters\"\xa0\x01\n" + + "\x1bGetFeatureSyncStatusRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12(\n" + + "\vcluster_set\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterSet\x12!\n" + + "\afeature\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\afeature\"y\n" + + "\x1cGetFeatureSyncStatusResponse\x12(\n" + + "\x10in_sync_clusters\x18\x01 \x03(\tR\x0einSyncClusters\x12/\n" + + "\x14out_of_sync_clusters\x18\x02 \x03(\tR\x11outOfSyncClusters\"x\n" + + "\x1dGetSpokeInstallCommandRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12!\n" + + "\acluster\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\":\n" + + "\x1eGetSpokeInstallCommandResponse\x12\x18\n" + + "\acommand\x18\x01 \x01(\tR\acommand\"\xc1\x02\n" + + "\x1bImportManagedClusterRequest\x124\n" + + "\x03hub\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\x03hub\x12!\n" + + "\acluster\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\x12!\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12=\n" + + "\ffeature_sets\x18\x04 \x03(\v2\x1a.akp.cluster.v2.FeatureSetR\vfeatureSets\x12'\n" + + "\x0fcluster_profile\x18\x05 \x01(\tR\x0eclusterProfile\x12>\n" + + "\toperation\x18\x06 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"W\n" + + "\x1cImportManagedClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"\xaf\x02\n" + + "\x1cConvertToSpokeClusterRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12/\n" + + "\x0fhub_cluster_uid\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\rhubClusterUid\x12@\n" + + "\n" + + "components\x18\x03 \x01(\v2 .akp.cluster.v2.ComponentOptionsR\n" + + "components\x12\x1e\n" + + "\n" + + "credential\x18\x04 \x01(\tR\n" + + "credential\x12>\n" + + "\toperation\x18\x05 \x01(\v2 .akp.cluster.v2.OperationOptionsR\toperation\"X\n" + + "\x1dConvertToSpokeClusterResponse\x127\n" + + "\toperation\x18\x01 \x01(\v2\x19.akp.cluster.v2.OperationR\toperation\"[\n" + + "\rClientOrgRole\x12\x12\n" + + "\x04role\x18\x01 \x01(\tR\x04role\x12\x1c\n" + + "\tnamespace\x18\x02 \x01(\tR\tnamespace\x12\x18\n" + + "\abinding\x18\x03 \x01(\tR\abinding\"Y\n" + + "\x19ListClientOrgUsersRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\"G\n" + + "\x1aListClientOrgUsersResponse\x12)\n" + + "\x05users\x18\x01 \x03(\v2\x13.akp.ocm.v2.HubUserR\x05users\"\xba\x01\n" + + "\x1aCreateClientOrgUserRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12$\n" + + "\tuser_name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\buserName\x128\n" + + "\vpermissions\x18\x03 \x03(\v2\x16.akp.ocm.v2.PermissionR\vpermissions\"\x1d\n" + + "\x1bCreateClientOrgUserResponse\"\xc5\x01\n" + + "%UpdateClientOrgUserPermissionsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12$\n" + + "\tuser_name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\buserName\x128\n" + + "\vpermissions\x18\x03 \x03(\v2\x16.akp.ocm.v2.PermissionR\vpermissions\"(\n" + + "&UpdateClientOrgUserPermissionsResponse\"\xb1\x01\n" + + "\"GetClientOrgUserPermissionsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\x12\x1e\n" + + "\n" + + "namespaces\x18\x03 \x03(\tR\n" + + "namespaces\"\x96\x01\n" + + "#GetClientOrgUserPermissionsResponse\x12/\n" + + "\x05roles\x18\x01 \x03(\v2\x19.akp.ocm.v2.ClientOrgRoleR\x05roles\x12>\n" + + "\rcluster_roles\x18\x02 \x03(\v2\x19.akp.ocm.v2.ClientOrgRoleR\fclusterRoles\"\x90\x01\n" + + "!GetClientOrgUserKubeconfigRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\"D\n" + + "\"GetClientOrgUserKubeconfigResponse\x12\x1e\n" + + "\n" + + "kubeconfig\x18\x01 \x01(\fR\n" + + "kubeconfig\"\xd6\x01\n" + + "%RemoveClientOrgUserPermissionsRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x122\n" + + "\x15cluster_role_bindings\x18\x02 \x03(\tR\x13clusterRoleBindings\x12;\n" + + "\rrole_bindings\x18\x03 \x03(\v2\x16.akp.ocm.v2.BindingRefR\froleBindings\"(\n" + + "&RemoveClientOrgUserPermissionsResponse\"\x89\x01\n" + + "\x1aDeleteClientOrgUserRequest\x12<\n" + + "\acluster\x18\x01 \x01(\v2\x1a.akp.cluster.v2.ClusterRefB\x06\xbaH\x03\xc8\x01\x01R\acluster\x12-\n" + + "\auser_id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x06userId\"\x1d\n" + + "\x1bDeleteClientOrgUserResponse2\xd8\t\n" + + "\x15ManagedClusterService\x12\\\n" + + "\x0fListHubClusters\x12\".akp.ocm.v2.ListHubClustersRequest\x1a#.akp.ocm.v2.ListHubClustersResponse\"\x00\x12h\n" + + "\x13ListManagedClusters\x12&.akp.ocm.v2.ListManagedClustersRequest\x1a'.akp.ocm.v2.ListManagedClustersResponse\"\x00\x12b\n" + + "\x11ListSpokeClusters\x12$.akp.ocm.v2.ListSpokeClustersRequest\x1a%.akp.ocm.v2.ListSpokeClustersResponse\"\x00\x12n\n" + + "\x15AcceptManagedClusters\x12(.akp.ocm.v2.AcceptManagedClustersRequest\x1a).akp.ocm.v2.AcceptManagedClustersResponse\"\x00\x12k\n" + + "\x14RemoveManagedCluster\x12'.akp.ocm.v2.RemoveManagedClusterRequest\x1a(.akp.ocm.v2.RemoveManagedClusterResponse\"\x00\x12}\n" + + "\x1aValidateClusterFeatureSets\x12-.akp.ocm.v2.ValidateClusterFeatureSetsRequest\x1a..akp.ocm.v2.ValidateClusterFeatureSetsResponse\"\x00\x12n\n" + + "\x15ListAvailableClusters\x12(.akp.ocm.v2.ListAvailableClustersRequest\x1a).akp.ocm.v2.ListAvailableClustersResponse\"\x00\x12w\n" + + "\x18ListAvailableClusterSets\x12+.akp.ocm.v2.ListAvailableClusterSetsRequest\x1a,.akp.ocm.v2.ListAvailableClusterSetsResponse\"\x00\x12q\n" + + "\x16GetSpokeInstallCommand\x12).akp.ocm.v2.GetSpokeInstallCommandRequest\x1a*.akp.ocm.v2.GetSpokeInstallCommandResponse\"\x00\x12k\n" + + "\x14ImportManagedCluster\x12'.akp.ocm.v2.ImportManagedClusterRequest\x1a(.akp.ocm.v2.ImportManagedClusterResponse\"\x00\x12n\n" + + "\x15ConvertToSpokeCluster\x12(.akp.ocm.v2.ConvertToSpokeClusterRequest\x1a).akp.ocm.v2.ConvertToSpokeClusterResponse\"\x002\x9c\t\n" + + "\x11ClusterSetService\x12\\\n" + + "\x0fListClusterSets\x12\".akp.ocm.v2.ListClusterSetsRequest\x1a#.akp.ocm.v2.ListClusterSetsResponse\"\x00\x12_\n" + + "\x10CreateClusterSet\x12#.akp.ocm.v2.CreateClusterSetRequest\x1a$.akp.ocm.v2.CreateClusterSetResponse\"\x00\x12_\n" + + "\x10DeleteClusterSet\x12#.akp.ocm.v2.DeleteClusterSetRequest\x1a$.akp.ocm.v2.DeleteClusterSetResponse\"\x00\x12t\n" + + "\x17AddClustersToClusterSet\x12*.akp.ocm.v2.AddClustersToClusterSetRequest\x1a+.akp.ocm.v2.AddClustersToClusterSetResponse\"\x00\x12\x83\x01\n" + + "\x1cRemoveClustersFromClusterSet\x12/.akp.ocm.v2.RemoveClustersFromClusterSetRequest\x1a0.akp.ocm.v2.RemoveClustersFromClusterSetResponse\"\x00\x12q\n" + + "\x16ListClusterSetClusters\x12).akp.ocm.v2.ListClusterSetClustersRequest\x1a*.akp.ocm.v2.ListClusterSetClustersResponse\"\x00\x12h\n" + + "\x13ListAddableClusters\x12&.akp.ocm.v2.ListAddableClustersRequest\x1a'.akp.ocm.v2.ListAddableClustersResponse\"\x00\x12h\n" + + "\x13ListBoundNamespaces\x12&.akp.ocm.v2.ListBoundNamespacesRequest\x1a'.akp.ocm.v2.ListBoundNamespacesResponse\"\x00\x12V\n" + + "\rBindNamespace\x12 .akp.ocm.v2.BindNamespaceRequest\x1a!.akp.ocm.v2.BindNamespaceResponse\"\x00\x12\\\n" + + "\x0fUnbindNamespace\x12\".akp.ocm.v2.UnbindNamespaceRequest\x1a#.akp.ocm.v2.UnbindNamespaceResponse\"\x00\x12n\n" + + "\x15GetClusterSetAuthInfo\x12(.akp.ocm.v2.GetClusterSetAuthInfoRequest\x1a).akp.ocm.v2.GetClusterSetAuthInfoResponse\"\x002\xdf\x06\n" + + "\x12ClusterAuthService\x12S\n" + + "\fSyncAccounts\x12\x1f.akp.ocm.v2.SyncAccountsRequest\x1a .akp.ocm.v2.SyncAccountsResponse\"\x00\x12J\n" + + "\tListUsers\x12\x1c.akp.ocm.v2.ListUsersRequest\x1a\x1d.akp.ocm.v2.ListUsersResponse\"\x00\x12M\n" + + "\n" + + "CreateUser\x12\x1d.akp.ocm.v2.CreateUserRequest\x1a\x1e.akp.ocm.v2.CreateUserResponse\"\x00\x12n\n" + + "\x15UpdateUserPermissions\x12(.akp.ocm.v2.UpdateUserPermissionsRequest\x1a).akp.ocm.v2.UpdateUserPermissionsResponse\"\x00\x12e\n" + + "\x12GetUserPermissions\x12%.akp.ocm.v2.GetUserPermissionsRequest\x1a&.akp.ocm.v2.GetUserPermissionsResponse\"\x00\x12_\n" + + "\x10ListUserClusters\x12#.akp.ocm.v2.ListUserClustersRequest\x1a$.akp.ocm.v2.ListUserClustersResponse\"\x00\x12b\n" + + "\x11GetUserKubeconfig\x12$.akp.ocm.v2.GetUserKubeconfigRequest\x1a%.akp.ocm.v2.GetUserKubeconfigResponse\"\x00\x12n\n" + + "\x15RemoveUserPermissions\x12(.akp.ocm.v2.RemoveUserPermissionsRequest\x1a).akp.ocm.v2.RemoveUserPermissionsResponse\"\x00\x12M\n" + + "\n" + + "DeleteUser\x12\x1d.akp.ocm.v2.DeleteUserRequest\x1a\x1e.akp.ocm.v2.DeleteUserResponse\"\x002\xef\a\n" + + "\x11FeatureSetService\x12\\\n" + + "\x0fListFeatureSets\x12\".akp.ocm.v2.ListFeatureSetsRequest\x1a#.akp.ocm.v2.ListFeatureSetsResponse\"\x00\x12b\n" + + "\x11InstallFeatureSet\x12$.akp.ocm.v2.InstallFeatureSetRequest\x1a%.akp.ocm.v2.InstallFeatureSetResponse\"\x00\x12t\n" + + "\x17UpdateClusterFeatureSet\x12*.akp.ocm.v2.UpdateClusterFeatureSetRequest\x1a+.akp.ocm.v2.UpdateClusterFeatureSetResponse\"\x00\x12b\n" + + "\x11DisableFeatureSet\x12$.akp.ocm.v2.DisableFeatureSetRequest\x1a%.akp.ocm.v2.DisableFeatureSetResponse\"\x00\x12\\\n" + + "\x0fCheckAutoUpdate\x12\".akp.ocm.v2.CheckAutoUpdateRequest\x1a#.akp.ocm.v2.CheckAutoUpdateResponse\"\x00\x12k\n" + + "\x14AutoUpdateClusterSet\x12'.akp.ocm.v2.AutoUpdateClusterSetRequest\x1a(.akp.ocm.v2.AutoUpdateClusterSetResponse\"\x00\x12w\n" + + "\x18GetFeatureSetsSyncStatus\x12+.akp.ocm.v2.GetFeatureSetsSyncStatusRequest\x1a,.akp.ocm.v2.GetFeatureSetsSyncStatusResponse\"\x00\x12\x8c\x01\n" + + "\x1fGetOpscenterFeaturesVersionSync\x122.akp.ocm.v2.GetOpscenterFeaturesVersionSyncRequest\x1a3.akp.ocm.v2.GetOpscenterFeaturesVersionSyncResponse\"\x00\x12k\n" + + "\x14GetFeatureSyncStatus\x12'.akp.ocm.v2.GetFeatureSyncStatusRequest\x1a(.akp.ocm.v2.GetFeatureSyncStatusResponse\"\x002\xe7\x06\n" + + "\x10ClientOrgService\x12e\n" + + "\x12ListClientOrgUsers\x12%.akp.ocm.v2.ListClientOrgUsersRequest\x1a&.akp.ocm.v2.ListClientOrgUsersResponse\"\x00\x12h\n" + + "\x13CreateClientOrgUser\x12&.akp.ocm.v2.CreateClientOrgUserRequest\x1a'.akp.ocm.v2.CreateClientOrgUserResponse\"\x00\x12\x89\x01\n" + + "\x1eUpdateClientOrgUserPermissions\x121.akp.ocm.v2.UpdateClientOrgUserPermissionsRequest\x1a2.akp.ocm.v2.UpdateClientOrgUserPermissionsResponse\"\x00\x12\x80\x01\n" + + "\x1bGetClientOrgUserPermissions\x12..akp.ocm.v2.GetClientOrgUserPermissionsRequest\x1a/.akp.ocm.v2.GetClientOrgUserPermissionsResponse\"\x00\x12}\n" + + "\x1aGetClientOrgUserKubeconfig\x12-.akp.ocm.v2.GetClientOrgUserKubeconfigRequest\x1a..akp.ocm.v2.GetClientOrgUserKubeconfigResponse\"\x00\x12\x89\x01\n" + + "\x1eRemoveClientOrgUserPermissions\x121.akp.ocm.v2.RemoveClientOrgUserPermissionsRequest\x1a2.akp.ocm.v2.RemoveClientOrgUserPermissionsResponse\"\x00\x12h\n" + + "\x13DeleteClientOrgUser\x12&.akp.ocm.v2.DeleteClientOrgUserRequest\x1a'.akp.ocm.v2.DeleteClientOrgUserResponse\"\x00B\x99\x01\n" + + "\x0ecom.akp.ocm.v2B\bOcmProtoP\x01Z3go.bytebuilders.dev/b3/apis/gen/go/akp/ocm/v2;ocmv2\xa2\x02\x03AOX\xaa\x02\n" + + "Akp.Ocm.V2\xca\x02\n" + + "Akp\\Ocm\\V2\xe2\x02\x16Akp\\Ocm\\V2\\GPBMetadata\xea\x02\fAkp::Ocm::V2b\x06proto3" + +var ( + file_akp_ocm_v2_ocm_proto_rawDescOnce sync.Once + file_akp_ocm_v2_ocm_proto_rawDescData []byte +) + +func file_akp_ocm_v2_ocm_proto_rawDescGZIP() []byte { + file_akp_ocm_v2_ocm_proto_rawDescOnce.Do(func() { + file_akp_ocm_v2_ocm_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_ocm_v2_ocm_proto_rawDesc), len(file_akp_ocm_v2_ocm_proto_rawDesc))) + }) + return file_akp_ocm_v2_ocm_proto_rawDescData +} + +var file_akp_ocm_v2_ocm_proto_msgTypes = make([]protoimpl.MessageInfo, 109) +var file_akp_ocm_v2_ocm_proto_goTypes = []any{ + (*HubCluster)(nil), // 0: akp.ocm.v2.HubCluster + (*ManagedCluster)(nil), // 1: akp.ocm.v2.ManagedCluster + (*ListHubClustersRequest)(nil), // 2: akp.ocm.v2.ListHubClustersRequest + (*ListHubClustersResponse)(nil), // 3: akp.ocm.v2.ListHubClustersResponse + (*ListManagedClustersRequest)(nil), // 4: akp.ocm.v2.ListManagedClustersRequest + (*ListManagedClustersResponse)(nil), // 5: akp.ocm.v2.ListManagedClustersResponse + (*ListSpokeClustersRequest)(nil), // 6: akp.ocm.v2.ListSpokeClustersRequest + (*ListSpokeClustersResponse)(nil), // 7: akp.ocm.v2.ListSpokeClustersResponse + (*AcceptManagedClustersRequest)(nil), // 8: akp.ocm.v2.AcceptManagedClustersRequest + (*AcceptManagedClustersResponse)(nil), // 9: akp.ocm.v2.AcceptManagedClustersResponse + (*RemoveManagedClusterRequest)(nil), // 10: akp.ocm.v2.RemoveManagedClusterRequest + (*RemoveManagedClusterResponse)(nil), // 11: akp.ocm.v2.RemoveManagedClusterResponse + (*ValidateClusterFeatureSetsRequest)(nil), // 12: akp.ocm.v2.ValidateClusterFeatureSetsRequest + (*ValidateClusterFeatureSetsResponse)(nil), // 13: akp.ocm.v2.ValidateClusterFeatureSetsResponse + (*ListAvailableClustersRequest)(nil), // 14: akp.ocm.v2.ListAvailableClustersRequest + (*ListAvailableClustersResponse)(nil), // 15: akp.ocm.v2.ListAvailableClustersResponse + (*ListAvailableClusterSetsRequest)(nil), // 16: akp.ocm.v2.ListAvailableClusterSetsRequest + (*ListAvailableClusterSetsResponse)(nil), // 17: akp.ocm.v2.ListAvailableClusterSetsResponse + (*ClusterSet)(nil), // 18: akp.ocm.v2.ClusterSet + (*ClusterSetCluster)(nil), // 19: akp.ocm.v2.ClusterSetCluster + (*ListClusterSetsRequest)(nil), // 20: akp.ocm.v2.ListClusterSetsRequest + (*ListClusterSetsResponse)(nil), // 21: akp.ocm.v2.ListClusterSetsResponse + (*CreateClusterSetRequest)(nil), // 22: akp.ocm.v2.CreateClusterSetRequest + (*CreateClusterSetResponse)(nil), // 23: akp.ocm.v2.CreateClusterSetResponse + (*DeleteClusterSetRequest)(nil), // 24: akp.ocm.v2.DeleteClusterSetRequest + (*DeleteClusterSetResponse)(nil), // 25: akp.ocm.v2.DeleteClusterSetResponse + (*AddClustersToClusterSetRequest)(nil), // 26: akp.ocm.v2.AddClustersToClusterSetRequest + (*AddClustersToClusterSetResponse)(nil), // 27: akp.ocm.v2.AddClustersToClusterSetResponse + (*RemoveClustersFromClusterSetRequest)(nil), // 28: akp.ocm.v2.RemoveClustersFromClusterSetRequest + (*RemoveClustersFromClusterSetResponse)(nil), // 29: akp.ocm.v2.RemoveClustersFromClusterSetResponse + (*ListClusterSetClustersRequest)(nil), // 30: akp.ocm.v2.ListClusterSetClustersRequest + (*ListClusterSetClustersResponse)(nil), // 31: akp.ocm.v2.ListClusterSetClustersResponse + (*ListAddableClustersRequest)(nil), // 32: akp.ocm.v2.ListAddableClustersRequest + (*ListAddableClustersResponse)(nil), // 33: akp.ocm.v2.ListAddableClustersResponse + (*BoundNamespace)(nil), // 34: akp.ocm.v2.BoundNamespace + (*ListBoundNamespacesRequest)(nil), // 35: akp.ocm.v2.ListBoundNamespacesRequest + (*ListBoundNamespacesResponse)(nil), // 36: akp.ocm.v2.ListBoundNamespacesResponse + (*BindNamespaceRequest)(nil), // 37: akp.ocm.v2.BindNamespaceRequest + (*BindNamespaceResponse)(nil), // 38: akp.ocm.v2.BindNamespaceResponse + (*UnbindNamespaceRequest)(nil), // 39: akp.ocm.v2.UnbindNamespaceRequest + (*UnbindNamespaceResponse)(nil), // 40: akp.ocm.v2.UnbindNamespaceResponse + (*HubUser)(nil), // 41: akp.ocm.v2.HubUser + (*RoleMembers)(nil), // 42: akp.ocm.v2.RoleMembers + (*GetClusterSetAuthInfoRequest)(nil), // 43: akp.ocm.v2.GetClusterSetAuthInfoRequest + (*GetClusterSetAuthInfoResponse)(nil), // 44: akp.ocm.v2.GetClusterSetAuthInfoResponse + (*Permission)(nil), // 45: akp.ocm.v2.Permission + (*SyncAccountsRequest)(nil), // 46: akp.ocm.v2.SyncAccountsRequest + (*SyncAccountsResponse)(nil), // 47: akp.ocm.v2.SyncAccountsResponse + (*ListUsersRequest)(nil), // 48: akp.ocm.v2.ListUsersRequest + (*ListUsersResponse)(nil), // 49: akp.ocm.v2.ListUsersResponse + (*CreateUserRequest)(nil), // 50: akp.ocm.v2.CreateUserRequest + (*CreateUserResponse)(nil), // 51: akp.ocm.v2.CreateUserResponse + (*UpdateUserPermissionsRequest)(nil), // 52: akp.ocm.v2.UpdateUserPermissionsRequest + (*UpdateUserPermissionsResponse)(nil), // 53: akp.ocm.v2.UpdateUserPermissionsResponse + (*GetUserPermissionsRequest)(nil), // 54: akp.ocm.v2.GetUserPermissionsRequest + (*GetUserPermissionsResponse)(nil), // 55: akp.ocm.v2.GetUserPermissionsResponse + (*ListUserClustersRequest)(nil), // 56: akp.ocm.v2.ListUserClustersRequest + (*ListUserClustersResponse)(nil), // 57: akp.ocm.v2.ListUserClustersResponse + (*GetUserKubeconfigRequest)(nil), // 58: akp.ocm.v2.GetUserKubeconfigRequest + (*GetUserKubeconfigResponse)(nil), // 59: akp.ocm.v2.GetUserKubeconfigResponse + (*BindingRef)(nil), // 60: akp.ocm.v2.BindingRef + (*RemoveUserPermissionsRequest)(nil), // 61: akp.ocm.v2.RemoveUserPermissionsRequest + (*RemoveUserPermissionsResponse)(nil), // 62: akp.ocm.v2.RemoveUserPermissionsResponse + (*DeleteUserRequest)(nil), // 63: akp.ocm.v2.DeleteUserRequest + (*DeleteUserResponse)(nil), // 64: akp.ocm.v2.DeleteUserResponse + (*Feature)(nil), // 65: akp.ocm.v2.Feature + (*FeatureSet)(nil), // 66: akp.ocm.v2.FeatureSet + (*ListFeatureSetsRequest)(nil), // 67: akp.ocm.v2.ListFeatureSetsRequest + (*ListFeatureSetsResponse)(nil), // 68: akp.ocm.v2.ListFeatureSetsResponse + (*InstallFeatureSetRequest)(nil), // 69: akp.ocm.v2.InstallFeatureSetRequest + (*InstallFeatureSetResponse)(nil), // 70: akp.ocm.v2.InstallFeatureSetResponse + (*UpdateClusterFeatureSetRequest)(nil), // 71: akp.ocm.v2.UpdateClusterFeatureSetRequest + (*UpdateClusterFeatureSetResponse)(nil), // 72: akp.ocm.v2.UpdateClusterFeatureSetResponse + (*DisableFeatureSetRequest)(nil), // 73: akp.ocm.v2.DisableFeatureSetRequest + (*DisableFeatureSetResponse)(nil), // 74: akp.ocm.v2.DisableFeatureSetResponse + (*CheckAutoUpdateRequest)(nil), // 75: akp.ocm.v2.CheckAutoUpdateRequest + (*CheckAutoUpdateResponse)(nil), // 76: akp.ocm.v2.CheckAutoUpdateResponse + (*AutoUpdateClusterSetRequest)(nil), // 77: akp.ocm.v2.AutoUpdateClusterSetRequest + (*AutoUpdateClusterSetResponse)(nil), // 78: akp.ocm.v2.AutoUpdateClusterSetResponse + (*FeatureSyncStatus)(nil), // 79: akp.ocm.v2.FeatureSyncStatus + (*GetFeatureSetsSyncStatusRequest)(nil), // 80: akp.ocm.v2.GetFeatureSetsSyncStatusRequest + (*GetFeatureSetsSyncStatusResponse)(nil), // 81: akp.ocm.v2.GetFeatureSetsSyncStatusResponse + (*ClusterVersion)(nil), // 82: akp.ocm.v2.ClusterVersion + (*GetOpscenterFeaturesVersionSyncRequest)(nil), // 83: akp.ocm.v2.GetOpscenterFeaturesVersionSyncRequest + (*GetOpscenterFeaturesVersionSyncResponse)(nil), // 84: akp.ocm.v2.GetOpscenterFeaturesVersionSyncResponse + (*GetFeatureSyncStatusRequest)(nil), // 85: akp.ocm.v2.GetFeatureSyncStatusRequest + (*GetFeatureSyncStatusResponse)(nil), // 86: akp.ocm.v2.GetFeatureSyncStatusResponse + (*GetSpokeInstallCommandRequest)(nil), // 87: akp.ocm.v2.GetSpokeInstallCommandRequest + (*GetSpokeInstallCommandResponse)(nil), // 88: akp.ocm.v2.GetSpokeInstallCommandResponse + (*ImportManagedClusterRequest)(nil), // 89: akp.ocm.v2.ImportManagedClusterRequest + (*ImportManagedClusterResponse)(nil), // 90: akp.ocm.v2.ImportManagedClusterResponse + (*ConvertToSpokeClusterRequest)(nil), // 91: akp.ocm.v2.ConvertToSpokeClusterRequest + (*ConvertToSpokeClusterResponse)(nil), // 92: akp.ocm.v2.ConvertToSpokeClusterResponse + (*ClientOrgRole)(nil), // 93: akp.ocm.v2.ClientOrgRole + (*ListClientOrgUsersRequest)(nil), // 94: akp.ocm.v2.ListClientOrgUsersRequest + (*ListClientOrgUsersResponse)(nil), // 95: akp.ocm.v2.ListClientOrgUsersResponse + (*CreateClientOrgUserRequest)(nil), // 96: akp.ocm.v2.CreateClientOrgUserRequest + (*CreateClientOrgUserResponse)(nil), // 97: akp.ocm.v2.CreateClientOrgUserResponse + (*UpdateClientOrgUserPermissionsRequest)(nil), // 98: akp.ocm.v2.UpdateClientOrgUserPermissionsRequest + (*UpdateClientOrgUserPermissionsResponse)(nil), // 99: akp.ocm.v2.UpdateClientOrgUserPermissionsResponse + (*GetClientOrgUserPermissionsRequest)(nil), // 100: akp.ocm.v2.GetClientOrgUserPermissionsRequest + (*GetClientOrgUserPermissionsResponse)(nil), // 101: akp.ocm.v2.GetClientOrgUserPermissionsResponse + (*GetClientOrgUserKubeconfigRequest)(nil), // 102: akp.ocm.v2.GetClientOrgUserKubeconfigRequest + (*GetClientOrgUserKubeconfigResponse)(nil), // 103: akp.ocm.v2.GetClientOrgUserKubeconfigResponse + (*RemoveClientOrgUserPermissionsRequest)(nil), // 104: akp.ocm.v2.RemoveClientOrgUserPermissionsRequest + (*RemoveClientOrgUserPermissionsResponse)(nil), // 105: akp.ocm.v2.RemoveClientOrgUserPermissionsResponse + (*DeleteClientOrgUserRequest)(nil), // 106: akp.ocm.v2.DeleteClientOrgUserRequest + (*DeleteClientOrgUserResponse)(nil), // 107: akp.ocm.v2.DeleteClientOrgUserResponse + nil, // 108: akp.ocm.v2.ManagedCluster.LabelsEntry + (*timestamppb.Timestamp)(nil), // 109: google.protobuf.Timestamp + (*v2.ClusterRef)(nil), // 110: akp.cluster.v2.ClusterRef + (*structpb.Struct)(nil), // 111: google.protobuf.Struct + (*v2.FeatureSet)(nil), // 112: akp.cluster.v2.FeatureSet + (*v2.OperationOptions)(nil), // 113: akp.cluster.v2.OperationOptions + (*v2.Operation)(nil), // 114: akp.cluster.v2.Operation + (*v2.ComponentOptions)(nil), // 115: akp.cluster.v2.ComponentOptions +} +var file_akp_ocm_v2_ocm_proto_depIdxs = []int32{ + 109, // 0: akp.ocm.v2.HubCluster.create_time:type_name -> google.protobuf.Timestamp + 108, // 1: akp.ocm.v2.ManagedCluster.labels:type_name -> akp.ocm.v2.ManagedCluster.LabelsEntry + 0, // 2: akp.ocm.v2.ListHubClustersResponse.hubs:type_name -> akp.ocm.v2.HubCluster + 110, // 3: akp.ocm.v2.ListManagedClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 1, // 4: akp.ocm.v2.ListManagedClustersResponse.clusters:type_name -> akp.ocm.v2.ManagedCluster + 110, // 5: akp.ocm.v2.ListSpokeClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 1, // 6: akp.ocm.v2.ListSpokeClustersResponse.clusters:type_name -> akp.ocm.v2.ManagedCluster + 110, // 7: akp.ocm.v2.AcceptManagedClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 8: akp.ocm.v2.RemoveManagedClusterRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 9: akp.ocm.v2.ValidateClusterFeatureSetsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 110, // 10: akp.ocm.v2.ListAvailableClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 1, // 11: akp.ocm.v2.ListAvailableClustersResponse.clusters:type_name -> akp.ocm.v2.ManagedCluster + 110, // 12: akp.ocm.v2.ListAvailableClusterSetsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 13: akp.ocm.v2.ListClusterSetsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 18, // 14: akp.ocm.v2.ListClusterSetsResponse.cluster_sets:type_name -> akp.ocm.v2.ClusterSet + 110, // 15: akp.ocm.v2.CreateClusterSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 16: akp.ocm.v2.DeleteClusterSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 17: akp.ocm.v2.AddClustersToClusterSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 18: akp.ocm.v2.RemoveClustersFromClusterSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 19: akp.ocm.v2.ListClusterSetClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 19, // 20: akp.ocm.v2.ListClusterSetClustersResponse.clusters:type_name -> akp.ocm.v2.ClusterSetCluster + 110, // 21: akp.ocm.v2.ListAddableClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 22: akp.ocm.v2.ListBoundNamespacesRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 34, // 23: akp.ocm.v2.ListBoundNamespacesResponse.namespaces:type_name -> akp.ocm.v2.BoundNamespace + 110, // 24: akp.ocm.v2.BindNamespaceRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 25: akp.ocm.v2.UnbindNamespaceRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 41, // 26: akp.ocm.v2.RoleMembers.users:type_name -> akp.ocm.v2.HubUser + 110, // 27: akp.ocm.v2.GetClusterSetAuthInfoRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 42, // 28: akp.ocm.v2.GetClusterSetAuthInfoResponse.roles:type_name -> akp.ocm.v2.RoleMembers + 110, // 29: akp.ocm.v2.SyncAccountsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 30: akp.ocm.v2.ListUsersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 41, // 31: akp.ocm.v2.ListUsersResponse.users:type_name -> akp.ocm.v2.HubUser + 110, // 32: akp.ocm.v2.CreateUserRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 45, // 33: akp.ocm.v2.CreateUserRequest.permissions:type_name -> akp.ocm.v2.Permission + 110, // 34: akp.ocm.v2.UpdateUserPermissionsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 45, // 35: akp.ocm.v2.UpdateUserPermissionsRequest.permissions:type_name -> akp.ocm.v2.Permission + 110, // 36: akp.ocm.v2.GetUserPermissionsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 45, // 37: akp.ocm.v2.GetUserPermissionsResponse.cluster_permissions:type_name -> akp.ocm.v2.Permission + 45, // 38: akp.ocm.v2.GetUserPermissionsResponse.cluster_set_permissions:type_name -> akp.ocm.v2.Permission + 110, // 39: akp.ocm.v2.ListUserClustersRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 40: akp.ocm.v2.GetUserKubeconfigRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 41: akp.ocm.v2.RemoveUserPermissionsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 60, // 42: akp.ocm.v2.RemoveUserPermissionsRequest.cluster_bindings:type_name -> akp.ocm.v2.BindingRef + 110, // 43: akp.ocm.v2.DeleteUserRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 65, // 44: akp.ocm.v2.FeatureSet.features:type_name -> akp.ocm.v2.Feature + 110, // 45: akp.ocm.v2.ListFeatureSetsRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 66, // 46: akp.ocm.v2.ListFeatureSetsResponse.feature_sets:type_name -> akp.ocm.v2.FeatureSet + 110, // 47: akp.ocm.v2.InstallFeatureSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 111, // 48: akp.ocm.v2.InstallFeatureSetRequest.model:type_name -> google.protobuf.Struct + 110, // 49: akp.ocm.v2.UpdateClusterFeatureSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 111, // 50: akp.ocm.v2.UpdateClusterFeatureSetRequest.model:type_name -> google.protobuf.Struct + 110, // 51: akp.ocm.v2.DisableFeatureSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 52: akp.ocm.v2.CheckAutoUpdateRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 53: akp.ocm.v2.AutoUpdateClusterSetRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 54: akp.ocm.v2.GetFeatureSetsSyncStatusRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 79, // 55: akp.ocm.v2.GetFeatureSetsSyncStatusResponse.features:type_name -> akp.ocm.v2.FeatureSyncStatus + 110, // 56: akp.ocm.v2.GetOpscenterFeaturesVersionSyncRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 82, // 57: akp.ocm.v2.GetOpscenterFeaturesVersionSyncResponse.clusters:type_name -> akp.ocm.v2.ClusterVersion + 110, // 58: akp.ocm.v2.GetFeatureSyncStatusRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 59: akp.ocm.v2.GetSpokeInstallCommandRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 110, // 60: akp.ocm.v2.ImportManagedClusterRequest.hub:type_name -> akp.cluster.v2.ClusterRef + 112, // 61: akp.ocm.v2.ImportManagedClusterRequest.feature_sets:type_name -> akp.cluster.v2.FeatureSet + 113, // 62: akp.ocm.v2.ImportManagedClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 114, // 63: akp.ocm.v2.ImportManagedClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 110, // 64: akp.ocm.v2.ConvertToSpokeClusterRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 115, // 65: akp.ocm.v2.ConvertToSpokeClusterRequest.components:type_name -> akp.cluster.v2.ComponentOptions + 113, // 66: akp.ocm.v2.ConvertToSpokeClusterRequest.operation:type_name -> akp.cluster.v2.OperationOptions + 114, // 67: akp.ocm.v2.ConvertToSpokeClusterResponse.operation:type_name -> akp.cluster.v2.Operation + 110, // 68: akp.ocm.v2.ListClientOrgUsersRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 41, // 69: akp.ocm.v2.ListClientOrgUsersResponse.users:type_name -> akp.ocm.v2.HubUser + 110, // 70: akp.ocm.v2.CreateClientOrgUserRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 45, // 71: akp.ocm.v2.CreateClientOrgUserRequest.permissions:type_name -> akp.ocm.v2.Permission + 110, // 72: akp.ocm.v2.UpdateClientOrgUserPermissionsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 45, // 73: akp.ocm.v2.UpdateClientOrgUserPermissionsRequest.permissions:type_name -> akp.ocm.v2.Permission + 110, // 74: akp.ocm.v2.GetClientOrgUserPermissionsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 93, // 75: akp.ocm.v2.GetClientOrgUserPermissionsResponse.roles:type_name -> akp.ocm.v2.ClientOrgRole + 93, // 76: akp.ocm.v2.GetClientOrgUserPermissionsResponse.cluster_roles:type_name -> akp.ocm.v2.ClientOrgRole + 110, // 77: akp.ocm.v2.GetClientOrgUserKubeconfigRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 110, // 78: akp.ocm.v2.RemoveClientOrgUserPermissionsRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 60, // 79: akp.ocm.v2.RemoveClientOrgUserPermissionsRequest.role_bindings:type_name -> akp.ocm.v2.BindingRef + 110, // 80: akp.ocm.v2.DeleteClientOrgUserRequest.cluster:type_name -> akp.cluster.v2.ClusterRef + 2, // 81: akp.ocm.v2.ManagedClusterService.ListHubClusters:input_type -> akp.ocm.v2.ListHubClustersRequest + 4, // 82: akp.ocm.v2.ManagedClusterService.ListManagedClusters:input_type -> akp.ocm.v2.ListManagedClustersRequest + 6, // 83: akp.ocm.v2.ManagedClusterService.ListSpokeClusters:input_type -> akp.ocm.v2.ListSpokeClustersRequest + 8, // 84: akp.ocm.v2.ManagedClusterService.AcceptManagedClusters:input_type -> akp.ocm.v2.AcceptManagedClustersRequest + 10, // 85: akp.ocm.v2.ManagedClusterService.RemoveManagedCluster:input_type -> akp.ocm.v2.RemoveManagedClusterRequest + 12, // 86: akp.ocm.v2.ManagedClusterService.ValidateClusterFeatureSets:input_type -> akp.ocm.v2.ValidateClusterFeatureSetsRequest + 14, // 87: akp.ocm.v2.ManagedClusterService.ListAvailableClusters:input_type -> akp.ocm.v2.ListAvailableClustersRequest + 16, // 88: akp.ocm.v2.ManagedClusterService.ListAvailableClusterSets:input_type -> akp.ocm.v2.ListAvailableClusterSetsRequest + 87, // 89: akp.ocm.v2.ManagedClusterService.GetSpokeInstallCommand:input_type -> akp.ocm.v2.GetSpokeInstallCommandRequest + 89, // 90: akp.ocm.v2.ManagedClusterService.ImportManagedCluster:input_type -> akp.ocm.v2.ImportManagedClusterRequest + 91, // 91: akp.ocm.v2.ManagedClusterService.ConvertToSpokeCluster:input_type -> akp.ocm.v2.ConvertToSpokeClusterRequest + 20, // 92: akp.ocm.v2.ClusterSetService.ListClusterSets:input_type -> akp.ocm.v2.ListClusterSetsRequest + 22, // 93: akp.ocm.v2.ClusterSetService.CreateClusterSet:input_type -> akp.ocm.v2.CreateClusterSetRequest + 24, // 94: akp.ocm.v2.ClusterSetService.DeleteClusterSet:input_type -> akp.ocm.v2.DeleteClusterSetRequest + 26, // 95: akp.ocm.v2.ClusterSetService.AddClustersToClusterSet:input_type -> akp.ocm.v2.AddClustersToClusterSetRequest + 28, // 96: akp.ocm.v2.ClusterSetService.RemoveClustersFromClusterSet:input_type -> akp.ocm.v2.RemoveClustersFromClusterSetRequest + 30, // 97: akp.ocm.v2.ClusterSetService.ListClusterSetClusters:input_type -> akp.ocm.v2.ListClusterSetClustersRequest + 32, // 98: akp.ocm.v2.ClusterSetService.ListAddableClusters:input_type -> akp.ocm.v2.ListAddableClustersRequest + 35, // 99: akp.ocm.v2.ClusterSetService.ListBoundNamespaces:input_type -> akp.ocm.v2.ListBoundNamespacesRequest + 37, // 100: akp.ocm.v2.ClusterSetService.BindNamespace:input_type -> akp.ocm.v2.BindNamespaceRequest + 39, // 101: akp.ocm.v2.ClusterSetService.UnbindNamespace:input_type -> akp.ocm.v2.UnbindNamespaceRequest + 43, // 102: akp.ocm.v2.ClusterSetService.GetClusterSetAuthInfo:input_type -> akp.ocm.v2.GetClusterSetAuthInfoRequest + 46, // 103: akp.ocm.v2.ClusterAuthService.SyncAccounts:input_type -> akp.ocm.v2.SyncAccountsRequest + 48, // 104: akp.ocm.v2.ClusterAuthService.ListUsers:input_type -> akp.ocm.v2.ListUsersRequest + 50, // 105: akp.ocm.v2.ClusterAuthService.CreateUser:input_type -> akp.ocm.v2.CreateUserRequest + 52, // 106: akp.ocm.v2.ClusterAuthService.UpdateUserPermissions:input_type -> akp.ocm.v2.UpdateUserPermissionsRequest + 54, // 107: akp.ocm.v2.ClusterAuthService.GetUserPermissions:input_type -> akp.ocm.v2.GetUserPermissionsRequest + 56, // 108: akp.ocm.v2.ClusterAuthService.ListUserClusters:input_type -> akp.ocm.v2.ListUserClustersRequest + 58, // 109: akp.ocm.v2.ClusterAuthService.GetUserKubeconfig:input_type -> akp.ocm.v2.GetUserKubeconfigRequest + 61, // 110: akp.ocm.v2.ClusterAuthService.RemoveUserPermissions:input_type -> akp.ocm.v2.RemoveUserPermissionsRequest + 63, // 111: akp.ocm.v2.ClusterAuthService.DeleteUser:input_type -> akp.ocm.v2.DeleteUserRequest + 67, // 112: akp.ocm.v2.FeatureSetService.ListFeatureSets:input_type -> akp.ocm.v2.ListFeatureSetsRequest + 69, // 113: akp.ocm.v2.FeatureSetService.InstallFeatureSet:input_type -> akp.ocm.v2.InstallFeatureSetRequest + 71, // 114: akp.ocm.v2.FeatureSetService.UpdateClusterFeatureSet:input_type -> akp.ocm.v2.UpdateClusterFeatureSetRequest + 73, // 115: akp.ocm.v2.FeatureSetService.DisableFeatureSet:input_type -> akp.ocm.v2.DisableFeatureSetRequest + 75, // 116: akp.ocm.v2.FeatureSetService.CheckAutoUpdate:input_type -> akp.ocm.v2.CheckAutoUpdateRequest + 77, // 117: akp.ocm.v2.FeatureSetService.AutoUpdateClusterSet:input_type -> akp.ocm.v2.AutoUpdateClusterSetRequest + 80, // 118: akp.ocm.v2.FeatureSetService.GetFeatureSetsSyncStatus:input_type -> akp.ocm.v2.GetFeatureSetsSyncStatusRequest + 83, // 119: akp.ocm.v2.FeatureSetService.GetOpscenterFeaturesVersionSync:input_type -> akp.ocm.v2.GetOpscenterFeaturesVersionSyncRequest + 85, // 120: akp.ocm.v2.FeatureSetService.GetFeatureSyncStatus:input_type -> akp.ocm.v2.GetFeatureSyncStatusRequest + 94, // 121: akp.ocm.v2.ClientOrgService.ListClientOrgUsers:input_type -> akp.ocm.v2.ListClientOrgUsersRequest + 96, // 122: akp.ocm.v2.ClientOrgService.CreateClientOrgUser:input_type -> akp.ocm.v2.CreateClientOrgUserRequest + 98, // 123: akp.ocm.v2.ClientOrgService.UpdateClientOrgUserPermissions:input_type -> akp.ocm.v2.UpdateClientOrgUserPermissionsRequest + 100, // 124: akp.ocm.v2.ClientOrgService.GetClientOrgUserPermissions:input_type -> akp.ocm.v2.GetClientOrgUserPermissionsRequest + 102, // 125: akp.ocm.v2.ClientOrgService.GetClientOrgUserKubeconfig:input_type -> akp.ocm.v2.GetClientOrgUserKubeconfigRequest + 104, // 126: akp.ocm.v2.ClientOrgService.RemoveClientOrgUserPermissions:input_type -> akp.ocm.v2.RemoveClientOrgUserPermissionsRequest + 106, // 127: akp.ocm.v2.ClientOrgService.DeleteClientOrgUser:input_type -> akp.ocm.v2.DeleteClientOrgUserRequest + 3, // 128: akp.ocm.v2.ManagedClusterService.ListHubClusters:output_type -> akp.ocm.v2.ListHubClustersResponse + 5, // 129: akp.ocm.v2.ManagedClusterService.ListManagedClusters:output_type -> akp.ocm.v2.ListManagedClustersResponse + 7, // 130: akp.ocm.v2.ManagedClusterService.ListSpokeClusters:output_type -> akp.ocm.v2.ListSpokeClustersResponse + 9, // 131: akp.ocm.v2.ManagedClusterService.AcceptManagedClusters:output_type -> akp.ocm.v2.AcceptManagedClustersResponse + 11, // 132: akp.ocm.v2.ManagedClusterService.RemoveManagedCluster:output_type -> akp.ocm.v2.RemoveManagedClusterResponse + 13, // 133: akp.ocm.v2.ManagedClusterService.ValidateClusterFeatureSets:output_type -> akp.ocm.v2.ValidateClusterFeatureSetsResponse + 15, // 134: akp.ocm.v2.ManagedClusterService.ListAvailableClusters:output_type -> akp.ocm.v2.ListAvailableClustersResponse + 17, // 135: akp.ocm.v2.ManagedClusterService.ListAvailableClusterSets:output_type -> akp.ocm.v2.ListAvailableClusterSetsResponse + 88, // 136: akp.ocm.v2.ManagedClusterService.GetSpokeInstallCommand:output_type -> akp.ocm.v2.GetSpokeInstallCommandResponse + 90, // 137: akp.ocm.v2.ManagedClusterService.ImportManagedCluster:output_type -> akp.ocm.v2.ImportManagedClusterResponse + 92, // 138: akp.ocm.v2.ManagedClusterService.ConvertToSpokeCluster:output_type -> akp.ocm.v2.ConvertToSpokeClusterResponse + 21, // 139: akp.ocm.v2.ClusterSetService.ListClusterSets:output_type -> akp.ocm.v2.ListClusterSetsResponse + 23, // 140: akp.ocm.v2.ClusterSetService.CreateClusterSet:output_type -> akp.ocm.v2.CreateClusterSetResponse + 25, // 141: akp.ocm.v2.ClusterSetService.DeleteClusterSet:output_type -> akp.ocm.v2.DeleteClusterSetResponse + 27, // 142: akp.ocm.v2.ClusterSetService.AddClustersToClusterSet:output_type -> akp.ocm.v2.AddClustersToClusterSetResponse + 29, // 143: akp.ocm.v2.ClusterSetService.RemoveClustersFromClusterSet:output_type -> akp.ocm.v2.RemoveClustersFromClusterSetResponse + 31, // 144: akp.ocm.v2.ClusterSetService.ListClusterSetClusters:output_type -> akp.ocm.v2.ListClusterSetClustersResponse + 33, // 145: akp.ocm.v2.ClusterSetService.ListAddableClusters:output_type -> akp.ocm.v2.ListAddableClustersResponse + 36, // 146: akp.ocm.v2.ClusterSetService.ListBoundNamespaces:output_type -> akp.ocm.v2.ListBoundNamespacesResponse + 38, // 147: akp.ocm.v2.ClusterSetService.BindNamespace:output_type -> akp.ocm.v2.BindNamespaceResponse + 40, // 148: akp.ocm.v2.ClusterSetService.UnbindNamespace:output_type -> akp.ocm.v2.UnbindNamespaceResponse + 44, // 149: akp.ocm.v2.ClusterSetService.GetClusterSetAuthInfo:output_type -> akp.ocm.v2.GetClusterSetAuthInfoResponse + 47, // 150: akp.ocm.v2.ClusterAuthService.SyncAccounts:output_type -> akp.ocm.v2.SyncAccountsResponse + 49, // 151: akp.ocm.v2.ClusterAuthService.ListUsers:output_type -> akp.ocm.v2.ListUsersResponse + 51, // 152: akp.ocm.v2.ClusterAuthService.CreateUser:output_type -> akp.ocm.v2.CreateUserResponse + 53, // 153: akp.ocm.v2.ClusterAuthService.UpdateUserPermissions:output_type -> akp.ocm.v2.UpdateUserPermissionsResponse + 55, // 154: akp.ocm.v2.ClusterAuthService.GetUserPermissions:output_type -> akp.ocm.v2.GetUserPermissionsResponse + 57, // 155: akp.ocm.v2.ClusterAuthService.ListUserClusters:output_type -> akp.ocm.v2.ListUserClustersResponse + 59, // 156: akp.ocm.v2.ClusterAuthService.GetUserKubeconfig:output_type -> akp.ocm.v2.GetUserKubeconfigResponse + 62, // 157: akp.ocm.v2.ClusterAuthService.RemoveUserPermissions:output_type -> akp.ocm.v2.RemoveUserPermissionsResponse + 64, // 158: akp.ocm.v2.ClusterAuthService.DeleteUser:output_type -> akp.ocm.v2.DeleteUserResponse + 68, // 159: akp.ocm.v2.FeatureSetService.ListFeatureSets:output_type -> akp.ocm.v2.ListFeatureSetsResponse + 70, // 160: akp.ocm.v2.FeatureSetService.InstallFeatureSet:output_type -> akp.ocm.v2.InstallFeatureSetResponse + 72, // 161: akp.ocm.v2.FeatureSetService.UpdateClusterFeatureSet:output_type -> akp.ocm.v2.UpdateClusterFeatureSetResponse + 74, // 162: akp.ocm.v2.FeatureSetService.DisableFeatureSet:output_type -> akp.ocm.v2.DisableFeatureSetResponse + 76, // 163: akp.ocm.v2.FeatureSetService.CheckAutoUpdate:output_type -> akp.ocm.v2.CheckAutoUpdateResponse + 78, // 164: akp.ocm.v2.FeatureSetService.AutoUpdateClusterSet:output_type -> akp.ocm.v2.AutoUpdateClusterSetResponse + 81, // 165: akp.ocm.v2.FeatureSetService.GetFeatureSetsSyncStatus:output_type -> akp.ocm.v2.GetFeatureSetsSyncStatusResponse + 84, // 166: akp.ocm.v2.FeatureSetService.GetOpscenterFeaturesVersionSync:output_type -> akp.ocm.v2.GetOpscenterFeaturesVersionSyncResponse + 86, // 167: akp.ocm.v2.FeatureSetService.GetFeatureSyncStatus:output_type -> akp.ocm.v2.GetFeatureSyncStatusResponse + 95, // 168: akp.ocm.v2.ClientOrgService.ListClientOrgUsers:output_type -> akp.ocm.v2.ListClientOrgUsersResponse + 97, // 169: akp.ocm.v2.ClientOrgService.CreateClientOrgUser:output_type -> akp.ocm.v2.CreateClientOrgUserResponse + 99, // 170: akp.ocm.v2.ClientOrgService.UpdateClientOrgUserPermissions:output_type -> akp.ocm.v2.UpdateClientOrgUserPermissionsResponse + 101, // 171: akp.ocm.v2.ClientOrgService.GetClientOrgUserPermissions:output_type -> akp.ocm.v2.GetClientOrgUserPermissionsResponse + 103, // 172: akp.ocm.v2.ClientOrgService.GetClientOrgUserKubeconfig:output_type -> akp.ocm.v2.GetClientOrgUserKubeconfigResponse + 105, // 173: akp.ocm.v2.ClientOrgService.RemoveClientOrgUserPermissions:output_type -> akp.ocm.v2.RemoveClientOrgUserPermissionsResponse + 107, // 174: akp.ocm.v2.ClientOrgService.DeleteClientOrgUser:output_type -> akp.ocm.v2.DeleteClientOrgUserResponse + 128, // [128:175] is the sub-list for method output_type + 81, // [81:128] is the sub-list for method input_type + 81, // [81:81] is the sub-list for extension type_name + 81, // [81:81] is the sub-list for extension extendee + 0, // [0:81] is the sub-list for field type_name +} + +func init() { file_akp_ocm_v2_ocm_proto_init() } +func file_akp_ocm_v2_ocm_proto_init() { + if File_akp_ocm_v2_ocm_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_ocm_v2_ocm_proto_rawDesc), len(file_akp_ocm_v2_ocm_proto_rawDesc)), + NumEnums: 0, + NumMessages: 109, + NumExtensions: 0, + NumServices: 5, + }, + GoTypes: file_akp_ocm_v2_ocm_proto_goTypes, + DependencyIndexes: file_akp_ocm_v2_ocm_proto_depIdxs, + MessageInfos: file_akp_ocm_v2_ocm_proto_msgTypes, + }.Build() + File_akp_ocm_v2_ocm_proto = out.File + file_akp_ocm_v2_ocm_proto_goTypes = nil + file_akp_ocm_v2_ocm_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/client_org.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/client_org.pb.go new file mode 100644 index 000000000..82782681e --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/client_org.pb.go @@ -0,0 +1,1434 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/user/v2/client_org.proto + +package userv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/ocm/v2" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ClientOrganizationStatus is how far a client organization's namespaces are deleted. +type ClientOrganizationStatus int32 + +const ( + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_UNSPECIFIED ClientOrganizationStatus = 0 + // All the namespaces are there. + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_ACTIVE ClientOrganizationStatus = 1 + // The namespaces are marked for deletion. + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_DELETING ClientOrganizationStatus = 2 + // Some of the namespaces are gone. + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_PARTIALLY_DELETED ClientOrganizationStatus = 3 + // The cluster is gone from the hub. + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_DELETED ClientOrganizationStatus = 4 + // The cluster could not be asked. + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_UNREACHABLE ClientOrganizationStatus = 5 + // The client organization has no such cluster. + ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_NOT_FOUND ClientOrganizationStatus = 6 +) + +// Enum value maps for ClientOrganizationStatus. +var ( + ClientOrganizationStatus_name = map[int32]string{ + 0: "CLIENT_ORGANIZATION_STATUS_UNSPECIFIED", + 1: "CLIENT_ORGANIZATION_STATUS_ACTIVE", + 2: "CLIENT_ORGANIZATION_STATUS_DELETING", + 3: "CLIENT_ORGANIZATION_STATUS_PARTIALLY_DELETED", + 4: "CLIENT_ORGANIZATION_STATUS_DELETED", + 5: "CLIENT_ORGANIZATION_STATUS_UNREACHABLE", + 6: "CLIENT_ORGANIZATION_STATUS_NOT_FOUND", + } + ClientOrganizationStatus_value = map[string]int32{ + "CLIENT_ORGANIZATION_STATUS_UNSPECIFIED": 0, + "CLIENT_ORGANIZATION_STATUS_ACTIVE": 1, + "CLIENT_ORGANIZATION_STATUS_DELETING": 2, + "CLIENT_ORGANIZATION_STATUS_PARTIALLY_DELETED": 3, + "CLIENT_ORGANIZATION_STATUS_DELETED": 4, + "CLIENT_ORGANIZATION_STATUS_UNREACHABLE": 5, + "CLIENT_ORGANIZATION_STATUS_NOT_FOUND": 6, + } +) + +func (x ClientOrganizationStatus) Enum() *ClientOrganizationStatus { + p := new(ClientOrganizationStatus) + *p = x + return p +} + +func (x ClientOrganizationStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClientOrganizationStatus) Descriptor() protoreflect.EnumDescriptor { + return file_akp_user_v2_client_org_proto_enumTypes[0].Descriptor() +} + +func (ClientOrganizationStatus) Type() protoreflect.EnumType { + return &file_akp_user_v2_client_org_proto_enumTypes[0] +} + +func (x ClientOrganizationStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ClientOrganizationStatus.Descriptor instead. +func (ClientOrganizationStatus) EnumDescriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{0} +} + +type ListClientOrganizationsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClientOrganizationsRequest) Reset() { + *x = ListClientOrganizationsRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClientOrganizationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClientOrganizationsRequest) ProtoMessage() {} + +func (x *ListClientOrganizationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClientOrganizationsRequest.ProtoReflect.Descriptor instead. +func (*ListClientOrganizationsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{0} +} + +func (x *ListClientOrganizationsRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +type ListClientOrganizationsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organizations []*Organization `protobuf:"bytes,1,rep,name=organizations,proto3" json:"organizations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClientOrganizationsResponse) Reset() { + *x = ListClientOrganizationsResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClientOrganizationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClientOrganizationsResponse) ProtoMessage() {} + +func (x *ListClientOrganizationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClientOrganizationsResponse.ProtoReflect.Descriptor instead. +func (*ListClientOrganizationsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{1} +} + +func (x *ListClientOrganizationsResponse) GetOrganizations() []*Organization { + if x != nil { + return x.Organizations + } + return nil +} + +type GetClientOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrganizationRequest) Reset() { + *x = GetClientOrganizationRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrganizationRequest) ProtoMessage() {} + +func (x *GetClientOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrganizationRequest.ProtoReflect.Descriptor instead. +func (*GetClientOrganizationRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{2} +} + +func (x *GetClientOrganizationRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *GetClientOrganizationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetClientOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization *Organization `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrganizationResponse) Reset() { + *x = GetClientOrganizationResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrganizationResponse) ProtoMessage() {} + +func (x *GetClientOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrganizationResponse.ProtoReflect.Descriptor instead. +func (*GetClientOrganizationResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{3} +} + +func (x *GetClientOrganizationResponse) GetOrganization() *Organization { + if x != nil { + return x.Organization + } + return nil +} + +type GetClientOrganizationStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + // name is the client organization's. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrganizationStatusRequest) Reset() { + *x = GetClientOrganizationStatusRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrganizationStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrganizationStatusRequest) ProtoMessage() {} + +func (x *GetClientOrganizationStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrganizationStatusRequest.ProtoReflect.Descriptor instead. +func (*GetClientOrganizationStatusRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{4} +} + +func (x *GetClientOrganizationStatusRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *GetClientOrganizationStatusRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetClientOrganizationStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status ClientOrganizationStatus `protobuf:"varint,1,opt,name=status,proto3,enum=akp.user.v2.ClientOrganizationStatus" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrganizationStatusResponse) Reset() { + *x = GetClientOrganizationStatusResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrganizationStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrganizationStatusResponse) ProtoMessage() {} + +func (x *GetClientOrganizationStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrganizationStatusResponse.ProtoReflect.Descriptor instead. +func (*GetClientOrganizationStatusResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{5} +} + +func (x *GetClientOrganizationStatusResponse) GetStatus() ClientOrganizationStatus { + if x != nil { + return x.Status + } + return ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_UNSPECIFIED +} + +type GetClientOrganizationClusterStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + // name is the client organization's. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Cluster string `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrganizationClusterStatusRequest) Reset() { + *x = GetClientOrganizationClusterStatusRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrganizationClusterStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrganizationClusterStatusRequest) ProtoMessage() {} + +func (x *GetClientOrganizationClusterStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrganizationClusterStatusRequest.ProtoReflect.Descriptor instead. +func (*GetClientOrganizationClusterStatusRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{6} +} + +func (x *GetClientOrganizationClusterStatusRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *GetClientOrganizationClusterStatusRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetClientOrganizationClusterStatusRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +type GetClientOrganizationClusterStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status ClientOrganizationStatus `protobuf:"varint,1,opt,name=status,proto3,enum=akp.user.v2.ClientOrganizationStatus" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClientOrganizationClusterStatusResponse) Reset() { + *x = GetClientOrganizationClusterStatusResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClientOrganizationClusterStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClientOrganizationClusterStatusResponse) ProtoMessage() {} + +func (x *GetClientOrganizationClusterStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClientOrganizationClusterStatusResponse.ProtoReflect.Descriptor instead. +func (*GetClientOrganizationClusterStatusResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{7} +} + +func (x *GetClientOrganizationClusterStatusResponse) GetStatus() ClientOrganizationStatus { + if x != nil { + return x.Status + } + return ClientOrganizationStatus_CLIENT_ORGANIZATION_STATUS_UNSPECIFIED +} + +type RemoveClientOrganizationClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + // name is the client organization's. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // hub_cluster_owner and hub_cluster_uid name the hub the cluster is a spoke of. + HubClusterOwner string `protobuf:"bytes,3,opt,name=hub_cluster_owner,json=hubClusterOwner,proto3" json:"hub_cluster_owner,omitempty"` + HubClusterUid string `protobuf:"bytes,4,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + // cluster is the client organization's cluster. + Cluster string `protobuf:"bytes,5,opt,name=cluster,proto3" json:"cluster,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClientOrganizationClusterRequest) Reset() { + *x = RemoveClientOrganizationClusterRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClientOrganizationClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClientOrganizationClusterRequest) ProtoMessage() {} + +func (x *RemoveClientOrganizationClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClientOrganizationClusterRequest.ProtoReflect.Descriptor instead. +func (*RemoveClientOrganizationClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{8} +} + +func (x *RemoveClientOrganizationClusterRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *RemoveClientOrganizationClusterRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RemoveClientOrganizationClusterRequest) GetHubClusterOwner() string { + if x != nil { + return x.HubClusterOwner + } + return "" +} + +func (x *RemoveClientOrganizationClusterRequest) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *RemoveClientOrganizationClusterRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +type RemoveClientOrganizationClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveClientOrganizationClusterResponse) Reset() { + *x = RemoveClientOrganizationClusterResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveClientOrganizationClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClientOrganizationClusterResponse) ProtoMessage() {} + +func (x *RemoveClientOrganizationClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClientOrganizationClusterResponse.ProtoReflect.Descriptor instead. +func (*RemoveClientOrganizationClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{9} +} + +type DeleteClientOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClientOrganizationRequest) Reset() { + *x = DeleteClientOrganizationRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClientOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClientOrganizationRequest) ProtoMessage() {} + +func (x *DeleteClientOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClientOrganizationRequest.ProtoReflect.Descriptor instead. +func (*DeleteClientOrganizationRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteClientOrganizationRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *DeleteClientOrganizationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteClientOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteClientOrganizationResponse) Reset() { + *x = DeleteClientOrganizationResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteClientOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteClientOrganizationResponse) ProtoMessage() {} + +func (x *DeleteClientOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteClientOrganizationResponse.ProtoReflect.Descriptor instead. +func (*DeleteClientOrganizationResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{11} +} + +// ClientOrganizationNamespaceOptions configure the namespaces a client organization gets in each +// of its clusters. +type ClientOrganizationNamespaceOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Annotations map[string]string `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // kubedb places KubeDB's operator for the organization: {nodeSelector, tolerations}, as + // Kubernetes has them. + Kubedb *structpb.Struct `protobuf:"bytes,2,opt,name=kubedb,proto3" json:"kubedb,omitempty"` + UseGateway bool `protobuf:"varint,3,opt,name=use_gateway,json=useGateway,proto3" json:"use_gateway,omitempty"` + // usable_as_shared puts the organization's gateway config in the shared gateway namespace. + UsableAsShared bool `protobuf:"varint,4,opt,name=usable_as_shared,json=usableAsShared,proto3" json:"usable_as_shared,omitempty"` + // gateway_config is the organization's gateway: {cluster, envoy, infra}, as the catalog's + // GatewayConfig has them. + GatewayConfig *structpb.Struct `protobuf:"bytes,5,opt,name=gateway_config,json=gatewayConfig,proto3" json:"gateway_config,omitempty"` + // gateway_config_ref names a GatewayConfig to use instead of making one. + GatewayConfigRef *GatewayConfigReference `protobuf:"bytes,6,opt,name=gateway_config_ref,json=gatewayConfigRef,proto3" json:"gateway_config_ref,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientOrganizationNamespaceOptions) Reset() { + *x = ClientOrganizationNamespaceOptions{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientOrganizationNamespaceOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientOrganizationNamespaceOptions) ProtoMessage() {} + +func (x *ClientOrganizationNamespaceOptions) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientOrganizationNamespaceOptions.ProtoReflect.Descriptor instead. +func (*ClientOrganizationNamespaceOptions) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{12} +} + +func (x *ClientOrganizationNamespaceOptions) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *ClientOrganizationNamespaceOptions) GetKubedb() *structpb.Struct { + if x != nil { + return x.Kubedb + } + return nil +} + +func (x *ClientOrganizationNamespaceOptions) GetUseGateway() bool { + if x != nil { + return x.UseGateway + } + return false +} + +func (x *ClientOrganizationNamespaceOptions) GetUsableAsShared() bool { + if x != nil { + return x.UsableAsShared + } + return false +} + +func (x *ClientOrganizationNamespaceOptions) GetGatewayConfig() *structpb.Struct { + if x != nil { + return x.GatewayConfig + } + return nil +} + +func (x *ClientOrganizationNamespaceOptions) GetGatewayConfigRef() *GatewayConfigReference { + if x != nil { + return x.GatewayConfigRef + } + return nil +} + +type GatewayConfigReference struct { + state protoimpl.MessageState `protogen:"open.v1"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GatewayConfigReference) Reset() { + *x = GatewayConfigReference{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GatewayConfigReference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GatewayConfigReference) ProtoMessage() {} + +func (x *GatewayConfigReference) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GatewayConfigReference.ProtoReflect.Descriptor instead. +func (*GatewayConfigReference) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{13} +} + +func (x *GatewayConfigReference) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *GatewayConfigReference) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// ClientOrganizationTelemetry is the monitoring cluster a client organization's telemetry goes +// to, and how long it is kept there. +type ClientOrganizationTelemetry struct { + state protoimpl.MessageState `protogen:"open.v1"` + MonitoringCluster string `protobuf:"bytes,1,opt,name=monitoring_cluster,json=monitoringCluster,proto3" json:"monitoring_cluster,omitempty"` + LogsRetention string `protobuf:"bytes,2,opt,name=logs_retention,json=logsRetention,proto3" json:"logs_retention,omitempty"` + TracesRetention string `protobuf:"bytes,3,opt,name=traces_retention,json=tracesRetention,proto3" json:"traces_retention,omitempty"` + MetricsRawRetention string `protobuf:"bytes,4,opt,name=metrics_raw_retention,json=metricsRawRetention,proto3" json:"metrics_raw_retention,omitempty"` + MetricsFiveMinuteRetention string `protobuf:"bytes,5,opt,name=metrics_five_minute_retention,json=metricsFiveMinuteRetention,proto3" json:"metrics_five_minute_retention,omitempty"` + MetricsOneHourRetention string `protobuf:"bytes,6,opt,name=metrics_one_hour_retention,json=metricsOneHourRetention,proto3" json:"metrics_one_hour_retention,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientOrganizationTelemetry) Reset() { + *x = ClientOrganizationTelemetry{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientOrganizationTelemetry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientOrganizationTelemetry) ProtoMessage() {} + +func (x *ClientOrganizationTelemetry) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientOrganizationTelemetry.ProtoReflect.Descriptor instead. +func (*ClientOrganizationTelemetry) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{14} +} + +func (x *ClientOrganizationTelemetry) GetMonitoringCluster() string { + if x != nil { + return x.MonitoringCluster + } + return "" +} + +func (x *ClientOrganizationTelemetry) GetLogsRetention() string { + if x != nil { + return x.LogsRetention + } + return "" +} + +func (x *ClientOrganizationTelemetry) GetTracesRetention() string { + if x != nil { + return x.TracesRetention + } + return "" +} + +func (x *ClientOrganizationTelemetry) GetMetricsRawRetention() string { + if x != nil { + return x.MetricsRawRetention + } + return "" +} + +func (x *ClientOrganizationTelemetry) GetMetricsFiveMinuteRetention() string { + if x != nil { + return x.MetricsFiveMinuteRetention + } + return "" +} + +func (x *ClientOrganizationTelemetry) GetMetricsOneHourRetention() string { + if x != nil { + return x.MetricsOneHourRetention + } + return "" +} + +type CreateClientOrganizationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + // name is the client organization's. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + // visibility is public (the default), limited or private. + Visibility string `protobuf:"bytes,4,opt,name=visibility,proto3" json:"visibility,omitempty"` + // rancher asks for a Rancher organization, which needs rancher_endpoint, the endpoint of its + // Rancher management cluster. The organization made is a client one either way. + Rancher bool `protobuf:"varint,5,opt,name=rancher,proto3" json:"rancher,omitempty"` + RancherEndpoint string `protobuf:"bytes,6,opt,name=rancher_endpoint,json=rancherEndpoint,proto3" json:"rancher_endpoint,omitempty"` + // hub_cluster_owner and hub_cluster_uid name the hub, which a site admin imported. + HubClusterOwner string `protobuf:"bytes,7,opt,name=hub_cluster_owner,json=hubClusterOwner,proto3" json:"hub_cluster_owner,omitempty"` + HubClusterUid string `protobuf:"bytes,8,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + // admin_user_name is the organization's admin; admin_email is the address of an admin made. + AdminUserName string `protobuf:"bytes,9,opt,name=admin_user_name,json=adminUserName,proto3" json:"admin_user_name,omitempty"` + AdminEmail string `protobuf:"bytes,10,opt,name=admin_email,json=adminEmail,proto3" json:"admin_email,omitempty"` + // permissions are the admin's on the hub's clusters and cluster sets. + Permissions []*v2.Permission `protobuf:"bytes,11,rep,name=permissions,proto3" json:"permissions,omitempty"` + Namespaces *ClientOrganizationNamespaceOptions `protobuf:"bytes,12,opt,name=namespaces,proto3" json:"namespaces,omitempty"` + Telemetry *ClientOrganizationTelemetry `protobuf:"bytes,13,opt,name=telemetry,proto3" json:"telemetry,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateClientOrganizationRequest) Reset() { + *x = CreateClientOrganizationRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateClientOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateClientOrganizationRequest) ProtoMessage() {} + +func (x *CreateClientOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateClientOrganizationRequest.ProtoReflect.Descriptor instead. +func (*CreateClientOrganizationRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{15} +} + +func (x *CreateClientOrganizationRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetVisibility() string { + if x != nil { + return x.Visibility + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetRancher() bool { + if x != nil { + return x.Rancher + } + return false +} + +func (x *CreateClientOrganizationRequest) GetRancherEndpoint() string { + if x != nil { + return x.RancherEndpoint + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetHubClusterOwner() string { + if x != nil { + return x.HubClusterOwner + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetAdminUserName() string { + if x != nil { + return x.AdminUserName + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetAdminEmail() string { + if x != nil { + return x.AdminEmail + } + return "" +} + +func (x *CreateClientOrganizationRequest) GetPermissions() []*v2.Permission { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *CreateClientOrganizationRequest) GetNamespaces() *ClientOrganizationNamespaceOptions { + if x != nil { + return x.Namespaces + } + return nil +} + +func (x *CreateClientOrganizationRequest) GetTelemetry() *ClientOrganizationTelemetry { + if x != nil { + return x.Telemetry + } + return nil +} + +type CreateClientOrganizationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateClientOrganizationResponse) Reset() { + *x = CreateClientOrganizationResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateClientOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateClientOrganizationResponse) ProtoMessage() {} + +func (x *CreateClientOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateClientOrganizationResponse.ProtoReflect.Descriptor instead. +func (*CreateClientOrganizationResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{16} +} + +type AddClientOrganizationClusterRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + // name is the client organization's. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + HubClusterOwner string `protobuf:"bytes,3,opt,name=hub_cluster_owner,json=hubClusterOwner,proto3" json:"hub_cluster_owner,omitempty"` + HubClusterUid string `protobuf:"bytes,4,opt,name=hub_cluster_uid,json=hubClusterUid,proto3" json:"hub_cluster_uid,omitempty"` + // cluster is the hub's spoke that the organization gets. + Cluster string `protobuf:"bytes,5,opt,name=cluster,proto3" json:"cluster,omitempty"` + Namespaces *ClientOrganizationNamespaceOptions `protobuf:"bytes,6,opt,name=namespaces,proto3" json:"namespaces,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddClientOrganizationClusterRequest) Reset() { + *x = AddClientOrganizationClusterRequest{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddClientOrganizationClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddClientOrganizationClusterRequest) ProtoMessage() {} + +func (x *AddClientOrganizationClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddClientOrganizationClusterRequest.ProtoReflect.Descriptor instead. +func (*AddClientOrganizationClusterRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{17} +} + +func (x *AddClientOrganizationClusterRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *AddClientOrganizationClusterRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddClientOrganizationClusterRequest) GetHubClusterOwner() string { + if x != nil { + return x.HubClusterOwner + } + return "" +} + +func (x *AddClientOrganizationClusterRequest) GetHubClusterUid() string { + if x != nil { + return x.HubClusterUid + } + return "" +} + +func (x *AddClientOrganizationClusterRequest) GetCluster() string { + if x != nil { + return x.Cluster + } + return "" +} + +func (x *AddClientOrganizationClusterRequest) GetNamespaces() *ClientOrganizationNamespaceOptions { + if x != nil { + return x.Namespaces + } + return nil +} + +type AddClientOrganizationClusterResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddClientOrganizationClusterResponse) Reset() { + *x = AddClientOrganizationClusterResponse{} + mi := &file_akp_user_v2_client_org_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddClientOrganizationClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddClientOrganizationClusterResponse) ProtoMessage() {} + +func (x *AddClientOrganizationClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_client_org_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddClientOrganizationClusterResponse.ProtoReflect.Descriptor instead. +func (*AddClientOrganizationClusterResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_client_org_proto_rawDescGZIP(), []int{18} +} + +var File_akp_user_v2_client_org_proto protoreflect.FileDescriptor + +const file_akp_user_v2_client_org_proto_rawDesc = "" + + "\n" + + "\x1cakp/user/v2/client_org.proto\x12\vakp.user.v2\x1a\x14akp/ocm/v2/ocm.proto\x1a\x16akp/user/v2/user.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\"M\n" + + "\x1eListClientOrganizationsRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\"b\n" + + "\x1fListClientOrganizationsResponse\x12?\n" + + "\rorganizations\x18\x01 \x03(\v2\x19.akp.user.v2.OrganizationR\rorganizations\"q\n" + + "\x1cGetClientOrganizationRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12$\n" + + "\x02id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x02id\"^\n" + + "\x1dGetClientOrganizationResponse\x12=\n" + + "\forganization\x18\x01 \x01(\v2\x19.akp.user.v2.OrganizationR\forganization\"n\n" + + "\"GetClientOrganizationStatusRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"d\n" + + "#GetClientOrganizationStatusResponse\x12=\n" + + "\x06status\x18\x01 \x01(\x0e2%.akp.user.v2.ClientOrganizationStatusR\x06status\"\x98\x01\n" + + ")GetClientOrganizationClusterStatusRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12!\n" + + "\acluster\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\"k\n" + + "*GetClientOrganizationClusterStatusResponse\x12=\n" + + "\x06status\x18\x01 \x01(\x0e2%.akp.user.v2.ClientOrganizationStatusR\x06status\"\xfb\x01\n" + + "&RemoveClientOrganizationClusterRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x123\n" + + "\x11hub_cluster_owner\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x0fhubClusterOwner\x12/\n" + + "\x0fhub_cluster_uid\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\rhubClusterUid\x12!\n" + + "\acluster\x18\x05 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\")\n" + + "'RemoveClientOrganizationClusterResponse\"t\n" + + "\x1fDeleteClientOrganizationRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12$\n" + + "\x02id\x18\x02 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x02id\"\"\n" + + " DeleteClientOrganizationResponse\"\xd7\x03\n" + + "\"ClientOrganizationNamespaceOptions\x12b\n" + + "\vannotations\x18\x01 \x03(\v2@.akp.user.v2.ClientOrganizationNamespaceOptions.AnnotationsEntryR\vannotations\x12/\n" + + "\x06kubedb\x18\x02 \x01(\v2\x17.google.protobuf.StructR\x06kubedb\x12\x1f\n" + + "\vuse_gateway\x18\x03 \x01(\bR\n" + + "useGateway\x12(\n" + + "\x10usable_as_shared\x18\x04 \x01(\bR\x0eusableAsShared\x12>\n" + + "\x0egateway_config\x18\x05 \x01(\v2\x17.google.protobuf.StructR\rgatewayConfig\x12Q\n" + + "\x12gateway_config_ref\x18\x06 \x01(\v2#.akp.user.v2.GatewayConfigReferenceR\x10gatewayConfigRef\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"J\n" + + "\x16GatewayConfigReference\x12\x1c\n" + + "\tnamespace\x18\x01 \x01(\tR\tnamespace\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"\xd2\x02\n" + + "\x1bClientOrganizationTelemetry\x12-\n" + + "\x12monitoring_cluster\x18\x01 \x01(\tR\x11monitoringCluster\x12%\n" + + "\x0elogs_retention\x18\x02 \x01(\tR\rlogsRetention\x12)\n" + + "\x10traces_retention\x18\x03 \x01(\tR\x0ftracesRetention\x122\n" + + "\x15metrics_raw_retention\x18\x04 \x01(\tR\x13metricsRawRetention\x12A\n" + + "\x1dmetrics_five_minute_retention\x18\x05 \x01(\tR\x1ametricsFiveMinuteRetention\x12;\n" + + "\x1ametrics_one_hour_retention\x18\x06 \x01(\tR\x17metricsOneHourRetention\"\x9b\x05\n" + + "\x1fCreateClientOrganizationRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x1b\n" + + "\tfull_name\x18\x03 \x01(\tR\bfullName\x12A\n" + + "\n" + + "visibility\x18\x04 \x01(\tB!\xbaH\x1er\x1cR\x00R\x06publicR\alimitedR\aprivateR\n" + + "visibility\x12\x18\n" + + "\arancher\x18\x05 \x01(\bR\arancher\x12)\n" + + "\x10rancher_endpoint\x18\x06 \x01(\tR\x0francherEndpoint\x123\n" + + "\x11hub_cluster_owner\x18\a \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x0fhubClusterOwner\x12/\n" + + "\x0fhub_cluster_uid\x18\b \x01(\tB\a\xbaH\x04r\x02\x10\x01R\rhubClusterUid\x12/\n" + + "\x0fadmin_user_name\x18\t \x01(\tB\a\xbaH\x04r\x02\x10\x01R\radminUserName\x12\x1f\n" + + "\vadmin_email\x18\n" + + " \x01(\tR\n" + + "adminEmail\x128\n" + + "\vpermissions\x18\v \x03(\v2\x16.akp.ocm.v2.PermissionR\vpermissions\x12O\n" + + "\n" + + "namespaces\x18\f \x01(\v2/.akp.user.v2.ClientOrganizationNamespaceOptionsR\n" + + "namespaces\x12F\n" + + "\ttelemetry\x18\r \x01(\v2(.akp.user.v2.ClientOrganizationTelemetryR\ttelemetry\"\"\n" + + " CreateClientOrganizationResponse\"\xc9\x02\n" + + "#AddClientOrganizationClusterRequest\x12+\n" + + "\forganization\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\forganization\x12\x1b\n" + + "\x04name\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x123\n" + + "\x11hub_cluster_owner\x18\x03 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x0fhubClusterOwner\x12/\n" + + "\x0fhub_cluster_uid\x18\x04 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\rhubClusterUid\x12!\n" + + "\acluster\x18\x05 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\acluster\x12O\n" + + "\n" + + "namespaces\x18\x06 \x01(\v2/.akp.user.v2.ClientOrganizationNamespaceOptionsR\n" + + "namespaces\"&\n" + + "$AddClientOrganizationClusterResponse*\xc6\x02\n" + + "\x18ClientOrganizationStatus\x12*\n" + + "&CLIENT_ORGANIZATION_STATUS_UNSPECIFIED\x10\x00\x12%\n" + + "!CLIENT_ORGANIZATION_STATUS_ACTIVE\x10\x01\x12'\n" + + "#CLIENT_ORGANIZATION_STATUS_DELETING\x10\x02\x120\n" + + ",CLIENT_ORGANIZATION_STATUS_PARTIALLY_DELETED\x10\x03\x12&\n" + + "\"CLIENT_ORGANIZATION_STATUS_DELETED\x10\x04\x12*\n" + + "&CLIENT_ORGANIZATION_STATUS_UNREACHABLE\x10\x05\x12(\n" + + "$CLIENT_ORGANIZATION_STATUS_NOT_FOUND\x10\x062\xb3\b\n" + + "\x19ClientOrganizationService\x12v\n" + + "\x17ListClientOrganizations\x12+.akp.user.v2.ListClientOrganizationsRequest\x1a,.akp.user.v2.ListClientOrganizationsResponse\"\x00\x12p\n" + + "\x15GetClientOrganization\x12).akp.user.v2.GetClientOrganizationRequest\x1a*.akp.user.v2.GetClientOrganizationResponse\"\x00\x12\x82\x01\n" + + "\x1bGetClientOrganizationStatus\x12/.akp.user.v2.GetClientOrganizationStatusRequest\x1a0.akp.user.v2.GetClientOrganizationStatusResponse\"\x00\x12\x97\x01\n" + + "\"GetClientOrganizationClusterStatus\x126.akp.user.v2.GetClientOrganizationClusterStatusRequest\x1a7.akp.user.v2.GetClientOrganizationClusterStatusResponse\"\x00\x12\x8e\x01\n" + + "\x1fRemoveClientOrganizationCluster\x123.akp.user.v2.RemoveClientOrganizationClusterRequest\x1a4.akp.user.v2.RemoveClientOrganizationClusterResponse\"\x00\x12y\n" + + "\x18DeleteClientOrganization\x12,.akp.user.v2.DeleteClientOrganizationRequest\x1a-.akp.user.v2.DeleteClientOrganizationResponse\"\x00\x12y\n" + + "\x18CreateClientOrganization\x12,.akp.user.v2.CreateClientOrganizationRequest\x1a-.akp.user.v2.CreateClientOrganizationResponse\"\x00\x12\x85\x01\n" + + "\x1cAddClientOrganizationCluster\x120.akp.user.v2.AddClientOrganizationClusterRequest\x1a1.akp.user.v2.AddClientOrganizationClusterResponse\"\x00B\xa6\x01\n" + + "\x0fcom.akp.user.v2B\x0eClientOrgProtoP\x01Z5go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2;userv2\xa2\x02\x03AUX\xaa\x02\vAkp.User.V2\xca\x02\vAkp\\User\\V2\xe2\x02\x17Akp\\User\\V2\\GPBMetadata\xea\x02\rAkp::User::V2b\x06proto3" + +var ( + file_akp_user_v2_client_org_proto_rawDescOnce sync.Once + file_akp_user_v2_client_org_proto_rawDescData []byte +) + +func file_akp_user_v2_client_org_proto_rawDescGZIP() []byte { + file_akp_user_v2_client_org_proto_rawDescOnce.Do(func() { + file_akp_user_v2_client_org_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_user_v2_client_org_proto_rawDesc), len(file_akp_user_v2_client_org_proto_rawDesc))) + }) + return file_akp_user_v2_client_org_proto_rawDescData +} + +var file_akp_user_v2_client_org_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_akp_user_v2_client_org_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_akp_user_v2_client_org_proto_goTypes = []any{ + (ClientOrganizationStatus)(0), // 0: akp.user.v2.ClientOrganizationStatus + (*ListClientOrganizationsRequest)(nil), // 1: akp.user.v2.ListClientOrganizationsRequest + (*ListClientOrganizationsResponse)(nil), // 2: akp.user.v2.ListClientOrganizationsResponse + (*GetClientOrganizationRequest)(nil), // 3: akp.user.v2.GetClientOrganizationRequest + (*GetClientOrganizationResponse)(nil), // 4: akp.user.v2.GetClientOrganizationResponse + (*GetClientOrganizationStatusRequest)(nil), // 5: akp.user.v2.GetClientOrganizationStatusRequest + (*GetClientOrganizationStatusResponse)(nil), // 6: akp.user.v2.GetClientOrganizationStatusResponse + (*GetClientOrganizationClusterStatusRequest)(nil), // 7: akp.user.v2.GetClientOrganizationClusterStatusRequest + (*GetClientOrganizationClusterStatusResponse)(nil), // 8: akp.user.v2.GetClientOrganizationClusterStatusResponse + (*RemoveClientOrganizationClusterRequest)(nil), // 9: akp.user.v2.RemoveClientOrganizationClusterRequest + (*RemoveClientOrganizationClusterResponse)(nil), // 10: akp.user.v2.RemoveClientOrganizationClusterResponse + (*DeleteClientOrganizationRequest)(nil), // 11: akp.user.v2.DeleteClientOrganizationRequest + (*DeleteClientOrganizationResponse)(nil), // 12: akp.user.v2.DeleteClientOrganizationResponse + (*ClientOrganizationNamespaceOptions)(nil), // 13: akp.user.v2.ClientOrganizationNamespaceOptions + (*GatewayConfigReference)(nil), // 14: akp.user.v2.GatewayConfigReference + (*ClientOrganizationTelemetry)(nil), // 15: akp.user.v2.ClientOrganizationTelemetry + (*CreateClientOrganizationRequest)(nil), // 16: akp.user.v2.CreateClientOrganizationRequest + (*CreateClientOrganizationResponse)(nil), // 17: akp.user.v2.CreateClientOrganizationResponse + (*AddClientOrganizationClusterRequest)(nil), // 18: akp.user.v2.AddClientOrganizationClusterRequest + (*AddClientOrganizationClusterResponse)(nil), // 19: akp.user.v2.AddClientOrganizationClusterResponse + nil, // 20: akp.user.v2.ClientOrganizationNamespaceOptions.AnnotationsEntry + (*Organization)(nil), // 21: akp.user.v2.Organization + (*structpb.Struct)(nil), // 22: google.protobuf.Struct + (*v2.Permission)(nil), // 23: akp.ocm.v2.Permission +} +var file_akp_user_v2_client_org_proto_depIdxs = []int32{ + 21, // 0: akp.user.v2.ListClientOrganizationsResponse.organizations:type_name -> akp.user.v2.Organization + 21, // 1: akp.user.v2.GetClientOrganizationResponse.organization:type_name -> akp.user.v2.Organization + 0, // 2: akp.user.v2.GetClientOrganizationStatusResponse.status:type_name -> akp.user.v2.ClientOrganizationStatus + 0, // 3: akp.user.v2.GetClientOrganizationClusterStatusResponse.status:type_name -> akp.user.v2.ClientOrganizationStatus + 20, // 4: akp.user.v2.ClientOrganizationNamespaceOptions.annotations:type_name -> akp.user.v2.ClientOrganizationNamespaceOptions.AnnotationsEntry + 22, // 5: akp.user.v2.ClientOrganizationNamespaceOptions.kubedb:type_name -> google.protobuf.Struct + 22, // 6: akp.user.v2.ClientOrganizationNamespaceOptions.gateway_config:type_name -> google.protobuf.Struct + 14, // 7: akp.user.v2.ClientOrganizationNamespaceOptions.gateway_config_ref:type_name -> akp.user.v2.GatewayConfigReference + 23, // 8: akp.user.v2.CreateClientOrganizationRequest.permissions:type_name -> akp.ocm.v2.Permission + 13, // 9: akp.user.v2.CreateClientOrganizationRequest.namespaces:type_name -> akp.user.v2.ClientOrganizationNamespaceOptions + 15, // 10: akp.user.v2.CreateClientOrganizationRequest.telemetry:type_name -> akp.user.v2.ClientOrganizationTelemetry + 13, // 11: akp.user.v2.AddClientOrganizationClusterRequest.namespaces:type_name -> akp.user.v2.ClientOrganizationNamespaceOptions + 1, // 12: akp.user.v2.ClientOrganizationService.ListClientOrganizations:input_type -> akp.user.v2.ListClientOrganizationsRequest + 3, // 13: akp.user.v2.ClientOrganizationService.GetClientOrganization:input_type -> akp.user.v2.GetClientOrganizationRequest + 5, // 14: akp.user.v2.ClientOrganizationService.GetClientOrganizationStatus:input_type -> akp.user.v2.GetClientOrganizationStatusRequest + 7, // 15: akp.user.v2.ClientOrganizationService.GetClientOrganizationClusterStatus:input_type -> akp.user.v2.GetClientOrganizationClusterStatusRequest + 9, // 16: akp.user.v2.ClientOrganizationService.RemoveClientOrganizationCluster:input_type -> akp.user.v2.RemoveClientOrganizationClusterRequest + 11, // 17: akp.user.v2.ClientOrganizationService.DeleteClientOrganization:input_type -> akp.user.v2.DeleteClientOrganizationRequest + 16, // 18: akp.user.v2.ClientOrganizationService.CreateClientOrganization:input_type -> akp.user.v2.CreateClientOrganizationRequest + 18, // 19: akp.user.v2.ClientOrganizationService.AddClientOrganizationCluster:input_type -> akp.user.v2.AddClientOrganizationClusterRequest + 2, // 20: akp.user.v2.ClientOrganizationService.ListClientOrganizations:output_type -> akp.user.v2.ListClientOrganizationsResponse + 4, // 21: akp.user.v2.ClientOrganizationService.GetClientOrganization:output_type -> akp.user.v2.GetClientOrganizationResponse + 6, // 22: akp.user.v2.ClientOrganizationService.GetClientOrganizationStatus:output_type -> akp.user.v2.GetClientOrganizationStatusResponse + 8, // 23: akp.user.v2.ClientOrganizationService.GetClientOrganizationClusterStatus:output_type -> akp.user.v2.GetClientOrganizationClusterStatusResponse + 10, // 24: akp.user.v2.ClientOrganizationService.RemoveClientOrganizationCluster:output_type -> akp.user.v2.RemoveClientOrganizationClusterResponse + 12, // 25: akp.user.v2.ClientOrganizationService.DeleteClientOrganization:output_type -> akp.user.v2.DeleteClientOrganizationResponse + 17, // 26: akp.user.v2.ClientOrganizationService.CreateClientOrganization:output_type -> akp.user.v2.CreateClientOrganizationResponse + 19, // 27: akp.user.v2.ClientOrganizationService.AddClientOrganizationCluster:output_type -> akp.user.v2.AddClientOrganizationClusterResponse + 20, // [20:28] is the sub-list for method output_type + 12, // [12:20] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_akp_user_v2_client_org_proto_init() } +func file_akp_user_v2_client_org_proto_init() { + if File_akp_user_v2_client_org_proto != nil { + return + } + file_akp_user_v2_user_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_user_v2_client_org_proto_rawDesc), len(file_akp_user_v2_client_org_proto_rawDesc)), + NumEnums: 1, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_user_v2_client_org_proto_goTypes, + DependencyIndexes: file_akp_user_v2_client_org_proto_depIdxs, + EnumInfos: file_akp_user_v2_client_org_proto_enumTypes, + MessageInfos: file_akp_user_v2_client_org_proto_msgTypes, + }.Build() + File_akp_user_v2_client_org_proto = out.File + file_akp_user_v2_client_org_proto_goTypes = nil + file_akp_user_v2_client_org_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/cloud.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/cloud.pb.go new file mode 100644 index 000000000..1c830c9d9 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/cloud.pb.go @@ -0,0 +1,831 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/user/v2/cloud.proto + +package userv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CloudCredential struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // type is the provider, e.g. "AWS", "DigitalOcean" or "Rancher". + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // spec holds the provider's fields under the provider's key, e.g. {"digitalocean": {"token": ...}}. + Spec *structpb.Struct `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CloudCredential) Reset() { + *x = CloudCredential{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CloudCredential) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudCredential) ProtoMessage() {} + +func (x *CloudCredential) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudCredential.ProtoReflect.Descriptor instead. +func (*CloudCredential) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{0} +} + +func (x *CloudCredential) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CloudCredential) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CloudCredential) GetSpec() *structpb.Struct { + if x != nil { + return x.Spec + } + return nil +} + +func (x *CloudCredential) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +type ListCloudCredentialsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // types narrows the list; empty for all. + Types []string `protobuf:"bytes,1,rep,name=types,proto3" json:"types,omitempty"` + // rancher_endpoint leaves out Rancher credentials of other endpoints. + RancherEndpoint string `protobuf:"bytes,2,opt,name=rancher_endpoint,json=rancherEndpoint,proto3" json:"rancher_endpoint,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListCloudCredentialsRequest) Reset() { + *x = ListCloudCredentialsRequest{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListCloudCredentialsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCloudCredentialsRequest) ProtoMessage() {} + +func (x *ListCloudCredentialsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCloudCredentialsRequest.ProtoReflect.Descriptor instead. +func (*ListCloudCredentialsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{1} +} + +func (x *ListCloudCredentialsRequest) GetTypes() []string { + if x != nil { + return x.Types + } + return nil +} + +func (x *ListCloudCredentialsRequest) GetRancherEndpoint() string { + if x != nil { + return x.RancherEndpoint + } + return "" +} + +type ListCloudCredentialsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Credentials []*CloudCredential `protobuf:"bytes,1,rep,name=credentials,proto3" json:"credentials,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListCloudCredentialsResponse) Reset() { + *x = ListCloudCredentialsResponse{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListCloudCredentialsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCloudCredentialsResponse) ProtoMessage() {} + +func (x *ListCloudCredentialsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCloudCredentialsResponse.ProtoReflect.Descriptor instead. +func (*ListCloudCredentialsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{2} +} + +func (x *ListCloudCredentialsResponse) GetCredentials() []*CloudCredential { + if x != nil { + return x.Credentials + } + return nil +} + +type GetCloudCredentialRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetCloudCredentialRequest) Reset() { + *x = GetCloudCredentialRequest{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetCloudCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCloudCredentialRequest) ProtoMessage() {} + +func (x *GetCloudCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCloudCredentialRequest.ProtoReflect.Descriptor instead. +func (*GetCloudCredentialRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{3} +} + +func (x *GetCloudCredentialRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetCloudCredentialResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Credential *CloudCredential `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetCloudCredentialResponse) Reset() { + *x = GetCloudCredentialResponse{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetCloudCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCloudCredentialResponse) ProtoMessage() {} + +func (x *GetCloudCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCloudCredentialResponse.ProtoReflect.Descriptor instead. +func (*GetCloudCredentialResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{4} +} + +func (x *GetCloudCredentialResponse) GetCredential() *CloudCredential { + if x != nil { + return x.Credential + } + return nil +} + +type CreateCloudCredentialRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // name may hold letters, digits, '_' and '-'. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Spec *structpb.Struct `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateCloudCredentialRequest) Reset() { + *x = CreateCloudCredentialRequest{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateCloudCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCloudCredentialRequest) ProtoMessage() {} + +func (x *CreateCloudCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCloudCredentialRequest.ProtoReflect.Descriptor instead. +func (*CreateCloudCredentialRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateCloudCredentialRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateCloudCredentialRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CreateCloudCredentialRequest) GetSpec() *structpb.Struct { + if x != nil { + return x.Spec + } + return nil +} + +type CreateCloudCredentialResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateCloudCredentialResponse) Reset() { + *x = CreateCloudCredentialResponse{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateCloudCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCloudCredentialResponse) ProtoMessage() {} + +func (x *CreateCloudCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCloudCredentialResponse.ProtoReflect.Descriptor instead. +func (*CreateCloudCredentialResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{6} +} + +type UpdateCloudCredentialRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Spec *structpb.Struct `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateCloudCredentialRequest) Reset() { + *x = UpdateCloudCredentialRequest{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateCloudCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCloudCredentialRequest) ProtoMessage() {} + +func (x *UpdateCloudCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCloudCredentialRequest.ProtoReflect.Descriptor instead. +func (*UpdateCloudCredentialRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateCloudCredentialRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateCloudCredentialRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpdateCloudCredentialRequest) GetSpec() *structpb.Struct { + if x != nil { + return x.Spec + } + return nil +} + +type UpdateCloudCredentialResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateCloudCredentialResponse) Reset() { + *x = UpdateCloudCredentialResponse{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateCloudCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCloudCredentialResponse) ProtoMessage() {} + +func (x *UpdateCloudCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCloudCredentialResponse.ProtoReflect.Descriptor instead. +func (*UpdateCloudCredentialResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{8} +} + +type DeleteCloudCredentialRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteCloudCredentialRequest) Reset() { + *x = DeleteCloudCredentialRequest{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteCloudCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCloudCredentialRequest) ProtoMessage() {} + +func (x *DeleteCloudCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCloudCredentialRequest.ProtoReflect.Descriptor instead. +func (*DeleteCloudCredentialRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteCloudCredentialRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteCloudCredentialResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteCloudCredentialResponse) Reset() { + *x = DeleteCloudCredentialResponse{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteCloudCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCloudCredentialResponse) ProtoMessage() {} + +func (x *DeleteCloudCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCloudCredentialResponse.ProtoReflect.Descriptor instead. +func (*DeleteCloudCredentialResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{10} +} + +// ListBucketsRequest names a cloud credential, or a secret in a cluster. +type ListBucketsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterUid string `protobuf:"bytes,1,opt,name=cluster_uid,json=clusterUid,proto3" json:"cluster_uid,omitempty"` + Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` + GceProject string `protobuf:"bytes,3,opt,name=gce_project,json=gceProject,proto3" json:"gce_project,omitempty"` + SecretNamespace string `protobuf:"bytes,4,opt,name=secret_namespace,json=secretNamespace,proto3" json:"secret_namespace,omitempty"` + SecretName string `protobuf:"bytes,5,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` + // provider is the storage kind of a secret: "s3", "gcs", "azure" or "swift". + Provider string `protobuf:"bytes,6,opt,name=provider,proto3" json:"provider,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBucketsRequest) Reset() { + *x = ListBucketsRequest{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBucketsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBucketsRequest) ProtoMessage() {} + +func (x *ListBucketsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBucketsRequest.ProtoReflect.Descriptor instead. +func (*ListBucketsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{11} +} + +func (x *ListBucketsRequest) GetClusterUid() string { + if x != nil { + return x.ClusterUid + } + return "" +} + +func (x *ListBucketsRequest) GetCredential() string { + if x != nil { + return x.Credential + } + return "" +} + +func (x *ListBucketsRequest) GetGceProject() string { + if x != nil { + return x.GceProject + } + return "" +} + +func (x *ListBucketsRequest) GetSecretNamespace() string { + if x != nil { + return x.SecretNamespace + } + return "" +} + +func (x *ListBucketsRequest) GetSecretName() string { + if x != nil { + return x.SecretName + } + return "" +} + +func (x *ListBucketsRequest) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +type ListBucketsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBucketsResponse) Reset() { + *x = ListBucketsResponse{} + mi := &file_akp_user_v2_cloud_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBucketsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBucketsResponse) ProtoMessage() {} + +func (x *ListBucketsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_cloud_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBucketsResponse.ProtoReflect.Descriptor instead. +func (*ListBucketsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_cloud_proto_rawDescGZIP(), []int{12} +} + +func (x *ListBucketsResponse) GetNames() []string { + if x != nil { + return x.Names + } + return nil +} + +var File_akp_user_v2_cloud_proto protoreflect.FileDescriptor + +const file_akp_user_v2_cloud_proto_rawDesc = "" + + "\n" + + "\x17akp/user/v2/cloud.proto\x12\vakp.user.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa3\x01\n" + + "\x0fCloudCredential\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12+\n" + + "\x04spec\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x04spec\x12;\n" + + "\vcreate_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\"^\n" + + "\x1bListCloudCredentialsRequest\x12\x14\n" + + "\x05types\x18\x01 \x03(\tR\x05types\x12)\n" + + "\x10rancher_endpoint\x18\x02 \x01(\tR\x0francherEndpoint\"^\n" + + "\x1cListCloudCredentialsResponse\x12>\n" + + "\vcredentials\x18\x01 \x03(\v2\x1c.akp.user.v2.CloudCredentialR\vcredentials\"8\n" + + "\x19GetCloudCredentialRequest\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"Z\n" + + "\x1aGetCloudCredentialResponse\x12<\n" + + "\n" + + "credential\x18\x01 \x01(\v2\x1c.akp.user.v2.CloudCredentialR\n" + + "credential\"\x95\x01\n" + + "\x1cCreateCloudCredentialRequest\x12+\n" + + "\x04name\x18\x01 \x01(\tB\x17\xbaH\x14r\x122\x10^[a-zA-Z0-9_-]*$R\x04name\x12\x1b\n" + + "\x04type\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04type\x12+\n" + + "\x04spec\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x04spec\"\x1f\n" + + "\x1dCreateCloudCredentialResponse\"\x85\x01\n" + + "\x1cUpdateCloudCredentialRequest\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\x12\x1b\n" + + "\x04type\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04type\x12+\n" + + "\x04spec\x18\x03 \x01(\v2\x17.google.protobuf.StructR\x04spec\"\x1f\n" + + "\x1dUpdateCloudCredentialResponse\";\n" + + "\x1cDeleteCloudCredentialRequest\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"\x1f\n" + + "\x1dDeleteCloudCredentialResponse\"\xe7\x01\n" + + "\x12ListBucketsRequest\x12(\n" + + "\vcluster_uid\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\n" + + "clusterUid\x12\x1e\n" + + "\n" + + "credential\x18\x02 \x01(\tR\n" + + "credential\x12\x1f\n" + + "\vgce_project\x18\x03 \x01(\tR\n" + + "gceProject\x12)\n" + + "\x10secret_namespace\x18\x04 \x01(\tR\x0fsecretNamespace\x12\x1f\n" + + "\vsecret_name\x18\x05 \x01(\tR\n" + + "secretName\x12\x1a\n" + + "\bprovider\x18\x06 \x01(\tR\bprovider\"+\n" + + "\x13ListBucketsResponse\x12\x14\n" + + "\x05names\x18\x01 \x03(\tR\x05names2\x9a\x05\n" + + "\x16CloudCredentialService\x12m\n" + + "\x14ListCloudCredentials\x12(.akp.user.v2.ListCloudCredentialsRequest\x1a).akp.user.v2.ListCloudCredentialsResponse\"\x00\x12g\n" + + "\x12GetCloudCredential\x12&.akp.user.v2.GetCloudCredentialRequest\x1a'.akp.user.v2.GetCloudCredentialResponse\"\x00\x12p\n" + + "\x15CreateCloudCredential\x12).akp.user.v2.CreateCloudCredentialRequest\x1a*.akp.user.v2.CreateCloudCredentialResponse\"\x00\x12p\n" + + "\x15UpdateCloudCredential\x12).akp.user.v2.UpdateCloudCredentialRequest\x1a*.akp.user.v2.UpdateCloudCredentialResponse\"\x00\x12p\n" + + "\x15DeleteCloudCredential\x12).akp.user.v2.DeleteCloudCredentialRequest\x1a*.akp.user.v2.DeleteCloudCredentialResponse\"\x00\x12R\n" + + "\vListBuckets\x12\x1f.akp.user.v2.ListBucketsRequest\x1a .akp.user.v2.ListBucketsResponse\"\x00B\xa2\x01\n" + + "\x0fcom.akp.user.v2B\n" + + "CloudProtoP\x01Z5go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2;userv2\xa2\x02\x03AUX\xaa\x02\vAkp.User.V2\xca\x02\vAkp\\User\\V2\xe2\x02\x17Akp\\User\\V2\\GPBMetadata\xea\x02\rAkp::User::V2b\x06proto3" + +var ( + file_akp_user_v2_cloud_proto_rawDescOnce sync.Once + file_akp_user_v2_cloud_proto_rawDescData []byte +) + +func file_akp_user_v2_cloud_proto_rawDescGZIP() []byte { + file_akp_user_v2_cloud_proto_rawDescOnce.Do(func() { + file_akp_user_v2_cloud_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_user_v2_cloud_proto_rawDesc), len(file_akp_user_v2_cloud_proto_rawDesc))) + }) + return file_akp_user_v2_cloud_proto_rawDescData +} + +var file_akp_user_v2_cloud_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_akp_user_v2_cloud_proto_goTypes = []any{ + (*CloudCredential)(nil), // 0: akp.user.v2.CloudCredential + (*ListCloudCredentialsRequest)(nil), // 1: akp.user.v2.ListCloudCredentialsRequest + (*ListCloudCredentialsResponse)(nil), // 2: akp.user.v2.ListCloudCredentialsResponse + (*GetCloudCredentialRequest)(nil), // 3: akp.user.v2.GetCloudCredentialRequest + (*GetCloudCredentialResponse)(nil), // 4: akp.user.v2.GetCloudCredentialResponse + (*CreateCloudCredentialRequest)(nil), // 5: akp.user.v2.CreateCloudCredentialRequest + (*CreateCloudCredentialResponse)(nil), // 6: akp.user.v2.CreateCloudCredentialResponse + (*UpdateCloudCredentialRequest)(nil), // 7: akp.user.v2.UpdateCloudCredentialRequest + (*UpdateCloudCredentialResponse)(nil), // 8: akp.user.v2.UpdateCloudCredentialResponse + (*DeleteCloudCredentialRequest)(nil), // 9: akp.user.v2.DeleteCloudCredentialRequest + (*DeleteCloudCredentialResponse)(nil), // 10: akp.user.v2.DeleteCloudCredentialResponse + (*ListBucketsRequest)(nil), // 11: akp.user.v2.ListBucketsRequest + (*ListBucketsResponse)(nil), // 12: akp.user.v2.ListBucketsResponse + (*structpb.Struct)(nil), // 13: google.protobuf.Struct + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp +} +var file_akp_user_v2_cloud_proto_depIdxs = []int32{ + 13, // 0: akp.user.v2.CloudCredential.spec:type_name -> google.protobuf.Struct + 14, // 1: akp.user.v2.CloudCredential.create_time:type_name -> google.protobuf.Timestamp + 0, // 2: akp.user.v2.ListCloudCredentialsResponse.credentials:type_name -> akp.user.v2.CloudCredential + 0, // 3: akp.user.v2.GetCloudCredentialResponse.credential:type_name -> akp.user.v2.CloudCredential + 13, // 4: akp.user.v2.CreateCloudCredentialRequest.spec:type_name -> google.protobuf.Struct + 13, // 5: akp.user.v2.UpdateCloudCredentialRequest.spec:type_name -> google.protobuf.Struct + 1, // 6: akp.user.v2.CloudCredentialService.ListCloudCredentials:input_type -> akp.user.v2.ListCloudCredentialsRequest + 3, // 7: akp.user.v2.CloudCredentialService.GetCloudCredential:input_type -> akp.user.v2.GetCloudCredentialRequest + 5, // 8: akp.user.v2.CloudCredentialService.CreateCloudCredential:input_type -> akp.user.v2.CreateCloudCredentialRequest + 7, // 9: akp.user.v2.CloudCredentialService.UpdateCloudCredential:input_type -> akp.user.v2.UpdateCloudCredentialRequest + 9, // 10: akp.user.v2.CloudCredentialService.DeleteCloudCredential:input_type -> akp.user.v2.DeleteCloudCredentialRequest + 11, // 11: akp.user.v2.CloudCredentialService.ListBuckets:input_type -> akp.user.v2.ListBucketsRequest + 2, // 12: akp.user.v2.CloudCredentialService.ListCloudCredentials:output_type -> akp.user.v2.ListCloudCredentialsResponse + 4, // 13: akp.user.v2.CloudCredentialService.GetCloudCredential:output_type -> akp.user.v2.GetCloudCredentialResponse + 6, // 14: akp.user.v2.CloudCredentialService.CreateCloudCredential:output_type -> akp.user.v2.CreateCloudCredentialResponse + 8, // 15: akp.user.v2.CloudCredentialService.UpdateCloudCredential:output_type -> akp.user.v2.UpdateCloudCredentialResponse + 10, // 16: akp.user.v2.CloudCredentialService.DeleteCloudCredential:output_type -> akp.user.v2.DeleteCloudCredentialResponse + 12, // 17: akp.user.v2.CloudCredentialService.ListBuckets:output_type -> akp.user.v2.ListBucketsResponse + 12, // [12:18] is the sub-list for method output_type + 6, // [6:12] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_akp_user_v2_cloud_proto_init() } +func file_akp_user_v2_cloud_proto_init() { + if File_akp_user_v2_cloud_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_user_v2_cloud_proto_rawDesc), len(file_akp_user_v2_cloud_proto_rawDesc)), + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_user_v2_cloud_proto_goTypes, + DependencyIndexes: file_akp_user_v2_cloud_proto_depIdxs, + MessageInfos: file_akp_user_v2_cloud_proto_msgTypes, + }.Build() + File_akp_user_v2_cloud_proto = out.File + file_akp_user_v2_cloud_proto_goTypes = nil + file_akp_user_v2_cloud_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/deploy.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/deploy.pb.go new file mode 100644 index 000000000..f9b75e1a2 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/deploy.pb.go @@ -0,0 +1,674 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/user/v2/deploy.proto + +package userv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateOrderRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // order is a releases.x-helm.dev/v1alpha1 Order; its spec selects at least one package. + Order *structpb.Struct `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrderRequest) Reset() { + *x = CreateOrderRequest{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrderRequest) ProtoMessage() {} + +func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead. +func (*CreateOrderRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateOrderRequest) GetOrder() *structpb.Struct { + if x != nil { + return x.Order + } + return nil +} + +type CreateOrderResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Order *structpb.Struct `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateOrderResponse) Reset() { + *x = CreateOrderResponse{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateOrderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrderResponse) ProtoMessage() {} + +func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead. +func (*CreateOrderResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateOrderResponse) GetOrder() *structpb.Struct { + if x != nil { + return x.Order + } + return nil +} + +type RenderOrderManifestRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenderOrderManifestRequest) Reset() { + *x = RenderOrderManifestRequest{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenderOrderManifestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenderOrderManifestRequest) ProtoMessage() {} + +func (x *RenderOrderManifestRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenderOrderManifestRequest.ProtoReflect.Descriptor instead. +func (*RenderOrderManifestRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{2} +} + +func (x *RenderOrderManifestRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type RenderOrderManifestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Manifest string `protobuf:"bytes,1,opt,name=manifest,proto3" json:"manifest,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenderOrderManifestResponse) Reset() { + *x = RenderOrderManifestResponse{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenderOrderManifestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenderOrderManifestResponse) ProtoMessage() {} + +func (x *RenderOrderManifestResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenderOrderManifestResponse.ProtoReflect.Descriptor instead. +func (*RenderOrderManifestResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{3} +} + +func (x *RenderOrderManifestResponse) GetManifest() string { + if x != nil { + return x.Manifest + } + return "" +} + +type RenderOrderResourcesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + SkipCrds bool `protobuf:"varint,2,opt,name=skip_crds,json=skipCrds,proto3" json:"skip_crds,omitempty"` + // format is "yaml" (the default) or "json". + Format string `protobuf:"bytes,3,opt,name=format,proto3" json:"format,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenderOrderResourcesRequest) Reset() { + *x = RenderOrderResourcesRequest{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenderOrderResourcesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenderOrderResourcesRequest) ProtoMessage() {} + +func (x *RenderOrderResourcesRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenderOrderResourcesRequest.ProtoReflect.Descriptor instead. +func (*RenderOrderResourcesRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{4} +} + +func (x *RenderOrderResourcesRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *RenderOrderResourcesRequest) GetSkipCrds() bool { + if x != nil { + return x.SkipCrds + } + return false +} + +func (x *RenderOrderResourcesRequest) GetFormat() string { + if x != nil { + return x.Format + } + return "" +} + +type RenderOrderResourcesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // charts are releases.x-helm.dev/v1alpha1 ChartTemplateOutputs. + Charts []*structpb.Struct `protobuf:"bytes,1,rep,name=charts,proto3" json:"charts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RenderOrderResourcesResponse) Reset() { + *x = RenderOrderResourcesResponse{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RenderOrderResourcesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenderOrderResourcesResponse) ProtoMessage() {} + +func (x *RenderOrderResourcesResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RenderOrderResourcesResponse.ProtoReflect.Descriptor instead. +func (*RenderOrderResourcesResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{5} +} + +func (x *RenderOrderResourcesResponse) GetCharts() []*structpb.Struct { + if x != nil { + return x.Charts + } + return nil +} + +type InstallScript struct { + state protoimpl.MessageState `protogen:"open.v1"` + // os is "linux", "darwin", "windows", or empty for any. + Os string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + Command string `protobuf:"bytes,3,opt,name=command,proto3" json:"command,omitempty"` + Script string `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InstallScript) Reset() { + *x = InstallScript{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InstallScript) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallScript) ProtoMessage() {} + +func (x *InstallScript) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallScript.ProtoReflect.Descriptor instead. +func (*InstallScript) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{6} +} + +func (x *InstallScript) GetOs() string { + if x != nil { + return x.Os + } + return "" +} + +func (x *InstallScript) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *InstallScript) GetCommand() string { + if x != nil { + return x.Command + } + return "" +} + +func (x *InstallScript) GetScript() string { + if x != nil { + return x.Script + } + return "" +} + +type GetOrderHelmScriptRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOrderHelmScriptRequest) Reset() { + *x = GetOrderHelmScriptRequest{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOrderHelmScriptRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrderHelmScriptRequest) ProtoMessage() {} + +func (x *GetOrderHelmScriptRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrderHelmScriptRequest.ProtoReflect.Descriptor instead. +func (*GetOrderHelmScriptRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{7} +} + +func (x *GetOrderHelmScriptRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetOrderHelmScriptResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Scripts []*InstallScript `protobuf:"bytes,1,rep,name=scripts,proto3" json:"scripts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOrderHelmScriptResponse) Reset() { + *x = GetOrderHelmScriptResponse{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOrderHelmScriptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrderHelmScriptResponse) ProtoMessage() {} + +func (x *GetOrderHelmScriptResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrderHelmScriptResponse.ProtoReflect.Descriptor instead. +func (*GetOrderHelmScriptResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{8} +} + +func (x *GetOrderHelmScriptResponse) GetScripts() []*InstallScript { + if x != nil { + return x.Scripts + } + return nil +} + +type GetOrderYamlScriptRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOrderYamlScriptRequest) Reset() { + *x = GetOrderYamlScriptRequest{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOrderYamlScriptRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrderYamlScriptRequest) ProtoMessage() {} + +func (x *GetOrderYamlScriptRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrderYamlScriptRequest.ProtoReflect.Descriptor instead. +func (*GetOrderYamlScriptRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{9} +} + +func (x *GetOrderYamlScriptRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetOrderYamlScriptResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Scripts []*InstallScript `protobuf:"bytes,1,rep,name=scripts,proto3" json:"scripts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetOrderYamlScriptResponse) Reset() { + *x = GetOrderYamlScriptResponse{} + mi := &file_akp_user_v2_deploy_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetOrderYamlScriptResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrderYamlScriptResponse) ProtoMessage() {} + +func (x *GetOrderYamlScriptResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_deploy_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrderYamlScriptResponse.ProtoReflect.Descriptor instead. +func (*GetOrderYamlScriptResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_deploy_proto_rawDescGZIP(), []int{10} +} + +func (x *GetOrderYamlScriptResponse) GetScripts() []*InstallScript { + if x != nil { + return x.Scripts + } + return nil +} + +var File_akp_user_v2_deploy_proto protoreflect.FileDescriptor + +const file_akp_user_v2_deploy_proto_rawDesc = "" + + "\n" + + "\x18akp/user/v2/deploy.proto\x12\vakp.user.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\"K\n" + + "\x12CreateOrderRequest\x125\n" + + "\x05order\x18\x01 \x01(\v2\x17.google.protobuf.StructB\x06\xbaH\x03\xc8\x01\x01R\x05order\"D\n" + + "\x13CreateOrderResponse\x12-\n" + + "\x05order\x18\x01 \x01(\v2\x17.google.protobuf.StructR\x05order\"5\n" + + "\x1aRenderOrderManifestRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\"9\n" + + "\x1bRenderOrderManifestResponse\x12\x1a\n" + + "\bmanifest\x18\x01 \x01(\tR\bmanifest\"k\n" + + "\x1bRenderOrderResourcesRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\x12\x1b\n" + + "\tskip_crds\x18\x02 \x01(\bR\bskipCrds\x12\x16\n" + + "\x06format\x18\x03 \x01(\tR\x06format\"O\n" + + "\x1cRenderOrderResourcesResponse\x12/\n" + + "\x06charts\x18\x01 \x03(\v2\x17.google.protobuf.StructR\x06charts\"c\n" + + "\rInstallScript\x12\x0e\n" + + "\x02os\x18\x01 \x01(\tR\x02os\x12\x10\n" + + "\x03url\x18\x02 \x01(\tR\x03url\x12\x18\n" + + "\acommand\x18\x03 \x01(\tR\acommand\x12\x16\n" + + "\x06script\x18\x04 \x01(\tR\x06script\"4\n" + + "\x19GetOrderHelmScriptRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\"R\n" + + "\x1aGetOrderHelmScriptResponse\x124\n" + + "\ascripts\x18\x01 \x03(\v2\x1a.akp.user.v2.InstallScriptR\ascripts\"4\n" + + "\x19GetOrderYamlScriptRequest\x12\x17\n" + + "\x02id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x02id\"R\n" + + "\x1aGetOrderYamlScriptResponse\x124\n" + + "\ascripts\x18\x01 \x03(\v2\x1a.akp.user.v2.InstallScriptR\ascripts2\x95\x04\n" + + "\x12DeployOrderService\x12R\n" + + "\vCreateOrder\x12\x1f.akp.user.v2.CreateOrderRequest\x1a .akp.user.v2.CreateOrderResponse\"\x00\x12j\n" + + "\x13RenderOrderManifest\x12'.akp.user.v2.RenderOrderManifestRequest\x1a(.akp.user.v2.RenderOrderManifestResponse\"\x00\x12m\n" + + "\x14RenderOrderResources\x12(.akp.user.v2.RenderOrderResourcesRequest\x1a).akp.user.v2.RenderOrderResourcesResponse\"\x00\x12g\n" + + "\x12GetOrderHelmScript\x12&.akp.user.v2.GetOrderHelmScriptRequest\x1a'.akp.user.v2.GetOrderHelmScriptResponse\"\x00\x12g\n" + + "\x12GetOrderYamlScript\x12&.akp.user.v2.GetOrderYamlScriptRequest\x1a'.akp.user.v2.GetOrderYamlScriptResponse\"\x00B\xa3\x01\n" + + "\x0fcom.akp.user.v2B\vDeployProtoP\x01Z5go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2;userv2\xa2\x02\x03AUX\xaa\x02\vAkp.User.V2\xca\x02\vAkp\\User\\V2\xe2\x02\x17Akp\\User\\V2\\GPBMetadata\xea\x02\rAkp::User::V2b\x06proto3" + +var ( + file_akp_user_v2_deploy_proto_rawDescOnce sync.Once + file_akp_user_v2_deploy_proto_rawDescData []byte +) + +func file_akp_user_v2_deploy_proto_rawDescGZIP() []byte { + file_akp_user_v2_deploy_proto_rawDescOnce.Do(func() { + file_akp_user_v2_deploy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_user_v2_deploy_proto_rawDesc), len(file_akp_user_v2_deploy_proto_rawDesc))) + }) + return file_akp_user_v2_deploy_proto_rawDescData +} + +var file_akp_user_v2_deploy_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_akp_user_v2_deploy_proto_goTypes = []any{ + (*CreateOrderRequest)(nil), // 0: akp.user.v2.CreateOrderRequest + (*CreateOrderResponse)(nil), // 1: akp.user.v2.CreateOrderResponse + (*RenderOrderManifestRequest)(nil), // 2: akp.user.v2.RenderOrderManifestRequest + (*RenderOrderManifestResponse)(nil), // 3: akp.user.v2.RenderOrderManifestResponse + (*RenderOrderResourcesRequest)(nil), // 4: akp.user.v2.RenderOrderResourcesRequest + (*RenderOrderResourcesResponse)(nil), // 5: akp.user.v2.RenderOrderResourcesResponse + (*InstallScript)(nil), // 6: akp.user.v2.InstallScript + (*GetOrderHelmScriptRequest)(nil), // 7: akp.user.v2.GetOrderHelmScriptRequest + (*GetOrderHelmScriptResponse)(nil), // 8: akp.user.v2.GetOrderHelmScriptResponse + (*GetOrderYamlScriptRequest)(nil), // 9: akp.user.v2.GetOrderYamlScriptRequest + (*GetOrderYamlScriptResponse)(nil), // 10: akp.user.v2.GetOrderYamlScriptResponse + (*structpb.Struct)(nil), // 11: google.protobuf.Struct +} +var file_akp_user_v2_deploy_proto_depIdxs = []int32{ + 11, // 0: akp.user.v2.CreateOrderRequest.order:type_name -> google.protobuf.Struct + 11, // 1: akp.user.v2.CreateOrderResponse.order:type_name -> google.protobuf.Struct + 11, // 2: akp.user.v2.RenderOrderResourcesResponse.charts:type_name -> google.protobuf.Struct + 6, // 3: akp.user.v2.GetOrderHelmScriptResponse.scripts:type_name -> akp.user.v2.InstallScript + 6, // 4: akp.user.v2.GetOrderYamlScriptResponse.scripts:type_name -> akp.user.v2.InstallScript + 0, // 5: akp.user.v2.DeployOrderService.CreateOrder:input_type -> akp.user.v2.CreateOrderRequest + 2, // 6: akp.user.v2.DeployOrderService.RenderOrderManifest:input_type -> akp.user.v2.RenderOrderManifestRequest + 4, // 7: akp.user.v2.DeployOrderService.RenderOrderResources:input_type -> akp.user.v2.RenderOrderResourcesRequest + 7, // 8: akp.user.v2.DeployOrderService.GetOrderHelmScript:input_type -> akp.user.v2.GetOrderHelmScriptRequest + 9, // 9: akp.user.v2.DeployOrderService.GetOrderYamlScript:input_type -> akp.user.v2.GetOrderYamlScriptRequest + 1, // 10: akp.user.v2.DeployOrderService.CreateOrder:output_type -> akp.user.v2.CreateOrderResponse + 3, // 11: akp.user.v2.DeployOrderService.RenderOrderManifest:output_type -> akp.user.v2.RenderOrderManifestResponse + 5, // 12: akp.user.v2.DeployOrderService.RenderOrderResources:output_type -> akp.user.v2.RenderOrderResourcesResponse + 8, // 13: akp.user.v2.DeployOrderService.GetOrderHelmScript:output_type -> akp.user.v2.GetOrderHelmScriptResponse + 10, // 14: akp.user.v2.DeployOrderService.GetOrderYamlScript:output_type -> akp.user.v2.GetOrderYamlScriptResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_akp_user_v2_deploy_proto_init() } +func file_akp_user_v2_deploy_proto_init() { + if File_akp_user_v2_deploy_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_user_v2_deploy_proto_rawDesc), len(file_akp_user_v2_deploy_proto_rawDesc)), + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_user_v2_deploy_proto_goTypes, + DependencyIndexes: file_akp_user_v2_deploy_proto_depIdxs, + MessageInfos: file_akp_user_v2_deploy_proto_msgTypes, + }.Build() + File_akp_user_v2_deploy_proto = out.File + file_akp_user_v2_deploy_proto_goTypes = nil + file_akp_user_v2_deploy_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/nats.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/nats.pb.go new file mode 100644 index 000000000..3956e68d1 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/nats.pb.go @@ -0,0 +1,836 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/user/v2/nats.proto + +package userv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetNatsCredentialsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNatsCredentialsRequest) Reset() { + *x = GetNatsCredentialsRequest{} + mi := &file_akp_user_v2_nats_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNatsCredentialsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNatsCredentialsRequest) ProtoMessage() {} + +func (x *GetNatsCredentialsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNatsCredentialsRequest.ProtoReflect.Descriptor instead. +func (*GetNatsCredentialsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{0} +} + +type GetNatsCredentialsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + // credentials is a NATS creds file. + Credentials []byte `protobuf:"bytes,2,opt,name=credentials,proto3" json:"credentials,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNatsCredentialsResponse) Reset() { + *x = GetNatsCredentialsResponse{} + mi := &file_akp_user_v2_nats_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNatsCredentialsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNatsCredentialsResponse) ProtoMessage() {} + +func (x *GetNatsCredentialsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNatsCredentialsResponse.ProtoReflect.Descriptor instead. +func (*GetNatsCredentialsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{1} +} + +func (x *GetNatsCredentialsResponse) GetEndpoints() []string { + if x != nil { + return x.Endpoints + } + return nil +} + +func (x *GetNatsCredentialsResponse) GetCredentials() []byte { + if x != nil { + return x.Credentials + } + return nil +} + +// GetNatsAdminCredentialsRequest may name a user's cluster, by username or else email, to be +// answered the subject its resource history is asked on. +type GetNatsAdminCredentialsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNatsAdminCredentialsRequest) Reset() { + *x = GetNatsAdminCredentialsRequest{} + mi := &file_akp_user_v2_nats_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNatsAdminCredentialsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNatsAdminCredentialsRequest) ProtoMessage() {} + +func (x *GetNatsAdminCredentialsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNatsAdminCredentialsRequest.ProtoReflect.Descriptor instead. +func (*GetNatsAdminCredentialsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{2} +} + +func (x *GetNatsAdminCredentialsRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +func (x *GetNatsAdminCredentialsRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetNatsAdminCredentialsRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type GetNatsAdminCredentialsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + Credentials []byte `protobuf:"bytes,2,opt,name=credentials,proto3" json:"credentials,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNatsAdminCredentialsResponse) Reset() { + *x = GetNatsAdminCredentialsResponse{} + mi := &file_akp_user_v2_nats_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNatsAdminCredentialsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNatsAdminCredentialsResponse) ProtoMessage() {} + +func (x *GetNatsAdminCredentialsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNatsAdminCredentialsResponse.ProtoReflect.Descriptor instead. +func (*GetNatsAdminCredentialsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{3} +} + +func (x *GetNatsAdminCredentialsResponse) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *GetNatsAdminCredentialsResponse) GetCredentials() []byte { + if x != nil { + return x.Credentials + } + return nil +} + +// GetNatsUserCredentialsRequest names a user's cluster, by username or else email. +type GetNatsUserCredentialsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Product string `protobuf:"bytes,4,opt,name=product,proto3" json:"product,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNatsUserCredentialsRequest) Reset() { + *x = GetNatsUserCredentialsRequest{} + mi := &file_akp_user_v2_nats_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNatsUserCredentialsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNatsUserCredentialsRequest) ProtoMessage() {} + +func (x *GetNatsUserCredentialsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNatsUserCredentialsRequest.ProtoReflect.Descriptor instead. +func (*GetNatsUserCredentialsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{4} +} + +func (x *GetNatsUserCredentialsRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +func (x *GetNatsUserCredentialsRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetNatsUserCredentialsRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *GetNatsUserCredentialsRequest) GetProduct() string { + if x != nil { + return x.Product + } + return "" +} + +type GetNatsUserCredentialsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // subject is where the user's events from the cluster go. + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + Credentials []byte `protobuf:"bytes,2,opt,name=credentials,proto3" json:"credentials,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNatsUserCredentialsResponse) Reset() { + *x = GetNatsUserCredentialsResponse{} + mi := &file_akp_user_v2_nats_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNatsUserCredentialsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNatsUserCredentialsResponse) ProtoMessage() {} + +func (x *GetNatsUserCredentialsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNatsUserCredentialsResponse.ProtoReflect.Descriptor instead. +func (*GetNatsUserCredentialsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{5} +} + +func (x *GetNatsUserCredentialsResponse) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *GetNatsUserCredentialsResponse) GetCredentials() []byte { + if x != nil { + return x.Credentials + } + return nil +} + +type GetClusterResourceHistoryRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + // email is the cluster owner's. + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Product string `protobuf:"bytes,3,opt,name=product,proto3" json:"product,omitempty"` + Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` + Resource string `protobuf:"bytes,5,opt,name=resource,proto3" json:"resource,omitempty"` + Rid string `protobuf:"bytes,6,opt,name=rid,proto3" json:"rid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterResourceHistoryRequest) Reset() { + *x = GetClusterResourceHistoryRequest{} + mi := &file_akp_user_v2_nats_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterResourceHistoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterResourceHistoryRequest) ProtoMessage() {} + +func (x *GetClusterResourceHistoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterResourceHistoryRequest.ProtoReflect.Descriptor instead. +func (*GetClusterResourceHistoryRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{6} +} + +func (x *GetClusterResourceHistoryRequest) GetClusterId() string { + if x != nil { + return x.ClusterId + } + return "" +} + +func (x *GetClusterResourceHistoryRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *GetClusterResourceHistoryRequest) GetProduct() string { + if x != nil { + return x.Product + } + return "" +} + +func (x *GetClusterResourceHistoryRequest) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *GetClusterResourceHistoryRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *GetClusterResourceHistoryRequest) GetRid() string { + if x != nil { + return x.Rid + } + return "" +} + +type GetClusterResourceHistoryResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Entries []*HistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetClusterResourceHistoryResponse) Reset() { + *x = GetClusterResourceHistoryResponse{} + mi := &file_akp_user_v2_nats_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetClusterResourceHistoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterResourceHistoryResponse) ProtoMessage() {} + +func (x *GetClusterResourceHistoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterResourceHistoryResponse.ProtoReflect.Descriptor instead. +func (*GetClusterResourceHistoryResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{7} +} + +func (x *GetClusterResourceHistoryResponse) GetEntries() []*HistoryEntry { + if x != nil { + return x.Entries + } + return nil +} + +type HistoryEntry struct { + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Values []*HistoryValue `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` + // last_seen is a Unix time. + LastSeen int64 `protobuf:"varint,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HistoryEntry) Reset() { + *x = HistoryEntry{} + mi := &file_akp_user_v2_nats_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HistoryEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryEntry) ProtoMessage() {} + +func (x *HistoryEntry) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoryEntry.ProtoReflect.Descriptor instead. +func (*HistoryEntry) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{8} +} + +func (x *HistoryEntry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *HistoryEntry) GetValues() []*HistoryValue { + if x != nil { + return x.Values + } + return nil +} + +func (x *HistoryEntry) GetLastSeen() int64 { + if x != nil { + return x.LastSeen + } + return 0 +} + +type HistoryValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + // resource is the Kubernetes object as it was. + Resource *structpb.Struct `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + ResourceId *ResourceID `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` + LicenseId string `protobuf:"bytes,3,opt,name=license_id,json=licenseId,proto3" json:"license_id,omitempty"` + Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` + // timestamp is a Unix time. + Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HistoryValue) Reset() { + *x = HistoryValue{} + mi := &file_akp_user_v2_nats_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HistoryValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoryValue) ProtoMessage() {} + +func (x *HistoryValue) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoryValue.ProtoReflect.Descriptor instead. +func (*HistoryValue) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{9} +} + +func (x *HistoryValue) GetResource() *structpb.Struct { + if x != nil { + return x.Resource + } + return nil +} + +func (x *HistoryValue) GetResourceId() *ResourceID { + if x != nil { + return x.ResourceId + } + return nil +} + +func (x *HistoryValue) GetLicenseId() string { + if x != nil { + return x.LicenseId + } + return "" +} + +func (x *HistoryValue) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *HistoryValue) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type ResourceID struct { + state protoimpl.MessageState `protogen:"open.v1"` + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // name is the resource's plural name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Kind string `protobuf:"bytes,4,opt,name=kind,proto3" json:"kind,omitempty"` + Scope string `protobuf:"bytes,5,opt,name=scope,proto3" json:"scope,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResourceID) Reset() { + *x = ResourceID{} + mi := &file_akp_user_v2_nats_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResourceID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceID) ProtoMessage() {} + +func (x *ResourceID) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_nats_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceID.ProtoReflect.Descriptor instead. +func (*ResourceID) Descriptor() ([]byte, []int) { + return file_akp_user_v2_nats_proto_rawDescGZIP(), []int{10} +} + +func (x *ResourceID) GetGroup() string { + if x != nil { + return x.Group + } + return "" +} + +func (x *ResourceID) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ResourceID) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ResourceID) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *ResourceID) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +var File_akp_user_v2_nats_proto protoreflect.FileDescriptor + +const file_akp_user_v2_nats_proto_rawDesc = "" + + "\n" + + "\x16akp/user/v2/nats.proto\x12\vakp.user.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x1b\n" + + "\x19GetNatsCredentialsRequest\"\\\n" + + "\x1aGetNatsCredentialsResponse\x12\x1c\n" + + "\tendpoints\x18\x01 \x03(\tR\tendpoints\x12 \n" + + "\vcredentials\x18\x02 \x01(\fR\vcredentials\"q\n" + + "\x1eGetNatsAdminCredentialsRequest\x12\x1d\n" + + "\n" + + "cluster_id\x18\x01 \x01(\tR\tclusterId\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\"]\n" + + "\x1fGetNatsAdminCredentialsResponse\x12\x18\n" + + "\asubject\x18\x01 \x01(\tR\asubject\x12 \n" + + "\vcredentials\x18\x02 \x01(\fR\vcredentials\"\xf5\x01\n" + + "\x1dGetNatsUserCredentialsRequest\x12&\n" + + "\n" + + "cluster_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tclusterId\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\x12\x18\n" + + "\aproduct\x18\x04 \x01(\tR\aproduct:`\xbaH]\x1a[\n" + + "\x11username_or_email\x12\x1dusername or email is required\x1a'this.username != '' || this.email != ''\"\\\n" + + "\x1eGetNatsUserCredentialsResponse\x12\x18\n" + + "\asubject\x18\x01 \x01(\tR\asubject\x12 \n" + + "\vcredentials\x18\x02 \x01(\fR\vcredentials\"\xc7\x01\n" + + " GetClusterResourceHistoryRequest\x12&\n" + + "\n" + + "cluster_id\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\tclusterId\x12\x1d\n" + + "\x05email\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x05email\x12\x18\n" + + "\aproduct\x18\x03 \x01(\tR\aproduct\x12\x14\n" + + "\x05group\x18\x04 \x01(\tR\x05group\x12\x1a\n" + + "\bresource\x18\x05 \x01(\tR\bresource\x12\x10\n" + + "\x03rid\x18\x06 \x01(\tR\x03rid\"X\n" + + "!GetClusterResourceHistoryResponse\x123\n" + + "\aentries\x18\x01 \x03(\v2\x19.akp.user.v2.HistoryEntryR\aentries\"p\n" + + "\fHistoryEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x121\n" + + "\x06values\x18\x02 \x03(\v2\x19.akp.user.v2.HistoryValueR\x06values\x12\x1b\n" + + "\tlast_seen\x18\x03 \x01(\x03R\blastSeen\"\xd4\x01\n" + + "\fHistoryValue\x123\n" + + "\bresource\x18\x01 \x01(\v2\x17.google.protobuf.StructR\bresource\x128\n" + + "\vresource_id\x18\x02 \x01(\v2\x17.akp.user.v2.ResourceIDR\n" + + "resourceId\x12\x1d\n" + + "\n" + + "license_id\x18\x03 \x01(\tR\tlicenseId\x12\x18\n" + + "\aversion\x18\x04 \x01(\x04R\aversion\x12\x1c\n" + + "\ttimestamp\x18\x05 \x01(\x03R\ttimestamp\"z\n" + + "\n" + + "ResourceID\x12\x14\n" + + "\x05group\x18\x01 \x01(\tR\x05group\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04kind\x18\x04 \x01(\tR\x04kind\x12\x14\n" + + "\x05scope\x18\x05 \x01(\tR\x05scope2\xe1\x03\n" + + "\vNatsService\x12g\n" + + "\x12GetNatsCredentials\x12&.akp.user.v2.GetNatsCredentialsRequest\x1a'.akp.user.v2.GetNatsCredentialsResponse\"\x00\x12v\n" + + "\x17GetNatsAdminCredentials\x12+.akp.user.v2.GetNatsAdminCredentialsRequest\x1a,.akp.user.v2.GetNatsAdminCredentialsResponse\"\x00\x12s\n" + + "\x16GetNatsUserCredentials\x12*.akp.user.v2.GetNatsUserCredentialsRequest\x1a+.akp.user.v2.GetNatsUserCredentialsResponse\"\x00\x12|\n" + + "\x19GetClusterResourceHistory\x12-.akp.user.v2.GetClusterResourceHistoryRequest\x1a..akp.user.v2.GetClusterResourceHistoryResponse\"\x00B\xa1\x01\n" + + "\x0fcom.akp.user.v2B\tNatsProtoP\x01Z5go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2;userv2\xa2\x02\x03AUX\xaa\x02\vAkp.User.V2\xca\x02\vAkp\\User\\V2\xe2\x02\x17Akp\\User\\V2\\GPBMetadata\xea\x02\rAkp::User::V2b\x06proto3" + +var ( + file_akp_user_v2_nats_proto_rawDescOnce sync.Once + file_akp_user_v2_nats_proto_rawDescData []byte +) + +func file_akp_user_v2_nats_proto_rawDescGZIP() []byte { + file_akp_user_v2_nats_proto_rawDescOnce.Do(func() { + file_akp_user_v2_nats_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_user_v2_nats_proto_rawDesc), len(file_akp_user_v2_nats_proto_rawDesc))) + }) + return file_akp_user_v2_nats_proto_rawDescData +} + +var file_akp_user_v2_nats_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_akp_user_v2_nats_proto_goTypes = []any{ + (*GetNatsCredentialsRequest)(nil), // 0: akp.user.v2.GetNatsCredentialsRequest + (*GetNatsCredentialsResponse)(nil), // 1: akp.user.v2.GetNatsCredentialsResponse + (*GetNatsAdminCredentialsRequest)(nil), // 2: akp.user.v2.GetNatsAdminCredentialsRequest + (*GetNatsAdminCredentialsResponse)(nil), // 3: akp.user.v2.GetNatsAdminCredentialsResponse + (*GetNatsUserCredentialsRequest)(nil), // 4: akp.user.v2.GetNatsUserCredentialsRequest + (*GetNatsUserCredentialsResponse)(nil), // 5: akp.user.v2.GetNatsUserCredentialsResponse + (*GetClusterResourceHistoryRequest)(nil), // 6: akp.user.v2.GetClusterResourceHistoryRequest + (*GetClusterResourceHistoryResponse)(nil), // 7: akp.user.v2.GetClusterResourceHistoryResponse + (*HistoryEntry)(nil), // 8: akp.user.v2.HistoryEntry + (*HistoryValue)(nil), // 9: akp.user.v2.HistoryValue + (*ResourceID)(nil), // 10: akp.user.v2.ResourceID + (*structpb.Struct)(nil), // 11: google.protobuf.Struct +} +var file_akp_user_v2_nats_proto_depIdxs = []int32{ + 8, // 0: akp.user.v2.GetClusterResourceHistoryResponse.entries:type_name -> akp.user.v2.HistoryEntry + 9, // 1: akp.user.v2.HistoryEntry.values:type_name -> akp.user.v2.HistoryValue + 11, // 2: akp.user.v2.HistoryValue.resource:type_name -> google.protobuf.Struct + 10, // 3: akp.user.v2.HistoryValue.resource_id:type_name -> akp.user.v2.ResourceID + 0, // 4: akp.user.v2.NatsService.GetNatsCredentials:input_type -> akp.user.v2.GetNatsCredentialsRequest + 2, // 5: akp.user.v2.NatsService.GetNatsAdminCredentials:input_type -> akp.user.v2.GetNatsAdminCredentialsRequest + 4, // 6: akp.user.v2.NatsService.GetNatsUserCredentials:input_type -> akp.user.v2.GetNatsUserCredentialsRequest + 6, // 7: akp.user.v2.NatsService.GetClusterResourceHistory:input_type -> akp.user.v2.GetClusterResourceHistoryRequest + 1, // 8: akp.user.v2.NatsService.GetNatsCredentials:output_type -> akp.user.v2.GetNatsCredentialsResponse + 3, // 9: akp.user.v2.NatsService.GetNatsAdminCredentials:output_type -> akp.user.v2.GetNatsAdminCredentialsResponse + 5, // 10: akp.user.v2.NatsService.GetNatsUserCredentials:output_type -> akp.user.v2.GetNatsUserCredentialsResponse + 7, // 11: akp.user.v2.NatsService.GetClusterResourceHistory:output_type -> akp.user.v2.GetClusterResourceHistoryResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_akp_user_v2_nats_proto_init() } +func file_akp_user_v2_nats_proto_init() { + if File_akp_user_v2_nats_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_user_v2_nats_proto_rawDesc), len(file_akp_user_v2_nats_proto_rawDesc)), + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_akp_user_v2_nats_proto_goTypes, + DependencyIndexes: file_akp_user_v2_nats_proto_depIdxs, + MessageInfos: file_akp_user_v2_nats_proto_msgTypes, + }.Build() + File_akp_user_v2_nats_proto = out.File + file_akp_user_v2_nats_proto_goTypes = nil + file_akp_user_v2_nats_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/user.pb.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/user.pb.go new file mode 100644 index 000000000..d904ff43b --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/user.pb.go @@ -0,0 +1,3716 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.12 +// protoc (unknown) +// source: akp/user/v2/user.proto + +package userv2 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AccountType int32 + +const ( + AccountType_ACCOUNT_TYPE_UNSPECIFIED AccountType = 0 + AccountType_ACCOUNT_TYPE_INDIVIDUAL AccountType = 1 + AccountType_ACCOUNT_TYPE_ORGANIZATION AccountType = 2 + AccountType_ACCOUNT_TYPE_DEACTIVATED AccountType = 3 + AccountType_ACCOUNT_TYPE_REVENUE_OFFICER AccountType = 4 +) + +// Enum value maps for AccountType. +var ( + AccountType_name = map[int32]string{ + 0: "ACCOUNT_TYPE_UNSPECIFIED", + 1: "ACCOUNT_TYPE_INDIVIDUAL", + 2: "ACCOUNT_TYPE_ORGANIZATION", + 3: "ACCOUNT_TYPE_DEACTIVATED", + 4: "ACCOUNT_TYPE_REVENUE_OFFICER", + } + AccountType_value = map[string]int32{ + "ACCOUNT_TYPE_UNSPECIFIED": 0, + "ACCOUNT_TYPE_INDIVIDUAL": 1, + "ACCOUNT_TYPE_ORGANIZATION": 2, + "ACCOUNT_TYPE_DEACTIVATED": 3, + "ACCOUNT_TYPE_REVENUE_OFFICER": 4, + } +) + +func (x AccountType) Enum() *AccountType { + p := new(AccountType) + *p = x + return p +} + +func (x AccountType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AccountType) Descriptor() protoreflect.EnumDescriptor { + return file_akp_user_v2_user_proto_enumTypes[0].Descriptor() +} + +func (AccountType) Type() protoreflect.EnumType { + return &file_akp_user_v2_user_proto_enumTypes[0] +} + +func (x AccountType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AccountType.Descriptor instead. +func (AccountType) EnumDescriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{0} +} + +type OrganizationType int32 + +const ( + OrganizationType_ORGANIZATION_TYPE_UNSPECIFIED OrganizationType = 0 + OrganizationType_ORGANIZATION_TYPE_BASIC OrganizationType = 1 + OrganizationType_ORGANIZATION_TYPE_RANCHER OrganizationType = 2 + OrganizationType_ORGANIZATION_TYPE_CLIENT OrganizationType = 3 + OrganizationType_ORGANIZATION_TYPE_MARKETPLACE OrganizationType = 4 + OrganizationType_ORGANIZATION_TYPE_DBAAS OrganizationType = 5 + OrganizationType_ORGANIZATION_TYPE_SITE_ADMINISTRATION OrganizationType = 6 +) + +// Enum value maps for OrganizationType. +var ( + OrganizationType_name = map[int32]string{ + 0: "ORGANIZATION_TYPE_UNSPECIFIED", + 1: "ORGANIZATION_TYPE_BASIC", + 2: "ORGANIZATION_TYPE_RANCHER", + 3: "ORGANIZATION_TYPE_CLIENT", + 4: "ORGANIZATION_TYPE_MARKETPLACE", + 5: "ORGANIZATION_TYPE_DBAAS", + 6: "ORGANIZATION_TYPE_SITE_ADMINISTRATION", + } + OrganizationType_value = map[string]int32{ + "ORGANIZATION_TYPE_UNSPECIFIED": 0, + "ORGANIZATION_TYPE_BASIC": 1, + "ORGANIZATION_TYPE_RANCHER": 2, + "ORGANIZATION_TYPE_CLIENT": 3, + "ORGANIZATION_TYPE_MARKETPLACE": 4, + "ORGANIZATION_TYPE_DBAAS": 5, + "ORGANIZATION_TYPE_SITE_ADMINISTRATION": 6, + } +) + +func (x OrganizationType) Enum() *OrganizationType { + p := new(OrganizationType) + *p = x + return p +} + +func (x OrganizationType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OrganizationType) Descriptor() protoreflect.EnumDescriptor { + return file_akp_user_v2_user_proto_enumTypes[1].Descriptor() +} + +func (OrganizationType) Type() protoreflect.EnumType { + return &file_akp_user_v2_user_proto_enumTypes[1] +} + +func (x OrganizationType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OrganizationType.Descriptor instead. +func (OrganizationType) EnumDescriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{1} +} + +type LoginMethod int32 + +const ( + LoginMethod_LOGIN_METHOD_UNSPECIFIED LoginMethod = 0 + LoginMethod_LOGIN_METHOD_PASSWORD LoginMethod = 1 + LoginMethod_LOGIN_METHOD_SSO LoginMethod = 2 +) + +// Enum value maps for LoginMethod. +var ( + LoginMethod_name = map[int32]string{ + 0: "LOGIN_METHOD_UNSPECIFIED", + 1: "LOGIN_METHOD_PASSWORD", + 2: "LOGIN_METHOD_SSO", + } + LoginMethod_value = map[string]int32{ + "LOGIN_METHOD_UNSPECIFIED": 0, + "LOGIN_METHOD_PASSWORD": 1, + "LOGIN_METHOD_SSO": 2, + } +) + +func (x LoginMethod) Enum() *LoginMethod { + p := new(LoginMethod) + *p = x + return p +} + +func (x LoginMethod) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LoginMethod) Descriptor() protoreflect.EnumDescriptor { + return file_akp_user_v2_user_proto_enumTypes[2].Descriptor() +} + +func (LoginMethod) Type() protoreflect.EnumType { + return &file_akp_user_v2_user_proto_enumTypes[2] +} + +func (x LoginMethod) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LoginMethod.Descriptor instead. +func (LoginMethod) EnumDescriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{2} +} + +type ValidationStatus int32 + +const ( + ValidationStatus_VALIDATION_STATUS_UNSPECIFIED ValidationStatus = 0 + ValidationStatus_VALIDATION_STATUS_VALID ValidationStatus = 1 + // VALIDATION_STATUS_TAKEN: another account has it. + ValidationStatus_VALIDATION_STATUS_TAKEN ValidationStatus = 2 + ValidationStatus_VALIDATION_STATUS_RESERVED ValidationStatus = 3 + ValidationStatus_VALIDATION_STATUS_INVALID ValidationStatus = 4 + // VALIDATION_STATUS_NOT_ALLOWED: the caller may not rename the organization. + ValidationStatus_VALIDATION_STATUS_NOT_ALLOWED ValidationStatus = 5 +) + +// Enum value maps for ValidationStatus. +var ( + ValidationStatus_name = map[int32]string{ + 0: "VALIDATION_STATUS_UNSPECIFIED", + 1: "VALIDATION_STATUS_VALID", + 2: "VALIDATION_STATUS_TAKEN", + 3: "VALIDATION_STATUS_RESERVED", + 4: "VALIDATION_STATUS_INVALID", + 5: "VALIDATION_STATUS_NOT_ALLOWED", + } + ValidationStatus_value = map[string]int32{ + "VALIDATION_STATUS_UNSPECIFIED": 0, + "VALIDATION_STATUS_VALID": 1, + "VALIDATION_STATUS_TAKEN": 2, + "VALIDATION_STATUS_RESERVED": 3, + "VALIDATION_STATUS_INVALID": 4, + "VALIDATION_STATUS_NOT_ALLOWED": 5, + } +) + +func (x ValidationStatus) Enum() *ValidationStatus { + p := new(ValidationStatus) + *p = x + return p +} + +func (x ValidationStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ValidationStatus) Descriptor() protoreflect.EnumDescriptor { + return file_akp_user_v2_user_proto_enumTypes[3].Descriptor() +} + +func (ValidationStatus) Type() protoreflect.EnumType { + return &file_akp_user_v2_user_proto_enumTypes[3] +} + +func (x ValidationStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ValidationStatus.Descriptor instead. +func (ValidationStatus) EnumDescriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{3} +} + +// User is an account as the caller may see it. A private organization the caller is not in +// shows only its id, names, avatar and types. +type User struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + // email is left out for an anonymous caller, and when the user keeps it private. + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + AvatarUrl string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + Type AccountType `protobuf:"varint,6,opt,name=type,proto3,enum=akp.user.v2.AccountType" json:"type,omitempty"` + // organization_type is set for an organization. + OrganizationType OrganizationType `protobuf:"varint,7,opt,name=organization_type,json=organizationType,proto3,enum=akp.user.v2.OrganizationType" json:"organization_type,omitempty"` + Location string `protobuf:"bytes,8,opt,name=location,proto3" json:"location,omitempty"` + Website string `protobuf:"bytes,9,opt,name=website,proto3" json:"website,omitempty"` + Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // The following are shown to the user themselves and to site admins. + SiteAdmin bool `protobuf:"varint,12,opt,name=site_admin,json=siteAdmin,proto3" json:"site_admin,omitempty"` + Active bool `protobuf:"varint,13,opt,name=active,proto3" json:"active,omitempty"` + ProhibitLogin bool `protobuf:"varint,14,opt,name=prohibit_login,json=prohibitLogin,proto3" json:"prohibit_login,omitempty"` + Language string `protobuf:"bytes,15,opt,name=language,proto3" json:"language,omitempty"` + LastLoginTime *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=last_login_time,json=lastLoginTime,proto3" json:"last_login_time,omitempty"` + // client_organization_member is answered by GetAuthenticatedUser when asked for. + ClientOrganizationMember bool `protobuf:"varint,17,opt,name=client_organization_member,json=clientOrganizationMember,proto3" json:"client_organization_member,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *User) Reset() { + *x = User{} + mi := &file_akp_user_v2_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *User) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *User) GetType() AccountType { + if x != nil { + return x.Type + } + return AccountType_ACCOUNT_TYPE_UNSPECIFIED +} + +func (x *User) GetOrganizationType() OrganizationType { + if x != nil { + return x.OrganizationType + } + return OrganizationType_ORGANIZATION_TYPE_UNSPECIFIED +} + +func (x *User) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *User) GetWebsite() string { + if x != nil { + return x.Website + } + return "" +} + +func (x *User) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *User) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *User) GetSiteAdmin() bool { + if x != nil { + return x.SiteAdmin + } + return false +} + +func (x *User) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + +func (x *User) GetProhibitLogin() bool { + if x != nil { + return x.ProhibitLogin + } + return false +} + +func (x *User) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *User) GetLastLoginTime() *timestamppb.Timestamp { + if x != nil { + return x.LastLoginTime + } + return nil +} + +func (x *User) GetClientOrganizationMember() bool { + if x != nil { + return x.ClientOrganizationMember + } + return false +} + +type Organization struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + Website string `protobuf:"bytes,6,opt,name=website,proto3" json:"website,omitempty"` + Location string `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"` + RancherManagementClusterEndpoint string `protobuf:"bytes,8,opt,name=rancher_management_cluster_endpoint,json=rancherManagementClusterEndpoint,proto3" json:"rancher_management_cluster_endpoint,omitempty"` + // visibility is "public", "limited" or "private". + Visibility string `protobuf:"bytes,9,opt,name=visibility,proto3" json:"visibility,omitempty"` + Type OrganizationType `protobuf:"varint,10,opt,name=type,proto3,enum=akp.user.v2.OrganizationType" json:"type,omitempty"` + PassthroughLicenseAllowed bool `protobuf:"varint,11,opt,name=passthrough_license_allowed,json=passthroughLicenseAllowed,proto3" json:"passthrough_license_allowed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Organization) Reset() { + *x = Organization{} + mi := &file_akp_user_v2_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Organization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Organization) ProtoMessage() {} + +func (x *Organization) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Organization.ProtoReflect.Descriptor instead. +func (*Organization) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{1} +} + +func (x *Organization) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Organization) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Organization) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *Organization) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *Organization) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Organization) GetWebsite() string { + if x != nil { + return x.Website + } + return "" +} + +func (x *Organization) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *Organization) GetRancherManagementClusterEndpoint() string { + if x != nil { + return x.RancherManagementClusterEndpoint + } + return "" +} + +func (x *Organization) GetVisibility() string { + if x != nil { + return x.Visibility + } + return "" +} + +func (x *Organization) GetType() OrganizationType { + if x != nil { + return x.Type + } + return OrganizationType_ORGANIZATION_TYPE_UNSPECIFIED +} + +func (x *Organization) GetPassthroughLicenseAllowed() bool { + if x != nil { + return x.PassthroughLicenseAllowed + } + return false +} + +type Team struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Organization *Organization `protobuf:"bytes,4,opt,name=organization,proto3" json:"organization,omitempty"` + // permission is the team's access mode, e.g. "owner" or "custom". + Permission string `protobuf:"bytes,5,opt,name=permission,proto3" json:"permission,omitempty"` + Units []string `protobuf:"bytes,6,rep,name=units,proto3" json:"units,omitempty"` + Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"` + // role_ids are the roles bound to a team of custom permission. + RoleIds []string `protobuf:"bytes,8,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Team) Reset() { + *x = Team{} + mi := &file_akp_user_v2_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Team) ProtoMessage() {} + +func (x *Team) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Team.ProtoReflect.Descriptor instead. +func (*Team) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{2} +} + +func (x *Team) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Team) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Team) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Team) GetOrganization() *Organization { + if x != nil { + return x.Organization + } + return nil +} + +func (x *Team) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +func (x *Team) GetUnits() []string { + if x != nil { + return x.Units + } + return nil +} + +func (x *Team) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Team) GetRoleIds() []string { + if x != nil { + return x.RoleIds + } + return nil +} + +type Cluster struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + OwnerId string `protobuf:"bytes,5,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + OwnerName string `protobuf:"bytes,6,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` + ManagerId string `protobuf:"bytes,7,opt,name=manager_id,json=managerId,proto3" json:"manager_id,omitempty"` + Provider string `protobuf:"bytes,8,opt,name=provider,proto3" json:"provider,omitempty"` + Vendor string `protobuf:"bytes,9,opt,name=vendor,proto3" json:"vendor,omitempty"` + Endpoint string `protobuf:"bytes,10,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + Location string `protobuf:"bytes,11,opt,name=location,proto3" json:"location,omitempty"` + Project string `protobuf:"bytes,12,opt,name=project,proto3" json:"project,omitempty"` + KubernetesVersion string `protobuf:"bytes,13,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` + NodeCount int32 `protobuf:"varint,14,opt,name=node_count,json=nodeCount,proto3" json:"node_count,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // hub is set for a spoke cluster managed from a hub. + Hub *ClusterRef `protobuf:"bytes,16,opt,name=hub,proto3" json:"hub,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Cluster) Reset() { + *x = Cluster{} + mi := &file_akp_user_v2_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Cluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cluster) ProtoMessage() {} + +func (x *Cluster) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cluster.ProtoReflect.Descriptor instead. +func (*Cluster) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{3} +} + +func (x *Cluster) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Cluster) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *Cluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Cluster) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *Cluster) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *Cluster) GetOwnerName() string { + if x != nil { + return x.OwnerName + } + return "" +} + +func (x *Cluster) GetManagerId() string { + if x != nil { + return x.ManagerId + } + return "" +} + +func (x *Cluster) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *Cluster) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *Cluster) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Cluster) GetLocation() string { + if x != nil { + return x.Location + } + return "" +} + +func (x *Cluster) GetProject() string { + if x != nil { + return x.Project + } + return "" +} + +func (x *Cluster) GetKubernetesVersion() string { + if x != nil { + return x.KubernetesVersion + } + return "" +} + +func (x *Cluster) GetNodeCount() int32 { + if x != nil { + return x.NodeCount + } + return 0 +} + +func (x *Cluster) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Cluster) GetHub() *ClusterRef { + if x != nil { + return x.Hub + } + return nil +} + +type ClusterRef struct { + state protoimpl.MessageState `protogen:"open.v1"` + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + OwnerName string `protobuf:"bytes,3,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterRef) Reset() { + *x = ClusterRef{} + mi := &file_akp_user_v2_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterRef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterRef) ProtoMessage() {} + +func (x *ClusterRef) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterRef.ProtoReflect.Descriptor instead. +func (*ClusterRef) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{4} +} + +func (x *ClusterRef) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *ClusterRef) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterRef) GetOwnerName() string { + if x != nil { + return x.OwnerName + } + return "" +} + +type InboxSubscription struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + SubscriberId string `protobuf:"bytes,2,opt,name=subscriber_id,json=subscriberId,proto3" json:"subscriber_id,omitempty"` + SubscriberType string `protobuf:"bytes,3,opt,name=subscriber_type,json=subscriberType,proto3" json:"subscriber_type,omitempty"` + Scope string `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope,omitempty"` + OrganizationId string `protobuf:"bytes,5,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + // organization_name is the name of the cluster's owning organization, or the one subscribed. + OrganizationName string `protobuf:"bytes,6,opt,name=organization_name,json=organizationName,proto3" json:"organization_name,omitempty"` + ClusterOwnerId string `protobuf:"bytes,7,opt,name=cluster_owner_id,json=clusterOwnerId,proto3" json:"cluster_owner_id,omitempty"` + // cluster_owner_name is the name of the cluster's owner. + ClusterOwnerName string `protobuf:"bytes,8,opt,name=cluster_owner_name,json=clusterOwnerName,proto3" json:"cluster_owner_name,omitempty"` + ClusterUid string `protobuf:"bytes,9,opt,name=cluster_uid,json=clusterUid,proto3" json:"cluster_uid,omitempty"` + ClusterName string `protobuf:"bytes,10,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` + NamespaceUid string `protobuf:"bytes,11,opt,name=namespace_uid,json=namespaceUid,proto3" json:"namespace_uid,omitempty"` + NamespaceName string `protobuf:"bytes,12,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + ApiGroup string `protobuf:"bytes,13,opt,name=api_group,json=apiGroup,proto3" json:"api_group,omitempty"` + Version string `protobuf:"bytes,14,opt,name=version,proto3" json:"version,omitempty"` + Resource string `protobuf:"bytes,15,opt,name=resource,proto3" json:"resource,omitempty"` + ResourceName string `protobuf:"bytes,16,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + ResourceUid string `protobuf:"bytes,17,opt,name=resource_uid,json=resourceUid,proto3" json:"resource_uid,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,18,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,19,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InboxSubscription) Reset() { + *x = InboxSubscription{} + mi := &file_akp_user_v2_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InboxSubscription) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InboxSubscription) ProtoMessage() {} + +func (x *InboxSubscription) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InboxSubscription.ProtoReflect.Descriptor instead. +func (*InboxSubscription) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{5} +} + +func (x *InboxSubscription) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *InboxSubscription) GetSubscriberId() string { + if x != nil { + return x.SubscriberId + } + return "" +} + +func (x *InboxSubscription) GetSubscriberType() string { + if x != nil { + return x.SubscriberType + } + return "" +} + +func (x *InboxSubscription) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *InboxSubscription) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *InboxSubscription) GetOrganizationName() string { + if x != nil { + return x.OrganizationName + } + return "" +} + +func (x *InboxSubscription) GetClusterOwnerId() string { + if x != nil { + return x.ClusterOwnerId + } + return "" +} + +func (x *InboxSubscription) GetClusterOwnerName() string { + if x != nil { + return x.ClusterOwnerName + } + return "" +} + +func (x *InboxSubscription) GetClusterUid() string { + if x != nil { + return x.ClusterUid + } + return "" +} + +func (x *InboxSubscription) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *InboxSubscription) GetNamespaceUid() string { + if x != nil { + return x.NamespaceUid + } + return "" +} + +func (x *InboxSubscription) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *InboxSubscription) GetApiGroup() string { + if x != nil { + return x.ApiGroup + } + return "" +} + +func (x *InboxSubscription) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *InboxSubscription) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *InboxSubscription) GetResourceName() string { + if x != nil { + return x.ResourceName + } + return "" +} + +func (x *InboxSubscription) GetResourceUid() string { + if x != nil { + return x.ResourceUid + } + return "" +} + +func (x *InboxSubscription) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *InboxSubscription) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +type SearchUsersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + // id finds one user. + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // page_size is the most users to answer; 0 for the default. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersRequest) Reset() { + *x = SearchUsersRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersRequest) ProtoMessage() {} + +func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead. +func (*SearchUsersRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{6} +} + +func (x *SearchUsersRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SearchUsersRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *SearchUsersRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type SearchUsersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersResponse) Reset() { + *x = SearchUsersResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersResponse) ProtoMessage() {} + +func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead. +func (*SearchUsersResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{7} +} + +func (x *SearchUsersResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +type GetUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{8} +} + +func (x *GetUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type GetUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetUserResponse) Reset() { + *x = GetUserResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserResponse) ProtoMessage() {} + +func (x *GetUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. +func (*GetUserResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{9} +} + +func (x *GetUserResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +type GetAuthenticatedUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // check_client_organization asks whether the caller is in a client organization. + CheckClientOrganization bool `protobuf:"varint,1,opt,name=check_client_organization,json=checkClientOrganization,proto3" json:"check_client_organization,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAuthenticatedUserRequest) Reset() { + *x = GetAuthenticatedUserRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAuthenticatedUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAuthenticatedUserRequest) ProtoMessage() {} + +func (x *GetAuthenticatedUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAuthenticatedUserRequest.ProtoReflect.Descriptor instead. +func (*GetAuthenticatedUserRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{10} +} + +func (x *GetAuthenticatedUserRequest) GetCheckClientOrganization() bool { + if x != nil { + return x.CheckClientOrganization + } + return false +} + +type GetAuthenticatedUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAuthenticatedUserResponse) Reset() { + *x = GetAuthenticatedUserResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAuthenticatedUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAuthenticatedUserResponse) ProtoMessage() {} + +func (x *GetAuthenticatedUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAuthenticatedUserResponse.ProtoReflect.Descriptor instead. +func (*GetAuthenticatedUserResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{11} +} + +func (x *GetAuthenticatedUserResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +type ListTeamsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListTeamsRequest) Reset() { + *x = ListTeamsRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListTeamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamsRequest) ProtoMessage() {} + +func (x *ListTeamsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamsRequest.ProtoReflect.Descriptor instead. +func (*ListTeamsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{12} +} + +type ListTeamsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Teams []*Team `protobuf:"bytes,1,rep,name=teams,proto3" json:"teams,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListTeamsResponse) Reset() { + *x = ListTeamsResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListTeamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamsResponse) ProtoMessage() {} + +func (x *ListTeamsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamsResponse.ProtoReflect.Descriptor instead. +func (*ListTeamsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{13} +} + +func (x *ListTeamsResponse) GetTeams() []*Team { + if x != nil { + return x.Teams + } + return nil +} + +type ListClustersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // all asks for every cluster the caller has access to, not only those they own. It is not + // available yet and answers Unimplemented. + All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClustersRequest) Reset() { + *x = ListClustersRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClustersRequest) ProtoMessage() {} + +func (x *ListClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClustersRequest.ProtoReflect.Descriptor instead. +func (*ListClustersRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{14} +} + +func (x *ListClustersRequest) GetAll() bool { + if x != nil { + return x.All + } + return false +} + +type ListClustersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListClustersResponse) Reset() { + *x = ListClustersResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClustersResponse) ProtoMessage() {} + +func (x *ListClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListClustersResponse.ProtoReflect.Descriptor instead. +func (*ListClustersResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{15} +} + +func (x *ListClustersResponse) GetClusters() []*Cluster { + if x != nil { + return x.Clusters + } + return nil +} + +// ListInboxSubscriptionsRequest narrows the caller's subscriptions; an empty field matches all. +type ListInboxSubscriptionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Scope string `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + OrganizationName string `protobuf:"bytes,3,opt,name=organization_name,json=organizationName,proto3" json:"organization_name,omitempty"` + ClusterName string `protobuf:"bytes,4,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` + NamespaceName string `protobuf:"bytes,5,opt,name=namespace_name,json=namespaceName,proto3" json:"namespace_name,omitempty"` + ApiGroup string `protobuf:"bytes,6,opt,name=api_group,json=apiGroup,proto3" json:"api_group,omitempty"` + Version string `protobuf:"bytes,7,opt,name=version,proto3" json:"version,omitempty"` + Resource string `protobuf:"bytes,8,opt,name=resource,proto3" json:"resource,omitempty"` + ResourceName string `protobuf:"bytes,9,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + ClusterUid string `protobuf:"bytes,10,opt,name=cluster_uid,json=clusterUid,proto3" json:"cluster_uid,omitempty"` + NamespaceUid string `protobuf:"bytes,11,opt,name=namespace_uid,json=namespaceUid,proto3" json:"namespace_uid,omitempty"` + ResourceUid string `protobuf:"bytes,12,opt,name=resource_uid,json=resourceUid,proto3" json:"resource_uid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListInboxSubscriptionsRequest) Reset() { + *x = ListInboxSubscriptionsRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListInboxSubscriptionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListInboxSubscriptionsRequest) ProtoMessage() {} + +func (x *ListInboxSubscriptionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListInboxSubscriptionsRequest.ProtoReflect.Descriptor instead. +func (*ListInboxSubscriptionsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{16} +} + +func (x *ListInboxSubscriptionsRequest) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetOrganizationName() string { + if x != nil { + return x.OrganizationName + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetNamespaceName() string { + if x != nil { + return x.NamespaceName + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetApiGroup() string { + if x != nil { + return x.ApiGroup + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetResourceName() string { + if x != nil { + return x.ResourceName + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetClusterUid() string { + if x != nil { + return x.ClusterUid + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetNamespaceUid() string { + if x != nil { + return x.NamespaceUid + } + return "" +} + +func (x *ListInboxSubscriptionsRequest) GetResourceUid() string { + if x != nil { + return x.ResourceUid + } + return "" +} + +type ListInboxSubscriptionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Subscriptions []*InboxSubscription `protobuf:"bytes,1,rep,name=subscriptions,proto3" json:"subscriptions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListInboxSubscriptionsResponse) Reset() { + *x = ListInboxSubscriptionsResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListInboxSubscriptionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListInboxSubscriptionsResponse) ProtoMessage() {} + +func (x *ListInboxSubscriptionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListInboxSubscriptionsResponse.ProtoReflect.Descriptor instead. +func (*ListInboxSubscriptionsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{17} +} + +func (x *ListInboxSubscriptionsResponse) GetSubscriptions() []*InboxSubscription { + if x != nil { + return x.Subscriptions + } + return nil +} + +type GetFirebaseTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFirebaseTokenRequest) Reset() { + *x = GetFirebaseTokenRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFirebaseTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFirebaseTokenRequest) ProtoMessage() {} + +func (x *GetFirebaseTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFirebaseTokenRequest.ProtoReflect.Descriptor instead. +func (*GetFirebaseTokenRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{18} +} + +type GetFirebaseTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFirebaseTokenResponse) Reset() { + *x = GetFirebaseTokenResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFirebaseTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFirebaseTokenResponse) ProtoMessage() {} + +func (x *GetFirebaseTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFirebaseTokenResponse.ProtoReflect.Descriptor instead. +func (*GetFirebaseTokenResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{19} +} + +func (x *GetFirebaseTokenResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// GetLoginMethodRequest names an organization or, failing that, a username or email address. +type GetLoginMethodRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetLoginMethodRequest) Reset() { + *x = GetLoginMethodRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetLoginMethodRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLoginMethodRequest) ProtoMessage() {} + +func (x *GetLoginMethodRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetLoginMethodRequest.ProtoReflect.Descriptor instead. +func (*GetLoginMethodRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{20} +} + +func (x *GetLoginMethodRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *GetLoginMethodRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type GetLoginMethodResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Method LoginMethod `protobuf:"varint,1,opt,name=method,proto3,enum=akp.user.v2.LoginMethod" json:"method,omitempty"` + // The rest is set for SSO. + OrgAuthSourceId string `protobuf:"bytes,2,opt,name=org_auth_source_id,json=orgAuthSourceId,proto3" json:"org_auth_source_id,omitempty"` + ProviderName string `protobuf:"bytes,3,opt,name=provider_name,json=providerName,proto3" json:"provider_name,omitempty"` + // oauth_callback_path is where to send the browser to sign in. + OauthCallbackPath string `protobuf:"bytes,4,opt,name=oauth_callback_path,json=oauthCallbackPath,proto3" json:"oauth_callback_path,omitempty"` + DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetLoginMethodResponse) Reset() { + *x = GetLoginMethodResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetLoginMethodResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLoginMethodResponse) ProtoMessage() {} + +func (x *GetLoginMethodResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetLoginMethodResponse.ProtoReflect.Descriptor instead. +func (*GetLoginMethodResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{21} +} + +func (x *GetLoginMethodResponse) GetMethod() LoginMethod { + if x != nil { + return x.Method + } + return LoginMethod_LOGIN_METHOD_UNSPECIFIED +} + +func (x *GetLoginMethodResponse) GetOrgAuthSourceId() string { + if x != nil { + return x.OrgAuthSourceId + } + return "" +} + +func (x *GetLoginMethodResponse) GetProviderName() string { + if x != nil { + return x.ProviderName + } + return "" +} + +func (x *GetLoginMethodResponse) GetOauthCallbackPath() string { + if x != nil { + return x.OauthCallbackPath + } + return "" +} + +func (x *GetLoginMethodResponse) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +type ValidateUsernameRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateUsernameRequest) Reset() { + *x = ValidateUsernameRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateUsernameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateUsernameRequest) ProtoMessage() {} + +func (x *ValidateUsernameRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateUsernameRequest.ProtoReflect.Descriptor instead. +func (*ValidateUsernameRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{22} +} + +func (x *ValidateUsernameRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type ValidateUsernameResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status ValidationStatus `protobuf:"varint,1,opt,name=status,proto3,enum=akp.user.v2.ValidationStatus" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateUsernameResponse) Reset() { + *x = ValidateUsernameResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateUsernameResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateUsernameResponse) ProtoMessage() {} + +func (x *ValidateUsernameResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateUsernameResponse.ProtoReflect.Descriptor instead. +func (*ValidateUsernameResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{23} +} + +func (x *ValidateUsernameResponse) GetStatus() ValidationStatus { + if x != nil { + return x.Status + } + return ValidationStatus_VALIDATION_STATUS_UNSPECIFIED +} + +type ValidateOrganizationNameRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // organization is the organization to rename; empty for a new one. + Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateOrganizationNameRequest) Reset() { + *x = ValidateOrganizationNameRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateOrganizationNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateOrganizationNameRequest) ProtoMessage() {} + +func (x *ValidateOrganizationNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateOrganizationNameRequest.ProtoReflect.Descriptor instead. +func (*ValidateOrganizationNameRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{24} +} + +func (x *ValidateOrganizationNameRequest) GetOrganization() string { + if x != nil { + return x.Organization + } + return "" +} + +func (x *ValidateOrganizationNameRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ValidateOrganizationNameResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status ValidationStatus `protobuf:"varint,1,opt,name=status,proto3,enum=akp.user.v2.ValidationStatus" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateOrganizationNameResponse) Reset() { + *x = ValidateOrganizationNameResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateOrganizationNameResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateOrganizationNameResponse) ProtoMessage() {} + +func (x *ValidateOrganizationNameResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateOrganizationNameResponse.ProtoReflect.Descriptor instead. +func (*ValidateOrganizationNameResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{25} +} + +func (x *ValidateOrganizationNameResponse) GetStatus() ValidationStatus { + if x != nil { + return x.Status + } + return ValidationStatus_VALIDATION_STATUS_UNSPECIFIED +} + +type ValidateEmailRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateEmailRequest) Reset() { + *x = ValidateEmailRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateEmailRequest) ProtoMessage() {} + +func (x *ValidateEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateEmailRequest.ProtoReflect.Descriptor instead. +func (*ValidateEmailRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{26} +} + +func (x *ValidateEmailRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type ValidateEmailResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status ValidationStatus `protobuf:"varint,1,opt,name=status,proto3,enum=akp.user.v2.ValidationStatus" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateEmailResponse) Reset() { + *x = ValidateEmailResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateEmailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateEmailResponse) ProtoMessage() {} + +func (x *ValidateEmailResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateEmailResponse.ProtoReflect.Descriptor instead. +func (*ValidateEmailResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{27} +} + +func (x *ValidateEmailResponse) GetStatus() ValidationStatus { + if x != nil { + return x.Status + } + return ValidationStatus_VALIDATION_STATUS_UNSPECIFIED +} + +type ListFollowersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // page is 1-based; 0 is the first page. + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFollowersRequest) Reset() { + *x = ListFollowersRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFollowersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowersRequest) ProtoMessage() {} + +func (x *ListFollowersRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowersRequest.ProtoReflect.Descriptor instead. +func (*ListFollowersRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{28} +} + +func (x *ListFollowersRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListFollowersRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +type ListFollowersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFollowersResponse) Reset() { + *x = ListFollowersResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFollowersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowersResponse) ProtoMessage() {} + +func (x *ListFollowersResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowersResponse.ProtoReflect.Descriptor instead. +func (*ListFollowersResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{29} +} + +func (x *ListFollowersResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +type ListFollowingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFollowingRequest) Reset() { + *x = ListFollowingRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFollowingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowingRequest) ProtoMessage() {} + +func (x *ListFollowingRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowingRequest.ProtoReflect.Descriptor instead. +func (*ListFollowingRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{30} +} + +func (x *ListFollowingRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListFollowingRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +type ListFollowingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFollowingResponse) Reset() { + *x = ListFollowingResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFollowingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowingResponse) ProtoMessage() {} + +func (x *ListFollowingResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowingResponse.ProtoReflect.Descriptor instead. +func (*ListFollowingResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{31} +} + +func (x *ListFollowingResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +type CheckFollowingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckFollowingRequest) Reset() { + *x = CheckFollowingRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckFollowingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckFollowingRequest) ProtoMessage() {} + +func (x *CheckFollowingRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckFollowingRequest.ProtoReflect.Descriptor instead. +func (*CheckFollowingRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{32} +} + +func (x *CheckFollowingRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *CheckFollowingRequest) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +type CheckFollowingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Following bool `protobuf:"varint,1,opt,name=following,proto3" json:"following,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckFollowingResponse) Reset() { + *x = CheckFollowingResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckFollowingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckFollowingResponse) ProtoMessage() {} + +func (x *CheckFollowingResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckFollowingResponse.ProtoReflect.Descriptor instead. +func (*CheckFollowingResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{33} +} + +func (x *CheckFollowingResponse) GetFollowing() bool { + if x != nil { + return x.Following + } + return false +} + +type FollowUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FollowUserRequest) Reset() { + *x = FollowUserRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FollowUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FollowUserRequest) ProtoMessage() {} + +func (x *FollowUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FollowUserRequest.ProtoReflect.Descriptor instead. +func (*FollowUserRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{34} +} + +func (x *FollowUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type FollowUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FollowUserResponse) Reset() { + *x = FollowUserResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FollowUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FollowUserResponse) ProtoMessage() {} + +func (x *FollowUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FollowUserResponse.ProtoReflect.Descriptor instead. +func (*FollowUserResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{35} +} + +type UnfollowUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnfollowUserRequest) Reset() { + *x = UnfollowUserRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnfollowUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnfollowUserRequest) ProtoMessage() {} + +func (x *UnfollowUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnfollowUserRequest.ProtoReflect.Descriptor instead. +func (*UnfollowUserRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{36} +} + +func (x *UnfollowUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type UnfollowUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnfollowUserResponse) Reset() { + *x = UnfollowUserResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnfollowUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnfollowUserResponse) ProtoMessage() {} + +func (x *UnfollowUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnfollowUserResponse.ProtoReflect.Descriptor instead. +func (*UnfollowUserResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{37} +} + +type Email struct { + state protoimpl.MessageState `protogen:"open.v1"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Verified bool `protobuf:"varint,2,opt,name=verified,proto3" json:"verified,omitempty"` + Primary bool `protobuf:"varint,3,opt,name=primary,proto3" json:"primary,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Email) Reset() { + *x = Email{} + mi := &file_akp_user_v2_user_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Email) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Email) ProtoMessage() {} + +func (x *Email) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Email.ProtoReflect.Descriptor instead. +func (*Email) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{38} +} + +func (x *Email) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *Email) GetVerified() bool { + if x != nil { + return x.Verified + } + return false +} + +func (x *Email) GetPrimary() bool { + if x != nil { + return x.Primary + } + return false +} + +type ListEmailsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListEmailsRequest) Reset() { + *x = ListEmailsRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListEmailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEmailsRequest) ProtoMessage() {} + +func (x *ListEmailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListEmailsRequest.ProtoReflect.Descriptor instead. +func (*ListEmailsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{39} +} + +type ListEmailsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Emails []*Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListEmailsResponse) Reset() { + *x = ListEmailsResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListEmailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEmailsResponse) ProtoMessage() {} + +func (x *ListEmailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListEmailsResponse.ProtoReflect.Descriptor instead. +func (*ListEmailsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{40} +} + +func (x *ListEmailsResponse) GetEmails() []*Email { + if x != nil { + return x.Emails + } + return nil +} + +type AddEmailsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Emails []string `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddEmailsRequest) Reset() { + *x = AddEmailsRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddEmailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddEmailsRequest) ProtoMessage() {} + +func (x *AddEmailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddEmailsRequest.ProtoReflect.Descriptor instead. +func (*AddEmailsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{41} +} + +func (x *AddEmailsRequest) GetEmails() []string { + if x != nil { + return x.Emails + } + return nil +} + +type AddEmailsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Emails []*Email `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddEmailsResponse) Reset() { + *x = AddEmailsResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddEmailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddEmailsResponse) ProtoMessage() {} + +func (x *AddEmailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddEmailsResponse.ProtoReflect.Descriptor instead. +func (*AddEmailsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{42} +} + +func (x *AddEmailsResponse) GetEmails() []*Email { + if x != nil { + return x.Emails + } + return nil +} + +type DeleteEmailsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Emails []string `protobuf:"bytes,1,rep,name=emails,proto3" json:"emails,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteEmailsRequest) Reset() { + *x = DeleteEmailsRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteEmailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteEmailsRequest) ProtoMessage() {} + +func (x *DeleteEmailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteEmailsRequest.ProtoReflect.Descriptor instead. +func (*DeleteEmailsRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{43} +} + +func (x *DeleteEmailsRequest) GetEmails() []string { + if x != nil { + return x.Emails + } + return nil +} + +type DeleteEmailsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteEmailsResponse) Reset() { + *x = DeleteEmailsResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteEmailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteEmailsResponse) ProtoMessage() {} + +func (x *DeleteEmailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteEmailsResponse.ProtoReflect.Descriptor instead. +func (*DeleteEmailsResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{44} +} + +type AccessToken struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // token is the secret, answered only when the token is made. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + TokenLastEight string `protobuf:"bytes,4,opt,name=token_last_eight,json=tokenLastEight,proto3" json:"token_last_eight,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccessToken) Reset() { + *x = AccessToken{} + mi := &file_akp_user_v2_user_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccessToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessToken) ProtoMessage() {} + +func (x *AccessToken) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccessToken.ProtoReflect.Descriptor instead. +func (*AccessToken) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{45} +} + +func (x *AccessToken) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AccessToken) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AccessToken) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *AccessToken) GetTokenLastEight() string { + if x != nil { + return x.TokenLastEight + } + return "" +} + +type ListAccessTokensRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAccessTokensRequest) Reset() { + *x = ListAccessTokensRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAccessTokensRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccessTokensRequest) ProtoMessage() {} + +func (x *ListAccessTokensRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccessTokensRequest.ProtoReflect.Descriptor instead. +func (*ListAccessTokensRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{46} +} + +type ListAccessTokensResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tokens []*AccessToken `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAccessTokensResponse) Reset() { + *x = ListAccessTokensResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAccessTokensResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAccessTokensResponse) ProtoMessage() {} + +func (x *ListAccessTokensResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAccessTokensResponse.ProtoReflect.Descriptor instead. +func (*ListAccessTokensResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{47} +} + +func (x *ListAccessTokensResponse) GetTokens() []*AccessToken { + if x != nil { + return x.Tokens + } + return nil +} + +type CreateAccessTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAccessTokenRequest) Reset() { + *x = CreateAccessTokenRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAccessTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccessTokenRequest) ProtoMessage() {} + +func (x *CreateAccessTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAccessTokenRequest.ProtoReflect.Descriptor instead. +func (*CreateAccessTokenRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{48} +} + +func (x *CreateAccessTokenRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CreateAccessTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token *AccessToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAccessTokenResponse) Reset() { + *x = CreateAccessTokenResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAccessTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccessTokenResponse) ProtoMessage() {} + +func (x *CreateAccessTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAccessTokenResponse.ProtoReflect.Descriptor instead. +func (*CreateAccessTokenResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{49} +} + +func (x *CreateAccessTokenResponse) GetToken() *AccessToken { + if x != nil { + return x.Token + } + return nil +} + +type DeleteAccessTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAccessTokenRequest) Reset() { + *x = DeleteAccessTokenRequest{} + mi := &file_akp_user_v2_user_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAccessTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccessTokenRequest) ProtoMessage() {} + +func (x *DeleteAccessTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAccessTokenRequest.ProtoReflect.Descriptor instead. +func (*DeleteAccessTokenRequest) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{50} +} + +func (x *DeleteAccessTokenRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteAccessTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAccessTokenResponse) Reset() { + *x = DeleteAccessTokenResponse{} + mi := &file_akp_user_v2_user_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAccessTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccessTokenResponse) ProtoMessage() {} + +func (x *DeleteAccessTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_akp_user_v2_user_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAccessTokenResponse.ProtoReflect.Descriptor instead. +func (*DeleteAccessTokenResponse) Descriptor() ([]byte, []int) { + return file_akp_user_v2_user_proto_rawDescGZIP(), []int{51} +} + +var File_akp_user_v2_user_proto protoreflect.FileDescriptor + +const file_akp_user_v2_user_proto_rawDesc = "" + + "\n" + + "\x16akp/user/v2/user.proto\x12\vakp.user.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8f\x05\n" + + "\x04User\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x1b\n" + + "\tfull_name\x18\x03 \x01(\tR\bfullName\x12\x14\n" + + "\x05email\x18\x04 \x01(\tR\x05email\x12\x1d\n" + + "\n" + + "avatar_url\x18\x05 \x01(\tR\tavatarUrl\x12,\n" + + "\x04type\x18\x06 \x01(\x0e2\x18.akp.user.v2.AccountTypeR\x04type\x12J\n" + + "\x11organization_type\x18\a \x01(\x0e2\x1d.akp.user.v2.OrganizationTypeR\x10organizationType\x12\x1a\n" + + "\blocation\x18\b \x01(\tR\blocation\x12\x18\n" + + "\awebsite\x18\t \x01(\tR\awebsite\x12 \n" + + "\vdescription\x18\n" + + " \x01(\tR\vdescription\x12;\n" + + "\vcreate_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\x12\x1d\n" + + "\n" + + "site_admin\x18\f \x01(\bR\tsiteAdmin\x12\x16\n" + + "\x06active\x18\r \x01(\bR\x06active\x12%\n" + + "\x0eprohibit_login\x18\x0e \x01(\bR\rprohibitLogin\x12\x1a\n" + + "\blanguage\x18\x0f \x01(\tR\blanguage\x12B\n" + + "\x0flast_login_time\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampR\rlastLoginTime\x12<\n" + + "\x1aclient_organization_member\x18\x11 \x01(\bR\x18clientOrganizationMember\"\xa8\x03\n" + + "\fOrganization\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1b\n" + + "\tfull_name\x18\x03 \x01(\tR\bfullName\x12\x1d\n" + + "\n" + + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\x12 \n" + + "\vdescription\x18\x05 \x01(\tR\vdescription\x12\x18\n" + + "\awebsite\x18\x06 \x01(\tR\awebsite\x12\x1a\n" + + "\blocation\x18\a \x01(\tR\blocation\x12M\n" + + "#rancher_management_cluster_endpoint\x18\b \x01(\tR rancherManagementClusterEndpoint\x12\x1e\n" + + "\n" + + "visibility\x18\t \x01(\tR\n" + + "visibility\x121\n" + + "\x04type\x18\n" + + " \x01(\x0e2\x1d.akp.user.v2.OrganizationTypeR\x04type\x12>\n" + + "\x1bpassthrough_license_allowed\x18\v \x01(\bR\x19passthroughLicenseAllowed\"\xf0\x01\n" + + "\x04Team\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12=\n" + + "\forganization\x18\x04 \x01(\v2\x19.akp.user.v2.OrganizationR\forganization\x12\x1e\n" + + "\n" + + "permission\x18\x05 \x01(\tR\n" + + "permission\x12\x14\n" + + "\x05units\x18\x06 \x03(\tR\x05units\x12\x12\n" + + "\x04type\x18\a \x01(\tR\x04type\x12\x19\n" + + "\brole_ids\x18\b \x03(\tR\aroleIds\"\xf7\x03\n" + + "\aCluster\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x10\n" + + "\x03uid\x18\x02 \x01(\tR\x03uid\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12!\n" + + "\fdisplay_name\x18\x04 \x01(\tR\vdisplayName\x12\x19\n" + + "\bowner_id\x18\x05 \x01(\tR\aownerId\x12\x1d\n" + + "\n" + + "owner_name\x18\x06 \x01(\tR\townerName\x12\x1d\n" + + "\n" + + "manager_id\x18\a \x01(\tR\tmanagerId\x12\x1a\n" + + "\bprovider\x18\b \x01(\tR\bprovider\x12\x16\n" + + "\x06vendor\x18\t \x01(\tR\x06vendor\x12\x1a\n" + + "\bendpoint\x18\n" + + " \x01(\tR\bendpoint\x12\x1a\n" + + "\blocation\x18\v \x01(\tR\blocation\x12\x18\n" + + "\aproject\x18\f \x01(\tR\aproject\x12-\n" + + "\x12kubernetes_version\x18\r \x01(\tR\x11kubernetesVersion\x12\x1d\n" + + "\n" + + "node_count\x18\x0e \x01(\x05R\tnodeCount\x12;\n" + + "\vcreate_time\x18\x0f \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\x12)\n" + + "\x03hub\x18\x10 \x01(\v2\x17.akp.user.v2.ClusterRefR\x03hub\"Q\n" + + "\n" + + "ClusterRef\x12\x10\n" + + "\x03uid\x18\x01 \x01(\tR\x03uid\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1d\n" + + "\n" + + "owner_name\x18\x03 \x01(\tR\townerName\"\xda\x05\n" + + "\x11InboxSubscription\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12#\n" + + "\rsubscriber_id\x18\x02 \x01(\tR\fsubscriberId\x12'\n" + + "\x0fsubscriber_type\x18\x03 \x01(\tR\x0esubscriberType\x12\x14\n" + + "\x05scope\x18\x04 \x01(\tR\x05scope\x12'\n" + + "\x0forganization_id\x18\x05 \x01(\tR\x0eorganizationId\x12+\n" + + "\x11organization_name\x18\x06 \x01(\tR\x10organizationName\x12(\n" + + "\x10cluster_owner_id\x18\a \x01(\tR\x0eclusterOwnerId\x12,\n" + + "\x12cluster_owner_name\x18\b \x01(\tR\x10clusterOwnerName\x12\x1f\n" + + "\vcluster_uid\x18\t \x01(\tR\n" + + "clusterUid\x12!\n" + + "\fcluster_name\x18\n" + + " \x01(\tR\vclusterName\x12#\n" + + "\rnamespace_uid\x18\v \x01(\tR\fnamespaceUid\x12%\n" + + "\x0enamespace_name\x18\f \x01(\tR\rnamespaceName\x12\x1b\n" + + "\tapi_group\x18\r \x01(\tR\bapiGroup\x12\x18\n" + + "\aversion\x18\x0e \x01(\tR\aversion\x12\x1a\n" + + "\bresource\x18\x0f \x01(\tR\bresource\x12#\n" + + "\rresource_name\x18\x10 \x01(\tR\fresourceName\x12!\n" + + "\fresource_uid\x18\x11 \x01(\tR\vresourceUid\x12;\n" + + "\vcreate_time\x18\x12 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "createTime\x12;\n" + + "\vupdate_time\x18\x13 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "updateTime\"y\n" + + "\x12SearchUsersRequest\x12\x14\n" + + "\x05query\x18\x01 \x01(\tR\x05query\x12'\n" + + "\x02id\x18\x02 \x01(\tB\x17\xbaH\x14r\x122\x10^([1-9][0-9]*)?$R\x02id\x12$\n" + + "\tpage_size\x18\x03 \x01(\x05B\a\xbaH\x04\x1a\x02(\x00R\bpageSize\">\n" + + "\x13SearchUsersResponse\x12'\n" + + "\x05users\x18\x01 \x03(\v2\x11.akp.user.v2.UserR\x05users\"5\n" + + "\x0eGetUserRequest\x12#\n" + + "\busername\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\busername\"8\n" + + "\x0fGetUserResponse\x12%\n" + + "\x04user\x18\x01 \x01(\v2\x11.akp.user.v2.UserR\x04user\"Y\n" + + "\x1bGetAuthenticatedUserRequest\x12:\n" + + "\x19check_client_organization\x18\x01 \x01(\bR\x17checkClientOrganization\"E\n" + + "\x1cGetAuthenticatedUserResponse\x12%\n" + + "\x04user\x18\x01 \x01(\v2\x11.akp.user.v2.UserR\x04user\"\x12\n" + + "\x10ListTeamsRequest\"<\n" + + "\x11ListTeamsResponse\x12'\n" + + "\x05teams\x18\x01 \x03(\v2\x11.akp.user.v2.TeamR\x05teams\"'\n" + + "\x13ListClustersRequest\x12\x10\n" + + "\x03all\x18\x01 \x01(\bR\x03all\"H\n" + + "\x14ListClustersResponse\x120\n" + + "\bclusters\x18\x01 \x03(\v2\x14.akp.user.v2.ClusterR\bclusters\"\xb6\x03\n" + + "\x1dListInboxSubscriptionsRequest\x12\x14\n" + + "\x05scope\x18\x01 \x01(\tR\x05scope\x12'\n" + + "\x0forganization_id\x18\x02 \x01(\tR\x0eorganizationId\x12+\n" + + "\x11organization_name\x18\x03 \x01(\tR\x10organizationName\x12!\n" + + "\fcluster_name\x18\x04 \x01(\tR\vclusterName\x12%\n" + + "\x0enamespace_name\x18\x05 \x01(\tR\rnamespaceName\x12\x1b\n" + + "\tapi_group\x18\x06 \x01(\tR\bapiGroup\x12\x18\n" + + "\aversion\x18\a \x01(\tR\aversion\x12\x1a\n" + + "\bresource\x18\b \x01(\tR\bresource\x12#\n" + + "\rresource_name\x18\t \x01(\tR\fresourceName\x12\x1f\n" + + "\vcluster_uid\x18\n" + + " \x01(\tR\n" + + "clusterUid\x12#\n" + + "\rnamespace_uid\x18\v \x01(\tR\fnamespaceUid\x12!\n" + + "\fresource_uid\x18\f \x01(\tR\vresourceUid\"f\n" + + "\x1eListInboxSubscriptionsResponse\x12D\n" + + "\rsubscriptions\x18\x01 \x03(\v2\x1e.akp.user.v2.InboxSubscriptionR\rsubscriptions\"\x19\n" + + "\x17GetFirebaseTokenRequest\"0\n" + + "\x18GetFirebaseTokenResponse\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\"\xce\x01\n" + + "\x15GetLoginMethodRequest\x12\"\n" + + "\forganization\x18\x01 \x01(\tR\forganization\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername:u\xbaHr\x1ap\n" + + "\x18organization_or_username\x12$organization or username is required\x1a.this.organization != '' || this.username != ''\"\xef\x01\n" + + "\x16GetLoginMethodResponse\x120\n" + + "\x06method\x18\x01 \x01(\x0e2\x18.akp.user.v2.LoginMethodR\x06method\x12+\n" + + "\x12org_auth_source_id\x18\x02 \x01(\tR\x0forgAuthSourceId\x12#\n" + + "\rprovider_name\x18\x03 \x01(\tR\fproviderName\x12.\n" + + "\x13oauth_callback_path\x18\x04 \x01(\tR\x11oauthCallbackPath\x12!\n" + + "\fdisplay_name\x18\x05 \x01(\tR\vdisplayName\"5\n" + + "\x17ValidateUsernameRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\"Q\n" + + "\x18ValidateUsernameResponse\x125\n" + + "\x06status\x18\x01 \x01(\x0e2\x1d.akp.user.v2.ValidationStatusR\x06status\"Y\n" + + "\x1fValidateOrganizationNameRequest\x12\"\n" + + "\forganization\x18\x01 \x01(\tR\forganization\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"Y\n" + + " ValidateOrganizationNameResponse\x125\n" + + "\x06status\x18\x01 \x01(\x0e2\x1d.akp.user.v2.ValidationStatusR\x06status\",\n" + + "\x14ValidateEmailRequest\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email\"N\n" + + "\x15ValidateEmailResponse\x125\n" + + "\x06status\x18\x01 \x01(\x0e2\x1d.akp.user.v2.ValidationStatusR\x06status\"O\n" + + "\x14ListFollowersRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1b\n" + + "\x04page\x18\x02 \x01(\x05B\a\xbaH\x04\x1a\x02(\x00R\x04page\"@\n" + + "\x15ListFollowersResponse\x12'\n" + + "\x05users\x18\x01 \x03(\v2\x11.akp.user.v2.UserR\x05users\"O\n" + + "\x14ListFollowingRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1b\n" + + "\x04page\x18\x02 \x01(\x05B\a\xbaH\x04\x1a\x02(\x00R\x04page\"@\n" + + "\x15ListFollowingResponse\x12'\n" + + "\x05users\x18\x01 \x03(\v2\x11.akp.user.v2.UserR\x05users\"T\n" + + "\x15CheckFollowingRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1f\n" + + "\x06target\x18\x02 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x06target\"6\n" + + "\x16CheckFollowingResponse\x12\x1c\n" + + "\tfollowing\x18\x01 \x01(\bR\tfollowing\"8\n" + + "\x11FollowUserRequest\x12#\n" + + "\busername\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\busername\"\x14\n" + + "\x12FollowUserResponse\":\n" + + "\x13UnfollowUserRequest\x12#\n" + + "\busername\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\busername\"\x16\n" + + "\x14UnfollowUserResponse\"S\n" + + "\x05Email\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" + + "\bverified\x18\x02 \x01(\bR\bverified\x12\x18\n" + + "\aprimary\x18\x03 \x01(\bR\aprimary\"\x13\n" + + "\x11ListEmailsRequest\"@\n" + + "\x12ListEmailsResponse\x12*\n" + + "\x06emails\x18\x01 \x03(\v2\x12.akp.user.v2.EmailR\x06emails\"4\n" + + "\x10AddEmailsRequest\x12 \n" + + "\x06emails\x18\x01 \x03(\tB\b\xbaH\x05\x92\x01\x02\b\x01R\x06emails\"?\n" + + "\x11AddEmailsResponse\x12*\n" + + "\x06emails\x18\x01 \x03(\v2\x12.akp.user.v2.EmailR\x06emails\"-\n" + + "\x13DeleteEmailsRequest\x12\x16\n" + + "\x06emails\x18\x01 \x03(\tR\x06emails\"\x16\n" + + "\x14DeleteEmailsResponse\"q\n" + + "\vAccessToken\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05token\x18\x03 \x01(\tR\x05token\x12(\n" + + "\x10token_last_eight\x18\x04 \x01(\tR\x0etokenLastEight\"\x19\n" + + "\x17ListAccessTokensRequest\"L\n" + + "\x18ListAccessTokensResponse\x120\n" + + "\x06tokens\x18\x01 \x03(\v2\x18.akp.user.v2.AccessTokenR\x06tokens\"7\n" + + "\x18CreateAccessTokenRequest\x12\x1b\n" + + "\x04name\x18\x01 \x01(\tB\a\xbaH\x04r\x02\x10\x01R\x04name\"K\n" + + "\x19CreateAccessTokenResponse\x12.\n" + + "\x05token\x18\x01 \x01(\v2\x18.akp.user.v2.AccessTokenR\x05token\"@\n" + + "\x18DeleteAccessTokenRequest\x12$\n" + + "\x02id\x18\x01 \x01(\tB\x14\xbaH\x11r\x0f2\r^[1-9][0-9]*$R\x02id\"\x1b\n" + + "\x19DeleteAccessTokenResponse*\xa7\x01\n" + + "\vAccountType\x12\x1c\n" + + "\x18ACCOUNT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17ACCOUNT_TYPE_INDIVIDUAL\x10\x01\x12\x1d\n" + + "\x19ACCOUNT_TYPE_ORGANIZATION\x10\x02\x12\x1c\n" + + "\x18ACCOUNT_TYPE_DEACTIVATED\x10\x03\x12 \n" + + "\x1cACCOUNT_TYPE_REVENUE_OFFICER\x10\x04*\xfa\x01\n" + + "\x10OrganizationType\x12!\n" + + "\x1dORGANIZATION_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17ORGANIZATION_TYPE_BASIC\x10\x01\x12\x1d\n" + + "\x19ORGANIZATION_TYPE_RANCHER\x10\x02\x12\x1c\n" + + "\x18ORGANIZATION_TYPE_CLIENT\x10\x03\x12!\n" + + "\x1dORGANIZATION_TYPE_MARKETPLACE\x10\x04\x12\x1b\n" + + "\x17ORGANIZATION_TYPE_DBAAS\x10\x05\x12)\n" + + "%ORGANIZATION_TYPE_SITE_ADMINISTRATION\x10\x06*\\\n" + + "\vLoginMethod\x12\x1c\n" + + "\x18LOGIN_METHOD_UNSPECIFIED\x10\x00\x12\x19\n" + + "\x15LOGIN_METHOD_PASSWORD\x10\x01\x12\x14\n" + + "\x10LOGIN_METHOD_SSO\x10\x02*\xd1\x01\n" + + "\x10ValidationStatus\x12!\n" + + "\x1dVALIDATION_STATUS_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17VALIDATION_STATUS_VALID\x10\x01\x12\x1b\n" + + "\x17VALIDATION_STATUS_TAKEN\x10\x02\x12\x1e\n" + + "\x1aVALIDATION_STATUS_RESERVED\x10\x03\x12\x1d\n" + + "\x19VALIDATION_STATUS_INVALID\x10\x04\x12!\n" + + "\x1dVALIDATION_STATUS_NOT_ALLOWED\x10\x052\xaa\b\n" + + "\vUserService\x12R\n" + + "\vSearchUsers\x12\x1f.akp.user.v2.SearchUsersRequest\x1a .akp.user.v2.SearchUsersResponse\"\x00\x12F\n" + + "\aGetUser\x12\x1b.akp.user.v2.GetUserRequest\x1a\x1c.akp.user.v2.GetUserResponse\"\x00\x12m\n" + + "\x14GetAuthenticatedUser\x12(.akp.user.v2.GetAuthenticatedUserRequest\x1a).akp.user.v2.GetAuthenticatedUserResponse\"\x00\x12L\n" + + "\tListTeams\x12\x1d.akp.user.v2.ListTeamsRequest\x1a\x1e.akp.user.v2.ListTeamsResponse\"\x00\x12U\n" + + "\fListClusters\x12 .akp.user.v2.ListClustersRequest\x1a!.akp.user.v2.ListClustersResponse\"\x00\x12s\n" + + "\x16ListInboxSubscriptions\x12*.akp.user.v2.ListInboxSubscriptionsRequest\x1a+.akp.user.v2.ListInboxSubscriptionsResponse\"\x00\x12a\n" + + "\x10GetFirebaseToken\x12$.akp.user.v2.GetFirebaseTokenRequest\x1a%.akp.user.v2.GetFirebaseTokenResponse\"\x00\x12[\n" + + "\x0eGetLoginMethod\x12\".akp.user.v2.GetLoginMethodRequest\x1a#.akp.user.v2.GetLoginMethodResponse\"\x00\x12a\n" + + "\x10ValidateUsername\x12$.akp.user.v2.ValidateUsernameRequest\x1a%.akp.user.v2.ValidateUsernameResponse\"\x00\x12y\n" + + "\x18ValidateOrganizationName\x12,.akp.user.v2.ValidateOrganizationNameRequest\x1a-.akp.user.v2.ValidateOrganizationNameResponse\"\x00\x12X\n" + + "\rValidateEmail\x12!.akp.user.v2.ValidateEmailRequest\x1a\".akp.user.v2.ValidateEmailResponse\"\x002\xc8\x03\n" + + "\rFollowService\x12X\n" + + "\rListFollowers\x12!.akp.user.v2.ListFollowersRequest\x1a\".akp.user.v2.ListFollowersResponse\"\x00\x12X\n" + + "\rListFollowing\x12!.akp.user.v2.ListFollowingRequest\x1a\".akp.user.v2.ListFollowingResponse\"\x00\x12[\n" + + "\x0eCheckFollowing\x12\".akp.user.v2.CheckFollowingRequest\x1a#.akp.user.v2.CheckFollowingResponse\"\x00\x12O\n" + + "\n" + + "FollowUser\x12\x1e.akp.user.v2.FollowUserRequest\x1a\x1f.akp.user.v2.FollowUserResponse\"\x00\x12U\n" + + "\fUnfollowUser\x12 .akp.user.v2.UnfollowUserRequest\x1a!.akp.user.v2.UnfollowUserResponse\"\x002\x84\x02\n" + + "\fEmailService\x12O\n" + + "\n" + + "ListEmails\x12\x1e.akp.user.v2.ListEmailsRequest\x1a\x1f.akp.user.v2.ListEmailsResponse\"\x00\x12L\n" + + "\tAddEmails\x12\x1d.akp.user.v2.AddEmailsRequest\x1a\x1e.akp.user.v2.AddEmailsResponse\"\x00\x12U\n" + + "\fDeleteEmails\x12 .akp.user.v2.DeleteEmailsRequest\x1a!.akp.user.v2.DeleteEmailsResponse\"\x002\xc3\x02\n" + + "\x12AccessTokenService\x12a\n" + + "\x10ListAccessTokens\x12$.akp.user.v2.ListAccessTokensRequest\x1a%.akp.user.v2.ListAccessTokensResponse\"\x00\x12d\n" + + "\x11CreateAccessToken\x12%.akp.user.v2.CreateAccessTokenRequest\x1a&.akp.user.v2.CreateAccessTokenResponse\"\x00\x12d\n" + + "\x11DeleteAccessToken\x12%.akp.user.v2.DeleteAccessTokenRequest\x1a&.akp.user.v2.DeleteAccessTokenResponse\"\x00B\xa1\x01\n" + + "\x0fcom.akp.user.v2B\tUserProtoP\x01Z5go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2;userv2\xa2\x02\x03AUX\xaa\x02\vAkp.User.V2\xca\x02\vAkp\\User\\V2\xe2\x02\x17Akp\\User\\V2\\GPBMetadata\xea\x02\rAkp::User::V2b\x06proto3" + +var ( + file_akp_user_v2_user_proto_rawDescOnce sync.Once + file_akp_user_v2_user_proto_rawDescData []byte +) + +func file_akp_user_v2_user_proto_rawDescGZIP() []byte { + file_akp_user_v2_user_proto_rawDescOnce.Do(func() { + file_akp_user_v2_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_akp_user_v2_user_proto_rawDesc), len(file_akp_user_v2_user_proto_rawDesc))) + }) + return file_akp_user_v2_user_proto_rawDescData +} + +var file_akp_user_v2_user_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_akp_user_v2_user_proto_msgTypes = make([]protoimpl.MessageInfo, 52) +var file_akp_user_v2_user_proto_goTypes = []any{ + (AccountType)(0), // 0: akp.user.v2.AccountType + (OrganizationType)(0), // 1: akp.user.v2.OrganizationType + (LoginMethod)(0), // 2: akp.user.v2.LoginMethod + (ValidationStatus)(0), // 3: akp.user.v2.ValidationStatus + (*User)(nil), // 4: akp.user.v2.User + (*Organization)(nil), // 5: akp.user.v2.Organization + (*Team)(nil), // 6: akp.user.v2.Team + (*Cluster)(nil), // 7: akp.user.v2.Cluster + (*ClusterRef)(nil), // 8: akp.user.v2.ClusterRef + (*InboxSubscription)(nil), // 9: akp.user.v2.InboxSubscription + (*SearchUsersRequest)(nil), // 10: akp.user.v2.SearchUsersRequest + (*SearchUsersResponse)(nil), // 11: akp.user.v2.SearchUsersResponse + (*GetUserRequest)(nil), // 12: akp.user.v2.GetUserRequest + (*GetUserResponse)(nil), // 13: akp.user.v2.GetUserResponse + (*GetAuthenticatedUserRequest)(nil), // 14: akp.user.v2.GetAuthenticatedUserRequest + (*GetAuthenticatedUserResponse)(nil), // 15: akp.user.v2.GetAuthenticatedUserResponse + (*ListTeamsRequest)(nil), // 16: akp.user.v2.ListTeamsRequest + (*ListTeamsResponse)(nil), // 17: akp.user.v2.ListTeamsResponse + (*ListClustersRequest)(nil), // 18: akp.user.v2.ListClustersRequest + (*ListClustersResponse)(nil), // 19: akp.user.v2.ListClustersResponse + (*ListInboxSubscriptionsRequest)(nil), // 20: akp.user.v2.ListInboxSubscriptionsRequest + (*ListInboxSubscriptionsResponse)(nil), // 21: akp.user.v2.ListInboxSubscriptionsResponse + (*GetFirebaseTokenRequest)(nil), // 22: akp.user.v2.GetFirebaseTokenRequest + (*GetFirebaseTokenResponse)(nil), // 23: akp.user.v2.GetFirebaseTokenResponse + (*GetLoginMethodRequest)(nil), // 24: akp.user.v2.GetLoginMethodRequest + (*GetLoginMethodResponse)(nil), // 25: akp.user.v2.GetLoginMethodResponse + (*ValidateUsernameRequest)(nil), // 26: akp.user.v2.ValidateUsernameRequest + (*ValidateUsernameResponse)(nil), // 27: akp.user.v2.ValidateUsernameResponse + (*ValidateOrganizationNameRequest)(nil), // 28: akp.user.v2.ValidateOrganizationNameRequest + (*ValidateOrganizationNameResponse)(nil), // 29: akp.user.v2.ValidateOrganizationNameResponse + (*ValidateEmailRequest)(nil), // 30: akp.user.v2.ValidateEmailRequest + (*ValidateEmailResponse)(nil), // 31: akp.user.v2.ValidateEmailResponse + (*ListFollowersRequest)(nil), // 32: akp.user.v2.ListFollowersRequest + (*ListFollowersResponse)(nil), // 33: akp.user.v2.ListFollowersResponse + (*ListFollowingRequest)(nil), // 34: akp.user.v2.ListFollowingRequest + (*ListFollowingResponse)(nil), // 35: akp.user.v2.ListFollowingResponse + (*CheckFollowingRequest)(nil), // 36: akp.user.v2.CheckFollowingRequest + (*CheckFollowingResponse)(nil), // 37: akp.user.v2.CheckFollowingResponse + (*FollowUserRequest)(nil), // 38: akp.user.v2.FollowUserRequest + (*FollowUserResponse)(nil), // 39: akp.user.v2.FollowUserResponse + (*UnfollowUserRequest)(nil), // 40: akp.user.v2.UnfollowUserRequest + (*UnfollowUserResponse)(nil), // 41: akp.user.v2.UnfollowUserResponse + (*Email)(nil), // 42: akp.user.v2.Email + (*ListEmailsRequest)(nil), // 43: akp.user.v2.ListEmailsRequest + (*ListEmailsResponse)(nil), // 44: akp.user.v2.ListEmailsResponse + (*AddEmailsRequest)(nil), // 45: akp.user.v2.AddEmailsRequest + (*AddEmailsResponse)(nil), // 46: akp.user.v2.AddEmailsResponse + (*DeleteEmailsRequest)(nil), // 47: akp.user.v2.DeleteEmailsRequest + (*DeleteEmailsResponse)(nil), // 48: akp.user.v2.DeleteEmailsResponse + (*AccessToken)(nil), // 49: akp.user.v2.AccessToken + (*ListAccessTokensRequest)(nil), // 50: akp.user.v2.ListAccessTokensRequest + (*ListAccessTokensResponse)(nil), // 51: akp.user.v2.ListAccessTokensResponse + (*CreateAccessTokenRequest)(nil), // 52: akp.user.v2.CreateAccessTokenRequest + (*CreateAccessTokenResponse)(nil), // 53: akp.user.v2.CreateAccessTokenResponse + (*DeleteAccessTokenRequest)(nil), // 54: akp.user.v2.DeleteAccessTokenRequest + (*DeleteAccessTokenResponse)(nil), // 55: akp.user.v2.DeleteAccessTokenResponse + (*timestamppb.Timestamp)(nil), // 56: google.protobuf.Timestamp +} +var file_akp_user_v2_user_proto_depIdxs = []int32{ + 0, // 0: akp.user.v2.User.type:type_name -> akp.user.v2.AccountType + 1, // 1: akp.user.v2.User.organization_type:type_name -> akp.user.v2.OrganizationType + 56, // 2: akp.user.v2.User.create_time:type_name -> google.protobuf.Timestamp + 56, // 3: akp.user.v2.User.last_login_time:type_name -> google.protobuf.Timestamp + 1, // 4: akp.user.v2.Organization.type:type_name -> akp.user.v2.OrganizationType + 5, // 5: akp.user.v2.Team.organization:type_name -> akp.user.v2.Organization + 56, // 6: akp.user.v2.Cluster.create_time:type_name -> google.protobuf.Timestamp + 8, // 7: akp.user.v2.Cluster.hub:type_name -> akp.user.v2.ClusterRef + 56, // 8: akp.user.v2.InboxSubscription.create_time:type_name -> google.protobuf.Timestamp + 56, // 9: akp.user.v2.InboxSubscription.update_time:type_name -> google.protobuf.Timestamp + 4, // 10: akp.user.v2.SearchUsersResponse.users:type_name -> akp.user.v2.User + 4, // 11: akp.user.v2.GetUserResponse.user:type_name -> akp.user.v2.User + 4, // 12: akp.user.v2.GetAuthenticatedUserResponse.user:type_name -> akp.user.v2.User + 6, // 13: akp.user.v2.ListTeamsResponse.teams:type_name -> akp.user.v2.Team + 7, // 14: akp.user.v2.ListClustersResponse.clusters:type_name -> akp.user.v2.Cluster + 9, // 15: akp.user.v2.ListInboxSubscriptionsResponse.subscriptions:type_name -> akp.user.v2.InboxSubscription + 2, // 16: akp.user.v2.GetLoginMethodResponse.method:type_name -> akp.user.v2.LoginMethod + 3, // 17: akp.user.v2.ValidateUsernameResponse.status:type_name -> akp.user.v2.ValidationStatus + 3, // 18: akp.user.v2.ValidateOrganizationNameResponse.status:type_name -> akp.user.v2.ValidationStatus + 3, // 19: akp.user.v2.ValidateEmailResponse.status:type_name -> akp.user.v2.ValidationStatus + 4, // 20: akp.user.v2.ListFollowersResponse.users:type_name -> akp.user.v2.User + 4, // 21: akp.user.v2.ListFollowingResponse.users:type_name -> akp.user.v2.User + 42, // 22: akp.user.v2.ListEmailsResponse.emails:type_name -> akp.user.v2.Email + 42, // 23: akp.user.v2.AddEmailsResponse.emails:type_name -> akp.user.v2.Email + 49, // 24: akp.user.v2.ListAccessTokensResponse.tokens:type_name -> akp.user.v2.AccessToken + 49, // 25: akp.user.v2.CreateAccessTokenResponse.token:type_name -> akp.user.v2.AccessToken + 10, // 26: akp.user.v2.UserService.SearchUsers:input_type -> akp.user.v2.SearchUsersRequest + 12, // 27: akp.user.v2.UserService.GetUser:input_type -> akp.user.v2.GetUserRequest + 14, // 28: akp.user.v2.UserService.GetAuthenticatedUser:input_type -> akp.user.v2.GetAuthenticatedUserRequest + 16, // 29: akp.user.v2.UserService.ListTeams:input_type -> akp.user.v2.ListTeamsRequest + 18, // 30: akp.user.v2.UserService.ListClusters:input_type -> akp.user.v2.ListClustersRequest + 20, // 31: akp.user.v2.UserService.ListInboxSubscriptions:input_type -> akp.user.v2.ListInboxSubscriptionsRequest + 22, // 32: akp.user.v2.UserService.GetFirebaseToken:input_type -> akp.user.v2.GetFirebaseTokenRequest + 24, // 33: akp.user.v2.UserService.GetLoginMethod:input_type -> akp.user.v2.GetLoginMethodRequest + 26, // 34: akp.user.v2.UserService.ValidateUsername:input_type -> akp.user.v2.ValidateUsernameRequest + 28, // 35: akp.user.v2.UserService.ValidateOrganizationName:input_type -> akp.user.v2.ValidateOrganizationNameRequest + 30, // 36: akp.user.v2.UserService.ValidateEmail:input_type -> akp.user.v2.ValidateEmailRequest + 32, // 37: akp.user.v2.FollowService.ListFollowers:input_type -> akp.user.v2.ListFollowersRequest + 34, // 38: akp.user.v2.FollowService.ListFollowing:input_type -> akp.user.v2.ListFollowingRequest + 36, // 39: akp.user.v2.FollowService.CheckFollowing:input_type -> akp.user.v2.CheckFollowingRequest + 38, // 40: akp.user.v2.FollowService.FollowUser:input_type -> akp.user.v2.FollowUserRequest + 40, // 41: akp.user.v2.FollowService.UnfollowUser:input_type -> akp.user.v2.UnfollowUserRequest + 43, // 42: akp.user.v2.EmailService.ListEmails:input_type -> akp.user.v2.ListEmailsRequest + 45, // 43: akp.user.v2.EmailService.AddEmails:input_type -> akp.user.v2.AddEmailsRequest + 47, // 44: akp.user.v2.EmailService.DeleteEmails:input_type -> akp.user.v2.DeleteEmailsRequest + 50, // 45: akp.user.v2.AccessTokenService.ListAccessTokens:input_type -> akp.user.v2.ListAccessTokensRequest + 52, // 46: akp.user.v2.AccessTokenService.CreateAccessToken:input_type -> akp.user.v2.CreateAccessTokenRequest + 54, // 47: akp.user.v2.AccessTokenService.DeleteAccessToken:input_type -> akp.user.v2.DeleteAccessTokenRequest + 11, // 48: akp.user.v2.UserService.SearchUsers:output_type -> akp.user.v2.SearchUsersResponse + 13, // 49: akp.user.v2.UserService.GetUser:output_type -> akp.user.v2.GetUserResponse + 15, // 50: akp.user.v2.UserService.GetAuthenticatedUser:output_type -> akp.user.v2.GetAuthenticatedUserResponse + 17, // 51: akp.user.v2.UserService.ListTeams:output_type -> akp.user.v2.ListTeamsResponse + 19, // 52: akp.user.v2.UserService.ListClusters:output_type -> akp.user.v2.ListClustersResponse + 21, // 53: akp.user.v2.UserService.ListInboxSubscriptions:output_type -> akp.user.v2.ListInboxSubscriptionsResponse + 23, // 54: akp.user.v2.UserService.GetFirebaseToken:output_type -> akp.user.v2.GetFirebaseTokenResponse + 25, // 55: akp.user.v2.UserService.GetLoginMethod:output_type -> akp.user.v2.GetLoginMethodResponse + 27, // 56: akp.user.v2.UserService.ValidateUsername:output_type -> akp.user.v2.ValidateUsernameResponse + 29, // 57: akp.user.v2.UserService.ValidateOrganizationName:output_type -> akp.user.v2.ValidateOrganizationNameResponse + 31, // 58: akp.user.v2.UserService.ValidateEmail:output_type -> akp.user.v2.ValidateEmailResponse + 33, // 59: akp.user.v2.FollowService.ListFollowers:output_type -> akp.user.v2.ListFollowersResponse + 35, // 60: akp.user.v2.FollowService.ListFollowing:output_type -> akp.user.v2.ListFollowingResponse + 37, // 61: akp.user.v2.FollowService.CheckFollowing:output_type -> akp.user.v2.CheckFollowingResponse + 39, // 62: akp.user.v2.FollowService.FollowUser:output_type -> akp.user.v2.FollowUserResponse + 41, // 63: akp.user.v2.FollowService.UnfollowUser:output_type -> akp.user.v2.UnfollowUserResponse + 44, // 64: akp.user.v2.EmailService.ListEmails:output_type -> akp.user.v2.ListEmailsResponse + 46, // 65: akp.user.v2.EmailService.AddEmails:output_type -> akp.user.v2.AddEmailsResponse + 48, // 66: akp.user.v2.EmailService.DeleteEmails:output_type -> akp.user.v2.DeleteEmailsResponse + 51, // 67: akp.user.v2.AccessTokenService.ListAccessTokens:output_type -> akp.user.v2.ListAccessTokensResponse + 53, // 68: akp.user.v2.AccessTokenService.CreateAccessToken:output_type -> akp.user.v2.CreateAccessTokenResponse + 55, // 69: akp.user.v2.AccessTokenService.DeleteAccessToken:output_type -> akp.user.v2.DeleteAccessTokenResponse + 48, // [48:70] is the sub-list for method output_type + 26, // [26:48] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name +} + +func init() { file_akp_user_v2_user_proto_init() } +func file_akp_user_v2_user_proto_init() { + if File_akp_user_v2_user_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_akp_user_v2_user_proto_rawDesc), len(file_akp_user_v2_user_proto_rawDesc)), + NumEnums: 4, + NumMessages: 52, + NumExtensions: 0, + NumServices: 4, + }, + GoTypes: file_akp_user_v2_user_proto_goTypes, + DependencyIndexes: file_akp_user_v2_user_proto_depIdxs, + EnumInfos: file_akp_user_v2_user_proto_enumTypes, + MessageInfos: file_akp_user_v2_user_proto_msgTypes, + }.Build() + File_akp_user_v2_user_proto = out.File + file_akp_user_v2_user_proto_goTypes = nil + file_akp_user_v2_user_proto_depIdxs = nil +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/client_org.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/client_org.connect.go new file mode 100644 index 000000000..60b73ce4c --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/client_org.connect.go @@ -0,0 +1,369 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/user/v2/client_org.proto + +package userv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2" + 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 ( + // ClientOrganizationServiceName is the fully-qualified name of the ClientOrganizationService + // service. + ClientOrganizationServiceName = "akp.user.v2.ClientOrganizationService" +) + +// 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 ( + // ClientOrganizationServiceListClientOrganizationsProcedure is the fully-qualified name of the + // ClientOrganizationService's ListClientOrganizations RPC. + ClientOrganizationServiceListClientOrganizationsProcedure = "/akp.user.v2.ClientOrganizationService/ListClientOrganizations" + // ClientOrganizationServiceGetClientOrganizationProcedure is the fully-qualified name of the + // ClientOrganizationService's GetClientOrganization RPC. + ClientOrganizationServiceGetClientOrganizationProcedure = "/akp.user.v2.ClientOrganizationService/GetClientOrganization" + // ClientOrganizationServiceGetClientOrganizationStatusProcedure is the fully-qualified name of the + // ClientOrganizationService's GetClientOrganizationStatus RPC. + ClientOrganizationServiceGetClientOrganizationStatusProcedure = "/akp.user.v2.ClientOrganizationService/GetClientOrganizationStatus" + // ClientOrganizationServiceGetClientOrganizationClusterStatusProcedure is the fully-qualified name + // of the ClientOrganizationService's GetClientOrganizationClusterStatus RPC. + ClientOrganizationServiceGetClientOrganizationClusterStatusProcedure = "/akp.user.v2.ClientOrganizationService/GetClientOrganizationClusterStatus" + // ClientOrganizationServiceRemoveClientOrganizationClusterProcedure is the fully-qualified name of + // the ClientOrganizationService's RemoveClientOrganizationCluster RPC. + ClientOrganizationServiceRemoveClientOrganizationClusterProcedure = "/akp.user.v2.ClientOrganizationService/RemoveClientOrganizationCluster" + // ClientOrganizationServiceDeleteClientOrganizationProcedure is the fully-qualified name of the + // ClientOrganizationService's DeleteClientOrganization RPC. + ClientOrganizationServiceDeleteClientOrganizationProcedure = "/akp.user.v2.ClientOrganizationService/DeleteClientOrganization" + // ClientOrganizationServiceCreateClientOrganizationProcedure is the fully-qualified name of the + // ClientOrganizationService's CreateClientOrganization RPC. + ClientOrganizationServiceCreateClientOrganizationProcedure = "/akp.user.v2.ClientOrganizationService/CreateClientOrganization" + // ClientOrganizationServiceAddClientOrganizationClusterProcedure is the fully-qualified name of the + // ClientOrganizationService's AddClientOrganizationCluster RPC. + ClientOrganizationServiceAddClientOrganizationClusterProcedure = "/akp.user.v2.ClientOrganizationService/AddClientOrganizationCluster" +) + +// ClientOrganizationServiceClient is a client for the akp.user.v2.ClientOrganizationService +// service. +type ClientOrganizationServiceClient interface { + // ListClientOrganizations needs the permission to view client organizations, as do the + // methods that read. + ListClientOrganizations(context.Context, *connect.Request[v2.ListClientOrganizationsRequest]) (*connect.Response[v2.ListClientOrganizationsResponse], error) + GetClientOrganization(context.Context, *connect.Request[v2.GetClientOrganizationRequest]) (*connect.Response[v2.GetClientOrganizationResponse], error) + // GetClientOrganizationStatus is the status of a client organization, from its clusters'. + GetClientOrganizationStatus(context.Context, *connect.Request[v2.GetClientOrganizationStatusRequest]) (*connect.Response[v2.GetClientOrganizationStatusResponse], error) + // GetClientOrganizationClusterStatus is the status of a client organization's namespaces in + // one of its clusters. + GetClientOrganizationClusterStatus(context.Context, *connect.Request[v2.GetClientOrganizationClusterStatusRequest]) (*connect.Response[v2.GetClientOrganizationClusterStatusResponse], error) + // RemoveClientOrganizationCluster takes a cluster from a client organization: its namespaces + // are marked for deletion, and once the cluster has deleted them the organization's access + // to the cluster and its record go. A cluster the hub cannot reach is removed at once. Needs + // the permission to remove clusters from client organizations. + RemoveClientOrganizationCluster(context.Context, *connect.Request[v2.RemoveClientOrganizationClusterRequest]) (*connect.Response[v2.RemoveClientOrganizationClusterResponse], error) + // DeleteClientOrganization deletes a client organization: its namespaces are marked for + // deletion in each of its clusters, and once the clusters have deleted them its clusters and + // the organization go. Fails while another organization's gateway preset uses the + // organization's gateway. Needs the permission to delete client organizations. + DeleteClientOrganization(context.Context, *connect.Request[v2.DeleteClientOrganizationRequest]) (*connect.Response[v2.DeleteClientOrganizationResponse], error) + // CreateClientOrganization creates a client organization and its admin, made if no user has + // the name, who is given permissions on clusters and cluster sets of a hub; each of those + // clusters is imported into the organization through the hub, with the organization's + // namespaces in it. Needs the permission to create client organizations. + CreateClientOrganization(context.Context, *connect.Request[v2.CreateClientOrganizationRequest]) (*connect.Response[v2.CreateClientOrganizationResponse], error) + // AddClientOrganizationCluster gives a client organization a cluster of a hub: each of its + // owners gets the cluster's admin role in the organization's namespace, and the cluster is + // imported into the organization, whose telemetry tenant, if a monitoring cluster has one, it + // reports to. Needs the permission to add clusters to client organizations. + AddClientOrganizationCluster(context.Context, *connect.Request[v2.AddClientOrganizationClusterRequest]) (*connect.Response[v2.AddClientOrganizationClusterResponse], error) +} + +// NewClientOrganizationServiceClient constructs a client for the +// akp.user.v2.ClientOrganizationService 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 NewClientOrganizationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ClientOrganizationServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + clientOrganizationServiceMethods := v2.File_akp_user_v2_client_org_proto.Services().ByName("ClientOrganizationService").Methods() + return &clientOrganizationServiceClient{ + listClientOrganizations: connect.NewClient[v2.ListClientOrganizationsRequest, v2.ListClientOrganizationsResponse]( + httpClient, + baseURL+ClientOrganizationServiceListClientOrganizationsProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("ListClientOrganizations")), + connect.WithClientOptions(opts...), + ), + getClientOrganization: connect.NewClient[v2.GetClientOrganizationRequest, v2.GetClientOrganizationResponse]( + httpClient, + baseURL+ClientOrganizationServiceGetClientOrganizationProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("GetClientOrganization")), + connect.WithClientOptions(opts...), + ), + getClientOrganizationStatus: connect.NewClient[v2.GetClientOrganizationStatusRequest, v2.GetClientOrganizationStatusResponse]( + httpClient, + baseURL+ClientOrganizationServiceGetClientOrganizationStatusProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("GetClientOrganizationStatus")), + connect.WithClientOptions(opts...), + ), + getClientOrganizationClusterStatus: connect.NewClient[v2.GetClientOrganizationClusterStatusRequest, v2.GetClientOrganizationClusterStatusResponse]( + httpClient, + baseURL+ClientOrganizationServiceGetClientOrganizationClusterStatusProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("GetClientOrganizationClusterStatus")), + connect.WithClientOptions(opts...), + ), + removeClientOrganizationCluster: connect.NewClient[v2.RemoveClientOrganizationClusterRequest, v2.RemoveClientOrganizationClusterResponse]( + httpClient, + baseURL+ClientOrganizationServiceRemoveClientOrganizationClusterProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("RemoveClientOrganizationCluster")), + connect.WithClientOptions(opts...), + ), + deleteClientOrganization: connect.NewClient[v2.DeleteClientOrganizationRequest, v2.DeleteClientOrganizationResponse]( + httpClient, + baseURL+ClientOrganizationServiceDeleteClientOrganizationProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("DeleteClientOrganization")), + connect.WithClientOptions(opts...), + ), + createClientOrganization: connect.NewClient[v2.CreateClientOrganizationRequest, v2.CreateClientOrganizationResponse]( + httpClient, + baseURL+ClientOrganizationServiceCreateClientOrganizationProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("CreateClientOrganization")), + connect.WithClientOptions(opts...), + ), + addClientOrganizationCluster: connect.NewClient[v2.AddClientOrganizationClusterRequest, v2.AddClientOrganizationClusterResponse]( + httpClient, + baseURL+ClientOrganizationServiceAddClientOrganizationClusterProcedure, + connect.WithSchema(clientOrganizationServiceMethods.ByName("AddClientOrganizationCluster")), + connect.WithClientOptions(opts...), + ), + } +} + +// clientOrganizationServiceClient implements ClientOrganizationServiceClient. +type clientOrganizationServiceClient struct { + listClientOrganizations *connect.Client[v2.ListClientOrganizationsRequest, v2.ListClientOrganizationsResponse] + getClientOrganization *connect.Client[v2.GetClientOrganizationRequest, v2.GetClientOrganizationResponse] + getClientOrganizationStatus *connect.Client[v2.GetClientOrganizationStatusRequest, v2.GetClientOrganizationStatusResponse] + getClientOrganizationClusterStatus *connect.Client[v2.GetClientOrganizationClusterStatusRequest, v2.GetClientOrganizationClusterStatusResponse] + removeClientOrganizationCluster *connect.Client[v2.RemoveClientOrganizationClusterRequest, v2.RemoveClientOrganizationClusterResponse] + deleteClientOrganization *connect.Client[v2.DeleteClientOrganizationRequest, v2.DeleteClientOrganizationResponse] + createClientOrganization *connect.Client[v2.CreateClientOrganizationRequest, v2.CreateClientOrganizationResponse] + addClientOrganizationCluster *connect.Client[v2.AddClientOrganizationClusterRequest, v2.AddClientOrganizationClusterResponse] +} + +// ListClientOrganizations calls akp.user.v2.ClientOrganizationService.ListClientOrganizations. +func (c *clientOrganizationServiceClient) ListClientOrganizations(ctx context.Context, req *connect.Request[v2.ListClientOrganizationsRequest]) (*connect.Response[v2.ListClientOrganizationsResponse], error) { + return c.listClientOrganizations.CallUnary(ctx, req) +} + +// GetClientOrganization calls akp.user.v2.ClientOrganizationService.GetClientOrganization. +func (c *clientOrganizationServiceClient) GetClientOrganization(ctx context.Context, req *connect.Request[v2.GetClientOrganizationRequest]) (*connect.Response[v2.GetClientOrganizationResponse], error) { + return c.getClientOrganization.CallUnary(ctx, req) +} + +// GetClientOrganizationStatus calls +// akp.user.v2.ClientOrganizationService.GetClientOrganizationStatus. +func (c *clientOrganizationServiceClient) GetClientOrganizationStatus(ctx context.Context, req *connect.Request[v2.GetClientOrganizationStatusRequest]) (*connect.Response[v2.GetClientOrganizationStatusResponse], error) { + return c.getClientOrganizationStatus.CallUnary(ctx, req) +} + +// GetClientOrganizationClusterStatus calls +// akp.user.v2.ClientOrganizationService.GetClientOrganizationClusterStatus. +func (c *clientOrganizationServiceClient) GetClientOrganizationClusterStatus(ctx context.Context, req *connect.Request[v2.GetClientOrganizationClusterStatusRequest]) (*connect.Response[v2.GetClientOrganizationClusterStatusResponse], error) { + return c.getClientOrganizationClusterStatus.CallUnary(ctx, req) +} + +// RemoveClientOrganizationCluster calls +// akp.user.v2.ClientOrganizationService.RemoveClientOrganizationCluster. +func (c *clientOrganizationServiceClient) RemoveClientOrganizationCluster(ctx context.Context, req *connect.Request[v2.RemoveClientOrganizationClusterRequest]) (*connect.Response[v2.RemoveClientOrganizationClusterResponse], error) { + return c.removeClientOrganizationCluster.CallUnary(ctx, req) +} + +// DeleteClientOrganization calls akp.user.v2.ClientOrganizationService.DeleteClientOrganization. +func (c *clientOrganizationServiceClient) DeleteClientOrganization(ctx context.Context, req *connect.Request[v2.DeleteClientOrganizationRequest]) (*connect.Response[v2.DeleteClientOrganizationResponse], error) { + return c.deleteClientOrganization.CallUnary(ctx, req) +} + +// CreateClientOrganization calls akp.user.v2.ClientOrganizationService.CreateClientOrganization. +func (c *clientOrganizationServiceClient) CreateClientOrganization(ctx context.Context, req *connect.Request[v2.CreateClientOrganizationRequest]) (*connect.Response[v2.CreateClientOrganizationResponse], error) { + return c.createClientOrganization.CallUnary(ctx, req) +} + +// AddClientOrganizationCluster calls +// akp.user.v2.ClientOrganizationService.AddClientOrganizationCluster. +func (c *clientOrganizationServiceClient) AddClientOrganizationCluster(ctx context.Context, req *connect.Request[v2.AddClientOrganizationClusterRequest]) (*connect.Response[v2.AddClientOrganizationClusterResponse], error) { + return c.addClientOrganizationCluster.CallUnary(ctx, req) +} + +// ClientOrganizationServiceHandler is an implementation of the +// akp.user.v2.ClientOrganizationService service. +type ClientOrganizationServiceHandler interface { + // ListClientOrganizations needs the permission to view client organizations, as do the + // methods that read. + ListClientOrganizations(context.Context, *connect.Request[v2.ListClientOrganizationsRequest]) (*connect.Response[v2.ListClientOrganizationsResponse], error) + GetClientOrganization(context.Context, *connect.Request[v2.GetClientOrganizationRequest]) (*connect.Response[v2.GetClientOrganizationResponse], error) + // GetClientOrganizationStatus is the status of a client organization, from its clusters'. + GetClientOrganizationStatus(context.Context, *connect.Request[v2.GetClientOrganizationStatusRequest]) (*connect.Response[v2.GetClientOrganizationStatusResponse], error) + // GetClientOrganizationClusterStatus is the status of a client organization's namespaces in + // one of its clusters. + GetClientOrganizationClusterStatus(context.Context, *connect.Request[v2.GetClientOrganizationClusterStatusRequest]) (*connect.Response[v2.GetClientOrganizationClusterStatusResponse], error) + // RemoveClientOrganizationCluster takes a cluster from a client organization: its namespaces + // are marked for deletion, and once the cluster has deleted them the organization's access + // to the cluster and its record go. A cluster the hub cannot reach is removed at once. Needs + // the permission to remove clusters from client organizations. + RemoveClientOrganizationCluster(context.Context, *connect.Request[v2.RemoveClientOrganizationClusterRequest]) (*connect.Response[v2.RemoveClientOrganizationClusterResponse], error) + // DeleteClientOrganization deletes a client organization: its namespaces are marked for + // deletion in each of its clusters, and once the clusters have deleted them its clusters and + // the organization go. Fails while another organization's gateway preset uses the + // organization's gateway. Needs the permission to delete client organizations. + DeleteClientOrganization(context.Context, *connect.Request[v2.DeleteClientOrganizationRequest]) (*connect.Response[v2.DeleteClientOrganizationResponse], error) + // CreateClientOrganization creates a client organization and its admin, made if no user has + // the name, who is given permissions on clusters and cluster sets of a hub; each of those + // clusters is imported into the organization through the hub, with the organization's + // namespaces in it. Needs the permission to create client organizations. + CreateClientOrganization(context.Context, *connect.Request[v2.CreateClientOrganizationRequest]) (*connect.Response[v2.CreateClientOrganizationResponse], error) + // AddClientOrganizationCluster gives a client organization a cluster of a hub: each of its + // owners gets the cluster's admin role in the organization's namespace, and the cluster is + // imported into the organization, whose telemetry tenant, if a monitoring cluster has one, it + // reports to. Needs the permission to add clusters to client organizations. + AddClientOrganizationCluster(context.Context, *connect.Request[v2.AddClientOrganizationClusterRequest]) (*connect.Response[v2.AddClientOrganizationClusterResponse], error) +} + +// NewClientOrganizationServiceHandler 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 NewClientOrganizationServiceHandler(svc ClientOrganizationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + clientOrganizationServiceMethods := v2.File_akp_user_v2_client_org_proto.Services().ByName("ClientOrganizationService").Methods() + clientOrganizationServiceListClientOrganizationsHandler := connect.NewUnaryHandler( + ClientOrganizationServiceListClientOrganizationsProcedure, + svc.ListClientOrganizations, + connect.WithSchema(clientOrganizationServiceMethods.ByName("ListClientOrganizations")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceGetClientOrganizationHandler := connect.NewUnaryHandler( + ClientOrganizationServiceGetClientOrganizationProcedure, + svc.GetClientOrganization, + connect.WithSchema(clientOrganizationServiceMethods.ByName("GetClientOrganization")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceGetClientOrganizationStatusHandler := connect.NewUnaryHandler( + ClientOrganizationServiceGetClientOrganizationStatusProcedure, + svc.GetClientOrganizationStatus, + connect.WithSchema(clientOrganizationServiceMethods.ByName("GetClientOrganizationStatus")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceGetClientOrganizationClusterStatusHandler := connect.NewUnaryHandler( + ClientOrganizationServiceGetClientOrganizationClusterStatusProcedure, + svc.GetClientOrganizationClusterStatus, + connect.WithSchema(clientOrganizationServiceMethods.ByName("GetClientOrganizationClusterStatus")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceRemoveClientOrganizationClusterHandler := connect.NewUnaryHandler( + ClientOrganizationServiceRemoveClientOrganizationClusterProcedure, + svc.RemoveClientOrganizationCluster, + connect.WithSchema(clientOrganizationServiceMethods.ByName("RemoveClientOrganizationCluster")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceDeleteClientOrganizationHandler := connect.NewUnaryHandler( + ClientOrganizationServiceDeleteClientOrganizationProcedure, + svc.DeleteClientOrganization, + connect.WithSchema(clientOrganizationServiceMethods.ByName("DeleteClientOrganization")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceCreateClientOrganizationHandler := connect.NewUnaryHandler( + ClientOrganizationServiceCreateClientOrganizationProcedure, + svc.CreateClientOrganization, + connect.WithSchema(clientOrganizationServiceMethods.ByName("CreateClientOrganization")), + connect.WithHandlerOptions(opts...), + ) + clientOrganizationServiceAddClientOrganizationClusterHandler := connect.NewUnaryHandler( + ClientOrganizationServiceAddClientOrganizationClusterProcedure, + svc.AddClientOrganizationCluster, + connect.WithSchema(clientOrganizationServiceMethods.ByName("AddClientOrganizationCluster")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.ClientOrganizationService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ClientOrganizationServiceListClientOrganizationsProcedure: + clientOrganizationServiceListClientOrganizationsHandler.ServeHTTP(w, r) + case ClientOrganizationServiceGetClientOrganizationProcedure: + clientOrganizationServiceGetClientOrganizationHandler.ServeHTTP(w, r) + case ClientOrganizationServiceGetClientOrganizationStatusProcedure: + clientOrganizationServiceGetClientOrganizationStatusHandler.ServeHTTP(w, r) + case ClientOrganizationServiceGetClientOrganizationClusterStatusProcedure: + clientOrganizationServiceGetClientOrganizationClusterStatusHandler.ServeHTTP(w, r) + case ClientOrganizationServiceRemoveClientOrganizationClusterProcedure: + clientOrganizationServiceRemoveClientOrganizationClusterHandler.ServeHTTP(w, r) + case ClientOrganizationServiceDeleteClientOrganizationProcedure: + clientOrganizationServiceDeleteClientOrganizationHandler.ServeHTTP(w, r) + case ClientOrganizationServiceCreateClientOrganizationProcedure: + clientOrganizationServiceCreateClientOrganizationHandler.ServeHTTP(w, r) + case ClientOrganizationServiceAddClientOrganizationClusterProcedure: + clientOrganizationServiceAddClientOrganizationClusterHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedClientOrganizationServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedClientOrganizationServiceHandler struct{} + +func (UnimplementedClientOrganizationServiceHandler) ListClientOrganizations(context.Context, *connect.Request[v2.ListClientOrganizationsRequest]) (*connect.Response[v2.ListClientOrganizationsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.ListClientOrganizations is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) GetClientOrganization(context.Context, *connect.Request[v2.GetClientOrganizationRequest]) (*connect.Response[v2.GetClientOrganizationResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.GetClientOrganization is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) GetClientOrganizationStatus(context.Context, *connect.Request[v2.GetClientOrganizationStatusRequest]) (*connect.Response[v2.GetClientOrganizationStatusResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.GetClientOrganizationStatus is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) GetClientOrganizationClusterStatus(context.Context, *connect.Request[v2.GetClientOrganizationClusterStatusRequest]) (*connect.Response[v2.GetClientOrganizationClusterStatusResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.GetClientOrganizationClusterStatus is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) RemoveClientOrganizationCluster(context.Context, *connect.Request[v2.RemoveClientOrganizationClusterRequest]) (*connect.Response[v2.RemoveClientOrganizationClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.RemoveClientOrganizationCluster is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) DeleteClientOrganization(context.Context, *connect.Request[v2.DeleteClientOrganizationRequest]) (*connect.Response[v2.DeleteClientOrganizationResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.DeleteClientOrganization is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) CreateClientOrganization(context.Context, *connect.Request[v2.CreateClientOrganizationRequest]) (*connect.Response[v2.CreateClientOrganizationResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.CreateClientOrganization is not implemented")) +} + +func (UnimplementedClientOrganizationServiceHandler) AddClientOrganizationCluster(context.Context, *connect.Request[v2.AddClientOrganizationClusterRequest]) (*connect.Response[v2.AddClientOrganizationClusterResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.ClientOrganizationService.AddClientOrganizationCluster is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/cloud.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/cloud.connect.go new file mode 100644 index 000000000..4caa8e0eb --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/cloud.connect.go @@ -0,0 +1,269 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/user/v2/cloud.proto + +package userv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2" + 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 ( + // CloudCredentialServiceName is the fully-qualified name of the CloudCredentialService service. + CloudCredentialServiceName = "akp.user.v2.CloudCredentialService" +) + +// 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 ( + // CloudCredentialServiceListCloudCredentialsProcedure is the fully-qualified name of the + // CloudCredentialService's ListCloudCredentials RPC. + CloudCredentialServiceListCloudCredentialsProcedure = "/akp.user.v2.CloudCredentialService/ListCloudCredentials" + // CloudCredentialServiceGetCloudCredentialProcedure is the fully-qualified name of the + // CloudCredentialService's GetCloudCredential RPC. + CloudCredentialServiceGetCloudCredentialProcedure = "/akp.user.v2.CloudCredentialService/GetCloudCredential" + // CloudCredentialServiceCreateCloudCredentialProcedure is the fully-qualified name of the + // CloudCredentialService's CreateCloudCredential RPC. + CloudCredentialServiceCreateCloudCredentialProcedure = "/akp.user.v2.CloudCredentialService/CreateCloudCredential" + // CloudCredentialServiceUpdateCloudCredentialProcedure is the fully-qualified name of the + // CloudCredentialService's UpdateCloudCredential RPC. + CloudCredentialServiceUpdateCloudCredentialProcedure = "/akp.user.v2.CloudCredentialService/UpdateCloudCredential" + // CloudCredentialServiceDeleteCloudCredentialProcedure is the fully-qualified name of the + // CloudCredentialService's DeleteCloudCredential RPC. + CloudCredentialServiceDeleteCloudCredentialProcedure = "/akp.user.v2.CloudCredentialService/DeleteCloudCredential" + // CloudCredentialServiceListBucketsProcedure is the fully-qualified name of the + // CloudCredentialService's ListBuckets RPC. + CloudCredentialServiceListBucketsProcedure = "/akp.user.v2.CloudCredentialService/ListBuckets" +) + +// CloudCredentialServiceClient is a client for the akp.user.v2.CloudCredentialService service. +type CloudCredentialServiceClient interface { + ListCloudCredentials(context.Context, *connect.Request[v2.ListCloudCredentialsRequest]) (*connect.Response[v2.ListCloudCredentialsResponse], error) + GetCloudCredential(context.Context, *connect.Request[v2.GetCloudCredentialRequest]) (*connect.Response[v2.GetCloudCredentialResponse], error) + CreateCloudCredential(context.Context, *connect.Request[v2.CreateCloudCredentialRequest]) (*connect.Response[v2.CreateCloudCredentialResponse], error) + // UpdateCloudCredential replaces a credential, found by name. + UpdateCloudCredential(context.Context, *connect.Request[v2.UpdateCloudCredentialRequest]) (*connect.Response[v2.UpdateCloudCredentialResponse], error) + DeleteCloudCredential(context.Context, *connect.Request[v2.DeleteCloudCredentialRequest]) (*connect.Response[v2.DeleteCloudCredentialResponse], error) + // ListBuckets lists the buckets a cloud credential of the caller's, or a secret in one of the + // caller's clusters, can see. + ListBuckets(context.Context, *connect.Request[v2.ListBucketsRequest]) (*connect.Response[v2.ListBucketsResponse], error) +} + +// NewCloudCredentialServiceClient constructs a client for the akp.user.v2.CloudCredentialService +// 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 NewCloudCredentialServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CloudCredentialServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + cloudCredentialServiceMethods := v2.File_akp_user_v2_cloud_proto.Services().ByName("CloudCredentialService").Methods() + return &cloudCredentialServiceClient{ + listCloudCredentials: connect.NewClient[v2.ListCloudCredentialsRequest, v2.ListCloudCredentialsResponse]( + httpClient, + baseURL+CloudCredentialServiceListCloudCredentialsProcedure, + connect.WithSchema(cloudCredentialServiceMethods.ByName("ListCloudCredentials")), + connect.WithClientOptions(opts...), + ), + getCloudCredential: connect.NewClient[v2.GetCloudCredentialRequest, v2.GetCloudCredentialResponse]( + httpClient, + baseURL+CloudCredentialServiceGetCloudCredentialProcedure, + connect.WithSchema(cloudCredentialServiceMethods.ByName("GetCloudCredential")), + connect.WithClientOptions(opts...), + ), + createCloudCredential: connect.NewClient[v2.CreateCloudCredentialRequest, v2.CreateCloudCredentialResponse]( + httpClient, + baseURL+CloudCredentialServiceCreateCloudCredentialProcedure, + connect.WithSchema(cloudCredentialServiceMethods.ByName("CreateCloudCredential")), + connect.WithClientOptions(opts...), + ), + updateCloudCredential: connect.NewClient[v2.UpdateCloudCredentialRequest, v2.UpdateCloudCredentialResponse]( + httpClient, + baseURL+CloudCredentialServiceUpdateCloudCredentialProcedure, + connect.WithSchema(cloudCredentialServiceMethods.ByName("UpdateCloudCredential")), + connect.WithClientOptions(opts...), + ), + deleteCloudCredential: connect.NewClient[v2.DeleteCloudCredentialRequest, v2.DeleteCloudCredentialResponse]( + httpClient, + baseURL+CloudCredentialServiceDeleteCloudCredentialProcedure, + connect.WithSchema(cloudCredentialServiceMethods.ByName("DeleteCloudCredential")), + connect.WithClientOptions(opts...), + ), + listBuckets: connect.NewClient[v2.ListBucketsRequest, v2.ListBucketsResponse]( + httpClient, + baseURL+CloudCredentialServiceListBucketsProcedure, + connect.WithSchema(cloudCredentialServiceMethods.ByName("ListBuckets")), + connect.WithClientOptions(opts...), + ), + } +} + +// cloudCredentialServiceClient implements CloudCredentialServiceClient. +type cloudCredentialServiceClient struct { + listCloudCredentials *connect.Client[v2.ListCloudCredentialsRequest, v2.ListCloudCredentialsResponse] + getCloudCredential *connect.Client[v2.GetCloudCredentialRequest, v2.GetCloudCredentialResponse] + createCloudCredential *connect.Client[v2.CreateCloudCredentialRequest, v2.CreateCloudCredentialResponse] + updateCloudCredential *connect.Client[v2.UpdateCloudCredentialRequest, v2.UpdateCloudCredentialResponse] + deleteCloudCredential *connect.Client[v2.DeleteCloudCredentialRequest, v2.DeleteCloudCredentialResponse] + listBuckets *connect.Client[v2.ListBucketsRequest, v2.ListBucketsResponse] +} + +// ListCloudCredentials calls akp.user.v2.CloudCredentialService.ListCloudCredentials. +func (c *cloudCredentialServiceClient) ListCloudCredentials(ctx context.Context, req *connect.Request[v2.ListCloudCredentialsRequest]) (*connect.Response[v2.ListCloudCredentialsResponse], error) { + return c.listCloudCredentials.CallUnary(ctx, req) +} + +// GetCloudCredential calls akp.user.v2.CloudCredentialService.GetCloudCredential. +func (c *cloudCredentialServiceClient) GetCloudCredential(ctx context.Context, req *connect.Request[v2.GetCloudCredentialRequest]) (*connect.Response[v2.GetCloudCredentialResponse], error) { + return c.getCloudCredential.CallUnary(ctx, req) +} + +// CreateCloudCredential calls akp.user.v2.CloudCredentialService.CreateCloudCredential. +func (c *cloudCredentialServiceClient) CreateCloudCredential(ctx context.Context, req *connect.Request[v2.CreateCloudCredentialRequest]) (*connect.Response[v2.CreateCloudCredentialResponse], error) { + return c.createCloudCredential.CallUnary(ctx, req) +} + +// UpdateCloudCredential calls akp.user.v2.CloudCredentialService.UpdateCloudCredential. +func (c *cloudCredentialServiceClient) UpdateCloudCredential(ctx context.Context, req *connect.Request[v2.UpdateCloudCredentialRequest]) (*connect.Response[v2.UpdateCloudCredentialResponse], error) { + return c.updateCloudCredential.CallUnary(ctx, req) +} + +// DeleteCloudCredential calls akp.user.v2.CloudCredentialService.DeleteCloudCredential. +func (c *cloudCredentialServiceClient) DeleteCloudCredential(ctx context.Context, req *connect.Request[v2.DeleteCloudCredentialRequest]) (*connect.Response[v2.DeleteCloudCredentialResponse], error) { + return c.deleteCloudCredential.CallUnary(ctx, req) +} + +// ListBuckets calls akp.user.v2.CloudCredentialService.ListBuckets. +func (c *cloudCredentialServiceClient) ListBuckets(ctx context.Context, req *connect.Request[v2.ListBucketsRequest]) (*connect.Response[v2.ListBucketsResponse], error) { + return c.listBuckets.CallUnary(ctx, req) +} + +// CloudCredentialServiceHandler is an implementation of the akp.user.v2.CloudCredentialService +// service. +type CloudCredentialServiceHandler interface { + ListCloudCredentials(context.Context, *connect.Request[v2.ListCloudCredentialsRequest]) (*connect.Response[v2.ListCloudCredentialsResponse], error) + GetCloudCredential(context.Context, *connect.Request[v2.GetCloudCredentialRequest]) (*connect.Response[v2.GetCloudCredentialResponse], error) + CreateCloudCredential(context.Context, *connect.Request[v2.CreateCloudCredentialRequest]) (*connect.Response[v2.CreateCloudCredentialResponse], error) + // UpdateCloudCredential replaces a credential, found by name. + UpdateCloudCredential(context.Context, *connect.Request[v2.UpdateCloudCredentialRequest]) (*connect.Response[v2.UpdateCloudCredentialResponse], error) + DeleteCloudCredential(context.Context, *connect.Request[v2.DeleteCloudCredentialRequest]) (*connect.Response[v2.DeleteCloudCredentialResponse], error) + // ListBuckets lists the buckets a cloud credential of the caller's, or a secret in one of the + // caller's clusters, can see. + ListBuckets(context.Context, *connect.Request[v2.ListBucketsRequest]) (*connect.Response[v2.ListBucketsResponse], error) +} + +// NewCloudCredentialServiceHandler 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 NewCloudCredentialServiceHandler(svc CloudCredentialServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + cloudCredentialServiceMethods := v2.File_akp_user_v2_cloud_proto.Services().ByName("CloudCredentialService").Methods() + cloudCredentialServiceListCloudCredentialsHandler := connect.NewUnaryHandler( + CloudCredentialServiceListCloudCredentialsProcedure, + svc.ListCloudCredentials, + connect.WithSchema(cloudCredentialServiceMethods.ByName("ListCloudCredentials")), + connect.WithHandlerOptions(opts...), + ) + cloudCredentialServiceGetCloudCredentialHandler := connect.NewUnaryHandler( + CloudCredentialServiceGetCloudCredentialProcedure, + svc.GetCloudCredential, + connect.WithSchema(cloudCredentialServiceMethods.ByName("GetCloudCredential")), + connect.WithHandlerOptions(opts...), + ) + cloudCredentialServiceCreateCloudCredentialHandler := connect.NewUnaryHandler( + CloudCredentialServiceCreateCloudCredentialProcedure, + svc.CreateCloudCredential, + connect.WithSchema(cloudCredentialServiceMethods.ByName("CreateCloudCredential")), + connect.WithHandlerOptions(opts...), + ) + cloudCredentialServiceUpdateCloudCredentialHandler := connect.NewUnaryHandler( + CloudCredentialServiceUpdateCloudCredentialProcedure, + svc.UpdateCloudCredential, + connect.WithSchema(cloudCredentialServiceMethods.ByName("UpdateCloudCredential")), + connect.WithHandlerOptions(opts...), + ) + cloudCredentialServiceDeleteCloudCredentialHandler := connect.NewUnaryHandler( + CloudCredentialServiceDeleteCloudCredentialProcedure, + svc.DeleteCloudCredential, + connect.WithSchema(cloudCredentialServiceMethods.ByName("DeleteCloudCredential")), + connect.WithHandlerOptions(opts...), + ) + cloudCredentialServiceListBucketsHandler := connect.NewUnaryHandler( + CloudCredentialServiceListBucketsProcedure, + svc.ListBuckets, + connect.WithSchema(cloudCredentialServiceMethods.ByName("ListBuckets")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.CloudCredentialService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case CloudCredentialServiceListCloudCredentialsProcedure: + cloudCredentialServiceListCloudCredentialsHandler.ServeHTTP(w, r) + case CloudCredentialServiceGetCloudCredentialProcedure: + cloudCredentialServiceGetCloudCredentialHandler.ServeHTTP(w, r) + case CloudCredentialServiceCreateCloudCredentialProcedure: + cloudCredentialServiceCreateCloudCredentialHandler.ServeHTTP(w, r) + case CloudCredentialServiceUpdateCloudCredentialProcedure: + cloudCredentialServiceUpdateCloudCredentialHandler.ServeHTTP(w, r) + case CloudCredentialServiceDeleteCloudCredentialProcedure: + cloudCredentialServiceDeleteCloudCredentialHandler.ServeHTTP(w, r) + case CloudCredentialServiceListBucketsProcedure: + cloudCredentialServiceListBucketsHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedCloudCredentialServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedCloudCredentialServiceHandler struct{} + +func (UnimplementedCloudCredentialServiceHandler) ListCloudCredentials(context.Context, *connect.Request[v2.ListCloudCredentialsRequest]) (*connect.Response[v2.ListCloudCredentialsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.CloudCredentialService.ListCloudCredentials is not implemented")) +} + +func (UnimplementedCloudCredentialServiceHandler) GetCloudCredential(context.Context, *connect.Request[v2.GetCloudCredentialRequest]) (*connect.Response[v2.GetCloudCredentialResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.CloudCredentialService.GetCloudCredential is not implemented")) +} + +func (UnimplementedCloudCredentialServiceHandler) CreateCloudCredential(context.Context, *connect.Request[v2.CreateCloudCredentialRequest]) (*connect.Response[v2.CreateCloudCredentialResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.CloudCredentialService.CreateCloudCredential is not implemented")) +} + +func (UnimplementedCloudCredentialServiceHandler) UpdateCloudCredential(context.Context, *connect.Request[v2.UpdateCloudCredentialRequest]) (*connect.Response[v2.UpdateCloudCredentialResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.CloudCredentialService.UpdateCloudCredential is not implemented")) +} + +func (UnimplementedCloudCredentialServiceHandler) DeleteCloudCredential(context.Context, *connect.Request[v2.DeleteCloudCredentialRequest]) (*connect.Response[v2.DeleteCloudCredentialResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.CloudCredentialService.DeleteCloudCredential is not implemented")) +} + +func (UnimplementedCloudCredentialServiceHandler) ListBuckets(context.Context, *connect.Request[v2.ListBucketsRequest]) (*connect.Response[v2.ListBucketsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.CloudCredentialService.ListBuckets is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/deploy.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/deploy.connect.go new file mode 100644 index 000000000..6c4bc6906 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/deploy.connect.go @@ -0,0 +1,239 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/user/v2/deploy.proto + +package userv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2" + 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 ( + // DeployOrderServiceName is the fully-qualified name of the DeployOrderService service. + DeployOrderServiceName = "akp.user.v2.DeployOrderService" +) + +// 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 ( + // DeployOrderServiceCreateOrderProcedure is the fully-qualified name of the DeployOrderService's + // CreateOrder RPC. + DeployOrderServiceCreateOrderProcedure = "/akp.user.v2.DeployOrderService/CreateOrder" + // DeployOrderServiceRenderOrderManifestProcedure is the fully-qualified name of the + // DeployOrderService's RenderOrderManifest RPC. + DeployOrderServiceRenderOrderManifestProcedure = "/akp.user.v2.DeployOrderService/RenderOrderManifest" + // DeployOrderServiceRenderOrderResourcesProcedure is the fully-qualified name of the + // DeployOrderService's RenderOrderResources RPC. + DeployOrderServiceRenderOrderResourcesProcedure = "/akp.user.v2.DeployOrderService/RenderOrderResources" + // DeployOrderServiceGetOrderHelmScriptProcedure is the fully-qualified name of the + // DeployOrderService's GetOrderHelmScript RPC. + DeployOrderServiceGetOrderHelmScriptProcedure = "/akp.user.v2.DeployOrderService/GetOrderHelmScript" + // DeployOrderServiceGetOrderYamlScriptProcedure is the fully-qualified name of the + // DeployOrderService's GetOrderYamlScript RPC. + DeployOrderServiceGetOrderYamlScriptProcedure = "/akp.user.v2.DeployOrderService/GetOrderYamlScript" +) + +// DeployOrderServiceClient is a client for the akp.user.v2.DeployOrderService service. +type DeployOrderServiceClient interface { + // CreateOrder stores an order under a new UID. + CreateOrder(context.Context, *connect.Request[v2.CreateOrderRequest]) (*connect.Response[v2.CreateOrderResponse], error) + RenderOrderManifest(context.Context, *connect.Request[v2.RenderOrderManifestRequest]) (*connect.Response[v2.RenderOrderManifestResponse], error) + RenderOrderResources(context.Context, *connect.Request[v2.RenderOrderResourcesRequest]) (*connect.Response[v2.RenderOrderResourcesResponse], error) + // GetOrderHelmScript is the Helm 3 script, per OS, that installs an order. + GetOrderHelmScript(context.Context, *connect.Request[v2.GetOrderHelmScriptRequest]) (*connect.Response[v2.GetOrderHelmScriptResponse], error) + // GetOrderYamlScript is the kubectl script, per OS, that installs an order. + GetOrderYamlScript(context.Context, *connect.Request[v2.GetOrderYamlScriptRequest]) (*connect.Response[v2.GetOrderYamlScriptResponse], error) +} + +// NewDeployOrderServiceClient constructs a client for the akp.user.v2.DeployOrderService 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 NewDeployOrderServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DeployOrderServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + deployOrderServiceMethods := v2.File_akp_user_v2_deploy_proto.Services().ByName("DeployOrderService").Methods() + return &deployOrderServiceClient{ + createOrder: connect.NewClient[v2.CreateOrderRequest, v2.CreateOrderResponse]( + httpClient, + baseURL+DeployOrderServiceCreateOrderProcedure, + connect.WithSchema(deployOrderServiceMethods.ByName("CreateOrder")), + connect.WithClientOptions(opts...), + ), + renderOrderManifest: connect.NewClient[v2.RenderOrderManifestRequest, v2.RenderOrderManifestResponse]( + httpClient, + baseURL+DeployOrderServiceRenderOrderManifestProcedure, + connect.WithSchema(deployOrderServiceMethods.ByName("RenderOrderManifest")), + connect.WithClientOptions(opts...), + ), + renderOrderResources: connect.NewClient[v2.RenderOrderResourcesRequest, v2.RenderOrderResourcesResponse]( + httpClient, + baseURL+DeployOrderServiceRenderOrderResourcesProcedure, + connect.WithSchema(deployOrderServiceMethods.ByName("RenderOrderResources")), + connect.WithClientOptions(opts...), + ), + getOrderHelmScript: connect.NewClient[v2.GetOrderHelmScriptRequest, v2.GetOrderHelmScriptResponse]( + httpClient, + baseURL+DeployOrderServiceGetOrderHelmScriptProcedure, + connect.WithSchema(deployOrderServiceMethods.ByName("GetOrderHelmScript")), + connect.WithClientOptions(opts...), + ), + getOrderYamlScript: connect.NewClient[v2.GetOrderYamlScriptRequest, v2.GetOrderYamlScriptResponse]( + httpClient, + baseURL+DeployOrderServiceGetOrderYamlScriptProcedure, + connect.WithSchema(deployOrderServiceMethods.ByName("GetOrderYamlScript")), + connect.WithClientOptions(opts...), + ), + } +} + +// deployOrderServiceClient implements DeployOrderServiceClient. +type deployOrderServiceClient struct { + createOrder *connect.Client[v2.CreateOrderRequest, v2.CreateOrderResponse] + renderOrderManifest *connect.Client[v2.RenderOrderManifestRequest, v2.RenderOrderManifestResponse] + renderOrderResources *connect.Client[v2.RenderOrderResourcesRequest, v2.RenderOrderResourcesResponse] + getOrderHelmScript *connect.Client[v2.GetOrderHelmScriptRequest, v2.GetOrderHelmScriptResponse] + getOrderYamlScript *connect.Client[v2.GetOrderYamlScriptRequest, v2.GetOrderYamlScriptResponse] +} + +// CreateOrder calls akp.user.v2.DeployOrderService.CreateOrder. +func (c *deployOrderServiceClient) CreateOrder(ctx context.Context, req *connect.Request[v2.CreateOrderRequest]) (*connect.Response[v2.CreateOrderResponse], error) { + return c.createOrder.CallUnary(ctx, req) +} + +// RenderOrderManifest calls akp.user.v2.DeployOrderService.RenderOrderManifest. +func (c *deployOrderServiceClient) RenderOrderManifest(ctx context.Context, req *connect.Request[v2.RenderOrderManifestRequest]) (*connect.Response[v2.RenderOrderManifestResponse], error) { + return c.renderOrderManifest.CallUnary(ctx, req) +} + +// RenderOrderResources calls akp.user.v2.DeployOrderService.RenderOrderResources. +func (c *deployOrderServiceClient) RenderOrderResources(ctx context.Context, req *connect.Request[v2.RenderOrderResourcesRequest]) (*connect.Response[v2.RenderOrderResourcesResponse], error) { + return c.renderOrderResources.CallUnary(ctx, req) +} + +// GetOrderHelmScript calls akp.user.v2.DeployOrderService.GetOrderHelmScript. +func (c *deployOrderServiceClient) GetOrderHelmScript(ctx context.Context, req *connect.Request[v2.GetOrderHelmScriptRequest]) (*connect.Response[v2.GetOrderHelmScriptResponse], error) { + return c.getOrderHelmScript.CallUnary(ctx, req) +} + +// GetOrderYamlScript calls akp.user.v2.DeployOrderService.GetOrderYamlScript. +func (c *deployOrderServiceClient) GetOrderYamlScript(ctx context.Context, req *connect.Request[v2.GetOrderYamlScriptRequest]) (*connect.Response[v2.GetOrderYamlScriptResponse], error) { + return c.getOrderYamlScript.CallUnary(ctx, req) +} + +// DeployOrderServiceHandler is an implementation of the akp.user.v2.DeployOrderService service. +type DeployOrderServiceHandler interface { + // CreateOrder stores an order under a new UID. + CreateOrder(context.Context, *connect.Request[v2.CreateOrderRequest]) (*connect.Response[v2.CreateOrderResponse], error) + RenderOrderManifest(context.Context, *connect.Request[v2.RenderOrderManifestRequest]) (*connect.Response[v2.RenderOrderManifestResponse], error) + RenderOrderResources(context.Context, *connect.Request[v2.RenderOrderResourcesRequest]) (*connect.Response[v2.RenderOrderResourcesResponse], error) + // GetOrderHelmScript is the Helm 3 script, per OS, that installs an order. + GetOrderHelmScript(context.Context, *connect.Request[v2.GetOrderHelmScriptRequest]) (*connect.Response[v2.GetOrderHelmScriptResponse], error) + // GetOrderYamlScript is the kubectl script, per OS, that installs an order. + GetOrderYamlScript(context.Context, *connect.Request[v2.GetOrderYamlScriptRequest]) (*connect.Response[v2.GetOrderYamlScriptResponse], error) +} + +// NewDeployOrderServiceHandler 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 NewDeployOrderServiceHandler(svc DeployOrderServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + deployOrderServiceMethods := v2.File_akp_user_v2_deploy_proto.Services().ByName("DeployOrderService").Methods() + deployOrderServiceCreateOrderHandler := connect.NewUnaryHandler( + DeployOrderServiceCreateOrderProcedure, + svc.CreateOrder, + connect.WithSchema(deployOrderServiceMethods.ByName("CreateOrder")), + connect.WithHandlerOptions(opts...), + ) + deployOrderServiceRenderOrderManifestHandler := connect.NewUnaryHandler( + DeployOrderServiceRenderOrderManifestProcedure, + svc.RenderOrderManifest, + connect.WithSchema(deployOrderServiceMethods.ByName("RenderOrderManifest")), + connect.WithHandlerOptions(opts...), + ) + deployOrderServiceRenderOrderResourcesHandler := connect.NewUnaryHandler( + DeployOrderServiceRenderOrderResourcesProcedure, + svc.RenderOrderResources, + connect.WithSchema(deployOrderServiceMethods.ByName("RenderOrderResources")), + connect.WithHandlerOptions(opts...), + ) + deployOrderServiceGetOrderHelmScriptHandler := connect.NewUnaryHandler( + DeployOrderServiceGetOrderHelmScriptProcedure, + svc.GetOrderHelmScript, + connect.WithSchema(deployOrderServiceMethods.ByName("GetOrderHelmScript")), + connect.WithHandlerOptions(opts...), + ) + deployOrderServiceGetOrderYamlScriptHandler := connect.NewUnaryHandler( + DeployOrderServiceGetOrderYamlScriptProcedure, + svc.GetOrderYamlScript, + connect.WithSchema(deployOrderServiceMethods.ByName("GetOrderYamlScript")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.DeployOrderService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case DeployOrderServiceCreateOrderProcedure: + deployOrderServiceCreateOrderHandler.ServeHTTP(w, r) + case DeployOrderServiceRenderOrderManifestProcedure: + deployOrderServiceRenderOrderManifestHandler.ServeHTTP(w, r) + case DeployOrderServiceRenderOrderResourcesProcedure: + deployOrderServiceRenderOrderResourcesHandler.ServeHTTP(w, r) + case DeployOrderServiceGetOrderHelmScriptProcedure: + deployOrderServiceGetOrderHelmScriptHandler.ServeHTTP(w, r) + case DeployOrderServiceGetOrderYamlScriptProcedure: + deployOrderServiceGetOrderYamlScriptHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedDeployOrderServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedDeployOrderServiceHandler struct{} + +func (UnimplementedDeployOrderServiceHandler) CreateOrder(context.Context, *connect.Request[v2.CreateOrderRequest]) (*connect.Response[v2.CreateOrderResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.DeployOrderService.CreateOrder is not implemented")) +} + +func (UnimplementedDeployOrderServiceHandler) RenderOrderManifest(context.Context, *connect.Request[v2.RenderOrderManifestRequest]) (*connect.Response[v2.RenderOrderManifestResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.DeployOrderService.RenderOrderManifest is not implemented")) +} + +func (UnimplementedDeployOrderServiceHandler) RenderOrderResources(context.Context, *connect.Request[v2.RenderOrderResourcesRequest]) (*connect.Response[v2.RenderOrderResourcesResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.DeployOrderService.RenderOrderResources is not implemented")) +} + +func (UnimplementedDeployOrderServiceHandler) GetOrderHelmScript(context.Context, *connect.Request[v2.GetOrderHelmScriptRequest]) (*connect.Response[v2.GetOrderHelmScriptResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.DeployOrderService.GetOrderHelmScript is not implemented")) +} + +func (UnimplementedDeployOrderServiceHandler) GetOrderYamlScript(context.Context, *connect.Request[v2.GetOrderYamlScriptRequest]) (*connect.Response[v2.GetOrderYamlScriptResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.DeployOrderService.GetOrderYamlScript is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/nats.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/nats.connect.go new file mode 100644 index 000000000..8468d6e33 --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/nats.connect.go @@ -0,0 +1,212 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/user/v2/nats.proto + +package userv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2" + 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 ( + // NatsServiceName is the fully-qualified name of the NatsService service. + NatsServiceName = "akp.user.v2.NatsService" +) + +// 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 ( + // NatsServiceGetNatsCredentialsProcedure is the fully-qualified name of the NatsService's + // GetNatsCredentials RPC. + NatsServiceGetNatsCredentialsProcedure = "/akp.user.v2.NatsService/GetNatsCredentials" + // NatsServiceGetNatsAdminCredentialsProcedure is the fully-qualified name of the NatsService's + // GetNatsAdminCredentials RPC. + NatsServiceGetNatsAdminCredentialsProcedure = "/akp.user.v2.NatsService/GetNatsAdminCredentials" + // NatsServiceGetNatsUserCredentialsProcedure is the fully-qualified name of the NatsService's + // GetNatsUserCredentials RPC. + NatsServiceGetNatsUserCredentialsProcedure = "/akp.user.v2.NatsService/GetNatsUserCredentials" + // NatsServiceGetClusterResourceHistoryProcedure is the fully-qualified name of the NatsService's + // GetClusterResourceHistory RPC. + NatsServiceGetClusterResourceHistoryProcedure = "/akp.user.v2.NatsService/GetClusterResourceHistory" +) + +// NatsServiceClient is a client for the akp.user.v2.NatsService service. +type NatsServiceClient interface { + GetNatsCredentials(context.Context, *connect.Request[v2.GetNatsCredentialsRequest]) (*connect.Response[v2.GetNatsCredentialsResponse], error) + // GetNatsAdminCredentials needs a site admin. + GetNatsAdminCredentials(context.Context, *connect.Request[v2.GetNatsAdminCredentialsRequest]) (*connect.Response[v2.GetNatsAdminCredentialsResponse], error) + // GetNatsUserCredentials needs a site admin. + GetNatsUserCredentials(context.Context, *connect.Request[v2.GetNatsUserCredentialsRequest]) (*connect.Response[v2.GetNatsUserCredentialsResponse], error) + // GetClusterResourceHistory asks a user's cluster for its resource history. It needs a site + // admin. + GetClusterResourceHistory(context.Context, *connect.Request[v2.GetClusterResourceHistoryRequest]) (*connect.Response[v2.GetClusterResourceHistoryResponse], error) +} + +// NewNatsServiceClient constructs a client for the akp.user.v2.NatsService 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 NewNatsServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) NatsServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + natsServiceMethods := v2.File_akp_user_v2_nats_proto.Services().ByName("NatsService").Methods() + return &natsServiceClient{ + getNatsCredentials: connect.NewClient[v2.GetNatsCredentialsRequest, v2.GetNatsCredentialsResponse]( + httpClient, + baseURL+NatsServiceGetNatsCredentialsProcedure, + connect.WithSchema(natsServiceMethods.ByName("GetNatsCredentials")), + connect.WithClientOptions(opts...), + ), + getNatsAdminCredentials: connect.NewClient[v2.GetNatsAdminCredentialsRequest, v2.GetNatsAdminCredentialsResponse]( + httpClient, + baseURL+NatsServiceGetNatsAdminCredentialsProcedure, + connect.WithSchema(natsServiceMethods.ByName("GetNatsAdminCredentials")), + connect.WithClientOptions(opts...), + ), + getNatsUserCredentials: connect.NewClient[v2.GetNatsUserCredentialsRequest, v2.GetNatsUserCredentialsResponse]( + httpClient, + baseURL+NatsServiceGetNatsUserCredentialsProcedure, + connect.WithSchema(natsServiceMethods.ByName("GetNatsUserCredentials")), + connect.WithClientOptions(opts...), + ), + getClusterResourceHistory: connect.NewClient[v2.GetClusterResourceHistoryRequest, v2.GetClusterResourceHistoryResponse]( + httpClient, + baseURL+NatsServiceGetClusterResourceHistoryProcedure, + connect.WithSchema(natsServiceMethods.ByName("GetClusterResourceHistory")), + connect.WithClientOptions(opts...), + ), + } +} + +// natsServiceClient implements NatsServiceClient. +type natsServiceClient struct { + getNatsCredentials *connect.Client[v2.GetNatsCredentialsRequest, v2.GetNatsCredentialsResponse] + getNatsAdminCredentials *connect.Client[v2.GetNatsAdminCredentialsRequest, v2.GetNatsAdminCredentialsResponse] + getNatsUserCredentials *connect.Client[v2.GetNatsUserCredentialsRequest, v2.GetNatsUserCredentialsResponse] + getClusterResourceHistory *connect.Client[v2.GetClusterResourceHistoryRequest, v2.GetClusterResourceHistoryResponse] +} + +// GetNatsCredentials calls akp.user.v2.NatsService.GetNatsCredentials. +func (c *natsServiceClient) GetNatsCredentials(ctx context.Context, req *connect.Request[v2.GetNatsCredentialsRequest]) (*connect.Response[v2.GetNatsCredentialsResponse], error) { + return c.getNatsCredentials.CallUnary(ctx, req) +} + +// GetNatsAdminCredentials calls akp.user.v2.NatsService.GetNatsAdminCredentials. +func (c *natsServiceClient) GetNatsAdminCredentials(ctx context.Context, req *connect.Request[v2.GetNatsAdminCredentialsRequest]) (*connect.Response[v2.GetNatsAdminCredentialsResponse], error) { + return c.getNatsAdminCredentials.CallUnary(ctx, req) +} + +// GetNatsUserCredentials calls akp.user.v2.NatsService.GetNatsUserCredentials. +func (c *natsServiceClient) GetNatsUserCredentials(ctx context.Context, req *connect.Request[v2.GetNatsUserCredentialsRequest]) (*connect.Response[v2.GetNatsUserCredentialsResponse], error) { + return c.getNatsUserCredentials.CallUnary(ctx, req) +} + +// GetClusterResourceHistory calls akp.user.v2.NatsService.GetClusterResourceHistory. +func (c *natsServiceClient) GetClusterResourceHistory(ctx context.Context, req *connect.Request[v2.GetClusterResourceHistoryRequest]) (*connect.Response[v2.GetClusterResourceHistoryResponse], error) { + return c.getClusterResourceHistory.CallUnary(ctx, req) +} + +// NatsServiceHandler is an implementation of the akp.user.v2.NatsService service. +type NatsServiceHandler interface { + GetNatsCredentials(context.Context, *connect.Request[v2.GetNatsCredentialsRequest]) (*connect.Response[v2.GetNatsCredentialsResponse], error) + // GetNatsAdminCredentials needs a site admin. + GetNatsAdminCredentials(context.Context, *connect.Request[v2.GetNatsAdminCredentialsRequest]) (*connect.Response[v2.GetNatsAdminCredentialsResponse], error) + // GetNatsUserCredentials needs a site admin. + GetNatsUserCredentials(context.Context, *connect.Request[v2.GetNatsUserCredentialsRequest]) (*connect.Response[v2.GetNatsUserCredentialsResponse], error) + // GetClusterResourceHistory asks a user's cluster for its resource history. It needs a site + // admin. + GetClusterResourceHistory(context.Context, *connect.Request[v2.GetClusterResourceHistoryRequest]) (*connect.Response[v2.GetClusterResourceHistoryResponse], error) +} + +// NewNatsServiceHandler 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 NewNatsServiceHandler(svc NatsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + natsServiceMethods := v2.File_akp_user_v2_nats_proto.Services().ByName("NatsService").Methods() + natsServiceGetNatsCredentialsHandler := connect.NewUnaryHandler( + NatsServiceGetNatsCredentialsProcedure, + svc.GetNatsCredentials, + connect.WithSchema(natsServiceMethods.ByName("GetNatsCredentials")), + connect.WithHandlerOptions(opts...), + ) + natsServiceGetNatsAdminCredentialsHandler := connect.NewUnaryHandler( + NatsServiceGetNatsAdminCredentialsProcedure, + svc.GetNatsAdminCredentials, + connect.WithSchema(natsServiceMethods.ByName("GetNatsAdminCredentials")), + connect.WithHandlerOptions(opts...), + ) + natsServiceGetNatsUserCredentialsHandler := connect.NewUnaryHandler( + NatsServiceGetNatsUserCredentialsProcedure, + svc.GetNatsUserCredentials, + connect.WithSchema(natsServiceMethods.ByName("GetNatsUserCredentials")), + connect.WithHandlerOptions(opts...), + ) + natsServiceGetClusterResourceHistoryHandler := connect.NewUnaryHandler( + NatsServiceGetClusterResourceHistoryProcedure, + svc.GetClusterResourceHistory, + connect.WithSchema(natsServiceMethods.ByName("GetClusterResourceHistory")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.NatsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case NatsServiceGetNatsCredentialsProcedure: + natsServiceGetNatsCredentialsHandler.ServeHTTP(w, r) + case NatsServiceGetNatsAdminCredentialsProcedure: + natsServiceGetNatsAdminCredentialsHandler.ServeHTTP(w, r) + case NatsServiceGetNatsUserCredentialsProcedure: + natsServiceGetNatsUserCredentialsHandler.ServeHTTP(w, r) + case NatsServiceGetClusterResourceHistoryProcedure: + natsServiceGetClusterResourceHistoryHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedNatsServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedNatsServiceHandler struct{} + +func (UnimplementedNatsServiceHandler) GetNatsCredentials(context.Context, *connect.Request[v2.GetNatsCredentialsRequest]) (*connect.Response[v2.GetNatsCredentialsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.NatsService.GetNatsCredentials is not implemented")) +} + +func (UnimplementedNatsServiceHandler) GetNatsAdminCredentials(context.Context, *connect.Request[v2.GetNatsAdminCredentialsRequest]) (*connect.Response[v2.GetNatsAdminCredentialsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.NatsService.GetNatsAdminCredentials is not implemented")) +} + +func (UnimplementedNatsServiceHandler) GetNatsUserCredentials(context.Context, *connect.Request[v2.GetNatsUserCredentialsRequest]) (*connect.Response[v2.GetNatsUserCredentialsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.NatsService.GetNatsUserCredentials is not implemented")) +} + +func (UnimplementedNatsServiceHandler) GetClusterResourceHistory(context.Context, *connect.Request[v2.GetClusterResourceHistoryRequest]) (*connect.Response[v2.GetClusterResourceHistoryResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.NatsService.GetClusterResourceHistory is not implemented")) +} diff --git a/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/user.connect.go b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/user.connect.go new file mode 100644 index 000000000..cc0d4f35b --- /dev/null +++ b/vendor/go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect/user.connect.go @@ -0,0 +1,887 @@ +// Copyright AppsCode Inc. and Contributors +// +// Licensed under the AppsCode Community License 1.0.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: akp/user/v2/user.proto + +package userv2connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v2 "go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2" + 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 ( + // UserServiceName is the fully-qualified name of the UserService service. + UserServiceName = "akp.user.v2.UserService" + // FollowServiceName is the fully-qualified name of the FollowService service. + FollowServiceName = "akp.user.v2.FollowService" + // EmailServiceName is the fully-qualified name of the EmailService service. + EmailServiceName = "akp.user.v2.EmailService" + // AccessTokenServiceName is the fully-qualified name of the AccessTokenService service. + AccessTokenServiceName = "akp.user.v2.AccessTokenService" +) + +// 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 ( + // UserServiceSearchUsersProcedure is the fully-qualified name of the UserService's SearchUsers RPC. + UserServiceSearchUsersProcedure = "/akp.user.v2.UserService/SearchUsers" + // UserServiceGetUserProcedure is the fully-qualified name of the UserService's GetUser RPC. + UserServiceGetUserProcedure = "/akp.user.v2.UserService/GetUser" + // UserServiceGetAuthenticatedUserProcedure is the fully-qualified name of the UserService's + // GetAuthenticatedUser RPC. + UserServiceGetAuthenticatedUserProcedure = "/akp.user.v2.UserService/GetAuthenticatedUser" + // UserServiceListTeamsProcedure is the fully-qualified name of the UserService's ListTeams RPC. + UserServiceListTeamsProcedure = "/akp.user.v2.UserService/ListTeams" + // UserServiceListClustersProcedure is the fully-qualified name of the UserService's ListClusters + // RPC. + UserServiceListClustersProcedure = "/akp.user.v2.UserService/ListClusters" + // UserServiceListInboxSubscriptionsProcedure is the fully-qualified name of the UserService's + // ListInboxSubscriptions RPC. + UserServiceListInboxSubscriptionsProcedure = "/akp.user.v2.UserService/ListInboxSubscriptions" + // UserServiceGetFirebaseTokenProcedure is the fully-qualified name of the UserService's + // GetFirebaseToken RPC. + UserServiceGetFirebaseTokenProcedure = "/akp.user.v2.UserService/GetFirebaseToken" + // UserServiceGetLoginMethodProcedure is the fully-qualified name of the UserService's + // GetLoginMethod RPC. + UserServiceGetLoginMethodProcedure = "/akp.user.v2.UserService/GetLoginMethod" + // UserServiceValidateUsernameProcedure is the fully-qualified name of the UserService's + // ValidateUsername RPC. + UserServiceValidateUsernameProcedure = "/akp.user.v2.UserService/ValidateUsername" + // UserServiceValidateOrganizationNameProcedure is the fully-qualified name of the UserService's + // ValidateOrganizationName RPC. + UserServiceValidateOrganizationNameProcedure = "/akp.user.v2.UserService/ValidateOrganizationName" + // UserServiceValidateEmailProcedure is the fully-qualified name of the UserService's ValidateEmail + // RPC. + UserServiceValidateEmailProcedure = "/akp.user.v2.UserService/ValidateEmail" + // FollowServiceListFollowersProcedure is the fully-qualified name of the FollowService's + // ListFollowers RPC. + FollowServiceListFollowersProcedure = "/akp.user.v2.FollowService/ListFollowers" + // FollowServiceListFollowingProcedure is the fully-qualified name of the FollowService's + // ListFollowing RPC. + FollowServiceListFollowingProcedure = "/akp.user.v2.FollowService/ListFollowing" + // FollowServiceCheckFollowingProcedure is the fully-qualified name of the FollowService's + // CheckFollowing RPC. + FollowServiceCheckFollowingProcedure = "/akp.user.v2.FollowService/CheckFollowing" + // FollowServiceFollowUserProcedure is the fully-qualified name of the FollowService's FollowUser + // RPC. + FollowServiceFollowUserProcedure = "/akp.user.v2.FollowService/FollowUser" + // FollowServiceUnfollowUserProcedure is the fully-qualified name of the FollowService's + // UnfollowUser RPC. + FollowServiceUnfollowUserProcedure = "/akp.user.v2.FollowService/UnfollowUser" + // EmailServiceListEmailsProcedure is the fully-qualified name of the EmailService's ListEmails RPC. + EmailServiceListEmailsProcedure = "/akp.user.v2.EmailService/ListEmails" + // EmailServiceAddEmailsProcedure is the fully-qualified name of the EmailService's AddEmails RPC. + EmailServiceAddEmailsProcedure = "/akp.user.v2.EmailService/AddEmails" + // EmailServiceDeleteEmailsProcedure is the fully-qualified name of the EmailService's DeleteEmails + // RPC. + EmailServiceDeleteEmailsProcedure = "/akp.user.v2.EmailService/DeleteEmails" + // AccessTokenServiceListAccessTokensProcedure is the fully-qualified name of the + // AccessTokenService's ListAccessTokens RPC. + AccessTokenServiceListAccessTokensProcedure = "/akp.user.v2.AccessTokenService/ListAccessTokens" + // AccessTokenServiceCreateAccessTokenProcedure is the fully-qualified name of the + // AccessTokenService's CreateAccessToken RPC. + AccessTokenServiceCreateAccessTokenProcedure = "/akp.user.v2.AccessTokenService/CreateAccessToken" + // AccessTokenServiceDeleteAccessTokenProcedure is the fully-qualified name of the + // AccessTokenService's DeleteAccessToken RPC. + AccessTokenServiceDeleteAccessTokenProcedure = "/akp.user.v2.AccessTokenService/DeleteAccessToken" +) + +// UserServiceClient is a client for the akp.user.v2.UserService service. +type UserServiceClient interface { + // SearchUsers finds individual users by keyword or ID. It needs no sign-in. + SearchUsers(context.Context, *connect.Request[v2.SearchUsersRequest]) (*connect.Response[v2.SearchUsersResponse], error) + // GetUser needs no sign-in; what it shows depends on who asks. + GetUser(context.Context, *connect.Request[v2.GetUserRequest]) (*connect.Response[v2.GetUserResponse], error) + GetAuthenticatedUser(context.Context, *connect.Request[v2.GetAuthenticatedUserRequest]) (*connect.Response[v2.GetAuthenticatedUserResponse], error) + // ListTeams lists the teams the caller is in. + ListTeams(context.Context, *connect.Request[v2.ListTeamsRequest]) (*connect.Response[v2.ListTeamsResponse], error) + // ListClusters lists the clusters the caller owns or, with all, has access to. + ListClusters(context.Context, *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) + ListInboxSubscriptions(context.Context, *connect.Request[v2.ListInboxSubscriptionsRequest]) (*connect.Response[v2.ListInboxSubscriptionsResponse], error) + // GetFirebaseToken is AppsCode-hosted only. + GetFirebaseToken(context.Context, *connect.Request[v2.GetFirebaseTokenRequest]) (*connect.Response[v2.GetFirebaseTokenResponse], error) + // GetLoginMethod answers, before sign-in, whether to sign in with a password or through an + // organization's SSO. It needs no sign-in. + GetLoginMethod(context.Context, *connect.Request[v2.GetLoginMethodRequest]) (*connect.Response[v2.GetLoginMethodResponse], error) + // ValidateUsername answers whether the caller may rename themselves to a name. + ValidateUsername(context.Context, *connect.Request[v2.ValidateUsernameRequest]) (*connect.Response[v2.ValidateUsernameResponse], error) + // ValidateOrganizationName answers whether a new organization, or one the caller owns, may + // take a name. + ValidateOrganizationName(context.Context, *connect.Request[v2.ValidateOrganizationNameRequest]) (*connect.Response[v2.ValidateOrganizationNameResponse], error) + // ValidateEmail answers whether the caller may take an email address. + ValidateEmail(context.Context, *connect.Request[v2.ValidateEmailRequest]) (*connect.Response[v2.ValidateEmailResponse], error) +} + +// NewUserServiceClient constructs a client for the akp.user.v2.UserService 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 NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) UserServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + userServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("UserService").Methods() + return &userServiceClient{ + searchUsers: connect.NewClient[v2.SearchUsersRequest, v2.SearchUsersResponse]( + httpClient, + baseURL+UserServiceSearchUsersProcedure, + connect.WithSchema(userServiceMethods.ByName("SearchUsers")), + connect.WithClientOptions(opts...), + ), + getUser: connect.NewClient[v2.GetUserRequest, v2.GetUserResponse]( + httpClient, + baseURL+UserServiceGetUserProcedure, + connect.WithSchema(userServiceMethods.ByName("GetUser")), + connect.WithClientOptions(opts...), + ), + getAuthenticatedUser: connect.NewClient[v2.GetAuthenticatedUserRequest, v2.GetAuthenticatedUserResponse]( + httpClient, + baseURL+UserServiceGetAuthenticatedUserProcedure, + connect.WithSchema(userServiceMethods.ByName("GetAuthenticatedUser")), + connect.WithClientOptions(opts...), + ), + listTeams: connect.NewClient[v2.ListTeamsRequest, v2.ListTeamsResponse]( + httpClient, + baseURL+UserServiceListTeamsProcedure, + connect.WithSchema(userServiceMethods.ByName("ListTeams")), + connect.WithClientOptions(opts...), + ), + listClusters: connect.NewClient[v2.ListClustersRequest, v2.ListClustersResponse]( + httpClient, + baseURL+UserServiceListClustersProcedure, + connect.WithSchema(userServiceMethods.ByName("ListClusters")), + connect.WithClientOptions(opts...), + ), + listInboxSubscriptions: connect.NewClient[v2.ListInboxSubscriptionsRequest, v2.ListInboxSubscriptionsResponse]( + httpClient, + baseURL+UserServiceListInboxSubscriptionsProcedure, + connect.WithSchema(userServiceMethods.ByName("ListInboxSubscriptions")), + connect.WithClientOptions(opts...), + ), + getFirebaseToken: connect.NewClient[v2.GetFirebaseTokenRequest, v2.GetFirebaseTokenResponse]( + httpClient, + baseURL+UserServiceGetFirebaseTokenProcedure, + connect.WithSchema(userServiceMethods.ByName("GetFirebaseToken")), + connect.WithClientOptions(opts...), + ), + getLoginMethod: connect.NewClient[v2.GetLoginMethodRequest, v2.GetLoginMethodResponse]( + httpClient, + baseURL+UserServiceGetLoginMethodProcedure, + connect.WithSchema(userServiceMethods.ByName("GetLoginMethod")), + connect.WithClientOptions(opts...), + ), + validateUsername: connect.NewClient[v2.ValidateUsernameRequest, v2.ValidateUsernameResponse]( + httpClient, + baseURL+UserServiceValidateUsernameProcedure, + connect.WithSchema(userServiceMethods.ByName("ValidateUsername")), + connect.WithClientOptions(opts...), + ), + validateOrganizationName: connect.NewClient[v2.ValidateOrganizationNameRequest, v2.ValidateOrganizationNameResponse]( + httpClient, + baseURL+UserServiceValidateOrganizationNameProcedure, + connect.WithSchema(userServiceMethods.ByName("ValidateOrganizationName")), + connect.WithClientOptions(opts...), + ), + validateEmail: connect.NewClient[v2.ValidateEmailRequest, v2.ValidateEmailResponse]( + httpClient, + baseURL+UserServiceValidateEmailProcedure, + connect.WithSchema(userServiceMethods.ByName("ValidateEmail")), + connect.WithClientOptions(opts...), + ), + } +} + +// userServiceClient implements UserServiceClient. +type userServiceClient struct { + searchUsers *connect.Client[v2.SearchUsersRequest, v2.SearchUsersResponse] + getUser *connect.Client[v2.GetUserRequest, v2.GetUserResponse] + getAuthenticatedUser *connect.Client[v2.GetAuthenticatedUserRequest, v2.GetAuthenticatedUserResponse] + listTeams *connect.Client[v2.ListTeamsRequest, v2.ListTeamsResponse] + listClusters *connect.Client[v2.ListClustersRequest, v2.ListClustersResponse] + listInboxSubscriptions *connect.Client[v2.ListInboxSubscriptionsRequest, v2.ListInboxSubscriptionsResponse] + getFirebaseToken *connect.Client[v2.GetFirebaseTokenRequest, v2.GetFirebaseTokenResponse] + getLoginMethod *connect.Client[v2.GetLoginMethodRequest, v2.GetLoginMethodResponse] + validateUsername *connect.Client[v2.ValidateUsernameRequest, v2.ValidateUsernameResponse] + validateOrganizationName *connect.Client[v2.ValidateOrganizationNameRequest, v2.ValidateOrganizationNameResponse] + validateEmail *connect.Client[v2.ValidateEmailRequest, v2.ValidateEmailResponse] +} + +// SearchUsers calls akp.user.v2.UserService.SearchUsers. +func (c *userServiceClient) SearchUsers(ctx context.Context, req *connect.Request[v2.SearchUsersRequest]) (*connect.Response[v2.SearchUsersResponse], error) { + return c.searchUsers.CallUnary(ctx, req) +} + +// GetUser calls akp.user.v2.UserService.GetUser. +func (c *userServiceClient) GetUser(ctx context.Context, req *connect.Request[v2.GetUserRequest]) (*connect.Response[v2.GetUserResponse], error) { + return c.getUser.CallUnary(ctx, req) +} + +// GetAuthenticatedUser calls akp.user.v2.UserService.GetAuthenticatedUser. +func (c *userServiceClient) GetAuthenticatedUser(ctx context.Context, req *connect.Request[v2.GetAuthenticatedUserRequest]) (*connect.Response[v2.GetAuthenticatedUserResponse], error) { + return c.getAuthenticatedUser.CallUnary(ctx, req) +} + +// ListTeams calls akp.user.v2.UserService.ListTeams. +func (c *userServiceClient) ListTeams(ctx context.Context, req *connect.Request[v2.ListTeamsRequest]) (*connect.Response[v2.ListTeamsResponse], error) { + return c.listTeams.CallUnary(ctx, req) +} + +// ListClusters calls akp.user.v2.UserService.ListClusters. +func (c *userServiceClient) ListClusters(ctx context.Context, req *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) { + return c.listClusters.CallUnary(ctx, req) +} + +// ListInboxSubscriptions calls akp.user.v2.UserService.ListInboxSubscriptions. +func (c *userServiceClient) ListInboxSubscriptions(ctx context.Context, req *connect.Request[v2.ListInboxSubscriptionsRequest]) (*connect.Response[v2.ListInboxSubscriptionsResponse], error) { + return c.listInboxSubscriptions.CallUnary(ctx, req) +} + +// GetFirebaseToken calls akp.user.v2.UserService.GetFirebaseToken. +func (c *userServiceClient) GetFirebaseToken(ctx context.Context, req *connect.Request[v2.GetFirebaseTokenRequest]) (*connect.Response[v2.GetFirebaseTokenResponse], error) { + return c.getFirebaseToken.CallUnary(ctx, req) +} + +// GetLoginMethod calls akp.user.v2.UserService.GetLoginMethod. +func (c *userServiceClient) GetLoginMethod(ctx context.Context, req *connect.Request[v2.GetLoginMethodRequest]) (*connect.Response[v2.GetLoginMethodResponse], error) { + return c.getLoginMethod.CallUnary(ctx, req) +} + +// ValidateUsername calls akp.user.v2.UserService.ValidateUsername. +func (c *userServiceClient) ValidateUsername(ctx context.Context, req *connect.Request[v2.ValidateUsernameRequest]) (*connect.Response[v2.ValidateUsernameResponse], error) { + return c.validateUsername.CallUnary(ctx, req) +} + +// ValidateOrganizationName calls akp.user.v2.UserService.ValidateOrganizationName. +func (c *userServiceClient) ValidateOrganizationName(ctx context.Context, req *connect.Request[v2.ValidateOrganizationNameRequest]) (*connect.Response[v2.ValidateOrganizationNameResponse], error) { + return c.validateOrganizationName.CallUnary(ctx, req) +} + +// ValidateEmail calls akp.user.v2.UserService.ValidateEmail. +func (c *userServiceClient) ValidateEmail(ctx context.Context, req *connect.Request[v2.ValidateEmailRequest]) (*connect.Response[v2.ValidateEmailResponse], error) { + return c.validateEmail.CallUnary(ctx, req) +} + +// UserServiceHandler is an implementation of the akp.user.v2.UserService service. +type UserServiceHandler interface { + // SearchUsers finds individual users by keyword or ID. It needs no sign-in. + SearchUsers(context.Context, *connect.Request[v2.SearchUsersRequest]) (*connect.Response[v2.SearchUsersResponse], error) + // GetUser needs no sign-in; what it shows depends on who asks. + GetUser(context.Context, *connect.Request[v2.GetUserRequest]) (*connect.Response[v2.GetUserResponse], error) + GetAuthenticatedUser(context.Context, *connect.Request[v2.GetAuthenticatedUserRequest]) (*connect.Response[v2.GetAuthenticatedUserResponse], error) + // ListTeams lists the teams the caller is in. + ListTeams(context.Context, *connect.Request[v2.ListTeamsRequest]) (*connect.Response[v2.ListTeamsResponse], error) + // ListClusters lists the clusters the caller owns or, with all, has access to. + ListClusters(context.Context, *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) + ListInboxSubscriptions(context.Context, *connect.Request[v2.ListInboxSubscriptionsRequest]) (*connect.Response[v2.ListInboxSubscriptionsResponse], error) + // GetFirebaseToken is AppsCode-hosted only. + GetFirebaseToken(context.Context, *connect.Request[v2.GetFirebaseTokenRequest]) (*connect.Response[v2.GetFirebaseTokenResponse], error) + // GetLoginMethod answers, before sign-in, whether to sign in with a password or through an + // organization's SSO. It needs no sign-in. + GetLoginMethod(context.Context, *connect.Request[v2.GetLoginMethodRequest]) (*connect.Response[v2.GetLoginMethodResponse], error) + // ValidateUsername answers whether the caller may rename themselves to a name. + ValidateUsername(context.Context, *connect.Request[v2.ValidateUsernameRequest]) (*connect.Response[v2.ValidateUsernameResponse], error) + // ValidateOrganizationName answers whether a new organization, or one the caller owns, may + // take a name. + ValidateOrganizationName(context.Context, *connect.Request[v2.ValidateOrganizationNameRequest]) (*connect.Response[v2.ValidateOrganizationNameResponse], error) + // ValidateEmail answers whether the caller may take an email address. + ValidateEmail(context.Context, *connect.Request[v2.ValidateEmailRequest]) (*connect.Response[v2.ValidateEmailResponse], error) +} + +// NewUserServiceHandler 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 NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + userServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("UserService").Methods() + userServiceSearchUsersHandler := connect.NewUnaryHandler( + UserServiceSearchUsersProcedure, + svc.SearchUsers, + connect.WithSchema(userServiceMethods.ByName("SearchUsers")), + connect.WithHandlerOptions(opts...), + ) + userServiceGetUserHandler := connect.NewUnaryHandler( + UserServiceGetUserProcedure, + svc.GetUser, + connect.WithSchema(userServiceMethods.ByName("GetUser")), + connect.WithHandlerOptions(opts...), + ) + userServiceGetAuthenticatedUserHandler := connect.NewUnaryHandler( + UserServiceGetAuthenticatedUserProcedure, + svc.GetAuthenticatedUser, + connect.WithSchema(userServiceMethods.ByName("GetAuthenticatedUser")), + connect.WithHandlerOptions(opts...), + ) + userServiceListTeamsHandler := connect.NewUnaryHandler( + UserServiceListTeamsProcedure, + svc.ListTeams, + connect.WithSchema(userServiceMethods.ByName("ListTeams")), + connect.WithHandlerOptions(opts...), + ) + userServiceListClustersHandler := connect.NewUnaryHandler( + UserServiceListClustersProcedure, + svc.ListClusters, + connect.WithSchema(userServiceMethods.ByName("ListClusters")), + connect.WithHandlerOptions(opts...), + ) + userServiceListInboxSubscriptionsHandler := connect.NewUnaryHandler( + UserServiceListInboxSubscriptionsProcedure, + svc.ListInboxSubscriptions, + connect.WithSchema(userServiceMethods.ByName("ListInboxSubscriptions")), + connect.WithHandlerOptions(opts...), + ) + userServiceGetFirebaseTokenHandler := connect.NewUnaryHandler( + UserServiceGetFirebaseTokenProcedure, + svc.GetFirebaseToken, + connect.WithSchema(userServiceMethods.ByName("GetFirebaseToken")), + connect.WithHandlerOptions(opts...), + ) + userServiceGetLoginMethodHandler := connect.NewUnaryHandler( + UserServiceGetLoginMethodProcedure, + svc.GetLoginMethod, + connect.WithSchema(userServiceMethods.ByName("GetLoginMethod")), + connect.WithHandlerOptions(opts...), + ) + userServiceValidateUsernameHandler := connect.NewUnaryHandler( + UserServiceValidateUsernameProcedure, + svc.ValidateUsername, + connect.WithSchema(userServiceMethods.ByName("ValidateUsername")), + connect.WithHandlerOptions(opts...), + ) + userServiceValidateOrganizationNameHandler := connect.NewUnaryHandler( + UserServiceValidateOrganizationNameProcedure, + svc.ValidateOrganizationName, + connect.WithSchema(userServiceMethods.ByName("ValidateOrganizationName")), + connect.WithHandlerOptions(opts...), + ) + userServiceValidateEmailHandler := connect.NewUnaryHandler( + UserServiceValidateEmailProcedure, + svc.ValidateEmail, + connect.WithSchema(userServiceMethods.ByName("ValidateEmail")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.UserService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case UserServiceSearchUsersProcedure: + userServiceSearchUsersHandler.ServeHTTP(w, r) + case UserServiceGetUserProcedure: + userServiceGetUserHandler.ServeHTTP(w, r) + case UserServiceGetAuthenticatedUserProcedure: + userServiceGetAuthenticatedUserHandler.ServeHTTP(w, r) + case UserServiceListTeamsProcedure: + userServiceListTeamsHandler.ServeHTTP(w, r) + case UserServiceListClustersProcedure: + userServiceListClustersHandler.ServeHTTP(w, r) + case UserServiceListInboxSubscriptionsProcedure: + userServiceListInboxSubscriptionsHandler.ServeHTTP(w, r) + case UserServiceGetFirebaseTokenProcedure: + userServiceGetFirebaseTokenHandler.ServeHTTP(w, r) + case UserServiceGetLoginMethodProcedure: + userServiceGetLoginMethodHandler.ServeHTTP(w, r) + case UserServiceValidateUsernameProcedure: + userServiceValidateUsernameHandler.ServeHTTP(w, r) + case UserServiceValidateOrganizationNameProcedure: + userServiceValidateOrganizationNameHandler.ServeHTTP(w, r) + case UserServiceValidateEmailProcedure: + userServiceValidateEmailHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedUserServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedUserServiceHandler struct{} + +func (UnimplementedUserServiceHandler) SearchUsers(context.Context, *connect.Request[v2.SearchUsersRequest]) (*connect.Response[v2.SearchUsersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.SearchUsers is not implemented")) +} + +func (UnimplementedUserServiceHandler) GetUser(context.Context, *connect.Request[v2.GetUserRequest]) (*connect.Response[v2.GetUserResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.GetUser is not implemented")) +} + +func (UnimplementedUserServiceHandler) GetAuthenticatedUser(context.Context, *connect.Request[v2.GetAuthenticatedUserRequest]) (*connect.Response[v2.GetAuthenticatedUserResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.GetAuthenticatedUser is not implemented")) +} + +func (UnimplementedUserServiceHandler) ListTeams(context.Context, *connect.Request[v2.ListTeamsRequest]) (*connect.Response[v2.ListTeamsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.ListTeams is not implemented")) +} + +func (UnimplementedUserServiceHandler) ListClusters(context.Context, *connect.Request[v2.ListClustersRequest]) (*connect.Response[v2.ListClustersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.ListClusters is not implemented")) +} + +func (UnimplementedUserServiceHandler) ListInboxSubscriptions(context.Context, *connect.Request[v2.ListInboxSubscriptionsRequest]) (*connect.Response[v2.ListInboxSubscriptionsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.ListInboxSubscriptions is not implemented")) +} + +func (UnimplementedUserServiceHandler) GetFirebaseToken(context.Context, *connect.Request[v2.GetFirebaseTokenRequest]) (*connect.Response[v2.GetFirebaseTokenResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.GetFirebaseToken is not implemented")) +} + +func (UnimplementedUserServiceHandler) GetLoginMethod(context.Context, *connect.Request[v2.GetLoginMethodRequest]) (*connect.Response[v2.GetLoginMethodResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.GetLoginMethod is not implemented")) +} + +func (UnimplementedUserServiceHandler) ValidateUsername(context.Context, *connect.Request[v2.ValidateUsernameRequest]) (*connect.Response[v2.ValidateUsernameResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.ValidateUsername is not implemented")) +} + +func (UnimplementedUserServiceHandler) ValidateOrganizationName(context.Context, *connect.Request[v2.ValidateOrganizationNameRequest]) (*connect.Response[v2.ValidateOrganizationNameResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.ValidateOrganizationName is not implemented")) +} + +func (UnimplementedUserServiceHandler) ValidateEmail(context.Context, *connect.Request[v2.ValidateEmailRequest]) (*connect.Response[v2.ValidateEmailResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.UserService.ValidateEmail is not implemented")) +} + +// FollowServiceClient is a client for the akp.user.v2.FollowService service. +type FollowServiceClient interface { + ListFollowers(context.Context, *connect.Request[v2.ListFollowersRequest]) (*connect.Response[v2.ListFollowersResponse], error) + ListFollowing(context.Context, *connect.Request[v2.ListFollowingRequest]) (*connect.Response[v2.ListFollowingResponse], error) + CheckFollowing(context.Context, *connect.Request[v2.CheckFollowingRequest]) (*connect.Response[v2.CheckFollowingResponse], error) + // FollowUser makes the caller follow a user. + FollowUser(context.Context, *connect.Request[v2.FollowUserRequest]) (*connect.Response[v2.FollowUserResponse], error) + UnfollowUser(context.Context, *connect.Request[v2.UnfollowUserRequest]) (*connect.Response[v2.UnfollowUserResponse], error) +} + +// NewFollowServiceClient constructs a client for the akp.user.v2.FollowService 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 NewFollowServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) FollowServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + followServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("FollowService").Methods() + return &followServiceClient{ + listFollowers: connect.NewClient[v2.ListFollowersRequest, v2.ListFollowersResponse]( + httpClient, + baseURL+FollowServiceListFollowersProcedure, + connect.WithSchema(followServiceMethods.ByName("ListFollowers")), + connect.WithClientOptions(opts...), + ), + listFollowing: connect.NewClient[v2.ListFollowingRequest, v2.ListFollowingResponse]( + httpClient, + baseURL+FollowServiceListFollowingProcedure, + connect.WithSchema(followServiceMethods.ByName("ListFollowing")), + connect.WithClientOptions(opts...), + ), + checkFollowing: connect.NewClient[v2.CheckFollowingRequest, v2.CheckFollowingResponse]( + httpClient, + baseURL+FollowServiceCheckFollowingProcedure, + connect.WithSchema(followServiceMethods.ByName("CheckFollowing")), + connect.WithClientOptions(opts...), + ), + followUser: connect.NewClient[v2.FollowUserRequest, v2.FollowUserResponse]( + httpClient, + baseURL+FollowServiceFollowUserProcedure, + connect.WithSchema(followServiceMethods.ByName("FollowUser")), + connect.WithClientOptions(opts...), + ), + unfollowUser: connect.NewClient[v2.UnfollowUserRequest, v2.UnfollowUserResponse]( + httpClient, + baseURL+FollowServiceUnfollowUserProcedure, + connect.WithSchema(followServiceMethods.ByName("UnfollowUser")), + connect.WithClientOptions(opts...), + ), + } +} + +// followServiceClient implements FollowServiceClient. +type followServiceClient struct { + listFollowers *connect.Client[v2.ListFollowersRequest, v2.ListFollowersResponse] + listFollowing *connect.Client[v2.ListFollowingRequest, v2.ListFollowingResponse] + checkFollowing *connect.Client[v2.CheckFollowingRequest, v2.CheckFollowingResponse] + followUser *connect.Client[v2.FollowUserRequest, v2.FollowUserResponse] + unfollowUser *connect.Client[v2.UnfollowUserRequest, v2.UnfollowUserResponse] +} + +// ListFollowers calls akp.user.v2.FollowService.ListFollowers. +func (c *followServiceClient) ListFollowers(ctx context.Context, req *connect.Request[v2.ListFollowersRequest]) (*connect.Response[v2.ListFollowersResponse], error) { + return c.listFollowers.CallUnary(ctx, req) +} + +// ListFollowing calls akp.user.v2.FollowService.ListFollowing. +func (c *followServiceClient) ListFollowing(ctx context.Context, req *connect.Request[v2.ListFollowingRequest]) (*connect.Response[v2.ListFollowingResponse], error) { + return c.listFollowing.CallUnary(ctx, req) +} + +// CheckFollowing calls akp.user.v2.FollowService.CheckFollowing. +func (c *followServiceClient) CheckFollowing(ctx context.Context, req *connect.Request[v2.CheckFollowingRequest]) (*connect.Response[v2.CheckFollowingResponse], error) { + return c.checkFollowing.CallUnary(ctx, req) +} + +// FollowUser calls akp.user.v2.FollowService.FollowUser. +func (c *followServiceClient) FollowUser(ctx context.Context, req *connect.Request[v2.FollowUserRequest]) (*connect.Response[v2.FollowUserResponse], error) { + return c.followUser.CallUnary(ctx, req) +} + +// UnfollowUser calls akp.user.v2.FollowService.UnfollowUser. +func (c *followServiceClient) UnfollowUser(ctx context.Context, req *connect.Request[v2.UnfollowUserRequest]) (*connect.Response[v2.UnfollowUserResponse], error) { + return c.unfollowUser.CallUnary(ctx, req) +} + +// FollowServiceHandler is an implementation of the akp.user.v2.FollowService service. +type FollowServiceHandler interface { + ListFollowers(context.Context, *connect.Request[v2.ListFollowersRequest]) (*connect.Response[v2.ListFollowersResponse], error) + ListFollowing(context.Context, *connect.Request[v2.ListFollowingRequest]) (*connect.Response[v2.ListFollowingResponse], error) + CheckFollowing(context.Context, *connect.Request[v2.CheckFollowingRequest]) (*connect.Response[v2.CheckFollowingResponse], error) + // FollowUser makes the caller follow a user. + FollowUser(context.Context, *connect.Request[v2.FollowUserRequest]) (*connect.Response[v2.FollowUserResponse], error) + UnfollowUser(context.Context, *connect.Request[v2.UnfollowUserRequest]) (*connect.Response[v2.UnfollowUserResponse], error) +} + +// NewFollowServiceHandler 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 NewFollowServiceHandler(svc FollowServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + followServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("FollowService").Methods() + followServiceListFollowersHandler := connect.NewUnaryHandler( + FollowServiceListFollowersProcedure, + svc.ListFollowers, + connect.WithSchema(followServiceMethods.ByName("ListFollowers")), + connect.WithHandlerOptions(opts...), + ) + followServiceListFollowingHandler := connect.NewUnaryHandler( + FollowServiceListFollowingProcedure, + svc.ListFollowing, + connect.WithSchema(followServiceMethods.ByName("ListFollowing")), + connect.WithHandlerOptions(opts...), + ) + followServiceCheckFollowingHandler := connect.NewUnaryHandler( + FollowServiceCheckFollowingProcedure, + svc.CheckFollowing, + connect.WithSchema(followServiceMethods.ByName("CheckFollowing")), + connect.WithHandlerOptions(opts...), + ) + followServiceFollowUserHandler := connect.NewUnaryHandler( + FollowServiceFollowUserProcedure, + svc.FollowUser, + connect.WithSchema(followServiceMethods.ByName("FollowUser")), + connect.WithHandlerOptions(opts...), + ) + followServiceUnfollowUserHandler := connect.NewUnaryHandler( + FollowServiceUnfollowUserProcedure, + svc.UnfollowUser, + connect.WithSchema(followServiceMethods.ByName("UnfollowUser")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.FollowService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case FollowServiceListFollowersProcedure: + followServiceListFollowersHandler.ServeHTTP(w, r) + case FollowServiceListFollowingProcedure: + followServiceListFollowingHandler.ServeHTTP(w, r) + case FollowServiceCheckFollowingProcedure: + followServiceCheckFollowingHandler.ServeHTTP(w, r) + case FollowServiceFollowUserProcedure: + followServiceFollowUserHandler.ServeHTTP(w, r) + case FollowServiceUnfollowUserProcedure: + followServiceUnfollowUserHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedFollowServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedFollowServiceHandler struct{} + +func (UnimplementedFollowServiceHandler) ListFollowers(context.Context, *connect.Request[v2.ListFollowersRequest]) (*connect.Response[v2.ListFollowersResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.FollowService.ListFollowers is not implemented")) +} + +func (UnimplementedFollowServiceHandler) ListFollowing(context.Context, *connect.Request[v2.ListFollowingRequest]) (*connect.Response[v2.ListFollowingResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.FollowService.ListFollowing is not implemented")) +} + +func (UnimplementedFollowServiceHandler) CheckFollowing(context.Context, *connect.Request[v2.CheckFollowingRequest]) (*connect.Response[v2.CheckFollowingResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.FollowService.CheckFollowing is not implemented")) +} + +func (UnimplementedFollowServiceHandler) FollowUser(context.Context, *connect.Request[v2.FollowUserRequest]) (*connect.Response[v2.FollowUserResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.FollowService.FollowUser is not implemented")) +} + +func (UnimplementedFollowServiceHandler) UnfollowUser(context.Context, *connect.Request[v2.UnfollowUserRequest]) (*connect.Response[v2.UnfollowUserResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.FollowService.UnfollowUser is not implemented")) +} + +// EmailServiceClient is a client for the akp.user.v2.EmailService service. +type EmailServiceClient interface { + ListEmails(context.Context, *connect.Request[v2.ListEmailsRequest]) (*connect.Response[v2.ListEmailsResponse], error) + // AddEmails adds addresses, activated unless sign-up needs a confirmation. + AddEmails(context.Context, *connect.Request[v2.AddEmailsRequest]) (*connect.Response[v2.AddEmailsResponse], error) + DeleteEmails(context.Context, *connect.Request[v2.DeleteEmailsRequest]) (*connect.Response[v2.DeleteEmailsResponse], error) +} + +// NewEmailServiceClient constructs a client for the akp.user.v2.EmailService 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 NewEmailServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) EmailServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + emailServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("EmailService").Methods() + return &emailServiceClient{ + listEmails: connect.NewClient[v2.ListEmailsRequest, v2.ListEmailsResponse]( + httpClient, + baseURL+EmailServiceListEmailsProcedure, + connect.WithSchema(emailServiceMethods.ByName("ListEmails")), + connect.WithClientOptions(opts...), + ), + addEmails: connect.NewClient[v2.AddEmailsRequest, v2.AddEmailsResponse]( + httpClient, + baseURL+EmailServiceAddEmailsProcedure, + connect.WithSchema(emailServiceMethods.ByName("AddEmails")), + connect.WithClientOptions(opts...), + ), + deleteEmails: connect.NewClient[v2.DeleteEmailsRequest, v2.DeleteEmailsResponse]( + httpClient, + baseURL+EmailServiceDeleteEmailsProcedure, + connect.WithSchema(emailServiceMethods.ByName("DeleteEmails")), + connect.WithClientOptions(opts...), + ), + } +} + +// emailServiceClient implements EmailServiceClient. +type emailServiceClient struct { + listEmails *connect.Client[v2.ListEmailsRequest, v2.ListEmailsResponse] + addEmails *connect.Client[v2.AddEmailsRequest, v2.AddEmailsResponse] + deleteEmails *connect.Client[v2.DeleteEmailsRequest, v2.DeleteEmailsResponse] +} + +// ListEmails calls akp.user.v2.EmailService.ListEmails. +func (c *emailServiceClient) ListEmails(ctx context.Context, req *connect.Request[v2.ListEmailsRequest]) (*connect.Response[v2.ListEmailsResponse], error) { + return c.listEmails.CallUnary(ctx, req) +} + +// AddEmails calls akp.user.v2.EmailService.AddEmails. +func (c *emailServiceClient) AddEmails(ctx context.Context, req *connect.Request[v2.AddEmailsRequest]) (*connect.Response[v2.AddEmailsResponse], error) { + return c.addEmails.CallUnary(ctx, req) +} + +// DeleteEmails calls akp.user.v2.EmailService.DeleteEmails. +func (c *emailServiceClient) DeleteEmails(ctx context.Context, req *connect.Request[v2.DeleteEmailsRequest]) (*connect.Response[v2.DeleteEmailsResponse], error) { + return c.deleteEmails.CallUnary(ctx, req) +} + +// EmailServiceHandler is an implementation of the akp.user.v2.EmailService service. +type EmailServiceHandler interface { + ListEmails(context.Context, *connect.Request[v2.ListEmailsRequest]) (*connect.Response[v2.ListEmailsResponse], error) + // AddEmails adds addresses, activated unless sign-up needs a confirmation. + AddEmails(context.Context, *connect.Request[v2.AddEmailsRequest]) (*connect.Response[v2.AddEmailsResponse], error) + DeleteEmails(context.Context, *connect.Request[v2.DeleteEmailsRequest]) (*connect.Response[v2.DeleteEmailsResponse], error) +} + +// NewEmailServiceHandler 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 NewEmailServiceHandler(svc EmailServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + emailServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("EmailService").Methods() + emailServiceListEmailsHandler := connect.NewUnaryHandler( + EmailServiceListEmailsProcedure, + svc.ListEmails, + connect.WithSchema(emailServiceMethods.ByName("ListEmails")), + connect.WithHandlerOptions(opts...), + ) + emailServiceAddEmailsHandler := connect.NewUnaryHandler( + EmailServiceAddEmailsProcedure, + svc.AddEmails, + connect.WithSchema(emailServiceMethods.ByName("AddEmails")), + connect.WithHandlerOptions(opts...), + ) + emailServiceDeleteEmailsHandler := connect.NewUnaryHandler( + EmailServiceDeleteEmailsProcedure, + svc.DeleteEmails, + connect.WithSchema(emailServiceMethods.ByName("DeleteEmails")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.EmailService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case EmailServiceListEmailsProcedure: + emailServiceListEmailsHandler.ServeHTTP(w, r) + case EmailServiceAddEmailsProcedure: + emailServiceAddEmailsHandler.ServeHTTP(w, r) + case EmailServiceDeleteEmailsProcedure: + emailServiceDeleteEmailsHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedEmailServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedEmailServiceHandler struct{} + +func (UnimplementedEmailServiceHandler) ListEmails(context.Context, *connect.Request[v2.ListEmailsRequest]) (*connect.Response[v2.ListEmailsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.EmailService.ListEmails is not implemented")) +} + +func (UnimplementedEmailServiceHandler) AddEmails(context.Context, *connect.Request[v2.AddEmailsRequest]) (*connect.Response[v2.AddEmailsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.EmailService.AddEmails is not implemented")) +} + +func (UnimplementedEmailServiceHandler) DeleteEmails(context.Context, *connect.Request[v2.DeleteEmailsRequest]) (*connect.Response[v2.DeleteEmailsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.EmailService.DeleteEmails is not implemented")) +} + +// AccessTokenServiceClient is a client for the akp.user.v2.AccessTokenService service. +type AccessTokenServiceClient interface { + ListAccessTokens(context.Context, *connect.Request[v2.ListAccessTokensRequest]) (*connect.Response[v2.ListAccessTokensResponse], error) + // CreateAccessToken answers the token's secret, this once. + CreateAccessToken(context.Context, *connect.Request[v2.CreateAccessTokenRequest]) (*connect.Response[v2.CreateAccessTokenResponse], error) + DeleteAccessToken(context.Context, *connect.Request[v2.DeleteAccessTokenRequest]) (*connect.Response[v2.DeleteAccessTokenResponse], error) +} + +// NewAccessTokenServiceClient constructs a client for the akp.user.v2.AccessTokenService 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 NewAccessTokenServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AccessTokenServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + accessTokenServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("AccessTokenService").Methods() + return &accessTokenServiceClient{ + listAccessTokens: connect.NewClient[v2.ListAccessTokensRequest, v2.ListAccessTokensResponse]( + httpClient, + baseURL+AccessTokenServiceListAccessTokensProcedure, + connect.WithSchema(accessTokenServiceMethods.ByName("ListAccessTokens")), + connect.WithClientOptions(opts...), + ), + createAccessToken: connect.NewClient[v2.CreateAccessTokenRequest, v2.CreateAccessTokenResponse]( + httpClient, + baseURL+AccessTokenServiceCreateAccessTokenProcedure, + connect.WithSchema(accessTokenServiceMethods.ByName("CreateAccessToken")), + connect.WithClientOptions(opts...), + ), + deleteAccessToken: connect.NewClient[v2.DeleteAccessTokenRequest, v2.DeleteAccessTokenResponse]( + httpClient, + baseURL+AccessTokenServiceDeleteAccessTokenProcedure, + connect.WithSchema(accessTokenServiceMethods.ByName("DeleteAccessToken")), + connect.WithClientOptions(opts...), + ), + } +} + +// accessTokenServiceClient implements AccessTokenServiceClient. +type accessTokenServiceClient struct { + listAccessTokens *connect.Client[v2.ListAccessTokensRequest, v2.ListAccessTokensResponse] + createAccessToken *connect.Client[v2.CreateAccessTokenRequest, v2.CreateAccessTokenResponse] + deleteAccessToken *connect.Client[v2.DeleteAccessTokenRequest, v2.DeleteAccessTokenResponse] +} + +// ListAccessTokens calls akp.user.v2.AccessTokenService.ListAccessTokens. +func (c *accessTokenServiceClient) ListAccessTokens(ctx context.Context, req *connect.Request[v2.ListAccessTokensRequest]) (*connect.Response[v2.ListAccessTokensResponse], error) { + return c.listAccessTokens.CallUnary(ctx, req) +} + +// CreateAccessToken calls akp.user.v2.AccessTokenService.CreateAccessToken. +func (c *accessTokenServiceClient) CreateAccessToken(ctx context.Context, req *connect.Request[v2.CreateAccessTokenRequest]) (*connect.Response[v2.CreateAccessTokenResponse], error) { + return c.createAccessToken.CallUnary(ctx, req) +} + +// DeleteAccessToken calls akp.user.v2.AccessTokenService.DeleteAccessToken. +func (c *accessTokenServiceClient) DeleteAccessToken(ctx context.Context, req *connect.Request[v2.DeleteAccessTokenRequest]) (*connect.Response[v2.DeleteAccessTokenResponse], error) { + return c.deleteAccessToken.CallUnary(ctx, req) +} + +// AccessTokenServiceHandler is an implementation of the akp.user.v2.AccessTokenService service. +type AccessTokenServiceHandler interface { + ListAccessTokens(context.Context, *connect.Request[v2.ListAccessTokensRequest]) (*connect.Response[v2.ListAccessTokensResponse], error) + // CreateAccessToken answers the token's secret, this once. + CreateAccessToken(context.Context, *connect.Request[v2.CreateAccessTokenRequest]) (*connect.Response[v2.CreateAccessTokenResponse], error) + DeleteAccessToken(context.Context, *connect.Request[v2.DeleteAccessTokenRequest]) (*connect.Response[v2.DeleteAccessTokenResponse], error) +} + +// NewAccessTokenServiceHandler 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 NewAccessTokenServiceHandler(svc AccessTokenServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + accessTokenServiceMethods := v2.File_akp_user_v2_user_proto.Services().ByName("AccessTokenService").Methods() + accessTokenServiceListAccessTokensHandler := connect.NewUnaryHandler( + AccessTokenServiceListAccessTokensProcedure, + svc.ListAccessTokens, + connect.WithSchema(accessTokenServiceMethods.ByName("ListAccessTokens")), + connect.WithHandlerOptions(opts...), + ) + accessTokenServiceCreateAccessTokenHandler := connect.NewUnaryHandler( + AccessTokenServiceCreateAccessTokenProcedure, + svc.CreateAccessToken, + connect.WithSchema(accessTokenServiceMethods.ByName("CreateAccessToken")), + connect.WithHandlerOptions(opts...), + ) + accessTokenServiceDeleteAccessTokenHandler := connect.NewUnaryHandler( + AccessTokenServiceDeleteAccessTokenProcedure, + svc.DeleteAccessToken, + connect.WithSchema(accessTokenServiceMethods.ByName("DeleteAccessToken")), + connect.WithHandlerOptions(opts...), + ) + return "/akp.user.v2.AccessTokenService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case AccessTokenServiceListAccessTokensProcedure: + accessTokenServiceListAccessTokensHandler.ServeHTTP(w, r) + case AccessTokenServiceCreateAccessTokenProcedure: + accessTokenServiceCreateAccessTokenHandler.ServeHTTP(w, r) + case AccessTokenServiceDeleteAccessTokenProcedure: + accessTokenServiceDeleteAccessTokenHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedAccessTokenServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedAccessTokenServiceHandler struct{} + +func (UnimplementedAccessTokenServiceHandler) ListAccessTokens(context.Context, *connect.Request[v2.ListAccessTokensRequest]) (*connect.Response[v2.ListAccessTokensResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.AccessTokenService.ListAccessTokens is not implemented")) +} + +func (UnimplementedAccessTokenServiceHandler) CreateAccessToken(context.Context, *connect.Request[v2.CreateAccessTokenRequest]) (*connect.Response[v2.CreateAccessTokenResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.AccessTokenService.CreateAccessToken is not implemented")) +} + +func (UnimplementedAccessTokenServiceHandler) DeleteAccessToken(context.Context, *connect.Request[v2.DeleteAccessTokenRequest]) (*connect.Response[v2.DeleteAccessTokenResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("akp.user.v2.AccessTokenService.DeleteAccessToken is not implemented")) +} diff --git a/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go b/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go index 2ef36bbcf..ec63689e7 100644 --- a/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go +++ b/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go @@ -10,6 +10,7 @@ import ( "encoding/binary" "fmt" "io" + "math" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/errors" @@ -117,7 +118,13 @@ func (o UnmarshalOptions) UnmarshalFrom(r Reader, m proto.Message) error { if maxSize == 0 { maxSize = defaultMaxSize } - if maxSize != -1 && size > uint64(maxSize) { + if maxSize == -1 { + // No limit specified: Just check that size fits into an integer, + // otherwise the make([]byte, size) call below will panic. + if size > math.MaxInt { + return errors.Wrap(&SizeTooLargeError{Size: size, MaxSize: math.MaxInt}, "") + } + } else if size > uint64(maxSize) { return errors.Wrap(&SizeTooLargeError{Size: size, MaxSize: uint64(maxSize)}, "") } diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index 737d6876d..1d6608dc7 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -365,6 +365,10 @@ func unmarshalInt(tok json.Token, bitSize int) (protoreflect.Value, bool) { if err != nil { return protoreflect.Value{}, false } + // Ensure there is no non-number content in this string. + if next, err := dec.Read(); err != nil || next.Kind() != json.EOF { + return protoreflect.Value{}, false + } return getInt(tok, bitSize) } return protoreflect.Value{}, false @@ -397,6 +401,10 @@ func unmarshalUint(tok json.Token, bitSize int) (protoreflect.Value, bool) { if err != nil { return protoreflect.Value{}, false } + // Ensure there is no non-number content in this string. + if next, err := dec.Read(); err != nil || next.Kind() != json.EOF { + return protoreflect.Value{}, false + } return getUint(tok, bitSize) } return protoreflect.Value{}, false @@ -447,6 +455,10 @@ func unmarshalFloat(tok json.Token, bitSize int) (protoreflect.Value, bool) { if err != nil { return protoreflect.Value{}, false } + // Ensure there is no non-number content in this string. + if next, err := dec.Read(); err != nil || next.Kind() != json.EOF { + return protoreflect.Value{}, false + } return getFloat(tok, bitSize) } return protoreflect.Value{}, false diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go index e9fe10394..d2eab4694 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go @@ -52,7 +52,10 @@ func wellKnownTypeMarshaler(name protoreflect.FullName) marshalFunc { case genid.FieldMask_message_name: return encoder.marshalFieldMask case genid.Empty_message_name: - return encoder.marshalEmpty + // The spec explicitly specifies that the Empty message + // is not considered to have any special JSON mapping: + // https://protobuf.dev/programming-guides/json/#any + return nil } } return nil diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index b53805056..20ec09e19 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -8,6 +8,7 @@ import ( "fmt" "unicode/utf8" + "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/encoding/text" "google.golang.org/protobuf/internal/errors" @@ -49,12 +50,19 @@ type UnmarshalOptions struct { protoregistry.MessageTypeResolver protoregistry.ExtensionTypeResolver } + + // RecursionLimit limits how deeply messages may be nested. + // If zero, a default limit is applied. + RecursionLimit int } // Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { + if o.RecursionLimit == 0 { + o.RecursionLimit = protowire.DefaultRecursionLimit + } return o.unmarshal(b, m) } @@ -102,8 +110,14 @@ func (d decoder) syntaxError(pos int, f string, x ...any) error { return errors.New(head+f, x...) } +var errRecursionDepth = errors.New("exceeded maximum recursion depth") + // unmarshalMessage unmarshals into the given protoreflect.Message. func (d decoder) unmarshalMessage(m protoreflect.Message, checkDelims bool) error { + if d.opts.RecursionLimit--; d.opts.RecursionLimit < 0 { + return errRecursionDepth + } + messageDesc := m.Descriptor() if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { return errors.New("no support for proto1 MessageSets") @@ -437,6 +451,10 @@ func (d decoder) unmarshalList(fd protoreflect.FieldDescriptor, list protoreflec // unmarshalMap unmarshals into given protoreflect.Map. A map value is a // textproto message containing {key: , value: }. func (d decoder) unmarshalMap(fd protoreflect.FieldDescriptor, mmap protoreflect.Map) error { + if d.opts.RecursionLimit--; d.opts.RecursionLimit < 0 { + return errRecursionDepth + } + // Determine ahead whether map entry is a scalar type or a message type in // order to call the appropriate unmarshalMapValue func inside // unmarshalMapEntry. diff --git a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index 87e46bd4d..0b0dfacbe 100644 --- a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -83,12 +83,13 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { case protoreflect.FileImports: for i := 0; i < vs.Len(); i++ { var rs records - rv := reflect.ValueOf(vs.Get(i)) - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Path"), "Path"}, - {rv.MethodByName("Package"), "Package"}, - {rv.MethodByName("IsPublic"), "IsPublic"}, - {rv.MethodByName("IsWeak"), "IsWeak"}, + fi := vs.Get(i) + rv := reflect.ValueOf(fi) + rs.Append(rv, []attrAndName{ + {fi.Path(), "Path"}, + {fi.Package(), "Package"}, + {fi.IsPublic, "IsPublic"}, + {fi.IsWeak, "IsWeak"}, }...) ss = append(ss, "{"+rs.Join()+"}") } @@ -104,9 +105,9 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { } } -type methodAndName struct { - method reflect.Value - name string +type attrAndName struct { + attr any + name string } func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) { @@ -126,58 +127,58 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record fu start = rt.Name() + "{" } - _, isFile := t.(protoreflect.FileDescriptor) + fd, isFile := t.(protoreflect.FileDescriptor) rs := records{ allowMulti: allowMulti, record: record, } if t.IsPlaceholder() { if isFile { - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Path"), "Path"}, - {rv.MethodByName("Package"), "Package"}, - {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + rs.Append(rv, []attrAndName{ + {fd.Path(), "Path"}, + {fd.Package(), "Package"}, + {fd.IsPlaceholder(), "IsPlaceholder"}, }...) } else { - rs.Append(rv, []methodAndName{ - {rv.MethodByName("FullName"), "FullName"}, - {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + rs.Append(rv, []attrAndName{ + {t.FullName(), "FullName"}, + {t.IsPlaceholder(), "IsPlaceholder"}, }...) } } else { switch { case isFile: - rs.Append(rv, methodAndName{rv.MethodByName("Syntax"), "Syntax"}) + rs.Append(rv, attrAndName{fd.Syntax(), "Syntax"}) case isRoot: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Syntax"), "Syntax"}, - {rv.MethodByName("FullName"), "FullName"}, + rs.Append(rv, []attrAndName{ + {t.Syntax(), "Syntax"}, + {t.FullName(), "FullName"}, }...) default: - rs.Append(rv, methodAndName{rv.MethodByName("Name"), "Name"}) + rs.Append(rv, attrAndName{t.Name(), "Name"}) } switch t := t.(type) { case protoreflect.FieldDescriptor: - accessors := []methodAndName{ - {rv.MethodByName("Number"), "Number"}, - {rv.MethodByName("Cardinality"), "Cardinality"}, - {rv.MethodByName("Kind"), "Kind"}, - {rv.MethodByName("HasJSONName"), "HasJSONName"}, - {rv.MethodByName("JSONName"), "JSONName"}, - {rv.MethodByName("HasPresence"), "HasPresence"}, - {rv.MethodByName("IsExtension"), "IsExtension"}, - {rv.MethodByName("IsPacked"), "IsPacked"}, - {rv.MethodByName("IsWeak"), "IsWeak"}, - {rv.MethodByName("IsList"), "IsList"}, - {rv.MethodByName("IsMap"), "IsMap"}, - {rv.MethodByName("MapKey"), "MapKey"}, - {rv.MethodByName("MapValue"), "MapValue"}, - {rv.MethodByName("HasDefault"), "HasDefault"}, - {rv.MethodByName("Default"), "Default"}, - {rv.MethodByName("ContainingOneof"), "ContainingOneof"}, - {rv.MethodByName("ContainingMessage"), "ContainingMessage"}, - {rv.MethodByName("Message"), "Message"}, - {rv.MethodByName("Enum"), "Enum"}, + accessors := []attrAndName{ + {t.Number(), "Number"}, + {t.Cardinality(), "Cardinality"}, + {t.Kind(), "Kind"}, + {t.HasJSONName(), "HasJSONName"}, + {t.JSONName(), "JSONName"}, + {t.HasPresence(), "HasPresence"}, + {t.IsExtension(), "IsExtension"}, + {t.IsPacked(), "IsPacked"}, + {t.IsWeak(), "IsWeak"}, + {t.IsList(), "IsList"}, + {t.IsMap(), "IsMap"}, + {t.MapKey(), "MapKey"}, + {t.MapValue(), "MapValue"}, + {t.HasDefault(), "HasDefault"}, + {t.Default(), "Default"}, + {t.ContainingOneof(), "ContainingOneof"}, + {t.ContainingMessage(), "ContainingMessage"}, + {t.Message(), "Message"}, + {t.Enum(), "Enum"}, } for _, s := range accessors { switch s.name { @@ -223,58 +224,54 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record fu } case protoreflect.FileDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Path"), "Path"}, - {rv.MethodByName("Package"), "Package"}, - {rv.MethodByName("Imports"), "Imports"}, - {rv.MethodByName("Messages"), "Messages"}, - {rv.MethodByName("Enums"), "Enums"}, - {rv.MethodByName("Extensions"), "Extensions"}, - {rv.MethodByName("Services"), "Services"}, + rs.Append(rv, []attrAndName{ + {t.Path(), "Path"}, + {t.Package(), "Package"}, + {t.Imports(), "Imports"}, + {t.Messages(), "Messages"}, + {t.Enums(), "Enums"}, + {t.Extensions(), "Extensions"}, + {t.Services(), "Services"}, }...) case protoreflect.MessageDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("IsMapEntry"), "IsMapEntry"}, - {rv.MethodByName("Fields"), "Fields"}, - {rv.MethodByName("Oneofs"), "Oneofs"}, - {rv.MethodByName("ReservedNames"), "ReservedNames"}, - {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, - {rv.MethodByName("RequiredNumbers"), "RequiredNumbers"}, - {rv.MethodByName("ExtensionRanges"), "ExtensionRanges"}, - {rv.MethodByName("Messages"), "Messages"}, - {rv.MethodByName("Enums"), "Enums"}, - {rv.MethodByName("Extensions"), "Extensions"}, + rs.Append(rv, []attrAndName{ + {t.IsMapEntry(), "IsMapEntry"}, + {t.Fields(), "Fields"}, + {t.Oneofs(), "Oneofs"}, + {t.ReservedNames(), "ReservedNames"}, + {t.ReservedRanges(), "ReservedRanges"}, + {t.RequiredNumbers(), "RequiredNumbers"}, + {t.ExtensionRanges(), "ExtensionRanges"}, + {t.Messages(), "Messages"}, + {t.Enums(), "Enums"}, + {t.Extensions(), "Extensions"}, }...) case protoreflect.EnumDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Values"), "Values"}, - {rv.MethodByName("ReservedNames"), "ReservedNames"}, - {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, - {rv.MethodByName("IsClosed"), "IsClosed"}, + rs.Append(rv, []attrAndName{ + {t.Values(), "Values"}, + {t.ReservedNames(), "ReservedNames"}, + {t.ReservedRanges(), "ReservedRanges"}, + {t.IsClosed(), "IsClosed"}, }...) case protoreflect.EnumValueDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Number"), "Number"}, - }...) + rs.Append(rv, attrAndName{t.Number(), "Number"}) case protoreflect.ServiceDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Methods"), "Methods"}, - }...) + rs.Append(rv, attrAndName{t.Methods(), "Methods"}) case protoreflect.MethodDescriptor: - rs.Append(rv, []methodAndName{ - {rv.MethodByName("Input"), "Input"}, - {rv.MethodByName("Output"), "Output"}, - {rv.MethodByName("IsStreamingClient"), "IsStreamingClient"}, - {rv.MethodByName("IsStreamingServer"), "IsStreamingServer"}, + rs.Append(rv, []attrAndName{ + {t.Input(), "Input"}, + {t.Output(), "Output"}, + {t.IsStreamingClient(), "IsStreamingClient"}, + {t.IsStreamingServer(), "IsStreamingServer"}, }...) } - if m := rv.MethodByName("GoType"); m.IsValid() { - rs.Append(rv, methodAndName{m, "GoType"}) + if m, ok := t.(interface{ GoType() reflect.Type }); ok { + rs.Append(rv, attrAndName{m.GoType(), "GoType"}) } } return start + rs.Join() + end @@ -297,68 +294,66 @@ func (rs *records) AppendRecs(fieldName string, newRecs [2]string) { rs.recs = append(rs.recs, newRecs) } -func (rs *records) Append(v reflect.Value, accessors ...methodAndName) { - for _, a := range accessors { - if rs.record != nil { - rs.record(a.name) - } - var rv reflect.Value - if a.method.IsValid() { - rv = a.method.Call(nil)[0] - } - if v.Kind() == reflect.Struct && !rv.IsValid() { - rv = v.FieldByName(a.name) - } - if !rv.IsValid() { - panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a.name)) - } - if _, ok := rv.Interface().(protoreflect.Value); ok { - rv = rv.MethodByName("Interface").Call(nil)[0] - if !rv.IsNil() { - rv = rv.Elem() - } - } +func (rs *records) Append(v reflect.Value, results ...attrAndName) { + for _, r := range results { + rs.appendAttribute(v, r.name, r.attr) + } +} - // Ignore zero values. - var isZero bool - switch rv.Kind() { - case reflect.Interface, reflect.Slice: - isZero = rv.IsNil() - case reflect.Bool: - isZero = rv.Bool() == false - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - isZero = rv.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - isZero = rv.Uint() == 0 - case reflect.String: - isZero = rv.String() == "" - } - if n, ok := rv.Interface().(list); ok { - isZero = n.Len() == 0 - } - if isZero { - continue +func (rs *records) appendAttribute(val reflect.Value, name string, attrVal any) { + if rs.record != nil { + rs.record(name) + } + if attrVal == nil { + return + } + rv := reflect.ValueOf(attrVal) + if _, ok := rv.Interface().(protoreflect.Value); ok { + rv = rv.MethodByName("Interface").Call(nil)[0] + if !rv.IsNil() { + rv = rv.Elem() } + } - // Format the value. - var s string - v := rv.Interface() - switch v := v.(type) { - case list: - s = formatListOpt(v, false, rs.allowMulti) - case protoreflect.FieldDescriptor, protoreflect.OneofDescriptor, protoreflect.EnumValueDescriptor, protoreflect.MethodDescriptor: - s = string(v.(protoreflect.Descriptor).Name()) - case protoreflect.Descriptor: - s = string(v.FullName()) - case string: - s = strconv.Quote(v) - case []byte: - s = fmt.Sprintf("%q", v) - default: - s = fmt.Sprint(v) - } - rs.recs = append(rs.recs, [2]string{a.name, s}) + // Ignore zero values. + var isZero bool + switch rv.Kind() { + case reflect.Interface, reflect.Slice: + isZero = rv.IsNil() + case reflect.Bool: + isZero = rv.Bool() == false + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + isZero = rv.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + isZero = rv.Uint() == 0 + case reflect.String: + isZero = rv.String() == "" + } + if n, ok := rv.Interface().(list); ok { + isZero = n.Len() == 0 + } + if isZero { + return + } + + // Format the value. + var s string + v := rv.Interface() + switch v := v.(type) { + case list: + s = formatListOpt(v, false, rs.allowMulti) + case protoreflect.FieldDescriptor, protoreflect.OneofDescriptor, protoreflect.EnumValueDescriptor, protoreflect.MethodDescriptor: + s = string(v.(protoreflect.Descriptor).Name()) + case protoreflect.Descriptor: + s = string(v.FullName()) + case string: + s = strconv.Quote(v) + case []byte: + s = fmt.Sprintf("%q", v) + default: + s = fmt.Sprint(v) } + rs.recs = append(rs.recs, [2]string{name, s}) } func (rs *records) Join() string { diff --git a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb index 04696351e..ad35ea4c4 100644 Binary files a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb and b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb differ diff --git a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go index 328dc733b..079a53dd1 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go @@ -69,19 +69,19 @@ func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescript } } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - if v, err := strconv.ParseInt(s, 10, 32); err == nil { + if v, err := strconv.ParseInt(s, 0, 32); err == nil { return protoreflect.ValueOfInt32(int32(v)), nil, nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - if v, err := strconv.ParseInt(s, 10, 64); err == nil { + if v, err := strconv.ParseInt(s, 0, 64); err == nil { return protoreflect.ValueOfInt64(int64(v)), nil, nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - if v, err := strconv.ParseUint(s, 10, 32); err == nil { + if v, err := strconv.ParseUint(s, 0, 32); err == nil { return protoreflect.ValueOfUint32(uint32(v)), nil, nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - if v, err := strconv.ParseUint(s, 10, 64); err == nil { + if v, err := strconv.ParseUint(s, 0, 64); err == nil { return protoreflect.ValueOfUint64(uint64(v)), nil, nil } case protoreflect.FloatKind, protoreflect.DoubleKind: diff --git a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go index 669133d04..c96e44834 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go @@ -32,7 +32,7 @@ var byteType = reflect.TypeOf(byte(0)) func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 - f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + packed := false for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { @@ -108,7 +108,7 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri f.L1.StringName.InitJSON(jsonName) } case s == "packed": - f.L1.EditionFeatures.IsPacked = true + packed = true case strings.HasPrefix(s, "def="): // The default tag is special in that everything afterwards is the // default regardless of the presence of commas. @@ -121,6 +121,13 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri tag = strings.TrimPrefix(tag[i:], ",") } + // Update EditionFeatures after the loop and after we know whether this is + // a proto2 or proto3 field. + f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + if packed { + f.L1.EditionFeatures.IsPacked = true + } + // The generator uses the group message name instead of the field name. // We obtain the real field name by lowercasing the group name. if f.L1.Kind == protoreflect.GroupKind { diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 099b2bf45..9aa7a9bb7 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -424,27 +424,34 @@ func (d *Decoder) parseFieldName() (tok Token, err error) { return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in)) } -// parseTypeName parses Any type URL or extension field name. The name is -// enclosed in [ and ] characters. The C++ parser does not handle many legal URL -// strings. This implementation is more liberal and allows for the pattern -// ^[-_a-zA-Z0-9]+([./][-_a-zA-Z0-9]+)*`). Whitespaces and comments are allowed -// in between [ ], '.', '/' and the sub names. +// parseTypeName parses an Any type URL or an extension field name. The name is +// enclosed in [ and ] characters. We allow almost arbitrary type URL prefixes, +// closely following the text-format spec [1,2]. We implement "ExtensionName | +// AnyName" as follows (with some exceptions for backwards compatibility): +// +// char = [-_a-zA-Z0-9] +// url_char = char | [.~!$&'()*+,;=] | "%", hex, hex +// +// Ident = char, { char } +// TypeName = Ident, { ".", Ident } ; +// UrlPrefix = url_char, { url_char | "/" } ; +// ExtensionName = "[", TypeName, "]" ; +// AnyName = "[", UrlPrefix, "/", TypeName, "]" ; +// +// Additionally, we allow arbitrary whitespace and comments between [ and ]. +// +// [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters +// [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-names func (d *Decoder) parseTypeName() (Token, error) { - startPos := len(d.orig) - len(d.in) // Use alias s to advance first in order to use d.in for error handling. - // Caller already checks for [ as first character. + // Caller already checks for [ as first character (d.in[0] == '['). s := consume(d.in[1:], 0) if len(s) == 0 { return Token{}, ErrUnexpectedEOF } + // Collect everything between [ and ] in name. var name []byte - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] - } - s = consume(s, 0) - var closed bool for len(s) > 0 && !closed { switch { @@ -452,23 +459,20 @@ func (d *Decoder) parseTypeName() (Token, error) { s = s[1:] closed = true - case s[0] == '/', s[0] == '.': - if len(name) > 0 && (name[len(name)-1] == '/' || name[len(name)-1] == '.') { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)+1]) - } + case s[0] == '/' || isTypeNameChar(s[0]) || isUrlExtraChar(s[0]): name = append(name, s[0]) - s = s[1:] - s = consume(s, 0) - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] + s = consume(s[1:], 0) + + // URL percent-encoded chars + case s[0] == '%': + if len(s) < 3 || !isHexChar(s[1]) || !isHexChar(s[2]) { + return Token{}, d.parseTypeNameError(s, 3) } - s = consume(s, 0) + name = append(name, s[0], s[1], s[2]) + s = consume(s[3:], 0) default: - return Token{}, d.newSyntaxError( - "invalid type URL/extension field name: %s", d.orig[startPos:len(d.orig)-len(s)+1]) + return Token{}, d.parseTypeNameError(s, 1) } } @@ -476,15 +480,38 @@ func (d *Decoder) parseTypeName() (Token, error) { return Token{}, ErrUnexpectedEOF } - // First character cannot be '.'. Last character cannot be '.' or '/'. - size := len(name) - if size == 0 || name[0] == '.' || name[size-1] == '.' || name[size-1] == '/' { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)]) + // Split collected name on last '/' into urlPrefix and typeName (if '/' is + // present). + typeName := name + if i := bytes.LastIndexByte(name, '/'); i != -1 { + urlPrefix := name[:i] + typeName = name[i+1:] + + // urlPrefix may be empty (for backwards compatibility). + // If non-empty, it must not start with '/'. + if len(urlPrefix) > 0 && urlPrefix[0] == '/' { + return Token{}, d.parseTypeNameError(s, 0) + } } + // typeName must not be empty (note: "" splits to [""]) and all identifier + // parts must not be empty. + for _, ident := range bytes.Split(typeName, []byte{'.'}) { + if len(ident) == 0 { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + // typeName must not contain any percent-encoded or special URL chars. + for _, b := range typeName { + if b == '%' || (b != '.' && isUrlExtraChar(b)) { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + startPos := len(d.orig) - len(d.in) + endPos := len(d.orig) - len(s) d.in = s - endPos := len(d.orig) - len(d.in) d.consume(0) return Token{ @@ -496,16 +523,32 @@ func (d *Decoder) parseTypeName() (Token, error) { }, nil } +func (d *Decoder) parseTypeNameError(s []byte, numUnconsumedChars int) error { + return d.newSyntaxError( + "invalid type URL/extension field name: %s", + d.in[:len(d.in)-len(s)+min(numUnconsumedChars, len(s))], + ) +} + +func isHexChar(b byte) bool { + return ('0' <= b && b <= '9') || + ('a' <= b && b <= 'f') || + ('A' <= b && b <= 'F') +} + func isTypeNameChar(b byte) bool { - return (b == '-' || b == '_' || + return b == '-' || b == '_' || ('0' <= b && b <= '9') || ('a' <= b && b <= 'z') || - ('A' <= b && b <= 'Z')) + ('A' <= b && b <= 'Z') } -func isWhiteSpace(b byte) bool { +// isUrlExtraChar complements isTypeNameChar with extra characters that we allow +// in URLs but not in type names. Note that '/' is not included so that it can +// be treated specially. +func isUrlExtraChar(b byte) bool { switch b { - case ' ', '\n', '\r', '\t': + case '.', '~', '!', '$', '&', '(', ')', '*', '+', ',', ';', '=': return true default: return false diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index dbcf90b87..c775e5832 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -32,6 +32,7 @@ const ( EditionProto3 Edition = 999 Edition2023 Edition = 1000 Edition2024 Edition = 1001 + EditionUnstable Edition = 9999 EditionUnsupported Edition = 100000 ) diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go index dd31faaeb..78f02b1b4 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go @@ -330,7 +330,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb) extensionIdx++ case genid.DescriptorProto_Options_field_number: - md.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: @@ -356,27 +355,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L2.Options = md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Message, rawOptions) } -func (md *Message) unmarshalOptions(b []byte) { - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - switch typ { - case protowire.VarintType: - v, m := protowire.ConsumeVarint(b) - b = b[m:] - switch num { - case genid.MessageOptions_MapEntry_field_number: - md.L1.IsMapEntry = protowire.DecodeBool(v) - case genid.MessageOptions_MessageSetWireFormat_field_number: - md.L1.IsMessageSet = protowire.DecodeBool(v) - } - default: - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - } -} - func unmarshalMessageReservedRange(b []byte) (r [2]protoreflect.FieldNumber) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 950a6a325..58aeff845 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -26,6 +26,8 @@ const ( Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 + Edition_EDITION_2026_enum_value = 1002 + Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 Edition_EDITION_99997_TEST_ONLY_enum_value = 99997 @@ -805,11 +807,13 @@ const ( FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed" + FieldOptions_FeatureSupport_RemovalError_field_name protoreflect.Name = "removal_error" FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced" FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed" + FieldOptions_FeatureSupport_RemovalError_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.removal_error" ) // Field numbers for google.protobuf.FieldOptions.FeatureSupport. @@ -818,6 +822,7 @@ const ( FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2 FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3 FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4 + FieldOptions_FeatureSupport_RemovalError_field_number protoreflect.FieldNumber = 5 ) // Names for google.protobuf.OneofOptions. @@ -1151,6 +1156,7 @@ const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN_enum_value = 0 FeatureSet_STYLE2024_enum_value = 1 FeatureSet_STYLE_LEGACY_enum_value = 2 + FeatureSet_STYLE2026_enum_value = 3 ) // Names for google.protobuf.FeatureSet.VisibilityFeature. diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index 229c69801..4a3bf393e 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -113,6 +113,9 @@ func sizeMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalO } func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } @@ -170,6 +173,9 @@ func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo } func consumeMapOfMessage(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } diff --git a/vendor/google.golang.org/protobuf/internal/impl/decode.go b/vendor/google.golang.org/protobuf/internal/impl/decode.go index e0dd21fa5..1228b5c8c 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/decode.go +++ b/vendor/google.golang.org/protobuf/internal/impl/decode.go @@ -102,8 +102,7 @@ var errUnknown = errors.New("unknown") func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { mi.init() - opts.depth-- - if opts.depth < 0 { + if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if flags.ProtoLegacy && mi.isMessageSet { diff --git a/vendor/google.golang.org/protobuf/internal/impl/validate.go b/vendor/google.golang.org/protobuf/internal/impl/validate.go index 7b2995dde..99a1eb95f 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/validate.go +++ b/vendor/google.golang.org/protobuf/internal/impl/validate.go @@ -68,9 +68,13 @@ func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out pr if in.Resolver == nil { in.Resolver = protoregistry.GlobalTypes } + if in.Depth == 0 { + in.Depth = protowire.DefaultRecursionLimit + } o, st := mi.validate(in.Buf, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, + depth: in.Depth, }) if o.initialized { out.Flags |= protoiface.UnmarshalInitialized @@ -257,6 +261,9 @@ func (mi *MessageInfo) validate(b []byte, groupTag protowire.Number, opts unmars states[0].typ = validationTypeGroup states[0].endGroup = groupTag } + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } initialized := true start := len(b) State: @@ -451,6 +458,13 @@ State: mi: vi.mi, tail: b, }) + if vi.typ == validationTypeMessage || + vi.typ == validationTypeGroup || + vi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State case validationTypeRepeatedVarint: @@ -499,6 +513,9 @@ State: mi: vi.mi, endGroup: num, }) + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } continue State case flags.ProtoLegacy && vi.typ == validationTypeMessageSetItem: typeid, v, n, err := messageset.ConsumeFieldValue(b, false) @@ -521,6 +538,13 @@ State: mi: xvi.mi, tail: b[n:], }) + if xvi.typ == validationTypeMessage || + xvi.typ == validationTypeGroup || + xvi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State } @@ -547,12 +571,14 @@ State: switch st.typ { case validationTypeMessage, validationTypeGroup: numRequiredFields = int(st.mi.numRequiredFields) + opts.depth++ case validationTypeMap: // If this is a map field with a message value that contains // required fields, require that the value be present. if st.mi != nil && st.mi.numRequiredFields > 0 { numRequiredFields = 1 } + opts.depth++ } // If there are more than 64 required fields, this check will // always fail and we will report that the message is potentially diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 77de0f238..58ff0e246 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,7 +52,7 @@ import ( const ( Major = 1 Minor = 36 - Patch = 10 + Patch = 12 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index 4cbf1aeaf..889d8511d 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -121,9 +121,8 @@ func (o UnmarshalOptions) unmarshal(b []byte, m protoreflect.Message) (out proto out, err = methods.Unmarshal(in) } else { - o.RecursionLimit-- - if o.RecursionLimit < 0 { - return out, errors.New("exceeded max recursion depth") + if o.RecursionLimit--; o.RecursionLimit < 0 { + return out, errRecursionDepth } err = o.unmarshalMessageSlow(b, m) } @@ -220,6 +219,9 @@ func (o UnmarshalOptions) unmarshalSingular(b []byte, wtyp protowire.Type, m pro } func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv protoreflect.Map, fd protoreflect.FieldDescriptor) (n int, err error) { + if o.RecursionLimit--; o.RecursionLimit < 0 { + return 0, errRecursionDepth + } if wtyp != protowire.BytesType { return 0, errUnknown } @@ -305,3 +307,5 @@ func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv proto var errUnknown = errors.New("BUG: internal error (unknown)") var errDecode = errors.New("cannot parse invalid wire-format data") + +var errRecursionDepth = errors.New("exceeded maximum recursion depth") diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index 730331e66..86f0d0926 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -546,6 +546,8 @@ func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte { b = p.appendSingularField(b, "deprecation_warning", nil) case 4: b = p.appendSingularField(b, "edition_removed", nil) + case 5: + b = p.appendSingularField(b, "removal_error", nil) } return b } diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 4eacb523c..a51cb1e54 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -1,32 +1,9 @@ // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ +// Copyright 2008 Google LLC. All rights reserved. // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -69,6 +46,9 @@ const ( // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 + Edition_EDITION_2026 Edition = 1002 + // A placeholder edition for developing and testing unscheduled features. + Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be // used or relied on outside of tests. Edition_EDITION_1_TEST_ONLY Edition = 1 @@ -91,6 +71,8 @@ var ( 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", + 1002: "EDITION_2026", + 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", 99997: "EDITION_99997_TEST_ONLY", @@ -105,6 +87,8 @@ var ( "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, + "EDITION_2026": 1002, + "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, "EDITION_99997_TEST_ONLY": 99997, @@ -1209,6 +1193,7 @@ const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN FeatureSet_EnforceNamingStyle = 0 FeatureSet_STYLE2024 FeatureSet_EnforceNamingStyle = 1 FeatureSet_STYLE_LEGACY FeatureSet_EnforceNamingStyle = 2 + FeatureSet_STYLE2026 FeatureSet_EnforceNamingStyle = 3 ) // Enum value maps for FeatureSet_EnforceNamingStyle. @@ -1217,11 +1202,13 @@ var ( 0: "ENFORCE_NAMING_STYLE_UNKNOWN", 1: "STYLE2024", 2: "STYLE_LEGACY", + 3: "STYLE2026", } FeatureSet_EnforceNamingStyle_value = map[string]int32{ "ENFORCE_NAMING_STYLE_UNKNOWN": 0, "STYLE2024": 1, "STYLE_LEGACY": 2, + "STYLE2026": 3, } ) @@ -4200,8 +4187,11 @@ type FieldOptions_FeatureSupport struct { // this one, the last default assigned will be used, and proto files will // not be able to override it. EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // The removal error text if this feature is used after the edition it was + // removed in. + RemovalError *string `protobuf:"bytes,5,opt,name=removal_error,json=removalError" json:"removal_error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FieldOptions_FeatureSupport) Reset() { @@ -4262,6 +4252,13 @@ func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition { return Edition_EDITION_UNKNOWN } +func (x *FieldOptions_FeatureSupport) GetRemovalError() string { + if x != nil && x.RemovalError != nil { + return *x.RemovalError + } + return "" +} + // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -4715,7 +4712,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\aoptions\x18\x03 \x01(\v2&.google.protobuf.ExtensionRangeOptionsR\aoptions\x1a7\n" + "\rReservedRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + - "\x03end\x18\x02 \x01(\x05R\x03end\"\xcc\x04\n" + + "\x03end\x18\x02 \x01(\x05R\x03end\"\xd4\x04\n" + "\x15ExtensionRangeOptions\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n" + "\vdeclaration\x18\x02 \x03(\v22.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\vdeclaration\x127\n" + @@ -4731,7 +4728,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x11VerificationState\x12\x0f\n" + "\vDECLARATION\x10\x00\x12\x0e\n" + "\n" + - "UNVERIFIED\x10\x01*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + + "UNVERIFIED\x10\x01*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + "\x14FieldDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x03 \x01(\x05R\x06number\x12A\n" + @@ -4793,11 +4790,11 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x18EnumValueDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x02 \x01(\x05R\x06number\x12;\n" + - "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xa7\x01\n" + + "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xb5\x01\n" + "\x16ServiceDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12>\n" + "\x06method\x18\x02 \x03(\v2&.google.protobuf.MethodDescriptorProtoR\x06method\x129\n" + - "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptions\"\x89\x02\n" + + "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptionsJ\x04\b\x04\x10\x05R\x06stream\"\x89\x02\n" + "\x15MethodDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" + "\n" + @@ -4806,12 +4803,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "outputType\x128\n" + "\aoptions\x18\x04 \x01(\v2\x1e.google.protobuf.MethodOptionsR\aoptions\x120\n" + "\x10client_streaming\x18\x05 \x01(\b:\x05falseR\x0fclientStreaming\x120\n" + - "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xad\t\n" + + "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xfa\n" + + "\n" + "\vFileOptions\x12!\n" + "\fjava_package\x18\x01 \x01(\tR\vjavaPackage\x120\n" + - "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x125\n" + + "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n" + "\x13java_multiple_files\x18\n" + - " \x01(\b:\x05falseR\x11javaMultipleFiles\x12D\n" + + " \x01(\b:\x05falseB\xc1\x01\xb2\x01\xbd\x01\b\xe6\a \xe9\a*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12D\n" + "\x1djava_generate_equals_and_hash\x18\x14 \x01(\bB\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n" + "\x16java_string_check_utf8\x18\x1b \x01(\b:\x05falseR\x13javaStringCheckUtf8\x12S\n" + "\foptimize_for\x18\t \x01(\x0e2).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\voptimizeFor\x12\x1d\n" + @@ -4836,7 +4834,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\fOptimizeMode\x12\t\n" + "\x05SPEED\x10\x01\x12\r\n" + "\tCODE_SIZE\x10\x02\x12\x10\n" + - "\fLITE_RUNTIME\x10\x03*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xf4\x03\n" + + "\fLITE_RUNTIME\x10\x03*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xfc\x03\n" + "\x0eMessageOptions\x12<\n" + "\x17message_set_wire_format\x18\x01 \x01(\b:\x05falseR\x14messageSetWireFormat\x12L\n" + "\x1fno_standard_descriptor_accessor\x18\x02 \x01(\b:\x05falseR\x1cnoStandardDescriptorAccessor\x12%\n" + @@ -4846,8 +4844,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\tmap_entry\x18\a \x01(\bR\bmapEntry\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\v \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\f \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + - "\"\xa1\r\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + + "\"\xce\r\n" + "\fFieldOptions\x12A\n" + "\x05ctype\x18\x01 \x01(\x0e2#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05ctype\x12\x16\n" + "\x06packed\x18\x02 \x01(\bR\x06packed\x12G\n" + @@ -4868,12 +4866,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n" + "\x0eEditionDefault\x122\n" + "\aedition\x18\x03 \x01(\x0e2\x18.google.protobuf.EditionR\aedition\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\x1a\x96\x02\n" + + "\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n" + "\x0eFeatureSupport\x12G\n" + "\x12edition_introduced\x18\x01 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionIntroduced\x12G\n" + "\x12edition_deprecated\x18\x02 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionDeprecated\x12/\n" + "\x13deprecation_warning\x18\x03 \x01(\tR\x12deprecationWarning\x12A\n" + - "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\"/\n" + + "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\x12#\n" + + "\rremoval_error\x18\x05 \x01(\tR\fremovalError\"/\n" + "\x05CType\x12\n" + "\n" + "\x06STRING\x10\x00\x12\b\n" + @@ -4897,10 +4896,10 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n" + "\x16TARGET_TYPE_ENUM_ENTRY\x10\a\x12\x17\n" + "\x13TARGET_TYPE_SERVICE\x10\b\x12\x16\n" + - "\x12TARGET_TYPE_METHOD\x10\t*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xac\x01\n" + + "\x12TARGET_TYPE_METHOD\x10\t*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xb4\x01\n" + "\fOneofOptions\x127\n" + "\bfeatures\x18\x01 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd1\x02\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd9\x02\n" + "\vEnumOptions\x12\x1f\n" + "\vallow_alias\x18\x02 \x01(\bR\n" + "allowAlias\x12%\n" + @@ -4909,7 +4908,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "deprecated\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\a \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xd8\x02\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xe0\x02\n" + "\x10EnumValueOptions\x12%\n" + "\n" + "deprecated\x18\x01 \x01(\b:\x05falseR\n" + @@ -4917,13 +4916,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bfeatures\x18\x02 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12(\n" + "\fdebug_redact\x18\x03 \x01(\b:\x05falseR\vdebugRedact\x12U\n" + "\x0ffeature_support\x18\x04 \x01(\v2,.google.protobuf.FieldOptions.FeatureSupportR\x0efeatureSupport\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd5\x01\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xdd\x01\n" + "\x0eServiceOptions\x127\n" + "\bfeatures\x18\" \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + "deprecated\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x99\x03\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xa1\x03\n" + "\rMethodOptions\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + @@ -4935,7 +4934,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n" + "\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n" + "\n" + - "IDEMPOTENT\x10\x02*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + + "IDEMPOTENT\x10\x02*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + "\x13UninterpretedOption\x12A\n" + "\x04name\x18\x02 \x03(\v2-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n" + "\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n" + @@ -4946,7 +4945,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x0faggregate_value\x18\b \x01(\tR\x0eaggregateValue\x1aJ\n" + "\bNamePart\x12\x1b\n" + "\tname_part\x18\x01 \x02(\tR\bnamePart\x12!\n" + - "\fis_extension\x18\x02 \x02(\bR\visExtension\"\x8e\x0f\n" + + "\fis_extension\x18\x02 \x02(\bR\visExtension\"\xae\x0f\n" + "\n" + "FeatureSet\x12\x91\x01\n" + "\x0efield_presence\x18\x01 \x01(\x0e2).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPLICIT\x18\x84\a\xa2\x01\r\x12\bIMPLICIT\x18\xe7\a\xa2\x01\r\x12\bEXPLICIT\x18\xe8\a\xb2\x01\x03\b\xe8\aR\rfieldPresence\x12l\n" + @@ -4956,8 +4955,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x10message_encoding\x18\x05 \x01(\x0e2+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\a\xb2\x01\x03\b\xe8\aR\x0fmessageEncoding\x12\x82\x01\n" + "\vjson_format\x18\x06 \x01(\x0e2&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\a\xa2\x01\n" + "\x12\x05ALLOW\x18\xe7\a\xb2\x01\x03\b\xe8\aR\n" + - "jsonFormat\x12\xab\x01\n" + - "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + + "jsonFormat\x12\xbc\x01\n" + + "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBZ\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xa2\x01\x0e\x12\tSTYLE2026\x18\x8fN\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + "\x19default_symbol_visibility\x18\b \x01(\x0e2E.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\n" + "EXPORT_ALL\x18\x84\a\xa2\x01\x15\x12\x10EXPORT_TOP_LEVEL\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x17defaultSymbolVisibility\x1a\xa1\x01\n" + "\x11VisibilityFeature\"\x81\x01\n" + @@ -4997,11 +4996,12 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "JsonFormat\x12\x17\n" + "\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n" + "\x05ALLOW\x10\x01\x12\x16\n" + - "\x12LEGACY_BEST_EFFORT\x10\x02\"W\n" + + "\x12LEGACY_BEST_EFFORT\x10\x02\"f\n" + "\x12EnforceNamingStyle\x12 \n" + "\x1cENFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n" + "\tSTYLE2024\x10\x01\x12\x10\n" + - "\fSTYLE_LEGACY\x10\x02*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + + "\fSTYLE_LEGACY\x10\x02\x12\r\n" + + "\tSTYLE2026\x10\x03*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + "\x12FeatureSetDefaults\x12X\n" + "\bdefaults\x18\x01 \x03(\v2<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\bdefaults\x12A\n" + "\x0fminimum_edition\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eminimumEdition\x12A\n" + @@ -5033,14 +5033,16 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + - "\x05ALIAS\x10\x02*\xa7\x02\n" + + "\x05ALIAS\x10\x02*\xd1\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + - "\fEDITION_2024\x10\xe9\a\x12\x17\n" + + "\fEDITION_2024\x10\xe9\a\x12\x11\n" + + "\fEDITION_2026\x10\xea\a\x12\x15\n" + + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + "\x17EDITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n" + diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 1ff0d1494..510894f2b 100644 --- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -128,120 +128,66 @@ import ( // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } +// In its binary encoding, an `Any` is an ordinary message; but in other wire +// forms like JSON, it has a special encoding. The format of the type URL is +// described on the `type_url` field. +// +// Protobuf APIs provide utilities to interact with `Any` values: +// +// - A 'pack' operation accepts a message and constructs a generic `Any` wrapper +// around it. +// - An 'unpack' operation reads the content of an `Any` message, either into an +// existing message or a new one. Unpack operations must check the type of the +// value they unpack against the declared `type_url`. +// - An 'is' operation decides whether an `Any` contains a message of the given +// type, i.e. whether it can 'unpack' that type. +// +// The JSON format representation of an `Any` follows one of these cases: +// +// - For types without special-cased JSON encodings, the JSON format +// representation of the `Any` is the same as that of the message, with an +// additional `@type` field which contains the type URL. +// - For types with special-cased JSON encodings (typically called 'well-known' +// types, listed in https://protobuf.dev/programming-guides/json/#any), the +// JSON format representation has a key `@type` which contains the type URL +// and a key `value` which contains the JSON-serialized value. +// +// The text format representation of an `Any` is like a message with one field +// whose name is the type URL in brackets. For example, an `Any` containing a +// `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`. type Any struct { state protoimpl.MessageState `protogen:"open.v1"` - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). + // Identifies the type of the serialized Protobuf message with a URI reference + // consisting of a prefix ending in a slash and the fully-qualified type name. + // + // Example: type.googleapis.com/google.protobuf.StringValue // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: + // This string must contain at least one `/` character, and the content after + // the last `/` must be the fully-qualified name of the type in canonical + // form, without a leading dot. Do not write a scheme on these URI references + // so that clients do not attempt to contact them. // - // - If no scheme is provided, `https` is assumed. - // - An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // - Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) + // The prefix is arbitrary and Protobuf implementations are expected to + // simply strip off everything up to and including the last `/` to identify + // the type. `type.googleapis.com/` is a common default prefix that some + // legacy implementations require. This prefix does not indicate the origin of + // the type, and URIs containing it are not expected to respond to any + // requests. // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. + // All type URL strings must be legal URI references with the additional + // restriction (for the text format) that the content of the reference + // must consist only of alphanumeric characters, percent-encoded escapes, and + // characters in the following set (not including the outer backticks): + // `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations + // should not unescape them to prevent confusion with existing parsers. For + // example, `type.googleapis.com%2FFoo` should be rejected. // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. + // In the original design of `Any`, the possibility of launching a type + // resolution service at these type URLs was considered but Protobuf never + // implemented one and considers contacting these URLs to be problematic and + // a potential security issue. Do not attempt to contact type URLs. TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - // Must be a valid serialized protocol buffer of the above specified type. + // Holds a Protobuf serialization of the type described by type_url. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache diff --git a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go index 91ee89a5c..4a0437911 100644 --- a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go @@ -197,24 +197,22 @@ import ( // An implementation may provide options to override this default behavior for // repeated and message fields. // -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. +// Note that libraries which implement FieldMask resolution have various +// different behaviors in the face of empty masks or the special "*" mask. +// When implementing a service you should confirm these cases have the +// appropriate behavior in the underlying FieldMask library that you desire, +// and you may need to special case those cases in your application code if +// the underlying field mask library behavior differs from your intended +// service semantics. +// +// Update methods implementing https://google.aip.dev/134 +// - MUST support the special value * meaning "full replace" +// - MUST treat an omitted field mask as "replace fields which are present". +// +// Other methods implementing https://google.aip.dev/157 +// - SHOULD support the special value "*" to mean "get all". +// - MUST treat an omitted field mask to mean "get all", unless otherwise +// documented. // // ## Considerations for HTTP REST // diff --git a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go index 30411b728..8325a5048 100644 --- a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go @@ -131,10 +131,15 @@ import ( unsafe "unsafe" ) -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. +// Represents a JSON `null`. // -// The JSON representation for `NullValue` is JSON `null`. +// `NullValue` is a sentinel, using an enum with only one value to represent +// the null value for the `Value` type union. +// +// A field of type `NullValue` with any value other than `0` is considered +// invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set +// as a JSON `null` regardless of the integer value, and so will round trip to +// a `0` value. type NullValue int32 const ( @@ -179,14 +184,19 @@ func (NullValue) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} } -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. +// Represents a JSON object. +// +// An unordered key-value map, intending to perfectly capture the semantics of a +// JSON object. This enables parsing any arbitrary JSON payload as a message +// field in ProtoJSON format. +// +// This follows RFC 8259 guidelines for interoperable JSON: notably this type +// cannot represent large Int64 values or `NaN`/`Infinity` numbers, +// since the JSON format generally does not support those values in its number +// type. // -// The JSON representation for `Struct` is JSON object. +// If you do not intend to parse arbitrary JSON into your message, a custom +// typed message should be preferred instead of using this type. type Struct struct { state protoimpl.MessageState `protogen:"open.v1"` // Unordered map of dynamically typed values. @@ -269,12 +279,12 @@ func (x *Struct) GetFields() map[string]*Value { return nil } +// Represents a JSON value. +// // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these -// variants. Absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. +// variants. Absence of any variant is an invalid state. type Value struct { state protoimpl.MessageState `protogen:"open.v1"` // The kind of value. @@ -548,32 +558,35 @@ type isValue_Kind interface { } type Value_NullValue struct { - // Represents a null value. + // Represents a JSON `null`. NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` } type Value_NumberValue struct { - // Represents a double value. + // Represents a JSON number. Must not be `NaN`, `Infinity` or + // `-Infinity`, since those are not supported in JSON. This also cannot + // represent large Int64 values, since JSON format generally does not + // support them in its number type. NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` } type Value_StringValue struct { - // Represents a string value. + // Represents a JSON string. StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` } type Value_BoolValue struct { - // Represents a boolean value. + // Represents a JSON boolean (`true` or `false` literal in JSON). BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` } type Value_StructValue struct { - // Represents a structured value. + // Represents a JSON object. StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` } type Value_ListValue struct { - // Represents a repeated `Value`. + // Represents a JSON array. ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` } @@ -589,9 +602,7 @@ func (*Value_StructValue) isValue_Kind() {} func (*Value_ListValue) isValue_Kind() {} -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. +// Represents a JSON array. type ListValue struct { state protoimpl.MessageState `protogen:"open.v1"` // Repeated field of dynamically typed values. diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 06d584c14..2cd60946c 100644 --- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -153,8 +153,8 @@ import ( // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// is required. A ProtoJSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a ProtoJSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past @@ -172,13 +172,14 @@ import ( // ) to obtain a formatter capable of generating timestamps in this format. type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. + // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + // be between -62135596800 and 253402300799 inclusive (which corresponds to + // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 + // Non-negative fractions of a second at nanosecond resolution. This field is + // the nanosecond portion of the duration, not an alternative to seconds. + // Negative second values with fractions must still have non-negative nanos + // values that count forward in time. Must be between 0 and 999,999,999 // inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` unknownFields protoimpl.UnknownFields diff --git a/vendor/modules.txt b/vendor/modules.txt index 6d816e781..0f9476c5d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,3 +1,6 @@ +# buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260415201107-50325440f8f2.1 +## explicit; go 1.23 +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate # cel.dev/expr v0.24.0 ## explicit; go 1.22.0 cel.dev/expr @@ -52,6 +55,10 @@ cloud.google.com/go/storage/experimental cloud.google.com/go/storage/internal cloud.google.com/go/storage/internal/apiv2 cloud.google.com/go/storage/internal/apiv2/storagepb +# connectrpc.com/connect v1.21.1 +## explicit; go 1.26.0 +connectrpc.com/connect +connectrpc.com/connect/internal/gen/connectext/grpc/status/v1 # filippo.io/edwards25519 v1.1.1 ## explicit; go 1.20 filippo.io/edwards25519 @@ -928,6 +935,13 @@ github.com/zeebo/errs # github.com/zeebo/xxh3 v1.0.2 ## explicit; go 1.17 github.com/zeebo/xxh3 +# go.bytebuilders.dev/b3/apis v0.0.0-20261108173727-9aab4bbcfac7 => github.com/appscode-cloud/b3/apis v0.0.0-20261108173727-9aab4bbcfac7 +## explicit; go 1.26.0 +go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2 +go.bytebuilders.dev/b3/apis/gen/go/akp/cluster/v2/clusterv2connect +go.bytebuilders.dev/b3/apis/gen/go/akp/ocm/v2 +go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2 +go.bytebuilders.dev/b3/apis/gen/go/akp/user/v2/userv2connect # go.bytebuilders.dev/catalog v0.0.19 ## explicit; go 1.25.6 go.bytebuilders.dev/catalog/api/catalog/v1alpha1 @@ -1382,7 +1396,7 @@ google.golang.org/grpc/xds google.golang.org/grpc/xds/bootstrap google.golang.org/grpc/xds/csds google.golang.org/grpc/xds/googledirectpath -# google.golang.org/protobuf v1.36.10 +# google.golang.org/protobuf v1.36.12 ## explicit; go 1.23 google.golang.org/protobuf/encoding/protodelim google.golang.org/protobuf/encoding/protojson @@ -2219,3 +2233,4 @@ x-helm.dev/apimachinery/crds # github.com/Masterminds/sprig/v3 => github.com/gomodules/sprig/v3 v3.2.3-0.20220405051441-0a8a99bac1b8 # sigs.k8s.io/controller-runtime => github.com/kmodules/controller-runtime v0.22.5-0.20251227114913-f011264689cd # k8s.io/apiserver => github.com/kmodules/apiserver v0.34.4-0.20251227112449-07fa35efc6fc +# go.bytebuilders.dev/b3/apis => github.com/appscode-cloud/b3/apis v0.0.0-20261108173727-9aab4bbcfac7